2021-04-05 20:00:29 -04:00
|
|
|
# Disabling trivy scans while they get troubleshooting for failures
|
2021-04-17 17:50:23 -04:00
|
|
|
---
|
2022-02-21 10:17:34 -05:00
|
|
|
name: Trivy Container Scan
|
2021-04-17 17:50:23 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-10-01 15:57:26 -04:00
|
|
|
- main
|
2021-04-17 17:50:23 -04:00
|
|
|
pull_request:
|
2022-04-11 15:52:49 -04:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-04-17 17:50:23 -04:00
|
|
|
jobs:
|
|
|
|
scan-container:
|
2022-04-11 15:52:49 -04:00
|
|
|
permissions:
|
|
|
|
contents: read # for actions/checkout to fetch code
|
|
|
|
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
2021-04-17 17:50:23 -04:00
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-18.04
|
2021-11-15 11:25:36 -05:00
|
|
|
timeout-minutes: 60
|
2021-04-17 17:50:23 -04:00
|
|
|
steps:
|
|
|
|
######################
|
|
|
|
# Checkout code base #
|
|
|
|
######################
|
|
|
|
- name: Checkout code
|
2022-03-07 10:34:26 -05:00
|
|
|
uses: actions/checkout@v3
|
2021-02-17 17:03:30 -05:00
|
|
|
|
2021-04-17 17:50:23 -04:00
|
|
|
# ##########################
|
|
|
|
# # Build the docker image #
|
|
|
|
# ##########################
|
|
|
|
- name: Build an image from Dockerfile
|
|
|
|
run: |
|
2021-07-19 10:28:49 -04:00
|
|
|
docker build -t "docker.io/github/super-linter:${{ github.sha }}" .
|
2021-02-17 17:03:30 -05:00
|
|
|
|
2021-04-17 17:50:23 -04:00
|
|
|
#################################
|
|
|
|
# Run Trivy Scan of source code #
|
|
|
|
#################################
|
|
|
|
- name: Trivy Scan
|
|
|
|
uses: aquasecurity/trivy-action@master
|
|
|
|
with:
|
|
|
|
scan-type: 'fs'
|
|
|
|
format: 'template'
|
|
|
|
template: '@/contrib/sarif.tpl'
|
|
|
|
output: 'report.sarif'
|
|
|
|
severity: 'HIGH,CRITICAL'
|
2021-02-17 17:03:30 -05:00
|
|
|
|
2021-04-17 17:50:23 -04:00
|
|
|
#################################
|
|
|
|
# Upload report to security tab #
|
|
|
|
#################################
|
|
|
|
- name: Upload Trivy scan results to GitHub Security tab
|
|
|
|
uses: github/codeql-action/upload-sarif@v1
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
sarif_file: 'report.sarif'
|