Skip to content

Instantly share code, notes, and snippets.

@alexolinux
Created April 19, 2024 12:08
Show Gist options
  • Select an option

  • Save alexolinux/46112e0932269c17f1e1adb3e2aa74ab to your computer and use it in GitHub Desktop.

Select an option

Save alexolinux/46112e0932269c17f1e1adb3e2aa74ab to your computer and use it in GitHub Desktop.
Installing Trivy using YUM Package Manager
#!/bin/bash
# https://aquasecurity.github.io/trivy/v0.50/getting-started/installation/#rhelcentos-official
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=1
enabled=1
gpgkey=https://aquasecurity.github.io/trivy-repo/rpm/public.key
EOF
# If ok, update yum repo and install trivy:
sudo yum -y update
sudo yum -y install trivy
# Finally, show the trivy version
trivy --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment