Compare commits
1 Commits
1.0.1
...
0946c898b6
| Author | SHA1 | Date | |
|---|---|---|---|
|
0946c898b6
|
+22
-1
@@ -10,6 +10,10 @@ inputs:
|
|||||||
description: "Path to the Trivy cache directory (default: ${{runner.temp}}/trivy)"
|
description: "Path to the Trivy cache directory (default: ${{runner.temp}}/trivy)"
|
||||||
required: false
|
required: false
|
||||||
default: "${{ runner.temp }}/trivy"
|
default: "${{ runner.temp }}/trivy"
|
||||||
|
trivy-version:
|
||||||
|
description: "Trivy docker image version to use (full image reference including digest is recommended)"
|
||||||
|
required: false
|
||||||
|
default: "ghcr.io/aquasecurity/trivy:0.69.3@sha256:bcc376de8d77cfe086a917230e818dc9f8528e3c852f7b1aff648949b6258d1c"
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
cache-dir:
|
cache-dir:
|
||||||
@@ -32,4 +36,21 @@ runs:
|
|||||||
trivy-db-${{ steps.current-date.outputs.current-date }}
|
trivy-db-${{ steps.current-date.outputs.current-date }}
|
||||||
- if: steps.restore-db.outputs.cache-hit != 'true'
|
- if: steps.restore-db.outputs.cache-hit != 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: trivy fs --download-db-only --cache-dir "${{ inputs.cache-dir }}"
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
--name trivy-db-download \
|
||||||
|
--user "$(id -u):$(id -g)" \
|
||||||
|
--read-only \
|
||||||
|
--env-file /dev/null \
|
||||||
|
--cap-drop ALL \
|
||||||
|
--pids-limit 64 \
|
||||||
|
--memory=512m \
|
||||||
|
--memory-swap=512m \
|
||||||
|
--cpus=1 \
|
||||||
|
--ipc private \
|
||||||
|
--cgroupns private \
|
||||||
|
--security-opt no-new-privileges \
|
||||||
|
--security-opt apparmor=docker-default \
|
||||||
|
--tmpfs /tmp:rw,noexec,nosuid,nodev,size=1g \
|
||||||
|
--mount type=bind,src=${{ inputs.cache-dir }},dst=/cache \
|
||||||
|
${{ inputs.trivy-version }} fs --download-db-only --cache-dir /cache
|
||||||
|
|||||||
Reference in New Issue
Block a user