Skip to content

fix(ci): add Bandit SAST and detect-secrets as CodeQL replacement - #2488

Merged
dieterolson merged 1 commit into
mainfrom
fix/issue-2473-sast-replacement
May 4, 2026
Merged

dieterolson merged 1 commit into
mainfrom
fix/issue-2473-sast-replacement

Conversation

@dieterolson

Copy link
Copy Markdown
Collaborator

Closes #2473

Summary

  • Adds .github/workflows/security.yml with two blocking SAST jobs that serve as the no-cost CodeQL replacement
  • bandit-sast: runs bandit -r src/ -ll -ii (medium+ severity and confidence) as a full-repo blocking gate; excludes the same legacy directories already suppressed in ci-standard.yml
  • detect-secrets-baseline: verifies .secrets.baseline has not drifted on every PR and push to main, blocking on any newly introduced secrets
  • Adds bandit>=1.7.7 and detect-secrets>=1.5.0 to [project.optional-dependencies.dev] so contributors can install both tools locally with pip install -e ".[dev]"

CodeQL remains disabled per maintainer direction (codeql-analysis.yml.disabled is unchanged).

Note: ci-standard.yml already runs a delta Bandit scan on changed files; this PR adds the complementary full-repo blocking scan that was missing.

Test plan

  • Confirm Security SAST / bandit-sast job passes on this PR
  • Confirm Security SAST / detect-secrets-baseline job passes on this PR
  • Verify codeql-analysis.yml.disabled is still present and unchanged
  • Introduce a test secret on a draft branch and confirm detect-secrets-baseline blocks it

🤖 Generated with Claude Code

@github-actions github-actions Bot added ci/cd config documentation Improvements or additions to documentation size/XL labels May 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1c3763ecc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .gitignore Outdated
*.docx

# PSA reference directory — contains overlong paths that break Windows checkout (Issue #2475)
src/shared/python/upstream_drift_tools/process_calculators/psa_package/References/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict ignore rule to specific overlong path(s)

The new .gitignore entry suppresses the entire psa_package/References/ tree, and this commit removes all tracked files under it (including non-overlong .md/.ipynb reference artifacts). That is broader than the stated Windows path-length fix and causes avoidable data loss while also preventing future versioning of legitimate reference material in that directory.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/security.yml Outdated
python-version: "3.12"

- name: Install detect-secrets
run: python -m pip install detect-secrets

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pin detect-secrets version in the security workflow

Installing detect-secrets without a version pin makes this required check non-deterministic: a new upstream release can change baseline output semantics and fail PRs even when repository code is unchanged. Since this job enforces a baseline diff and is intended to be blocking, it should use a pinned version (as done for Bandit) to keep CI behavior stable.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ SPEC.md Update Required

Source files were modified in this PR but SPEC.md was not updated.

Per the Specification-Driven Development Policy:

  • Any PR that adds, removes, or changes functionality must update SPEC.md
  • Update the relevant sections (features, architecture, tests, dependencies, etc.)
  • Bump the Spec Version if making substantive changes

To resolve:

  1. Update SPEC.md to reflect your changes, OR
  2. Add the spec-exempt label if this PR genuinely doesn't affect the spec (e.g., pure refactor with no behavior change)

This check is enforced by the spec-check CI workflow.

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

SLA Status

Note: Full SLA validation available in .benchmarks/PERFORMANCE_SLA.md

  • Rotation Converter: Target < 50ms per conversion
  • Pressure Drop: Target < 100ms per calculation
  • Data Processor: Target < 500ms for 10K-row filtering

Diagnostics

@dieterolson dieterolson added the spec-exempt Exempt from SPEC.md freshness check label May 4, 2026
@github-actions github-actions Bot added the tests label May 4, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dieterolson
dieterolson force-pushed the fix/issue-2473-sast-replacement branch from 6631459 to c4b92b3 Compare May 4, 2026 05:51
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

SLA Status

Note: Full SLA validation available in .benchmarks/PERFORMANCE_SLA.md

  • Rotation Converter: Target < 50ms per conversion
  • Pressure Drop: Target < 100ms per calculation
  • Data Processor: Target < 500ms for 10K-row filtering

Diagnostics

@github-actions github-actions Bot added the size/S label May 4, 2026
@dieterolson
dieterolson merged commit 02eb06d into main May 4, 2026
11 checks passed
@dieterolson
dieterolson deleted the fix/issue-2473-sast-replacement branch May 4, 2026 05:55
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

SLA Status

Note: Full SLA validation available in .benchmarks/PERFORMANCE_SLA.md

  • Rotation Converter: Target < 50ms per conversion
  • Pressure Drop: Target < 100ms per calculation
  • Data Processor: Target < 500ms for 10K-row filtering

Diagnostics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd config documentation Improvements or additions to documentation size/S size/XL spec-exempt Exempt from SPEC.md freshness check tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Production readiness: disabled CodeQL has no active no-cost SAST replacement

1 participant