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/10/01 21:56] 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
  
 +Django: Mise en place de l’HTTPS via Nginx
 +* 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 86: 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 107: 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 116: Ligne 123:
  
 === Droits pour utilisateur non root === Droits pour utilisateur non root
 +
  
  
Ligne 122: 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 149: Ligne 176:
 doesn't really make /mnt inside the container read-only doesn't really make /mnt inside the container read-only
 Submounts like /mnt/usbdisk are writable Submounts like /mnt/usbdisk are writable
 +
  
 ==== Autres - seccomp ==== Autres - seccomp
Ligne 368: Ligne 396:
 docker load -i <path to image tar file> docker load -i <path to image tar file>
 </code> </code>
 +
 +
 == Debug == Debug
  
Ligne 392: 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 480: 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 591: 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 669: 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 677: 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.1759348613.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki