Repository navigation
Accept vulnerabilities and too-new packages when a failed job is re-run - #10
Merged
Merged
Conversation
A re-run of a failed job (GITHUB_RUN_ATTEMPT / System.JobAttempt > 1) usually has a good reason, so on re-runs: - vulnerabilities found by Trivy are reported as warnings and the image is pushed - Dockerfile package installs run through shims that pass --safe-chain-skip-minimum-package-age - known malware is still blocked The log and summary say that the checks were relaxed. Opt out with bypass-on-rerun / bypassOnRerun: false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpAsQazVvi679PqLz7o1C1
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a user re-runs a failed job (Re-run failed jobs on GitHub, Rerun failed jobs on Azure DevOps), there's usually a good reason, so the security gates are relaxed automatically for that attempt:
--safe-chain-skip-minimum-package-age. safe-chain has no environment variable or exclusion pattern that skips the age check for all packages, and it strips its own flags before calling the real package manager.Re-runs are detected from
GITHUB_RUN_ATTEMPT(GitHub) andSystem.JobAttempt(Azure DevOps) being greater than 1. Setbypass-on-rerun: false(bypassOnRerun: falseon Azure DevOps) to enforce the checks on every attempt. This repo's own e2e step that expects the vulnerable image to be blocked sets that, so re-running CI stays meaningful.Testing
bypassOnRerun: falsenpm install brace-expansion@1.1.22(published about 18 hours earlier): attempt 1 is blocked by the minimum package age; attempt 2 installs it.npm install safe-chain-test(Aikido's malware test package) on attempt 2 is still blocked ("Malicious changes detected").SYSTEM_JOBATTEMPT=2pushes the vulnerable fixture.Generated by Claude Code