k8s-labs-developer

🧪 Übung: Trivy installieren und nginx Docker-Image scannen


🎯 Ziel


📁 Schritt 1: Trivy installieren

Linux (Debian/Ubuntu)

sudo apt-get install -y wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install trivy

Alternativ: Trivy als Binary herunterladen

https://github.com/aquasecurity/trivy/releases


📁 Schritt 2: Docker-Image herunterladen

docker pull nginx

📁 Schritt 3: Image mit Trivy scannen

trivy image nginx

Du bekommst eine Liste von gefundenen Schwachstellen mit Details zu Schweregrad, CVE-ID, Beschreibung.


📁 Schritt 4: Optionale Parameter

trivy image --severity HIGH,CRITICAL nginx
trivy image --format json nginx