trivy-scan: optional skip-dirs input for vendored toolchains (#4)
For directories whose bundled dependencies cannot be upgraded in place — first user: the Android SDK cmdline-tools jars (old protobuf/guava et al. inside sdkmanager) in the gitea-runner-android image. Callers must leave a comment in the workflow explaining each exclusion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P5NjXQ3jmyVjimHQxnyKhg Reviewed-on: #4 Co-authored-by: peet <peet@noctrl.eu>
This commit was merged in pull request #4.
This commit is contained in:
1 parent
88b8716ce7
commit
e501ab145f
1 file changed
+15
@@ -17,6 +17,14 @@ inputs:
|
|||||||
description: Comma-separated Trivy severities that fail the scan.
|
description: Comma-separated Trivy severities that fail the scan.
|
||||||
required: false
|
required: false
|
||||||
default: HIGH,CRITICAL
|
default: HIGH,CRITICAL
|
||||||
|
skip-dirs:
|
||||||
|
description: >
|
||||||
|
Comma-separated directories inside the image to exclude from the scan.
|
||||||
|
For vendored third-party toolchains whose bundled dependencies cannot
|
||||||
|
be upgraded in place (e.g. the Android SDK's cmdline-tools jars) —
|
||||||
|
always leave a comment in the workflow explaining why.
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
registry-username:
|
registry-username:
|
||||||
description: Registry username for pulling the image.
|
description: Registry username for pulling the image.
|
||||||
required: true
|
required: true
|
||||||
@@ -42,6 +50,12 @@ runs:
|
|||||||
|
|
||||||
image_ref="registry.noctrl.eu/${{ inputs.image-name }}:${{ inputs.tag }}"
|
image_ref="registry.noctrl.eu/${{ inputs.image-name }}:${{ inputs.tag }}"
|
||||||
|
|
||||||
|
extra_args=()
|
||||||
|
if [[ -n "${{ inputs.skip-dirs }}" ]]; then
|
||||||
|
extra_args+=(--skip-dirs "${{ inputs.skip-dirs }}")
|
||||||
|
echo "Excluding from scan: ${{ inputs.skip-dirs }}"
|
||||||
|
fi
|
||||||
|
|
||||||
# --ignore-unfixed: unfixed base-image CVEs are unactionable and would
|
# --ignore-unfixed: unfixed base-image CVEs are unactionable and would
|
||||||
# perma-block builds; the gate is on vulnerabilities with a fix.
|
# perma-block builds; the gate is on vulnerabilities with a fix.
|
||||||
echo "Scanning ${image_ref} (fail on: ${{ inputs.severity }}, fixed only)"
|
echo "Scanning ${image_ref} (fail on: ${{ inputs.severity }}, fixed only)"
|
||||||
@@ -51,4 +65,5 @@ runs:
|
|||||||
--ignore-unfixed \
|
--ignore-unfixed \
|
||||||
--exit-code 1 \
|
--exit-code 1 \
|
||||||
--no-progress \
|
--no-progress \
|
||||||
|
"${extra_args[@]}" \
|
||||||
"${image_ref}"
|
"${image_ref}"
|
||||||
Reference in new issue
Block a user