-
Notifications
You must be signed in to change notification settings - Fork 0
chore: security CI + lint/pre-commit config + NEXT_STEPS roadmap (+ exit-127 fix) #2
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 all commits
Commits
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,78 @@ | ||
| # Argus security CI — shift-left gates for a tool that ships offensive capability. | ||
| # Hardening per OpenSSF post-tj-actions guidance: every action pinned to a full | ||
| # commit SHA (never a mutable tag), least-privilege GITHUB_TOKEN, no secrets. | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: aegis | ||
|
|
||
| jobs: | ||
| test: | ||
| name: tests (pytest) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | ||
| with: | ||
| python-version: "3.12" | ||
| cache: pip | ||
| cache-dependency-path: aegis/requirements.txt | ||
| - name: Install deps | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
| - name: Run test suite | ||
| run: python -m pytest -q | ||
|
|
||
| sast: | ||
| name: SAST (Bandit) — blocking | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install Bandit | ||
| run: pip install "bandit[toml]==1.8.6" | ||
| # Blocks the build on medium+ severity / medium+ confidence findings. | ||
| - name: Run Bandit (medium+) | ||
| run: bandit -c pyproject.toml -r aegis --severity-level medium --confidence-level medium | ||
|
|
||
| deps: | ||
| name: Dependency audit (pip-audit) — informational | ||
| runs-on: ubuntu-latest | ||
| # Informational until requirements are hash-pinned + triaged (see NEXT_STEPS.md | ||
| # P0.3). Flip to blocking once the dependency tree is locked. | ||
| continue-on-error: true | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install pip-audit | ||
| run: pip install pip-audit==2.10.0 | ||
| - name: Audit dependencies | ||
| run: pip-audit -r requirements.txt --desc | ||
|
|
||
| secrets: | ||
| name: Secret scan (detect-secrets) — informational | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install detect-secrets | ||
| run: pip install detect-secrets==1.5.0 | ||
| - name: Scan working tree for secrets | ||
| run: detect-secrets scan aegis targets | ||
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,27 @@ | ||
| # Shift-left mirror of the CI gates (.github/workflows/ci.yml). Run locally with: | ||
| # pip install pre-commit && pre-commit install | ||
| # CI remains the authoritative gate (pre-commit can be skipped with --no-verify). | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-merge-conflict | ||
| - id: detect-private-key | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.8.4 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix] | ||
| files: ^aegis/ | ||
|
|
||
| - repo: https://github.com/PyCQA/bandit | ||
| rev: 1.8.6 | ||
| hooks: | ||
| - id: bandit | ||
| args: ["-c", "aegis/pyproject.toml", "--severity-level", "medium", | ||
| "--confidence-level", "medium"] | ||
| files: ^aegis/aegis/ |
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 suggestion (security): The paths passed to
detect-secretsdepend on the workflow-level working directory and may not cover the whole repo as intended.With
defaults.run.working-directoryset toaegis,detect-secrets scan aegis targetsactually scansaegis/aegisandaegis/targetsfrom the repo root, and skips top-level paths like.githubor any non-aegisdirectories. If you want full-repo coverage, consider removing the workflow-levelworking-directoryfor this job or adjusting the command to scan from the repo root (e.g.,detect-secrets scan . ..or explicitly listing root-level directories).