Outils pour utilisateurs

Outils du site


tech:notes_docker

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
tech:notes_docker [2025/06/01 16:14] Jean-Baptistetech:notes_docker [2025/12/05 11:50] (Version actuelle) Jean-Baptiste
Ligne 5: Ligne 5:
 Voir : Voir :
 * ''namespace.unpriv_enable=1'' * ''namespace.unpriv_enable=1''
 +* [[Scan de vulnérabilité pour les images de conteneurs]]
  
 Voir aussi OpenContainers : Voir aussi OpenContainers :
Ligne 16: Ligne 17:
 * https://docs.oracle.com/cd/E52668_01/E75728/html/docker_admin_config.html * https://docs.oracle.com/cd/E52668_01/E75728/html/docker_admin_config.html
  
-Script +DjangoMise en place de l’HTTPS via Nginx 
-* https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh+* https://nextcloud.inrae.fr/s/gtSrdE98Knp7HGf?openfile=true 
 + 
 +Mise en production de Django via Docker 
 +* https://nextcloud.inrae.fr/s/rdMSmet4miWkz8Q?openfile=true
  
 Docker et sécurité : Docker et sécurité :
 * https://resinfo.org/IMG/pdf/secu-docker.pdf * https://resinfo.org/IMG/pdf/secu-docker.pdf
-* [[https://computingforgeeks.com/scan-docker-container-images-with-trivy/|Scan Docker Container Images for Vulnerabilities with Trivy]] 
  
  
Ligne 43: Ligne 46:
  
 Vérifier les prérequis :  Vérifier les prérequis : 
 +# https://github.com/moby/moby/blob/master/contrib/check-config.sh
 +https://github.com/opencontainers/runc/blob/main/script/check-config.sh
 +
 +
  
-<code bash> 
-# https://github.com/moby/moby/blob/master/contrib/check-config.sh 
-wget https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh 
-chmod +x check-config.sh 
-./check-config.sh 
-</code> 
  
  
Ligne 90: Ligne 91:
 <code ini> <code ini>
 [Service] [Service]
-Environment = "HTTP_PROXY=http://192.168.56.1:3128/" "HTTPS_PROXY=http://192.168.56.1:3128/"+Environment = "HTTP_PROXY=http://192.168.56.1:3128/" "HTTPS_PROXY=http://192.168.56.1:3128/" 
 +Environment = "http_proxy=http://192.168.56.1:3128/" "https_proxy=http://192.168.56.1:3128/"
 </code> </code>
  
Ligne 111: Ligne 113:
  
 Voir :  Voir : 
 +* https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/docker-security/docker-breakout-privilege-escalation/index.html
 * https://benchmarks.cisecurity.org/tools2/docker/CIS_Docker_1.6_Benchmark_v1.0.0.pdf * https://benchmarks.cisecurity.org/tools2/docker/CIS_Docker_1.6_Benchmark_v1.0.0.pdf
 * https://docs.oracle.com/en/operating-systems/oracle-linux/podman/podman-SecurityRecommendations.html * https://docs.oracle.com/en/operating-systems/oracle-linux/podman/podman-SecurityRecommendations.html
Ligne 120: Ligne 123:
  
 === Droits pour utilisateur non root === Droits pour utilisateur non root
 +
  
  
Ligne 126: Ligne 130:
 docker run -ti --privileged -v /:/host debian chroot /host docker run -ti --privileged -v /:/host debian chroot /host
 docker run -ti --userns=host --privileged -v /:/host debian chroot /host docker run -ti --userns=host --privileged -v /:/host debian chroot /host
 +
 +#List images to use one
 +docker images
 +#Run the image mounting the host disk and chroot on it
 +docker run -it -v /:/host/ ubuntu:18.04 chroot /host/ bash
 +
 +# Get full access to the host via ns pid and nsenter cli
 +docker run -it --rm --pid=host --privileged ubuntu bash
 +nsenter --target 1 --mount --uts --ipc --net --pid -- bash
 +
 +# Get full privs in container without --privileged
 +docker run -it -v /:/host/ --cap-add=ALL --security-opt apparmor=unconfined --security-opt seccomp=unconfined --security-opt label:disable --pid=host --userns=host --uts=host --cgroupns=host ubuntu chroot /host/ bash
 +
 </code> </code>
 +
 +Voir :
 +* ''--security-opt apparmor=unconfined''
 +* ''--security-opt seccomp=unconfined''
 +* ''--security-opt label:disable''
 +
  
 Voir : http://www.projectatomic.io/blog/2015/08/why-we-dont-let-non-root-users-run-docker-in-centos-fedora-or-rhel/ Voir : http://www.projectatomic.io/blog/2015/08/why-we-dont-let-non-root-users-run-docker-in-centos-fedora-or-rhel/
Ligne 142: Ligne 165:
 * Podman * Podman
 * kata-containers * kata-containers
 +
 +
 +=== Droits montage
 +
 +<code bash>
 +docker run -v /mnt:/mnt:ro
 +</code>
 +
 +
 +doesn't really make /mnt inside the container read-only
 +Submounts like /mnt/usbdisk are writable
  
  
Ligne 362: Ligne 396:
 docker load -i <path to image tar file> docker load -i <path to image tar file>
 </code> </code>
 +
 +
 == Debug == Debug
  
Ligne 386: Ligne 422:
 docker run --platform linux/amd64 --publish 8000:8080 ghcr.io/mermaid-js/mermaid-live-editor docker run --platform linux/amd64 --publish 8000:8080 ghcr.io/mermaid-js/mermaid-live-editor
 </code> </code>
 +
  
 === Notes brouillon === Notes brouillon
Ligne 474: Ligne 511:
 </code> </code>
  
-=== Proxy (sous Debian)+ 
 +=== Proxy
  
 <code bash> <code bash>
-export http_proxy="http://192.168.56.1:3128/"+export ALL_PROXY="http://192.168.56.1:3128/"
 </code> </code>
  
Ligne 585: Ligne 623:
 grep CRIT /var/lib/docker/containers/*/*.log grep CRIT /var/lib/docker/containers/*/*.log
 </code> </code>
 +
  
 == Notes DNS Bind9 == Notes DNS Bind9
Ligne 614: Ligne 653:
 </code> </code>
  
-<code ini /etc/default/grub>+''/etc/default/grub'' 
 +<code ini>
 GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1" GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
 </code> </code>
Ligne 662: Ligne 702:
 docker save -o plop.tar.gz acme/jibe docker save -o plop.tar.gz acme/jibe
 </code> </code>
 +
  
 ==== Notes console TTY ==== Notes console TTY
Ligne 670: Ligne 711:
  
 If you use -t and -i then Control-C will terminate the container. When using -i with -t then you have to use Control-P Control-Q to detach without terminating. If you use -t and -i then Control-C will terminate the container. When using -i with -t then you have to use Control-P Control-Q to detach without terminating.
 +
  
 ==== Notes Haute dispo / Cluster ==== Notes Haute dispo / Cluster
tech/notes_docker.1748787293.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki