Skip to content

ci: add blocking bandit gate (P-20)#45

Merged
pcalnon merged 1 commit intomainfrom
fix/p20-bandit-blocking-gate
May 4, 2026
Merged

ci: add blocking bandit gate (P-20)#45
pcalnon merged 1 commit intomainfrom
fix/p20-bandit-blocking-gate

Conversation

@pcalnon
Copy link
Copy Markdown
Owner

@pcalnon pcalnon commented May 4, 2026

Cross-repo CI audit P-20: data-client's bandit was || true with no blocking follow-up — any finding silently tolerated. Mirror cascor/data's two-step pattern: SARIF with --exit-zero (for upload), then blocking gate at medium severity. Verified locally: 0 medium/high findings on current main.

Refs cross-repo CI audit P-20.

Cross-repo CI audit found juniper-data-client's bandit step was a
single ``bandit … || true`` with no follow-up blocking invocation, so
any genuine finding was silently tolerated. Mirror the canonical
two-step pattern used in cascor / data (and now extended in
juniper-data PR #67):

1. **SARIF generation** — ``bandit … -f sarif -o ... --exit-zero``.
   Always succeeds so the GitHub Security upload has a file regardless
   of findings.
2. **Blocking gate** — ``bandit … --confidence-level medium
   --severity-level medium``. Fails the job on medium-or-higher
   findings.

Also harden the SARIF upload with
``hashFiles('reports/security/bandit.sarif') != ''`` to keep the
upload step green if a future security-tools regression prevents
bandit from emitting the file.

Verified locally — current ``juniper_data_client`` has 0 medium /
high findings, so the new gate is non-blocking on this commit. Any
future medium-or-higher finding will now fail CI.

Refs cross-repo CI audit P-20.
@pcalnon pcalnon force-pushed the fix/p20-bandit-blocking-gate branch from 4119249 to d8fc259 Compare May 4, 2026 00:32
@pcalnon pcalnon self-assigned this May 4, 2026
Copy link
Copy Markdown
Owner Author

@pcalnon pcalnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@pcalnon pcalnon merged commit e874ae6 into main May 4, 2026
39 checks passed
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.

1 participant