Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:docker3:drf06 [2023/12/27 08:37] – created admin | elearning:workbooks:docker3:drf06 [2024/02/21 13:40] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2023.01** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
Ligne 15: | Ligne 15: | ||
* LAB #3 - Le Script docker-bench-security.sh | * LAB #3 - Le Script docker-bench-security.sh | ||
* LAB #4 - Sécurisation de la Configuration de l' | * LAB #4 - Sécurisation de la Configuration de l' | ||
- | * 4.1 - [WARN] 1.2.1 - Ensure a separate partition for containers has been created | ||
- | * 4.2 - [WARN] 1.2.3 - Ensure auditing is configured for the Docker daemon | ||
* LAB #5 - Sécurisation de la Configuration du daemon Docker | * LAB #5 - Sécurisation de la Configuration du daemon Docker | ||
- | * 5.1 - [WARN] 2.1 - Ensure network traffic is restricted between containers on the default bridge | + | * 5.1 - Le Fichier / |
- | * 5.2 - [WARN] 2.8 - Enable user namespace support | + | |
- | * 5.3 - [WARN] 2.11 - Ensure that authorization for Docker client commands is enabled | + | |
- | * 5.4 - [WARN] 2.12 - Ensure centralized and remote logging is configured | + | |
- | * 5.5 - [WARN] 2.14 - Ensure Userland Proxy is Disabled | + | |
- | * 5.6 - [WARN] 2.17 - Ensure containers are restricted from acquiring new privileges | + | |
- | * 5.7 - Le Fichier / | + | |
* LAB #6 - Sécurisation des Images et les Fichiers de Construction | * LAB #6 - Sécurisation des Images et les Fichiers de Construction | ||
- | * 6.1 - [WARN] 4.1 - Ensure a user for the container has been created | ||
- | * 6.2 - [WARN] 4.5 - Ensure Content trust for Docker is Enabled | ||
- | * 6.3 - [WARN] 4.6 - Ensure that HEALTHCHECK instructions have been added to container images | ||
* LAB #7 - Sécurisation du Container Runtime | * LAB #7 - Sécurisation du Container Runtime | ||
- | * 7.1 - [WARN] 5.1 - Ensure AppArmor Profile is Enabled | ||
- | * 7.2 - [WARN] 5.2 - Ensure SELinux security options are set, if applicable | ||
- | * 7.3 - [WARN] 5.10 - Ensure memory usage for container is limited | ||
- | * 7.4 - [WARN] 5.11 - Ensure CPU priority is set appropriately on the container | ||
- | * 7.5 - [WARN] 5.12 - Ensure the container' | ||
- | * 7.6 - [WARN] 5.14 - Ensure ' | ||
- | * 7.7 - [WARN] 5.25 - Ensure the container is restricted from acquiring additional privileges | ||
- | * 7.8 - [WARN] 5.26 - Ensure container health is checked at runtime | ||
- | * 7.9 - [WARN] 5.28 - Ensure PIDs cgroup limit is used | ||
* LAB #8 - Sécurisation des Images avec Docker Content Trust | * LAB #8 - Sécurisation des Images avec Docker Content Trust | ||
* 8.1 - DOCKER_CONTENT_TRUST | * 8.1 - DOCKER_CONTENT_TRUST | ||
Ligne 98: | Ligne 78: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 110: | Ligne 90: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez que la colonne **DRIVER** est vide. Ceci indique que le gestion des secrets est accomplie par Docker lui-même au lieu d' | **Important** : Notez que la colonne **DRIVER** est vide. Ceci indique que le gestion des secrets est accomplie par Docker lui-même au lieu d' | ||
</ | </ | ||
Ligne 123: | Ligne 103: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez qu'un secret Docker est immuable. | **Important** : Notez qu'un secret Docker est immuable. | ||
</ | </ | ||
Ligne 157: | Ligne 137: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : On peut constater dans la sortie de cette commande la valeur **CreatedAt** qui correspond à la date de création du secret ainsi que **UpdatedAt** qui correspond à la date de modification du secret. | **Important** : On peut constater dans la sortie de cette commande la valeur **CreatedAt** qui correspond à la date de création du secret ainsi que **UpdatedAt** qui correspond à la date de modification du secret. | ||
</ | </ | ||
Ligne 230: | Ligne 210: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Le terme **externe** indique que les secrets ne seront pas stockés dans l' | **Important** : Le terme **externe** indique que les secrets ne seront pas stockés dans l' | ||
</ | </ | ||
Ligne 245: | Ligne 225: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez a présence de l' | **Important** : Notez a présence de l' | ||
</ | </ | ||
Ligne 314: | Ligne 294: | ||
< | < | ||
trainee@manager: | trainee@manager: | ||
- | Mot de passe : fenestros | + | Password: fenestros |
root@manager: | root@manager: | ||
- | Clonage dans ' | + | Cloning in ' |
remote: Enumerating objects: 18, done. | remote: Enumerating objects: 18, done. | ||
remote: Counting objects: 100% (18/18), done. | remote: Counting objects: 100% (18/18), done. | ||
remote: Compressing objects: 100% (16/16), done. | remote: Compressing objects: 100% (16/16), done. | ||
remote: Total 1921 (delta 5), reused 6 (delta 2), pack-reused 1903 | remote: Total 1921 (delta 5), reused 6 (delta 2), pack-reused 1903 | ||
- | Réception d' | + | Receiving objects: 100% (1921/ |
- | Résolution des deltas: 100% (1339/ | + | Delta resolution: 100% (1339/ |
</ | </ | ||
Ligne 329: | Ligne 310: | ||
< | < | ||
root@manager: | root@manager: | ||
+ | |||
root@manager: | root@manager: | ||
- | # ------------------------------------------------------------------------------ | + | # -------------------------------------------------------------------------------------------- |
- | # Docker Bench for Security v1.3.5 | + | # Docker Bench for Security v1.6.0 |
# | # | ||
- | # Docker, Inc. (c) 2015- | + | # Docker, Inc. (c) 2015-2023 |
# | # | ||
# Checks for dozens of common best-practices around deploying Docker containers in production. | # Checks for dozens of common best-practices around deploying Docker containers in production. | ||
- | # Inspired by the CIS Docker Benchmark | + | # Based on the CIS Docker Benchmark |
- | # ------------------------------------------------------------------------------ | + | # -------------------------------------------------------------------------------------------- |
- | Initializing | + | Initializing |
- | [INFO] 1 - Host Configuration | + | Section A - Check results |
- | [INFO] 1.1 - General Configuration | + | [INFO] 1 - Host Configuration |
- | [NOTE] 1.1.1 - Ensure the container host has been Hardened | + | [INFO] 1.1 - Linux Hosts Specific Configuration |
- | [INFO] 1.1.2 - Ensure Docker is up to date | + | [WARN] 1.1.1 - Ensure a separate partition for containers has been created (Automated) |
+ | [INFO] 1.1.2 - Ensure only trusted users are allowed to control Docker daemon (Automated) | ||
+ | [INFO] | ||
+ | [WARN] 1.1.3 - Ensure auditing is configured for the Docker daemon (Automated) | ||
+ | [WARN] 1.1.4 - Ensure auditing is configured for Docker files and directories -/ | ||
+ | [WARN] 1.1.5 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [WARN] 1.1.6 - Ensure auditing is configured for Docker files and directories - /etc/docker (Automated) | ||
+ | [WARN] 1.1.7 - Ensure auditing is configured for Docker files and directories - docker.service (Automated) | ||
+ | [INFO] 1.1.8 - Ensure auditing is configured for Docker files and directories - containerd.sock (Automated) | ||
+ | [INFO] | ||
+ | [WARN] 1.1.9 - Ensure auditing is configured for Docker files and directories - docker.socket (Automated) | ||
+ | [WARN] 1.1.10 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] 1.1.11 - Ensure auditing is configured for Dockerfiles and directories - / | ||
+ | [INFO] | ||
+ | [WARN] 1.1.12 - 1.1.12 Ensure auditing is configured for Dockerfiles and directories - / | ||
+ | [INFO] 1.1.13 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] | ||
+ | [WARN] 1.1.14 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [WARN] 1.1.15 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] 1.1.16 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] | ||
+ | [INFO] 1.1.17 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] | ||
+ | [WARN] 1.1.18 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] 1.2 - General Configuration | ||
+ | [NOTE] 1.2.1 - Ensure the container host has been Hardened | ||
+ | [PASS] 1.2.2 - Ensure | ||
[INFO] | [INFO] | ||
- | [INFO] | ||
- | [INFO] 1.2 - Linux Hosts Specific Configuration | + | [INFO] |
- | [WARN] 1.2.1 - Ensure a separate partition | + | [NOTE] 2.1 - Run the Docker daemon as a non-root user, if possible (Manual) |
- | ... | + | [WARN] 2.2 - Ensure network traffic is restricted between containers on the default bridge (Scored) |
+ | [PASS] 2.3 - Ensure the logging level is set to ' | ||
+ | [PASS] 2.4 - Ensure Docker is allowed to make changes to iptables (Scored) | ||
+ | [PASS] 2.5 - Ensure insecure registries are not used (Scored) | ||
+ | [PASS] 2.6 - Ensure aufs storage driver is not used (Scored) | ||
+ | [INFO] 2.7 - Ensure TLS authentication for Docker daemon is configured (Scored) | ||
+ | [INFO] | ||
+ | [INFO] 2.8 - Ensure the default ulimit is configured appropriately (Manual) | ||
+ | [INFO] | ||
+ | [WARN] | ||
+ | [PASS] 2.10 - Ensure the default cgroup usage has been confirmed (Scored) | ||
+ | [PASS] 2.11 - Ensure base device size is not changed until needed (Scored) | ||
+ | [WARN] 2.12 - Ensure that authorization for Docker client commands is enabled (Scored) | ||
+ | [WARN] 2.13 - Ensure centralized and remote logging is configured (Scored) | ||
+ | [WARN] 2.14 - Ensure containers are restricted from acquiring new privileges (Scored) | ||
+ | [WARN] 2.15 - Ensure live restore is enabled (Scored) | ||
+ | [WARN] 2.16 - Ensure Userland Proxy is Disabled (Scored) | ||
+ | [PASS] 2.17 - Ensure that a daemon-wide custom seccomp profile is applied if appropriate (Manual) | ||
+ | [PASS] 2.18 - Ensure that experimental features are not implemented in production (Scored) | ||
+ | |||
+ | [INFO] 3 - Docker daemon configuration files | ||
+ | [PASS] 3.1 - Ensure that the docker.service file ownership is set to root:root (Automated) | ||
+ | [PASS] 3.2 - Ensure that docker.service file permissions are appropriately set (Automated) | ||
+ | [PASS] 3.3 - Ensure that docker.socket file ownership is set to root:root (Automated) | ||
+ | [PASS] 3.4 - Ensure that docker.socket file permissions are set to 644 or more restrictive (Automated) | ||
+ | [PASS] 3.5 - Ensure that the /etc/docker directory ownership is set to root:root (Automated) | ||
+ | [PASS] 3.6 - Ensure that /etc/docker directory permissions are set to 755 or more restrictively (Automated) | ||
+ | [INFO] 3.7 - Ensure that registry certificate file ownership is set to root:root (Automated) | ||
+ | [INFO] | ||
+ | [INFO] 3.8 - Ensure that registry certificate file permissions are set to 444 or more restrictively (Automated) | ||
+ | [INFO] | ||
+ | [INFO] 3.9 - Ensure that TLS CA certificate file ownership is set to root:root (Automated) | ||
+ | [INFO] | ||
+ | [INFO] 3.10 - Ensure that TLS CA certificate file permissions are set to 444 or more restrictively (Automated) | ||
+ | [INFO] | ||
+ | [INFO] 3.11 - Ensure that Docker server certificate file ownership is set to root:root (Automated) | ||
+ | [INFO] | ||
+ | [INFO] 3.12 - Ensure that the Docker server certificate file permissions are set to 444 or more restrictively (Automated) | ||
+ | [INFO] | ||
+ | [INFO] 3.13 - Ensure that the Docker server certificate key file ownership is set to root:root (Automated) | ||
+ | [INFO] | ||
+ | [INFO] 3.14 - Ensure that the Docker server certificate key file permissions are set to 400 (Automated) | ||
+ | [INFO] | ||
+ | [PASS] 3.15 - Ensure that the Docker socket file ownership is set to root:docker (Automated) | ||
+ | [PASS] 3.16 - Ensure that the Docker socket file permissions are set to 660 or more restrictively (Automated) | ||
+ | [INFO] 3.17 - Ensure that the daemon.json file ownership is set to root:root (Automated) | ||
+ | [INFO] | ||
+ | [INFO] 3.18 - Ensure that daemon.json file permissions are set to 644 or more restrictive (Automated) | ||
+ | [INFO] | ||
+ | [PASS] 3.19 - Ensure that the / | ||
+ | [PASS] 3.20 - Ensure that the / | ||
+ | [INFO] 3.21 - Ensure that the / | ||
+ | [INFO] | ||
+ | [INFO] 3.22 - Ensure that the / | ||
+ | [INFO] | ||
+ | [PASS] 3.23 - Ensure that the Containerd socket file ownership is set to root:root (Automated) | ||
+ | [PASS] 3.24 - Ensure that the Containerd socket file permissions are set to 660 or more restrictively (Automated) | ||
+ | |||
+ | [INFO] 4 - Container Images and Build File | ||
+ | [INFO] 4.1 - Ensure | ||
+ | [INFO] | ||
+ | [NOTE] 4.2 - Ensure that containers use only trusted base images (Manual) | ||
+ | [NOTE] 4.3 - Ensure that unnecessary packages are not installed in the container (Manual) | ||
+ | [NOTE] 4.4 - Ensure images are scanned and rebuilt to include security patches (Manual) | ||
+ | [WARN] 4.5 - Ensure Content trust for Docker is Enabled (Automated) | ||
+ | [WARN] 4.6 - Ensure that HEALTHCHECK instructions have been added to container images (Automated) | ||
+ | [WARN] | ||
+ | [WARN] | ||
+ | [WARN] | ||
+ | [WARN] | ||
+ | [PASS] 4.7 - Ensure update instructions are not used alone in the Dockerfile (Manual) | ||
+ | [NOTE] 4.8 - Ensure setuid and setgid permissions are removed (Manual) | ||
+ | [PASS] 4.9 - Ensure that COPY is used instead of ADD in Dockerfiles (Manual) | ||
+ | [NOTE] 4.10 - Ensure secrets are not stored in Dockerfiles (Manual) | ||
+ | [NOTE] 4.11 - Ensure only verified packages are installed (Manual) | ||
+ | [NOTE] 4.12 - Ensure all signed artifacts are validated (Manual) | ||
+ | |||
+ | [INFO] 5 - Container Runtime | ||
+ | [INFO] | ||
+ | |||
+ | [INFO] 6 - Docker Security Operations | ||
+ | [INFO] 6.1 - Ensure that image sprawl is avoided (Manual) | ||
+ | [INFO] | ||
+ | [INFO] | ||
+ | [INFO] 6.2 - Ensure that container sprawl is avoided (Manual) | ||
+ | [INFO] | ||
+ | |||
+ | [INFO] 7 - Docker Swarm Configuration | ||
+ | [WARN] 7.1 - Ensure swarm mode is not Enabled, if not needed (Automated) | ||
+ | [PASS] 7.2 - Ensure that the minimum number of manager nodes have been created in a swarm (Automated) (Swarm mode not enabled) | ||
+ | [PASS] 7.3 - Ensure that swarm services are bound to a specific host interface (Automated) (Swarm mode not enabled) | ||
+ | [PASS] 7.4 - Ensure that all Docker swarm overlay networks are encrypted (Automated) | ||
+ | [PASS] 7.5 - Ensure that Docker' | ||
+ | [PASS] 7.6 - Ensure that swarm manager is run in auto-lock mode (Automated) (Swarm mode not enabled) | ||
+ | [PASS] 7.7 - Ensure that the swarm manager auto-lock key is rotated periodically (Manual) (Swarm mode not enabled) | ||
+ | [PASS] 7.8 - Ensure that node certificates are rotated as appropriate (Manual) (Swarm mode not enabled) | ||
+ | [PASS] 7.9 - Ensure that CA certificates are rotated as appropriate (Manual) (Swarm mode not enabled) | ||
+ | [PASS] 7.10 - Ensure that management plane traffic is separated from data plane traffic (Manual) (Swarm mode not enabled) | ||
+ | |||
+ | |||
+ | Section C - Score | ||
+ | |||
+ | [INFO] Checks: 86 | ||
+ | [INFO] Score: 1 | ||
</ | </ | ||
Ligne 369: | Ligne 479: | ||
... | ... | ||
[INFO] 1 - Host Configuration | [INFO] 1 - Host Configuration | ||
- | + | [INFO] 1.1 - Linux Hosts Specific Configuration | |
- | [INFO] 1.1 - General Configuration | + | [WARN] 1.1.1 - Ensure a separate partition for containers has been created |
- | [NOTE] 1.1.1 - Ensure the container host has been Hardened | + | [INFO] 1.1.2 - Ensure only trusted users are allowed to control Docker daemon |
- | [INFO] 1.1.2 - Ensure Docker is up to date | + | [INFO] |
- | [INFO] | + | [WARN] 1.1.3 - Ensure auditing is configured for the Docker daemon |
- | [INFO] | + | [WARN] 1.1.4 - Ensure auditing is configured for Docker files and directories -/run/containerd (Automated) |
- | + | [WARN] 1.1.5 - Ensure auditing is configured for Docker files and directories - /var/lib/ | |
- | [INFO] 1.2 - Linux Hosts Specific Configuration | + | [WARN] 1.1.6 - Ensure auditing is configured for Docker files and directories - /etc/docker |
- | [WARN] 1.2.1 - Ensure a separate partition for containers has been created | + | [WARN] 1.1.7 - Ensure auditing is configured for Docker files and directories - docker.service (Automated) |
- | [INFO] 1.2.2 - Ensure only trusted users are allowed to control Docker daemon | + | [INFO] 1.1.8 - Ensure auditing is configured for Docker files and directories - containerd.sock (Automated) |
- | [INFO] | + | |
- | [WARN] 1.2.3 - Ensure auditing is configured for the Docker daemon | + | |
- | [WARN] 1.2.4 - Ensure auditing is configured for Docker files and directories - /var/lib/docker | + | |
- | [WARN] 1.2.5 - Ensure auditing is configured for Docker files and directories - /etc/docker | + | |
- | [WARN] 1.2.6 - Ensure auditing is configured for Docker files and directories - docker.service | + | |
- | [WARN] 1.2.7 - Ensure auditing is configured for Docker files and directories - docker.socket | + | |
- | [WARN] 1.2.8 - Ensure auditing is configured for Docker files and directories - / | + | |
- | [INFO] 1.2.9 - Ensure auditing is configured for Docker files and directories - / | + | |
[INFO] | [INFO] | ||
- | [INFO] 1.2.10 - Ensure auditing is configured for Docker files and directories - / | + | [WARN] 1.1.9 - Ensure auditing is configured for Docker files and directories - docker.socket (Automated) |
+ | [WARN] 1.1.10 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] 1.1.11 - Ensure auditing is configured for Dockerfiles | ||
+ | [INFO] | ||
+ | [WARN] 1.1.12 - 1.1.12 Ensure auditing is configured for Dockerfiles and directories - / | ||
+ | [INFO] 1.1.13 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] | ||
+ | [WARN] 1.1.14 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [WARN] 1.1.15 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] 1.1.16 - Ensure auditing is configured for Docker files and directories - / | ||
[INFO] | [INFO] | ||
- | [WARN] 1.2.11 | + | [INFO] 1.1.17 - Ensure auditing is configured for Docker files and directories - / |
- | [INFO] 1.2.12 | + | |
[INFO] | [INFO] | ||
+ | [WARN] 1.1.18 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [INFO] 1.2 - General Configuration | ||
+ | [NOTE] 1.2.1 - Ensure the container host has been Hardened (Manual) | ||
+ | [PASS] 1.2.2 - Ensure that the version of Docker is up to date (Manual) | ||
+ | [INFO] | ||
... | ... | ||
</ | </ | ||
Ligne 398: | Ligne 513: | ||
Les problèmes de sécurité qu'il convient à résoudre sont indiqués par les annotations **[WARN]**. | Les problèmes de sécurité qu'il convient à résoudre sont indiqués par les annotations **[WARN]**. | ||
- | ====4.1 - [WARN] 1.2.1 - Ensure a separate partition for containers has been created==== | + | ====[WARN] 1.1.1 - Ensure a separate partition for containers has been created |
Par défaut, tous les fichiers de Docker sont stockés dans le répertoire **/ | Par défaut, tous les fichiers de Docker sont stockés dans le répertoire **/ | ||
- | ====4.2 - [WARN] 1.2.3 - Ensure auditing is configured for the Docker daemon==== | + | ====[WARN] 1.1.3 - Ensure auditing is configured for the Docker daemon |
< | < | ||
- | [WARN] 1.2.4 - Ensure auditing is configured for Docker files and directories - / | + | [WARN] 1.1.4 - Ensure auditing is configured for Docker files and directories -/ |
- | [WARN] 1.2.5 | + | [WARN] 1.1.5 - Ensure auditing is configured for Docker files and directories - / |
- | [WARN] 1.2.6 | + | [WARN] 1.1.6 - Ensure auditing is configured for Docker files and directories - / |
- | [WARN] 1.2.7 | + | [WARN] 1.1.7 - Ensure auditing is configured for Docker files and directories - docker.service |
- | [WARN] 1.2.8 | + | [WARN] 1.1.9 - Ensure auditing is configured for Docker files and directories - docker.socket |
- | [WARN] 1.2.11 | + | [WARN] 1.1.10 - Ensure auditing is configured for Docker files and directories - / |
+ | [WARN] 1.1.12 - Ensure auditing is configured for Dockerfiles and directories - / | ||
+ | [WARN] 1.1.14 | ||
+ | [WARN] 1.1.15 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [WARN] 1.1.18 - Ensure auditing is configured for Docker files and directories - / | ||
</ | </ | ||
Ces avertissements sont présents parce que **auditd** n'est pas installé et parce qu'il n'y a pas de règles spécifiques au daemon Docker et ses répertoires et fichiers associés. | Ces avertissements sont présents parce que **auditd** n'est pas installé et parce qu'il n'y a pas de règles spécifiques au daemon Docker et ses répertoires et fichiers associés. | ||
+ | |||
+ | Editez le fichier **/ | ||
+ | |||
+ | < | ||
+ | root@manager: | ||
+ | |||
+ | root@manager: | ||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | deb [arch=amd64] https:// | ||
+ | </ | ||
+ | |||
+ | Exécutez la commande **apt-update** : | ||
+ | |||
+ | < | ||
+ | root@manager: | ||
+ | Ign:1 http:// | ||
+ | Atteint:2 http:// | ||
+ | Atteint:3 http:// | ||
+ | Réception de:4 https:// | ||
+ | 44,8 ko réceptionnés en 0s (107 ko/s) | ||
+ | Lecture des listes de paquets... Fait | ||
+ | Construction de l' | ||
+ | Lecture des informations d' | ||
+ | 254 packages can be upgraded. Run 'apt list --upgradable' | ||
+ | </ | ||
Pour installer auditd, utilisez **apt-get** : | Pour installer auditd, utilisez **apt-get** : | ||
< | < | ||
- | root@manager: | + | root@manager: |
</ | </ | ||
Ligne 425: | Ligne 572: | ||
< | < | ||
root@manager: | root@manager: | ||
+ | |||
root@manager: | root@manager: | ||
## First rule - delete all | ## First rule - delete all | ||
Ligne 450: | Ligne 598: | ||
-w / | -w / | ||
-w / | -w / | ||
+ | -w / | ||
+ | -w / | ||
+ | -w / | ||
+ | -w / | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : L' | **Important** : L' | ||
</ | </ | ||
Ligne 481: | Ligne 633: | ||
-w / | -w / | ||
-w / | -w / | ||
+ | -w / | ||
+ | -w / | ||
+ | -w / | ||
+ | -w / | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** - Pour plus d' | **Important** - Pour plus d' | ||
</ | </ | ||
Ligne 492: | Ligne 648: | ||
root@manager: | root@manager: | ||
... | ... | ||
- | [PASS] 1.2.4 - Ensure auditing is configured for Docker files and directories - / | + | [PASS] 1.1.4 - Ensure auditing is configured for Docker files and directories -/ |
- | [PASS] 1.2.5 | + | [PASS] 1.1.5 - Ensure auditing is configured for Docker files and directories - / |
- | [PASS] 1.2.6 | + | [PASS] 1.1.6 - Ensure auditing is configured for Docker files and directories - / |
- | [PASS] 1.2.7 | + | [PASS] 1.1.7 - Ensure auditing is configured for Docker files and directories - docker.service |
- | [PASS] 1.2.8 | + | [PASS] 1.1.9 - Ensure auditing is configured for Docker files and directories - docker.socket |
- | ... | + | [PASS] 1.1.10 - Ensure auditing is configured for Docker files and directories - / |
- | [PASS] 1.2.11 | + | [PASS] 1.1.12 - Ensure auditing is configured for Dockerfiles and directories - / |
+ | [PASS] 1.1.14 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [PASS] 1.1.15 - Ensure auditing is configured for Docker files and directories - / | ||
+ | [PASS] 1.1.18 - Ensure auditing is configured for Docker files and directories - / | ||
... | ... | ||
</ | </ | ||
Ligne 509: | Ligne 668: | ||
... | ... | ||
[INFO] 2 - Docker daemon configuration | [INFO] 2 - Docker daemon configuration | ||
- | [WARN] 2.1 - Ensure network traffic is restricted between containers on the default bridge | + | [NOTE] 2.1 - Run the Docker daemon as a non-root user, if possible (Manual) |
- | [PASS] 2.2 | + | [WARN] 2.2 - Ensure network traffic is restricted between containers on the default bridge |
- | [PASS] 2.3 | + | [PASS] 2.3 - Ensure the logging level is set to ' |
- | [PASS] 2.4 | + | [PASS] 2.4 - Ensure Docker is allowed to make changes to iptables |
- | [PASS] 2.5 | + | [PASS] 2.5 - Ensure insecure registries are not used (Scored) |
- | [INFO] 2.6 | + | [PASS] 2.6 - Ensure aufs storage driver is not used (Scored) |
+ | [INFO] 2.7 - Ensure TLS authentication for Docker daemon is configured | ||
[INFO] | [INFO] | ||
- | [INFO] 2.7 | + | [INFO] 2.8 - Ensure the default ulimit is configured appropriately |
[INFO] | [INFO] | ||
- | [WARN] 2.8 | + | [WARN] 2.9 - Enable user namespace support |
- | [PASS] 2.9 | + | [PASS] 2.10 - Ensure the default cgroup usage has been confirmed |
- | [PASS] 2.10 | + | [PASS] 2.11 - Ensure base device size is not changed until needed |
- | [WARN] 2.11 | + | [WARN] 2.12 - Ensure that authorization for Docker client commands is enabled |
- | [WARN] 2.12 | + | [WARN] 2.13 - Ensure centralized and remote logging is configured |
- | [PASS] 2.13 | + | [WARN] 2.14 - Ensure containers are restricted from acquiring new privileges (Scored) |
- | [WARN] 2.14 | + | [WARN] 2.15 - Ensure live restore is enabled |
- | [PASS] 2.15 | + | [WARN] 2.16 - Ensure Userland Proxy is Disabled |
- | [PASS] 2.16 | + | [PASS] 2.17 - Ensure that a daemon-wide custom seccomp profile is applied if appropriate |
- | [WARN] 2.17 - Ensure containers are restricted from acquiring new privileges | + | [PASS] 2.18 - Ensure that experimental features are not implemented in production |
... | ... | ||
</ | </ | ||
Ligne 533: | Ligne 693: | ||
Les problèmes de sécurité qu'il convient à résoudre sont indiqués par les annotations **[WARN]**. | Les problèmes de sécurité qu'il convient à résoudre sont indiqués par les annotations **[WARN]**. | ||
- | ====5.1 - [WARN] 2.1 | + | ====[WARN] 2.2 - Ensure network traffic is restricted between containers on the default bridge |
Par défaut Docker permet un trafic réseau sans restrictions entre des conteneurs sur le même hôte. Il est cependant possible de modifier la configuration par défaut. Pour empêcher ceci, il faut fixer la valeur de **icc** à **false**. De cette façon, docker crée des conteneurs qui peuvent communiquer entre eux **uniquement** s'il existe un lien. | Par défaut Docker permet un trafic réseau sans restrictions entre des conteneurs sur le même hôte. Il est cependant possible de modifier la configuration par défaut. Pour empêcher ceci, il faut fixer la valeur de **icc** à **false**. De cette façon, docker crée des conteneurs qui peuvent communiquer entre eux **uniquement** s'il existe un lien. | ||
Ligne 539: | Ligne 699: | ||
Pour plus d' | Pour plus d' | ||
- | ====5.2 - [WARN] 2.8 | + | ====[WARN] 2.9 - Enable user namespace support |
Cet avertissement nous indique que l' | Cet avertissement nous indique que l' | ||
Ligne 545: | Ligne 705: | ||
Pour plus d' | Pour plus d' | ||
- | ====5.3 - [WARN] 2.11 | + | ====[WARN] 2.12 - Ensure that authorization for Docker client commands is enabled |
Par défaut, Docker permet un accès sans restrictions aux daemon Docker. Il est possible de restreindre l' | Par défaut, Docker permet un accès sans restrictions aux daemon Docker. Il est possible de restreindre l' | ||
Ligne 551: | Ligne 711: | ||
Pour plus d' | Pour plus d' | ||
- | ====5.4 - [WARN] 2.12 | + | ====[WARN] 2.13 - Ensure centralized and remote logging is configured |
Cet avertissement indique que la configuration de rsyslog ne permet pas l' | Cet avertissement indique que la configuration de rsyslog ne permet pas l' | ||
Ligne 557: | Ligne 717: | ||
Pour plus d' | Pour plus d' | ||
- | ====5.5 - [WARN] 2.14 | + | ====[WARN] 2.14 - Ensure containers are restricted from acquiring new privileges (Scored)==== |
+ | |||
+ | Par défaut un conteneur peut obtenir une escalade de privilèges en utilisant les binaires setuid ou setgid. Pour interdire ceci il faut fixer la valeur de **no-new-privileges** à **true**. | ||
+ | |||
+ | Pour plus d' | ||
+ | |||
+ | ====[WARN] 2.15 - Ensure live restore is enabled (Scored)==== | ||
+ | |||
+ | L' | ||
+ | |||
+ | ====[WARN] 2.16 - Ensure Userland Proxy is Disabled | ||
Il existe deux méthodes pour qu'un conteneur puisse router vers l' | Il existe deux méthodes pour qu'un conteneur puisse router vers l' | ||
Ligne 568: | Ligne 738: | ||
Pour plus d' | Pour plus d' | ||
- | ====5.6 - [WARN] 2.17 - Ensure containers are restricted from acquiring new privileges==== | + | ====5.1 - Le Fichier / |
- | + | ||
- | Par défaut un conteneur peut obtenir une escalade de privilèges en utilisant les binaires setuid ou setgid. Pour interdire ceci il faut fixer la valeur de **no-new-privileges** à **true**. | + | |
- | + | ||
- | Pour plus d' | + | |
- | + | ||
- | ====5.7 | + | |
Créez le fichier **/ | Créez le fichier **/ | ||
Ligne 580: | Ligne 744: | ||
< | < | ||
root@manager: | root@manager: | ||
+ | |||
root@manager: | root@manager: | ||
{ | { | ||
Ligne 590: | Ligne 755: | ||
} | } | ||
</ | </ | ||
- | |||
- | Notez ici que **live-restore** est fixé à **true**. Ceci permet aux conteneurs de continuer à fonctionner même quand le daemon Docker ne fonctionne pas. Ceci est utile pendant la mise-à-jour de Docker. | ||
Re-démarrez le service Docker : | Re-démarrez le service Docker : | ||
Ligne 609: | Ligne 772: | ||
< | < | ||
- | root@manager: | ||
root@manager: | root@manager: | ||
... | ... | ||
- | [PASS] 2.1 | + | [PASS] 2.2 - Ensure network traffic is restricted between containers on the default bridge |
- | ... | + | [PASS] 2.3 - Ensure the logging level is set to ' |
- | [PASS] 2.8 | + | [PASS] 2.4 - Ensure Docker is allowed to make changes to iptables (Scored) |
- | ... | + | [PASS] 2.5 - Ensure insecure registries are not used (Scored) |
- | [WARN] 2.11 - Ensure | + | [PASS] 2.6 - Ensure aufs storage driver is not used (Scored) |
- | [PASS] 2.12 | + | [PASS] 2.9 - Enable user namespace support |
- | ... | + | [PASS] 2.10 - Ensure the default cgroup usage has been confirmed (Scored) |
- | [PASS] 2.14 | + | [PASS] 2.11 - Ensure |
- | ... | + | [PASS] 2.13 - Ensure centralized and remote logging is configured |
- | [PASS] 2.17 | + | [PASS] 2.14 - Ensure containers are restricted from acquiring new privileges (Scored) |
+ | [PASS] 2.15 - Ensure live restore is enabled (Scored) | ||
+ | [PASS] 2.16 - Ensure Userland Proxy is Disabled | ||
+ | [PASS] 2.17 - Ensure that a daemon-wide custom seccomp profile is applied if appropriate (Manual) | ||
+ | [PASS] 2.18 - Ensure | ||
... | ... | ||
</ | </ | ||
Ligne 632: | Ligne 798: | ||
< | < | ||
+ | root@manager: | ||
+ | Lecture des listes de paquets... Fait | ||
+ | Construction de l' | ||
+ | Lecture des informations d' | ||
+ | Le paquet suivant a été installé automatiquement et n'est plus nécessaire : | ||
+ | libsasl2-modules | ||
+ | Veuillez utiliser « apt autoremove » pour le supprimer. | ||
+ | Les paquets suivants seront mis à jour : | ||
+ | docker-ce | ||
+ | 1 mis à jour, 0 nouvellement installés, 0 à enlever et 252 non mis à jour. | ||
+ | Il est nécessaire de prendre 22,7 Mo dans les archives. | ||
+ | Après cette opération, 497 ko d' | ||
+ | Réception de:1 https:// | ||
+ | 22,7 Mo réceptionnés en 0s (26,0 Mo/s) | ||
+ | Lecture des fichiers de modifications (« changelog »)... Terminé | ||
+ | (Lecture de la base de données... 112865 fichiers et répertoires déjà installés.) | ||
+ | Préparation du dépaquetage de .../ | ||
+ | Dépaquetage de docker-ce (5: | ||
+ | Paramétrage de docker-ce (5: | ||
+ | Traitement des actions différées (« triggers ») pour systemd (232-25+deb9u14) ... | ||
+ | |||
root@manager: | root@manager: | ||
Unable to find image ' | Unable to find image ' | ||
latest: Pulling from library/ | latest: Pulling from library/ | ||
- | 80369df48736: Pull complete | + | e9f2695d7e5b: Pull complete |
- | e8f52315cb10: Pull complete | + | 80c6055edb33: Pull complete |
- | cf2189b391fc: Pull complete | + | c646ab461d8b: Pull complete |
- | cc98f645c682: Pull complete | + | 012006c6a591: Pull complete |
- | 27a27ac83f74: Pull complete | + | 929d5fa34b95: Pull complete |
- | fa1f04453414: Pull complete | + | 17e0243877fa: Pull complete |
- | d45bf7d22d33: Pull complete | + | 1850b459cd2f: Pull complete |
- | 3dbac26e409c: Pull complete | + | 8dceaed53baf: Pull complete |
- | 9017140fb8c1: Pull complete | + | 197b834ea1cd: Pull complete |
- | b76dda2673ae: | + | 8df78c25b227: Pull complete |
- | bea9eb46d12a: | + | Digest: sha256:ceb98918916bd5261b3e9866ac8271d75d276b8a4db56f1dc190770342a77a9b |
- | e1f050a38d0f: Pull complete | + | |
- | Digest: sha256:7345ce4ce6f0c1771d01fa333b8edb2c606ca59d385f69575f8e3e2ec6695eee | + | |
Status: Downloaded newer image for mysql: | Status: Downloaded newer image for mysql: | ||
- | 54606c03c52c5e3ec0328029d69b869d4b285fb433015576dedc8b8dd4ad0494 | + | e503dd98f88992ae6ed5ec4dcaa2e18982ade8ec74966869515a120763418f74 |
root@manager: | root@manager: | ||
- | CONTAINER ID IMAGE | + | CONTAINER ID IMAGE |
- | 54606c03c52c | + | e503dd98f889 |
</ | </ | ||
Ligne 661: | Ligne 847: | ||
... | ... | ||
[INFO] 4 - Container Images and Build File | [INFO] 4 - Container Images and Build File | ||
- | [WARN] 4.1 - Ensure a user for the container has been created | + | [WARN] 4.1 - Ensure |
[WARN] | [WARN] | ||
- | [NOTE] 4.2 - Ensure that containers use only trusted base images | + | [NOTE] 4.2 - Ensure that containers use only trusted base images |
- | [NOTE] 4.3 - Ensure that unnecessary packages are not installed in the container | + | [NOTE] 4.3 - Ensure that unnecessary packages are not installed in the container |
- | [NOTE] 4.4 - Ensure images are scanned and rebuilt to include security patches | + | [NOTE] 4.4 - Ensure images are scanned and rebuilt to include security patches |
- | [WARN] 4.5 - Ensure Content trust for Docker is Enabled | + | [WARN] 4.5 - Ensure Content trust for Docker is Enabled |
- | [WARN] 4.6 - Ensure that HEALTHCHECK instructions have been added to container images | + | [WARN] 4.6 - Ensure that HEALTHCHECK instructions have been added to container images |
- | [WARN] | + | |
[WARN] | [WARN] | ||
- | [INFO] 4.7 - Ensure update instructions are not use alone in the Dockerfile | + | [PASS] 4.7 - Ensure update instructions are not used alone in the Dockerfile |
- | [INFO] | + | [NOTE] 4.8 - Ensure setuid and setgid permissions are removed |
- | [NOTE] 4.8 - Ensure setuid and setgid permissions are removed | + | [PASS] 4.9 - Ensure that COPY is used instead of ADD in Dockerfiles |
- | [PASS] 4.9 - Ensure that COPY is used instead of ADD in Dockerfiles | + | [NOTE] 4.10 - Ensure secrets are not stored in Dockerfiles |
- | [NOTE] 4.10 - Ensure secrets are not stored in Dockerfiles | + | [NOTE] 4.11 - Ensure only verified packages are installed |
- | [NOTE] 4.11 - Ensure only verified packages are installed | + | [NOTE] 4.12 - Ensure all signed artifacts are validated (Manual) |
... | ... | ||
</ | </ | ||
- | ====6.1 - [WARN] 4.1 - Ensure a user for the container has been created==== | + | ====[WARN] 4.1 - Ensure |
Les processus dans le conteneur **mysql** tourne sous l'UID de root. Ceci est l' | Les processus dans le conteneur **mysql** tourne sous l'UID de root. Ceci est l' | ||
Ligne 685: | Ligne 870: | ||
Pour plus d' | Pour plus d' | ||
- | ====6.2 - [WARN] 4.5 - Ensure Content trust for Docker is Enabled==== | + | ====[WARN] 4.5 - Ensure Content trust for Docker is Enabled |
Cette ligne indique que le support de Content trust n'a pas été activé. Content trust permet de s' | Cette ligne indique que le support de Content trust n'a pas été activé. Content trust permet de s' | ||
Ligne 694: | Ligne 879: | ||
root@manager: | root@manager: | ||
DOCKER_CONTENT_TRUST=1 | DOCKER_CONTENT_TRUST=1 | ||
+ | |||
root@manager: | root@manager: | ||
</ | </ | ||
Ligne 700: | Ligne 886: | ||
< | < | ||
- | root@manager: | + | root@manager: |
+ | Connection to 10.0.2.62 closed by remote host. | ||
+ | Connection to 10.0.2.62 closed. | ||
+ | |||
+ | root@debian11: | ||
+ | trainee@10.0.2.62' | ||
+ | Linux manager.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 | ||
+ | |||
+ | The programs included with the Debian GNU/Linux system are free software; | ||
+ | the exact distribution terms for each program are described in the | ||
+ | individual files in / | ||
+ | |||
+ | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | ||
+ | permitted by applicable law. | ||
+ | Last login: Sun Dec 17 18:39:07 2023 from 10.0.2.46 | ||
+ | |||
+ | trainee@manager: | ||
+ | Mot de passe : fenestros | ||
+ | |||
+ | root@manager: | ||
+ | |||
+ | root@manager: | ||
+ | |||
+ | root@manager: | ||
mysql | mysql | ||
- | root@manager: | ||
- | CONTAINER ID IMAGE | ||
- | 54606c03c52c | ||
</ | </ | ||
Ligne 713: | Ligne 919: | ||
... | ... | ||
[INFO] 4 - Container Images and Build File | [INFO] 4 - Container Images and Build File | ||
- | [WARN] 4.1 - Ensure a user for the container has been created | + | [WARN] 4.1 - Ensure |
[WARN] | [WARN] | ||
- | [NOTE] 4.2 - Ensure that containers use only trusted base images | + | [NOTE] 4.2 - Ensure that containers use only trusted base images |
- | [NOTE] 4.3 - Ensure that unnecessary packages are not installed in the container | + | [NOTE] 4.3 - Ensure that unnecessary packages are not installed in the container |
- | [NOTE] 4.4 - Ensure images are scanned and rebuilt to include security patches | + | [NOTE] 4.4 - Ensure images are scanned and rebuilt to include security patches |
- | [PASS] 4.5 - Ensure Content trust for Docker is Enabled | + | [PASS] 4.5 - Ensure Content trust for Docker is Enabled |
- | [WARN] 4.6 - Ensure that HEALTHCHECK instructions have been added to container images | + | [WARN] 4.6 - Ensure that HEALTHCHECK instructions have been added to container images |
- | [WARN] | + | |
[WARN] | [WARN] | ||
- | [INFO] 4.7 - Ensure update instructions are not use alone in the Dockerfile | + | [PASS] 4.7 - Ensure update instructions are not used alone in the Dockerfile |
- | [INFO] | + | [NOTE] 4.8 - Ensure setuid and setgid permissions are removed |
- | [NOTE] 4.8 - Ensure setuid and setgid permissions are removed | + | [PASS] 4.9 - Ensure that COPY is used instead of ADD in Dockerfiles |
- | [PASS] 4.9 - Ensure that COPY is used instead of ADD in Dockerfiles | + | [NOTE] 4.10 - Ensure secrets are not stored in Dockerfiles |
- | [NOTE] 4.10 - Ensure secrets are not stored in Dockerfiles | + | [NOTE] 4.11 - Ensure only verified packages are installed |
- | [NOTE] 4.11 - Ensure only verified packages are installed | + | [NOTE] 4.12 - Ensure all signed artifacts are validated (Manual) |
... | ... | ||
</ | </ | ||
Ligne 733: | Ligne 938: | ||
Pour plus d' | Pour plus d' | ||
- | ====6.3 - [WARN] 4.6 - Ensure that HEALTHCHECK instructions have been added to container images==== | + | ====[WARN] 4.6 - Ensure that HEALTHCHECK instructions have been added to container images==== |
Quand une image est construite il est possible d'y mettre un **HEALTHCHECK** dont le statut peut être vérifié par Docker afin de relancer le conteneur si nécessaire. | Quand une image est construite il est possible d'y mettre un **HEALTHCHECK** dont le statut peut être vérifié par Docker afin de relancer le conteneur si nécessaire. | ||
Ligne 755: | Ligne 960: | ||
... | ... | ||
[INFO] 5 - Container Runtime | [INFO] 5 - Container Runtime | ||
- | [WARN] 5.1 - Ensure that, if applicable, an AppArmor Profile is enabled | + | [WARN] 5.1 - Ensure that, if applicable, an AppArmor Profile is enabled |
[WARN] | [WARN] | ||
- | [WARN] 5.2 - Ensure that, if applicable, SELinux security options are set | + | [WARN] 5.2 - Ensure that, if applicable, SELinux security options are set (Automated) |
[WARN] | [WARN] | ||
- | [PASS] 5.3 - Ensure Linux Kernel Capabilities | + | [PASS] 5.3 - Ensure |
- | [PASS] 5.4 - Ensure that privileged containers are not used | + | [PASS] 5.4 - Ensure that privileged containers are not used (Automated) |
- | [PASS] 5.5 - Ensure sensitive host system directories are not mounted on containers | + | [PASS] 5.5 - Ensure sensitive host system directories are not mounted on containers |
- | [PASS] 5.6 - Ensure sshd is not run within containers | + | [PASS] 5.6 - Ensure sshd is not run within containers |
- | [PASS] 5.7 - Ensure privileged ports are not mapped within containers | + | [PASS] 5.7 - Ensure privileged ports are not mapped within containers |
- | [NOTE] 5.8 - Ensure that only needed ports are open on the container | + | [PASS] 5.8 - Ensure that only needed ports are open on the container |
- | [PASS] 5.9 - Ensure the host's network namespace is not shared | + | [PASS] 5.9 - Ensure |
- | [WARN] 5.10 - Ensure that the memory usage for containers is limited | + | [WARN] 5.10 - Ensure that the memory usage for containers is limited |
- | [WARN] | + | [WARN] |
- | [WARN] 5.11 - Ensure CPU priority is set appropriately on the container | + | [WARN] 5.11 - Ensure |
- | [WARN] | + | [WARN] |
- | [WARN] 5.12 - Ensure that the container' | + | [WARN] 5.12 - Ensure that the container' |
- | [WARN] | + | [WARN] |
- | [PASS] 5.13 - Ensure that incoming container traffic is bound to a specific host interface | + | [PASS] 5.13 - Ensure that incoming container traffic is bound to a specific host interface |
- | [WARN] 5.14 - Ensure that the ' | + | [WARN] 5.14 - Ensure that the ' |
- | [WARN] | + | [WARN] |
- | [PASS] 5.15 - Ensure the host's process namespace is not shared | + | [PASS] 5.15 - Ensure |
- | [PASS] 5.16 - Ensure the host's IPC namespace is not shared | + | [PASS] 5.16 - Ensure |
- | [PASS] 5.17 - Ensure that host devices are not directly exposed to containers | + | [PASS] 5.17 - Ensure that host devices are not directly exposed to containers |
- | [INFO] 5.18 - Ensure that the default ulimit is overwritten at runtime if needed | + | [INFO] 5.18 - Ensure that the default ulimit is overwritten at runtime if needed |
- | [INFO] | + | [INFO] |
- | [PASS] 5.19 - Ensure mount propagation mode is not set to shared | + | [PASS] 5.19 - Ensure mount propagation mode is not set to shared |
- | [PASS] 5.20 - Ensure the host's UTS namespace is not shared | + | [PASS] 5.20 - Ensure |
- | [PASS] 5.21 - Ensure the default seccomp profile is not Disabled | + | [PASS] 5.21 - Ensure the default seccomp profile is not Disabled |
- | [NOTE] 5.22 - Ensure docker exec commands are not used with privileged option | + | [NOTE] 5.22 - Ensure |
- | [NOTE] 5.23 - Ensure that docker exec commands are not used with the user=root option | + | [NOTE] 5.23 - Ensure that docker exec commands are not used with the user=root option |
- | [PASS] 5.24 - Ensure that cgroup usage is confirmed | + | [PASS] 5.24 - Ensure that cgroup usage is confirmed |
- | [WARN] 5.25 - Ensure that the container is restricted from acquiring additional privileges | + | [PASS] 5.25 - Ensure that the container is restricted from acquiring additional privileges |
- | [WARN] | + | [WARN] 5.26 - Ensure that container health is checked at runtime |
- | [WARN] 5.26 - Ensure that container health is checked at runtime | + | [WARN] |
- | [WARN] | + | [INFO] 5.27 - Ensure that Docker commands always make use of the latest version of their image (Manual) |
- | [INFO] 5.27 - Ensure that Docker commands always make use of the latest version of their image | + | [WARN] 5.28 - Ensure that the PIDs cgroup limit is used (Automated) |
- | [WARN] 5.28 - Ensure that the PIDs cgroup limit is used | + | [WARN] |
- | [WARN] | + | [INFO] 5.29 - Ensure that Docker' |
- | [INFO] 5.29 - Ensure that Docker' | + | [INFO] |
- | [INFO] | + | [PASS] 5.30 - Ensure that the host's user namespaces are not shared |
- | [PASS] 5.30 - Ensure that the host's user namespaces are not shared | + | [PASS] 5.31 - Ensure that the Docker socket is not mounted inside any containers |
- | [PASS] 5.31 - Ensure that the Docker socket is not mounted inside any containers | + | |
... | ... | ||
</ | </ | ||
Ligne 802: | Ligne 1006: | ||
Les problèmes de sécurité qu'il convient à résoudre sont indiqués par les annotations **[WARN]**. | Les problèmes de sécurité qu'il convient à résoudre sont indiqués par les annotations **[WARN]**. | ||
- | ====7.1 - [WARN] 5.1 - Ensure AppArmor Profile is Enabled==== | + | ====[WARN] 5.1 - Ensure |
Cet avertissement est présent parce que le conteneur n' | Cet avertissement est présent parce que le conteneur n' | ||
Ligne 808: | Ligne 1012: | ||
Pour plus d' | Pour plus d' | ||
- | ====7.2 - [WARN] 5.2 - Ensure SELinux security options are set, if applicable==== | + | ====[WARN] 5.2 - Ensure |
Cet avertissement est présent parce que le conteneur n' | Cet avertissement est présent parce que le conteneur n' | ||
Ligne 814: | Ligne 1018: | ||
Pour plus d' | Pour plus d' | ||
- | ====7.3 - [WARN] 5.10 - Ensure memory usage for container | + | ====[WARN] 5.10 - Ensure |
Cet avertissement est du au fait que les conteneurs ont automatiquement accès à la totalité de la RAM de l' | Cet avertissement est du au fait que les conteneurs ont automatiquement accès à la totalité de la RAM de l' | ||
Ligne 830: | Ligne 1034: | ||
< | < | ||
- | root@manager: | + | root@manager: |
- | CONTAINER ID IMAGE | + | Unable to find image ' |
- | b04b2a6f0dd9 | + | sha256: |
- | 5b31fe1e13bc | + | 1f7ce2fa46ab: |
- | 7788c67c3b69 | + | 9b16c94bb686: |
- | root@manager: | + | 9a59d19f9c5b: |
- | b0 | + | 9ea27b074f71: |
- | root@manager: | + | c6edf33e2524: |
- | 095472e5096a57277230ff94822d9bd0ad479ad26a33cbf83ec381cdb02910e1 | + | 84b1ff10387b: |
- | root@manager: | + | 517357831967: |
- | CONTAINER ID NAME | + | Digest: sha256: |
- | 095472e5096a | + | Status: Downloaded newer image for nginx@sha256: |
+ | Tagging nginx@sha256: | ||
+ | e14d5112c2feb71e6f37252bcf99d03603d6b7a3e200bff0d55611a0e9a25e2b | ||
+ | |||
+ | root@manager: | ||
+ | CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O | ||
+ | e14d5112c2fe | ||
+ | e503dd98f889 | ||
+ | ^C | ||
+ | </ | ||
+ | |||
+ | Supprimez le conteneur et re-créez-le avec une limite de mémoire : | ||
+ | |||
+ | < | ||
+ | root@manager: | ||
+ | CONTAINER ID IMAGE | ||
+ | e14d5112c2fe | ||
+ | e503dd98f889 | ||
+ | |||
+ | root@manager: | ||
+ | e14 | ||
+ | |||
+ | root@manager: | ||
+ | 38e91e096c83f7cbe78089617a4d70110bd273f53339f8fed8df2503d3cd65ca | ||
+ | |||
+ | root@manager: | ||
+ | CONTAINER ID NAME CPU % MEM USAGE / LIMIT | ||
+ | 38e91e096c83 | ||
+ | e503dd98f889 | ||
^C | ^C | ||
</ | </ | ||
Ligne 847: | Ligne 1079: | ||
Pour plus d' | Pour plus d' | ||
- | ====7.4 - [WARN] 5.11 - Ensure CPU priority is set appropriately on the container==== | + | ====[WARN] 5.11 - Ensure |
Cet avertissement est du au fait que les conteneurs ont automatiquement accès à tous les CPU de l' | Cet avertissement est du au fait que les conteneurs ont automatiquement accès à tous les CPU de l' | ||
Ligne 855: | Ligne 1087: | ||
Pour plus d' | Pour plus d' | ||
- | ====7.5 - [WARN] 5.12 - Ensure the container' | + | ====[WARN] 5.12 - Ensure |
Afin de minimiser le risque de compromettre un conteneur par la présence de code malicieux, il est conseillé de démarrer les conteneurs en lecture seule, sauf pour les volumes qui nécessitent un accès en écriture/ | Afin de minimiser le risque de compromettre un conteneur par la présence de code malicieux, il est conseillé de démarrer les conteneurs en lecture seule, sauf pour les volumes qui nécessitent un accès en écriture/ | ||
Ligne 868: | Ligne 1100: | ||
< | < | ||
- | root@manager: | + | root@manager: |
- | A / | + | |
C /run | C /run | ||
C /run/mysqld | C /run/mysqld | ||
+ | A / | ||
A / | A / | ||
A / | A / | ||
A / | A / | ||
A / | A / | ||
- | A /run/ | + | A /write_a_file |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez que la sortie indique les changements apportés au conteneur. | **Important** : Notez que la sortie indique les changements apportés au conteneur. | ||
</ | </ | ||
Ligne 886: | Ligne 1118: | ||
< | < | ||
- | root@manager: | + | root@manager: |
mysql | mysql | ||
- | root@manager: | + | |
+ | root@manager: | ||
mysql | mysql | ||
</ | </ | ||
Ligne 895: | Ligne 1128: | ||
< | < | ||
- | root@manager: | + | root@manager: |
- | 7788c67c3b692515f63f4659a8f40af397bfbde97485e2e40c500c16b158045b | + | 711ab28bdfb41220c84246c1658bcde398681a78291bbbe7d3bbfd9bc317d41b |
- | root@manager: | + | |
- | CONTAINER ID IMAGE | + | |
- | 7788c67c3b69 | + | |
</ | </ | ||
Ligne 909: | Ligne 1139: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 920: | Ligne 1150: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez que la commande ne retourne aucune sortie. En effet le conteneur étant en lecture seule, aucun changement ne peut intervenir. | **Important** : Notez que la commande ne retourne aucune sortie. En effet le conteneur étant en lecture seule, aucun changement ne peut intervenir. | ||
</ | </ | ||
- | ====7.6 - [WARN] 5.14 - Ensure ' | + | ====[WARN] 5.14 - Ensure |
Cet avertissement concerne la politique de re-démarrage du conteneur. La politique **on-failure[: | Cet avertissement concerne la politique de re-démarrage du conteneur. La politique **on-failure[: | ||
Ligne 932: | Ligne 1162: | ||
Pour plus d' | Pour plus d' | ||
- | ====7.7 - [WARN] 5.25 - Ensure the container is restricted from acquiring additional privileges==== | + | ====[WARN] 5.26 - Ensure |
- | + | ||
- | Pour complémenter la configuration précédemment mise en place, il convient de lancer le conteneur en utilisant l' | + | |
- | + | ||
- | # docker container run -d --name mysql --read-only --restart on-failure: | + | |
- | + | ||
- | Pour plus d' | + | |
- | + | ||
- | ====7.8 - [WARN] 5.26 - Ensure container health is checked at runtime==== | + | |
Voir l' | Voir l' | ||
- | ====7.9 - [WARN] 5.28 - Ensure PIDs cgroup limit is used==== | + | ====[WARN] 5.28 - Ensure |
Sans l' | Sans l' | ||
Ligne 955: | Ligne 1177: | ||
< | < | ||
- | root@manager: | + | root@manager: |
- | CONTAINER ID IMAGE | + | Unable to find image ' |
- | 05b11e44e595 | + | sha256: |
- | ... | + | a48641193673: |
- | root@manager: | + | Digest: sha256: |
- | 05 | + | Status: Downloaded newer image for ubuntu@sha256: |
- | root@manager: | + | Tagging ubuntu@sha256: |
environment: | environment: | ||
environment: | environment: | ||
Ligne 968: | Ligne 1190: | ||
environment: | environment: | ||
environment: | environment: | ||
- | ^C | + | environment: |
+ | environment: | ||
+ | environment: | ||
+ | environment: | ||
+ | environment: | ||
+ | environment: | ||
+ | ^P^Q | ||
</ | </ | ||
Ligne 976: | Ligne 1204: | ||
< | < | ||
- | root@manager: | + | root@manager: |
- | CONTAINER ID IMAGE | + | db5ae43c3e55 |
- | 095472e5096a | + | f3b2528fbac0 |
- | 5b31fe1e13bc | + | 711ab28bdfb4 |
- | 7788c67c3b69 | + | |
- | root@manager: | + | root@manager: |
- | 095 | + | CONTAINER ID IMAGE |
- | root@manager: | + | |
- | 5b31fe1e13bc | + | |
- | 7788c67c3b69 | + | |
- | 095472e5096a | + | |
- | root@manager: | + | |
- | CONTAINER ID IMAGE | + | |
</ | </ | ||
Ligne 994: | Ligne 1216: | ||
< | < | ||
- | root@manager: | + | root@manager: |
- | root@manager: | + | f49d1ffdeae2e83435e8cc3a2e03fb2e0b33e5609d266e5a3403ff8859e5d122 |
- | df54974ebc11fe357f6e8e9b0f8499aee2658af435e32a45058a1e49fcd3dc24 | + | |
root@manager: | root@manager: | ||
CONTAINER ID IMAGE | CONTAINER ID IMAGE | ||
- | df54974ebc11 | + | f49d1ffdeae2 |
</ | </ | ||
Ligne 1007: | Ligne 1229: | ||
root@manager: | root@manager: | ||
... | ... | ||
- | [INFO] 5 - Container Runtime | + | [PASS] 5.2 - Ensure that, if applicable, SELinux security options are set (Automated) |
- | [WARN] 5.1 - Ensure that, if applicable, an AppArmor Profile is enabled | + | [PASS] 5.10 - Ensure that the memory usage for containers is limited |
- | [WARN] | + | [PASS] 5.11 - Ensure |
- | [PASS] 5.2 - Ensure that, if applicable, SELinux security options are set | + | [PASS] 5.12 - Ensure that the container' |
- | [PASS] 5.3 - Ensure Linux Kernel Capabilities are restricted within containers | + | [PASS] 5.14 - Ensure that the ' |
- | [PASS] 5.4 - Ensure that privileged containers are not used | + | [PASS] 5.28 - Ensure that the PIDs cgroup limit is used (Automated) |
- | [PASS] 5.5 - Ensure sensitive host system directories are not mounted on containers | + | |
- | [PASS] 5.6 - Ensure sshd is not run within containers | + | |
- | [PASS] 5.7 - Ensure privileged ports are not mapped within containers | + | |
- | [NOTE] 5.8 - Ensure that only needed ports are open on the container | + | |
- | [PASS] 5.9 - Ensure the host's network namespace is not shared | + | |
- | [PASS] 5.10 - Ensure that the memory usage for containers is limited | + | |
- | [PASS] 5.11 - Ensure CPU priority is set appropriately on the container | + | |
- | [PASS] 5.12 - Ensure that the container' | + | |
- | [PASS] 5.13 - Ensure that incoming container traffic is bound to a specific host interface | + | |
- | [PASS] 5.14 - Ensure that the ' | + | |
- | [PASS] 5.15 - Ensure the host's process namespace is not shared | + | |
- | [PASS] 5.16 - Ensure the host's IPC namespace is not shared | + | |
- | [PASS] 5.17 - Ensure that host devices are not directly exposed to containers | + | |
- | [INFO] 5.18 - Ensure that the default ulimit is overwritten at runtime if needed | + | |
- | [INFO] | + | |
- | [PASS] 5.19 - Ensure mount propagation mode is not set to shared | + | |
- | [PASS] 5.20 - Ensure the host's UTS namespace is not shared | + | |
- | [PASS] 5.21 - Ensure the default seccomp profile is not Disabled | + | |
- | [NOTE] 5.22 - Ensure docker exec commands are not used with privileged option | + | |
- | [NOTE] 5.23 - Ensure that docker exec commands are not used with the user=root option | + | |
- | [PASS] 5.24 - Ensure that cgroup usage is confirmed | + | |
- | [PASS] 5.25 - Ensure that the container is restricted from acquiring additional privileges | + | |
- | [WARN] 5.26 - Ensure that container health is checked at runtime | + | |
- | [WARN] | + | |
- | [INFO] 5.27 - Ensure that Docker commands always make use of the latest version of their image | + | |
- | [PASS] 5.28 - Ensure that the PIDs cgroup limit is used | + | |
- | [INFO] 5.29 - Ensure that Docker' | + | |
- | [INFO] | + | |
- | [PASS] 5.30 - Ensure that the host's user namespaces are not shared | + | |
- | [PASS] 5.31 - Ensure that the Docker socket is not mounted inside any containers | + | |
... | ... | ||
</ | </ | ||
Ligne 1096: | Ligne 1288: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 1270: | Ligne 1462: | ||
< | < | ||
root@manager: | root@manager: | ||
+ | |||
root@manager: | root@manager: | ||
+ | |||
root@manager: | root@manager: | ||
+ | |||
root@manager: | root@manager: | ||
FROM docker/ | FROM docker/ | ||
Ligne 1321: | Ligne 1516: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 1331: | Ligne 1526: | ||
< | < | ||
root@manager: | root@manager: | ||
+ | |||
root@manager: | root@manager: | ||
REPOSITORY | REPOSITORY | ||
Ligne 1356: | Ligne 1552: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez la création d'une deuxième repositry key (ID 7b13d02 au lieu de ID 168c754) lors du push de l' | **Important** : Notez la création d'une deuxième repositry key (ID 7b13d02 au lieu de ID 168c754) lors du push de l' | ||
</ | </ | ||
Ligne 1443: | Ligne 1639: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez que les clefs utilisées sont les mêmes pour les deux images. | **Important** : Notez que les clefs utilisées sont les mêmes pour les deux images. | ||
</ | </ | ||
Ligne 1484: | Ligne 1680: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important |
**Important** : Notez que les clefs utilisées sont différentes. | **Important** : Notez que les clefs utilisées sont différentes. | ||
</ | </ | ||
Ligne 1524: | Ligne 1720: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Il existe un autre mécanisme de signatures cryptographiques qui permet de certifier le contenu des images mises à disposition sur une Registry. Appelé **Notary**, ce système a été développé par la communauté Docker et intègre une partie de la spécification de **[[https:// | **Important** : Il existe un autre mécanisme de signatures cryptographiques qui permet de certifier le contenu des images mises à disposition sur une Registry. Appelé **Notary**, ce système a été développé par la communauté Docker et intègre une partie de la spécification de **[[https:// | ||
</ | </ | ||
Ligne 1604: | Ligne 1800: | ||
< | < | ||
- | root@manager: | + | root@manager: |
</ | </ | ||
Ligne 1617: | Ligne 1813: | ||
< | < | ||
root@manager: | root@manager: | ||
- | subjectAltName = DNS: | + | subjectAltName = DNS: |
extendedKeyUsage = serverAuth | extendedKeyUsage = serverAuth | ||
</ | </ | ||
Ligne 1643: | Ligne 1839: | ||
</ | </ | ||
- | Modifiez l' | + | Modifiez l' |
< | < | ||
Ligne 1649: | Ligne 1845: | ||
root@manager: | root@manager: | ||
127.0.0.1 localhost | 127.0.0.1 localhost | ||
- | 10.0.3.60 debian9.i2tch.loc debian9 | + | 10.0.2.46 debian11.i2tch.loc debian11 |
- | 10.0.3.61 myregistry.i2tch.loc | + | 10.0.2.45 myregistry.i2tch.loc |
- | 10.0.3.62 manager.i2tch.loc manager | + | 10.0.2.62 manager.i2tch.loc manager |
- | 10.0.3.63 worker1.i2tch.loc worker1 | + | 10.0.2.63 worker1.i2tch.loc worker1 |
- | 10.0.3.64 worker2.i2tch.loc worker2 | + | 10.0.2.64 worker2.i2tch.loc worker2 |
# The following lines are desirable for IPv6 capable hosts | # The following lines are desirable for IPv6 capable hosts | ||
Ligne 1807: | Ligne 2003: | ||
====9.5 - Configuration du Client==== | ====9.5 - Configuration du Client==== | ||
- | Transférez ensuite le certificat du CA ainsi que le certificat et la clef privée du client vers la VM **debian91** : | + | Transférez ensuite le certificat du CA ainsi que le certificat et la clef privée du client vers la VM **10.0.2.45** : |
< | < | ||
- | root@manager: | + | root@manager: |
- | The authenticity of host '10.0.3.61 (10.0.3.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: | ECDSA key fingerprint is SHA256: | ||
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.3.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.3.61's password: | + | trainee@10.0.2.45's password: |
ca.pem | ca.pem | ||
key.pem | key.pem | ||
Ligne 1821: | Ligne 2017: | ||
</ | </ | ||
- | Lancez la commande **docker version** sur la VM **debian91** : | + | Lancez la commande **docker version** sur la VM **10.0.2.45** : |
< | < | ||
Ligne 1876: | Ligne 2072: | ||
</ | </ | ||
- | Maintenant la connection | + | Maintenant la connexion |
< | < | ||
Ligne 1894: | Ligne 2090: | ||
----- | ----- | ||
- | Copyright © 2023 Hugh Norris. | + | Copyright © 2024 Hugh Norris. |