-
Notifications
You must be signed in to change notification settings - Fork 15
feat(ci): supply-chain & security hardening (#443, #689, #690, #691, #692, #468, #552) #718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3acbdc1
feat(ci): supply-chain & security hardening (#443, #689, #690, #691, …
claude e613276
fix(ci): address PR review — pin release actions to SHAs, correct Cod…
claude f36619a
fix(ci): exclude numpy stubs from the mypy type gate
claude 779d7f7
test(review): cover check_readme_version --print-version release-gate…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| version: 2 | ||
|
|
||
| # Automated dependency updates (issue #443). | ||
| # | ||
| # * pip — keep the declared Python dependency floors and dev toolchain | ||
| # current. Minor/patch bumps are grouped into a single weekly PR to limit | ||
| # noise; majors open individually so breaking changes get their own review. | ||
| # * github-actions — keep workflow action references current. This is also | ||
| # how action versions stay fresh now that the workflows pin to tags rather | ||
| # than commit SHAs (see docs/security_tooling.md and issue #468). | ||
|
|
||
| updates: | ||
| - package-ecosystem: pip | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly | ||
| day: monday | ||
| time: "06:00" | ||
| timezone: Etc/UTC | ||
| open-pull-requests-limit: 5 | ||
| groups: | ||
| python-minor-patch: | ||
| update-types: | ||
| - minor | ||
| - patch | ||
| labels: | ||
| - dependencies | ||
| commit-message: | ||
| prefix: "chore(deps)" | ||
|
|
||
| - package-ecosystem: github-actions | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly | ||
| day: monday | ||
| time: "06:00" | ||
| timezone: Etc/UTC | ||
| open-pull-requests-limit: 5 | ||
| groups: | ||
| actions-all: | ||
| update-types: | ||
| - minor | ||
| - patch | ||
| labels: | ||
| - dependencies | ||
| commit-message: | ||
| prefix: "chore(ci)" |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: CodeQL | ||
|
|
||
| # Static security analysis for the Python sources (issue #689, umbrella #443). | ||
| # Runs the default + security-extended query packs on every PR, on pushes to | ||
| # main, and on a weekly schedule so newly published queries surface findings | ||
| # even when the code is quiet. Findings land in the repository Security tab | ||
| # (code scanning). False positives are handled via the documented exception | ||
| # process in docs/security_tooling.md (issue #692). | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| # Monday 07:00 UTC. Off-hours, just after the weekly scorecard/benchmark | ||
| # crons, low contention with the gating CI job. | ||
| - cron: "0 7 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: codeql-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (python) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| permissions: | ||
| # Required for CodeQL to upload results to the code-scanning dashboard. | ||
| security-events: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: python | ||
| # ``security-extended`` adds the broader security query suite on top | ||
| # of the default pack; pure-Python project, so no build step. | ||
| queries: security-extended | ||
|
|
||
| - name: Perform CodeQL analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
| with: | ||
| category: "/language:python" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: OpenSSF Scorecard | ||
|
|
||
| # OpenSSF Scorecard supply-chain health analysis (issue #552, umbrella #443). | ||
| # | ||
| # Distinct from the *benchmark* scorecard regenerated by | ||
| # scorecard-weekly.yml — that one measures routing recall / token savings. | ||
| # This workflow runs the OpenSSF Scorecard checks (branch protection, token | ||
| # permissions, pinned dependencies, dangerous workflows, maintained, etc.), | ||
| # uploads the SARIF to the code-scanning dashboard, and publishes results so | ||
| # the README badge resolves. | ||
| # | ||
| # Applying for the OpenSSF Best Practices badge is a tracked manual step — see | ||
| # docs/security_tooling.md. | ||
|
|
||
| on: | ||
| branch_protection_rule: | ||
| push: | ||
| branches: [main] | ||
| schedule: | ||
| # Monday 08:00 UTC. | ||
| - cron: "0 8 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| analysis: | ||
| name: Scorecard analysis | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| permissions: | ||
| # Upload the results to the code-scanning dashboard. | ||
| security-events: write | ||
| # Publish results to the OpenSSF REST API so the README badge resolves. | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Run analysis | ||
| uses: ossf/scorecard-action@v2 | ||
| with: | ||
| results_file: results.sarif | ||
| results_format: sarif | ||
| # publish_results enables the public badge endpoint at | ||
| # api.securityscorecards.dev (see the README badge). | ||
| publish_results: true | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: scorecard-results | ||
| path: results.sarif | ||
| retention-days: 5 | ||
|
|
||
| - name: Upload to code-scanning | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: pip-audit | ||
|
|
||
| # Dependency vulnerability scan (issue #689, umbrella #443). | ||
| # | ||
| # Policy (documented in docs/security_tooling.md, issue #692): | ||
| # * The CORE runtime dependency set is GATING — a known-vulnerable advisory | ||
| # against a core dependency fails the job, because adopters put | ||
| # contextweaver in the data path between agents and tools. | ||
| # * The DEV/test extra is report-only (continue-on-error): it pulls a large | ||
| # transitive tree (crewai, mem0ai, fastmcp, langgraph, langchain-core) that | ||
| # would otherwise make the gate noisy and flaky. Findings are still printed | ||
| # for triage and recorded in the job summary. | ||
| # | ||
| # Runs on PRs that touch dependency metadata, on pushes to main, and weekly so | ||
| # newly published advisories surface against an otherwise-quiet tree. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "pyproject.toml" | ||
| - ".github/workflows/pip-audit.yml" | ||
| pull_request: | ||
| paths: | ||
| - "pyproject.toml" | ||
| - ".github/workflows/pip-audit.yml" | ||
| schedule: | ||
| # Monday 07:30 UTC, after CodeQL. | ||
| - cron: "30 7 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: pip-audit-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| audit-core: | ||
| name: Audit core dependencies (gating) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install core package and pip-audit | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e . | ||
| pip install pip-audit | ||
|
|
||
| - name: Audit installed environment (gating) | ||
| # No --ignore-vuln entries today. Document any future exception here | ||
| # with the advisory id and a link to its tracking issue, per the | ||
| # exception process in docs/security_tooling.md. | ||
| run: pip-audit --progress-spinner off | ||
|
|
||
| audit-dev: | ||
| name: Audit dev extra (report-only) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| continue-on-error: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install dev extra and pip-audit | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[dev]" | ||
| pip install pip-audit | ||
|
|
||
| - name: Audit installed environment (report-only) | ||
| run: pip-audit --progress-spinner off |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.