Created
April 19, 2024 12:08
-
-
Save alexolinux/46112e0932269c17f1e1adb3e2aa74ab to your computer and use it in GitHub Desktop.
Installing Trivy using YUM Package Manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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