diff --git a/.github/.trivyConf.yaml b/.github/.trivyConf.yaml new file mode 100644 index 0000000..1cbef61 --- /dev/null +++ b/.github/.trivyConf.yaml @@ -0,0 +1,4 @@ +exit-code: 1 +severity: + - HIGH + - CRITICAL \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..35c9d4c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/trivy-scan.yaml b/.github/workflows/trivy-scan.yaml new file mode 100644 index 0000000..27a7d84 --- /dev/null +++ b/.github/workflows/trivy-scan.yaml @@ -0,0 +1,33 @@ +name: trivy code scan +on: + push: + branches: + - master + pull_request: +permissions: + contents: read + +jobs: + trivy_scan: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + name: trivy scan + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run Trivy vulnerability scanner in fs mode + uses: aquasecurity/trivy-action@master + with: + scan-type: 'fs' + scan-ref: '.' + format: 'sarif' + output: 'trivy-results.sarif' + trivy-config: ./github/.trivyConf.yaml + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'trivy-results.sarif' \ No newline at end of file