Skip to content

Commit

Permalink
feat: scanning the entire repository
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuelaepure10 committed May 28, 2024
1 parent 39a97bc commit a8c969b
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
actions: write # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -34,19 +35,19 @@ jobs:
# run: |
# docker build -t docker.io/my-organization/my-app:${{ github.sha }} .

- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@master
with:
#- name: Run Trivy vulnerability scanner in fs mode
# uses: aquasecurity/trivy-action@master
# with:
# image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}'
scan-type: 'fs'
scan-ref: '.'
#scan-type: 'fs'
#scan-ref: '.'
#exit-code: '0'
#ignore-unfixed: true
format: 'sarif'
#format: 'sarif'
#vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM'
#severity: 'CRITICAL,HIGH,MEDIUM'
#template: '/sarif.tpl'
output: 'trivy-results.sarif'
#output: 'trivy-results.sarif'
#skip-dirs: "ignored-dir"
#trivy-config: trivy.yaml

Expand All @@ -56,10 +57,10 @@ jobs:
# name: trivy-results
# path: trivy-results.sarif

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
#- name: Upload Trivy scan results to GitHub Security tab
# uses: github/codeql-action/upload-sarif@v2
# with:
# sarif_file: 'trivy-results.sarif'


#- name: Create Pull Request
Expand All @@ -69,4 +70,17 @@ jobs:
# title: 'ci: Update vulnerability list'
# body: Update the vulnerability list
# branch: update-vulnerabilities
# base: master
# base: master


- name: Install Trivy
run: |
sudo apt-get update
sudo apt-get install wget -y
wget https://github.com/aquasecurity/trivy/releases/download/v0.34.0/trivy_0.34.0_Linux-64bit.deb
sudo dpkg -i trivy_0.34.0_Linux-64bit.deb
- name: Scan the entire repository
run: |
echo "Scanning the entire repository..."
trivy fs .

0 comments on commit a8c969b

Please sign in to comment.