Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:docker3:en:dre06 [2023/12/17 18:43] adminelearning:workbooks:docker3:en:dre06 [2024/12/17 13:46] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version : **2023.01**+Version : **2024.01**
  
 Last update : ~~LASTMOD~~ Last update : ~~LASTMOD~~
 +
  
 ======DOF607 - Docker Security Management====== ======DOF607 - Docker Security Management======
Ligne 557: Ligne 558:
 </code> </code>
  
-Exécute the **apt-update** command:+Execute the **apt-update** command:
  
 <code> <code>
Ligne 582: Ligne 583:
 <code> <code>
 root@manager:~/docker-bench-security# vi /etc/audit/rules.d/audit.rules root@manager:~/docker-bench-security# vi /etc/audit/rules.d/audit.rules
 +
 root@manager:~/docker-bench-security# cat /etc/audit/rules.d/audit.rules root@manager:~/docker-bench-security# cat /etc/audit/rules.d/audit.rules
 ## First rule - delete all ## First rule - delete all
Ligne 753: Ligne 755:
 <code> <code>
 root@manager:~/docker-bench-security# vi /etc/docker/daemon.json root@manager:~/docker-bench-security# vi /etc/docker/daemon.json
 +
 root@manager:~/docker-bench-security# cat /etc/docker/daemon.json root@manager:~/docker-bench-security# cat /etc/docker/daemon.json
 { {
Ligne 1309: Ligne 1312:
 <code> <code>
 root@manager:~# docker images root@manager:~# docker images
-REPOSITORY TAG IMAGE ID CREATED SIZE +REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE 
-ubuntu latest 775349758637 9 days ago 64.2MB +ubuntu              latest              775349758637        9 days ago          64.2MB 
-nginx latest 540a289bab6c 2 weeks ago 126MB +nginx               latest              540a289bab6c        2 weeks ago         126MB 
-alpine latest 965ea09ff2eb 2 weeks ago 5.55MB +alpine              latest              965ea09ff2eb        2 weeks ago         5.55MB 
-mysql latest c8ee894bd2bd 3 weeks ago 456MB +mysql               latest              c8ee894bd2bd        3 weeks ago         456MB 
-centos latest 0f3e07c0138f 5 weeks ago 220MB+centos              latest              0f3e07c0138f        5 weeks ago         220MB
 </code> </code>
  
Ligne 1339: Ligne 1342:
  
 root@manager:~# docker image ls root@manager:~# docker image ls
-REPOSITORY TAG IMAGE ID CREATED SIZE +REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE 
-ubuntu latest 775349758637 9 days ago 64.2MB +ubuntu              latest              775349758637        9 days ago          64.2MB 
-nginx latest 540a289bab6c 2 weeks ago 126MB +nginx               latest              540a289bab6c        2 weeks ago         126MB 
-alpine latest 965ea09ff2eb 2 weeks ago 5.55MB +alpine              latest              965ea09ff2eb        2 weeks ago         5.55MB 
-mysql latest c8ee894bd2bd 3 weeks ago 456MB +mysql               latest              c8ee894bd2bd        3 weeks ago         456MB 
-centos latest 0f3e07c0138f 5 weeks ago 220MB +centos              latest              0f3e07c0138f        5 weeks ago         220MB 
-i2tch/docker unsigned 9b915a241e29 3 years ago 212MB+i2tch/docker        unsigned            9b915a241e29        3 years ago         212MB
  
 root@manager:~# docker rmi i2tch/docker:unsigned root@manager:~# docker rmi i2tch/docker:unsigned
Ligne 1383: Ligne 1386:
 <code> <code>
 root@manager:~# docker image ls root@manager:~# docker image ls
-REPOSITORY TAG IMAGE ID CREATED SIZE +REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE 
-ubuntu latest 775349758637 9 days ago 64.2MB +ubuntu                 latest              775349758637        9 days ago          64.2MB 
-nginx latest 540a289bab6c 2 weeks ago 126MB +nginx                  latest              540a289bab6c        2 weeks ago         126MB 
-<your_account>/docker alpine 965ea09ff2eb 2 weeks ago 5.55MB +<votre_compte>/docker  alpine              965ea09ff2eb        2 weeks ago         5.55MB 
-alpine latest 965ea09ff2eb 2 weeks ago 5.55MB +alpine                 latest              965ea09ff2eb        2 weeks ago         5.55MB 
-mysql latest c8ee894bd2bd 3 weeks ago 456MB +mysql                  latest              c8ee894bd2bd        3 weeks ago         456MB 
-centos latest 0f3e07c0138f 5 weeks ago 220MB+centos                 latest              0f3e07c0138f        5 weeks ago         220MB
 </code> </code>
  
Ligne 1461: Ligne 1464:
 <code> <code>
 root@manager:~# mkdir nottrusted root@manager:~# mkdir nottrusted
 +
 root@manager:~# cd nottrusted/ root@manager:~# cd nottrusted/
 +
 root@manager:~/nottrusted# vi Dockerfile root@manager:~/nottrusted# vi Dockerfile
 +
 root@manager:~/nottrusted# cat Dockerfile root@manager:~/nottrusted# cat Dockerfile
 FROM docker/trusttest:latest FROM docker/trusttest:latest
Ligne 1522: Ligne 1528:
 <code> <code>
 root@manager:~/nottrusted# docker tag <your_account>/docker:nottrusted <your_account>/otherimage:latest root@manager:~/nottrusted# docker tag <your_account>/docker:nottrusted <your_account>/otherimage:latest
 +
 root@manager:~/nottrusted# docker images root@manager:~/nottrusted# docker images
-REPOSITORY TAG IMAGE ID CREATED SIZE +REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE 
-<your_account>/docker nottrusted 686e85ee76b8 9 minutes ago 5.03MB +<votre_compte>/docker        nottrusted          686e85ee76b8        9 minutes ago       5.03MB 
-<your_account>/otherimage latest 686e85ee76b8 9 minutes ago 5.03MB +<votre_compte>/otherimage    latest              686e85ee76b8        9 minutes ago       5.03MB 
-ubuntu latest 775349758637 9 days ago 64.2MB +ubuntu                       latest              775349758637        9 days ago          64.2MB 
-nginx latest 540a289bab6c 2 weeks ago 126MB +nginx                        latest              540a289bab6c        2 weeks ago         126MB 
-<your_account>/docker alpine 965ea09ff2eb 2 weeks ago 5.55MB +<votre_compte>/docker        alpine              965ea09ff2eb        2 weeks ago         5.55MB 
-alpine latest 965ea09ff2eb 2 weeks ago 5.55MB +alpine                       latest              965ea09ff2eb        2 weeks ago         5.55MB 
-mysql latest c8ee894bd2bd 3 weeks ago 456MB +mysql                        latest              c8ee894bd2bd        3 weeks ago         456MB 
-centos latest 0f3e07c0138f 5 weeks ago 220MB +centos                       latest              0f3e07c0138f        5 weeks ago         220MB 
-docker/trusttest latest cc7629d1331a 4 years ago 5.03MB+docker/trusttest             latest              cc7629d1331a        4 years ago         5.03MB
  
 root@manager:~/nottrusted# docker push docker.io/<your_account>/otherimage:latest root@manager:~/nottrusted# docker push docker.io/<your_account>/otherimage:latest
Ligne 1715: Ligne 1722:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 50%>
 **Important**: There is another cryptographic signature mechanism that certifies the content of images made available on a Registry. Called **Notary**, this system was developed by the Docker community and incorporates part of the **[[https://theupdateframework.io/|The Update Framework]]** (TUF) specification. For more information, see this **[[https://blog.octo.com/la-signature-dimages-docker-sur-une-registry-avec-notary/#:~:text=Notary%20is%20a%20m%C3%A9channel%20of,environment%20of%20production%20by%20example|article]]**. **Important**: There is another cryptographic signature mechanism that certifies the content of images made available on a Registry. Called **Notary**, this system was developed by the Docker community and incorporates part of the **[[https://theupdateframework.io/|The Update Framework]]** (TUF) specification. For more information, see this **[[https://blog.octo.com/la-signature-dimages-docker-sur-une-registry-avec-notary/#:~:text=Notary%20is%20a%20m%C3%A9channel%20of,environment%20of%20production%20by%20example|article]]**.
 </WRAP> </WRAP>
Ligne 1834: Ligne 1841:
 </code> </code>
  
-Modify the entry for address 10.0.2.61 in the manager's **/etc/hosts** file:+Modify the entry for address 10.0.2.45 in the manager's **/etc/hosts** file:
  
 <code> <code>
Ligne 1840: Ligne 1847:
 root@manager:~# cat /etc/hosts root@manager:~# cat /etc/hosts
 127.0.0.1 localhost 127.0.0.1 localhost
-10.0.2.60 debian9.i2tch.loc debian9 +10.0.2.46 debian11.i2tch.loc debian11 
-10.0.2.61 myregistry.i2tch.loc myregistry+10.0.2.45 myregistry.i2tch.loc myregistry
 10.0.2.62 manager.i2tch.loc manager 10.0.2.62 manager.i2tch.loc manager
 10.0.2.63 worker1.i2tch.loc worker1 10.0.2.63 worker1.i2tch.loc worker1
Ligne 1998: Ligne 2005:
 ====9.5 - Client configuration==== ====9.5 - Client configuration====
  
-Then transfer the CA certificate and the client certificate and private key to the **debian91** VM :+Then transfer the CA certificate and the client certificate and private key to the **10.0.2.45** VM :
  
 <code> <code>
-root@manager:~# scp ca.pem key.pem cert.pem trainee@10.0.2.61:/home/trainee/ +root@manager:~# scp ca.pem key.pem cert.pem trainee@10.0.2.45:/home/trainee/ 
-The authenticity of host '10.0.2.61 (10.0.2.61)' can't be established.+The authenticity of host '10.0.2.45 (10.0.2.45)' can't be established.
 ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE. ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE.
 Are you sure you want to continue connecting (yes/no)? yes Are you sure you want to continue connecting (yes/no)? yes
-Warning: Permanently added '10.0.2.61' (ECDSA) to the list of known hosts. +Warning: Permanently added '10.0.2.45' (ECDSA) to the list of known hosts. 
-trainee@10.0.2.61's password:  +trainee@10.0.2.45's password: trainee 
-ca.pem 100% 2163 917.8KB/s 00:00     +ca.pem                                                                                                                                 100% 2163   917.8KB/  00:00     
-key.pem 100% 3243 3.0MB/s 00:00    +key.pem                                                                                                                                100% 3243     3.0MB/  00:00    
-cert.pem 100% 1907 921.7KB/s 00:00 +cert.pem                                                                                                                               100% 1907   921.7KB/  00:00  
 </code> </code>
  
-Run the **docker version** command on the **debian91** VM:+Run the **docker version** command on the **10.0.2.45** VM:
  
 <code> <code>
 trainee@myregistry:~$ docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem -H=manager.i2tch.loc:2376 version trainee@myregistry:~$ docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem -H=manager.i2tch.loc:2376 version
 Client: Docker Engine - Community Client: Docker Engine - Community
- Version: 19.03.4 + Version:           19.03.4 
- API version: 1.40 + API version:       1.40 
- Go version: go1.12.10+ Go version:        go1.12.10
  Git commit:        9013bf583a  Git commit:        9013bf583a
  Built:             Fri Oct 18 15:52:34 2019  Built:             Fri Oct 18 15:52:34 2019
- OS/Arch: linux/amd64 + OS/Arch:           linux/amd64 
- Experimental: false+ Experimental:      false
  
 Server: Docker Engine - Community Server: Docker Engine - Community
  Engine:  Engine:
-  Version: 19.03.4 +  Version:          19.03.4 
-  API version: 1.40 (minimum version 1.12) +  API version:      1.40 (minimum version 1.12) 
-  Go version: go1.12.10+  Go version:       go1.12.10
   Git commit:       9013bf583a   Git commit:       9013bf583a
   Built:            Fri Oct 18 15:51:05 2019   Built:            Fri Oct 18 15:51:05 2019
-  OS/Arch: linux/amd64 +  OS/Arch:          linux/amd64 
-  Experimental: false+  Experimental:     false
  containerd:  containerd:
-  Version: 1.2.10 +  Version:          1.2.10 
-  GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339+  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
  runc:  runc:
-  Version: 1.0.0-rc8+dev+  Version:          1.0.0-rc8+dev
   GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657   GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
  docker-init:  docker-init:
-  Version: 0.18.0 +  Version:          0.18.0 
-  GitCommit: fec3683+  GitCommit:        fec3683
 </code> </code>
  
Ligne 2071: Ligne 2078:
 <code> <code>
 trainee@myregistry:~$ docker image ls trainee@myregistry:~$ docker image ls
-REPOSITORY TAG IMAGE ID CREATED SIZE +REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE 
-i2tch/docker nottrusted 686e85ee76b8 19 hours ago 5.03MB +i2tch/docker        nottrusted          686e85ee76b8        19 hours ago        5.03MB 
-i2tch/otherimage latest 686e85ee76b8 19 hours ago 5.03MB +i2tch/otherimage    latest              686e85ee76b8        19 hours ago        5.03MB 
-ubuntu latest 775349758637 10 days ago 64.2MB +ubuntu              latest              775349758637        10 days ago         64.2MB 
-nginx latest 540a289bab6c 2 weeks ago 126MB +nginx               latest              540a289bab6c        2 weeks ago         126MB 
-alpine latest 965ea09ff2eb 2 weeks ago 5.55MB +alpine              latest              965ea09ff2eb        2 weeks ago         5.55MB 
-i2tch/docker alpine 965ea09ff2eb 2 weeks ago 5.55MB +i2tch/docker        alpine              965ea09ff2eb        2 weeks ago         5.55MB 
-mysql latest c8ee894bd2bd 3 weeks ago 456MB +mysql               latest              c8ee894bd2bd        3 weeks ago         456MB 
-centos latest 0f3e07c0138f 5 weeks ago 220MB +centos              latest              0f3e07c0138f        5 weeks ago         220MB 
-docker/trusttest latest cc7629d1331a 4 years ago 5.03MB+docker/trusttest    latest              cc7629d1331a        4 years ago         5.03MB
 </code> </code>
  
 ----- -----
  
-Copyright © 2023 Hugh Norris.+Copyright © 2024 Hugh Norris.
Menu