feat: cast audit, upgrade, org audit, and baseline profiles#10
Merged
Conversation
Add governance features that move CAST from template generator to governance toolkit: - cast audit: check repo pipeline compliance against CAST baseline (secrets, SAST, SCA, container, quality, SARIF, gate, pinning, permissions, Scorecard, branch protection) - cast upgrade: detect drift between current workflow and latest CAST template, show unified diff - cast org audit: audit multiple repos at once with score table - cast init --profile: baseline profiles (opensource, enterprise, strict, ai-generated-code) - cast profiles: list available profiles Security fix: - Pin trivy-action from @master to @0.29.0 in all templates Positioning: - README: document CAST + OpenSSF Scorecard relationship - Philosophy: 'Scorecard tells you what is wrong. CAST helps you install and enforce the fix across CI/CD.'
- Remove unused typing.Optional from audit.py - Remove unused dataclasses.field from profiles.py - Remove unused pathlib.Path from test files - Fix f-strings with no placeholders in main.py (use plain strings)
aquasecurity/trivy-action git tags use a 'v' prefix (v0.29.0), but @0.29.0 (without the prefix) does not resolve as a valid GitHub Actions version reference.
v0.29.0 references aquasecurity/setup-trivy@v0.2.2 which does not exist on the registry. v0.36.0 is the latest stable release.
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
This PR implements the key governance features recommended in the cast-cli strategic review, moving CAST from a template generator to a serious governance toolkit.
What's new
cast audit— Pipeline compliance checkerChecks the current repo against the CAST baseline:
Output:
13 checks covering: secrets, SAST, SCA, container, quality, SARIF, gate, action pinning, permissions, Scorecard, and branch protection.
cast upgrade— Drift detectionDetects when a workflow has diverged from the latest CAST baseline:
cast org audit— Organization-level governanceAudit multiple repos at once:
Output table: repo name | CAST installed | security gate | score
cast init --profile— Baseline profilesFour pre-configured profiles:
opensourceenterprisestrictai-generated-codecast profiles— List available profilesSecurity fix
trivy-action@master→@0.29.0in all 3 GitHub Actions templates (supply-chain security)Positioning
"OpenSSF Scorecard tells you what is wrong. CAST helps you install and enforce the fix across CI/CD."
Files changed
src/cast_cli/audit.py— new: audit engine with 13 compliance checkssrc/cast_cli/upgrade.py— new: drift detection via unified diffsrc/cast_cli/profiles.py— new: 4 baseline profilessrc/cast_cli/main.py— add audit, upgrade, org, profiles commands + --profile flagsrc/cast_cli/templates/{python,go,nodejs}/devsecops.yml— pin trivy-action.github/workflows/devsecops.yml— regenerate with pinned trivy-actiontests/test_audit.py— 42 new teststests/test_upgrade.py— 9 new testsREADME.md— document all new commands + Scorecard philosophyTests: 143 total (up from 65), all passing.