Skip to content

Commit

Permalink
[Tool] Trivy Pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: AndyZiYe <[email protected]>
  • Loading branch information
andyziye committed May 21, 2024
1 parent 95b551d commit 64c2d99
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/.trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Same as '--severity'
# Default is all severities
severity:
- HIGH
- CRITICAL

scan:
# Same as '--security-checks'
# Default depends on subcommand
security-checks:
- vuln

vulnerability:
# Same as '--vuln-type'
# Default is 'os,library'
type:
- library

# Same as '--format'
format: sarif

# Same as '--output'
# Used to upload sarif to GitHub Security tab
output: trivy-results.sarif

# Same as '--ignore-unfixed'
ignore-unfixed: false

# Same as '--list-all-pkgs'
list-all-pkgs: false

# Same as '--exit-code'
# Zero as we are only reporting for now, not enforcing
exit-code: 0
29 changes: 29 additions & 0 deletions .github/workflows/trivy-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: TRIVY PIPELINE

on:
pull_request:
types:
- opened
- synchronize

branches:
- trivy-test
- main

concurrency:
group: ${{ github.event.number }}
cancel-in-progress: true

jobs:
trivy-checker:
runs-on: [self-hosted, normal]
name: RUN
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@d710430a6722f083d3b36b8339ff66b32f22ee55 #0.19.0
env:
TMPDIR: ${{ github.workspace }}/trivy_temp # Required to prevent Trivy running out of space
with:
image-ref: "registry.cn-zhangjiakou.aliyuncs.com/starrocks/dev-env-centos7:3.1-latest"
scan-type: "image"
trivy-config: ".trivy.yaml"

0 comments on commit 64c2d99

Please sign in to comment.