Skip to content

Commit

Permalink
Merge pull request #82 from paullockaby/add-trivy
Browse files Browse the repository at this point in the history
feat: enable trivy scanning in pipelines
  • Loading branch information
plockaby authored Dec 8, 2024
2 parents eb9c03d + 7b537bc commit 6761241
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:

jobs:
pre-commit:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest

permissions:
Expand All @@ -24,11 +25,31 @@ jobs:
env:
SKIP: no-commit-to-branch

test:
security:
runs-on: ubuntu-latest

needs:
- pre-commit
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Setup trivy
uses: aquasecurity/[email protected]
with:
cache: true
version: latest

- name: Run trivy configuration checks
run: |
trivy config . --config=.trivy.yaml --ignorefile=.trivyignore
- name: Run trivy filesystem checks
run: |
trivy filesystem . --config=.trivy.yaml --ignorefile=.trivyignore --no-progress
test:
runs-on: ubuntu-latest

permissions:
contents: read
Expand Down
8 changes: 8 additions & 0 deletions .trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
exit-code: 1

severity:
- HIGH
- CRITICAL

scan:
skip-dirs: []
Empty file added .trivyignore
Empty file.

0 comments on commit 6761241

Please sign in to comment.