Skip to content

Instantly share code, notes, and snippets.

@PouyaEsmaeili
Last active June 4, 2024 10:56
Show Gist options
  • Save PouyaEsmaeili/9eb24e0ce9588f4738b11c55b8b15138 to your computer and use it in GitHub Desktop.
Save PouyaEsmaeili/9eb24e0ce9588f4738b11c55b8b15138 to your computer and use it in GitHub Desktop.
Vulnerability Scanning in Gitlab CI
stages:
- vulnerability-scanning
osv-scanner:
stage: vulnerability-scanning
image: golang
before_script:
- go install github.com/google/osv-scanner/cmd/osv-scanner@v1
script:
- osv-scanner -v
- osv-scanner --lockfile=requirements.txt
grype-scanner:
stage: vulnerability-scanning
before_script:
- curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin
script:
- grype version
- grype <image> --scope all-layers --only-notfixed -v
yelp-scanner:
stage: vulnerability-scanning
image: python
before_script:
- pip install detect-secrets
script:
- detect-secrets --version
- detect-secrets scan
bandit-scanner:
stage: vulnerability-scanning
image: python
before_script:
- pip install bandit
script:
- bandit -r .
gitleaks-scanner:
stage: vulnerability-scanning
image: ubuntu
before_script:
- git clone https://github.com/gitleaks/gitleaks.git
- cd gitleaks
- make build
- cd ..
script:
- gitleaks detect -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment