Skip to content

Accept vulnerabilities and too-new packages when a failed job is re-run - #10

Merged
olljanat-ai merged 1 commit into
mainfrom
claude/tender-meitner-ajhg0z
Nov 12, 2026
Merged

olljanat-ai merged 1 commit into
mainfrom
claude/tender-meitner-ajhg0z

Conversation

@olljanat-ai

Copy link
Copy Markdown
Member

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:

  • Trivy: vulnerabilities are reported as warnings and the image is pushed.
  • Aikido Safe Chain: package installs in the Dockerfile run through a variant of the shims that passes --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.
  • Known malware is still blocked. A re-run is one click, often done after any failure, and it must not let a confirmed-malicious package through.
  • The job log (warning) and the summary state that the checks were relaxed for this attempt.

Re-runs are detected from GITHUB_RUN_ATTEMPT (GitHub) and System.JobAttempt (Azure DevOps) being greater than 1. Set bypass-on-rerun: false (bypassOnRerun: false on 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

  • 88 unit tests:
    • attempt mapping on both platforms
    • shim rewriting, rejecting shims in an unknown format
    • the instrumented Dockerfile mounting the relaxed shims on re-runs
    • vulnerabilities accepted and pushed on a re-run, and still failing with bypassOnRerun: false
  • Real runs of the bundled action with Docker and safe-chain 1.5.29:
    • npm 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").
    • An image with 2 HIGH vulnerabilities on attempt 2: Trivy reports them, they're accepted with a warning, and the image is pushed.
  • New CI step: the Azure task with SYSTEM_JOBATTEMPT=2 pushes the vulnerable fixture.

Generated by Claude Code

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
@olljanat-ai
olljanat-ai merged commit 3ca4142 into main Nov 12, 2026
7 checks passed
@olljanat-ai olljanat-ai mentioned this pull request Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants