diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml new file mode 100644 index 000000000..a7e214811 --- /dev/null +++ b/.github/workflows/trivy.yml @@ -0,0 +1,25 @@ +name: Trivy + +on: + schedule: + # Schedule execution daily at 7:23 am (UTC). + - cron: "23 07 * * *" + +jobs: + trivy-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Scan vulnerabilities with Trivy + uses: aquasecurity/trivy-action@0.29.0 + with: + scan-type: 'repo' + scanners: 'vuln' + ignore-unfixed: true + format: 'sarif' + output: 'trivy-results.sarif' + severity: 'CRITICAL,HIGH,MEDIUM,LOW' + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: 'trivy-results.sarif' diff --git a/README.md b/README.md index 527205e9f..f111fd54b 100644 --- a/README.md +++ b/README.md @@ -280,3 +280,12 @@ and push the tag to remote repository ```sh git push origin AKR-ga-1234 ``` + +## Security + +### Vulnerabilities + +Vulnerabilities in dependencies used by the applications are scanned daily with [Trivy](https://trivy.dev/latest/ecosystem/cicd/#trivy-action-official). +The scan is performed only against the default branch of the repository. + +Results of the scan are uploaded to the GitHub Security tab and are found under the section [Code scanning](https://github.com/Opetushallitus/kieli-ja-kaantajatutkinnot/security/code-scanning). The results are only available to GitHub users belonging to the Opetushallitus organization.