test vulnscan action
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paolo Asperti 2023-10-30 12:00:11 +01:00
parent 8473b553f8
commit 4c0d5f6ef9
Signed by: paspo
GPG Key ID: 06D46905D19D5182
2 changed files with 12 additions and 5 deletions

View File

@ -2,7 +2,7 @@ name: Vulnerability Scan
on: on:
schedule: schedule:
- cron: '0 14 * * *' - cron: "0 14 * * *"
jobs: jobs:
scan: scan:
@ -16,9 +16,10 @@ jobs:
id: scan id: scan
uses: aquasecurity/trivy-action@master uses: aquasecurity/trivy-action@master
with: with:
image-ref: 'docker.asperti.com/paspo/glpi:latest' image-ref: "docker.asperti.com/paspo/glpi:latest"
format: 'json' format: "json"
output: 'trivy-results.json' output: "trivy-results.json"
# if some vulnerability is found, we fail
- name: check output - name: check output
run: if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi run: if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi

View File

@ -18,5 +18,11 @@ see [docker-compose.yaml](docker-compose.yaml)
## test drone config ## test drone config
```sh ```sh
drone starlark --format --stdout drone starlark --format --stdout
```
## run vulnscan locally
```bash
act -W .gitea/workflows/vulnscan.yaml -j scan
``` ```