Scanning Vulnerability Docker Image with Trivy

Memindai Celah Kerantanan Docker Image dengan Trivy

  • Install Trivy pada Linux RHEL/CentOS/Alma/Rocky
  • Tambahkan repository trivy
RELEASE_VERSION=$(grep -Po '(?<=VERSION_ID=")[0-9]' /etc/os-release)
cat << EOF | sudo tee -a /etc/yum.repos.d/trivy.repo
[trivy]
name=Trivy repository
baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/$RELEASE_VERSION/\$basearch/
gpgcheck=0
enabled=1
EOF
  • Install Trivy
yum -y install trivy

  • Install Trivy pada Linux Debian/Ubuntu
  • Tambahkan repository trivy
apt install 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
  • Install Trivy
apt update && apt install trivy -y

  • Scan vulnerability dengan Trivy
trivy image nama_image

contoh:
trivy image sysopsid/ubuntu-desktop:latest
  • Hasil scanning

herdiana3389

A system administrator with skills in system administration, virtualization, linux, windows, networking, cloud computing, container, etc.