Repository navigation
ci: add OSV-Scanner, license compliance, and semantic PR title guards #437
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: License & Dependency Compliance | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| license-check: | ||
| name: License Compliance Audit | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install dependencies + pip-licenses | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e . | ||
| pip install pip-licenses | ||
|
|
||
| - name: Verify Allowed Open-Source Licenses | ||
| run: | | ||
| pip-licenses --allow-only="MIT License;Apache Software License;Apache 2.0;BSD License;BSD-2-Clause;BSD-3-Clause;ISC License (ISCL);Python Software Foundation License;The Unlicense (Unlicense);CC0 1.0 Universal (CC0 1.0) Public Domain Dedication;Mozilla Public License 2.0 (MPL 2.0)" --format=markdown | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||
| name: Supply Chain Security (OSV-Scanner) | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [main] | ||||||
| pull_request: | ||||||
| branches: [main] | ||||||
| schedule: | ||||||
| - cron: '0 3 * * 1' # Weekly on Monday at 03:00 UTC | ||||||
| workflow_dispatch: | ||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
||||||
| jobs: | ||||||
| osv-scan: | ||||||
| name: OSV-Scanner | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Harden Runner | ||||||
| uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0 | ||||||
| with: | ||||||
| egress-policy: audit | ||||||
|
|
||||||
| - name: Checkout | ||||||
| uses: actions/checkout@v4 | ||||||
| with: | ||||||
| persist-credentials: false | ||||||
|
|
||||||
| - name: Run OSV-Scanner | ||||||
| uses: google/osv-scanner-action/osv-scanner-action@v1.9.2 | ||||||
|
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): OSV scanner action reference looks incorrect and may not resolve to the intended action. GitHub Actions should be referenced as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3rd party Github Actions should be pinned - high severity
Suggested change
Reply |
||||||
| with: | ||||||
| scan-args: |- | ||||||
| --lockfile=pyproject.toml | ||||||
| --recursive | ||||||
| . | ||||||
|
Comment on lines
+33
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Wrong osv lockfile The OSV workflow passes "--lockfile=pyproject.toml", but this repo does not contain a resolved lockfile and pyproject.toml mostly declares unpinned dependencies, so the scan may be ineffective (no concrete versions) or fail depending on OSV-Scanner’s supported lockfile formats. Agent Prompt
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||
| name: Semantic PR Linter | ||||||
|
|
||||||
| on: | ||||||
| pull_request_target: | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Non-security semantic pr workflow The new Semantic PR Linter workflow enforces Conventional Commit title formatting, which is not a cybersecurity-focused capability. This violates the requirement that Agent-Alpha changes stay scoped to cybersecurity-related functionality. Agent Prompt
|
||||||
| types: | ||||||
| - opened | ||||||
| - edited | ||||||
| - synchronize | ||||||
| - reopened | ||||||
|
|
||||||
| permissions: | ||||||
| pull-requests: read | ||||||
| statuses: write | ||||||
|
|
||||||
| jobs: | ||||||
| validate-pr-title: | ||||||
| name: Validate PR Title | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Validate PR Title Format | ||||||
| uses: amannn/action-semantic-pull-request@v5 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3rd party Github Actions should be pinned - high severity
Suggested change
Reply |
||||||
| env: | ||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
Comment on lines
+20
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4. Unpinned third-party actions The new workflows reference third-party GitHub Actions via mutable tags (e.g., amannn/action-semantic-pull-request@v5, google/osv-scanner-action@v1.9.2), which can change without review and increases CI supply-chain risk. Agent Prompt
|
||||||
| with: | ||||||
| types: | | ||||||
| feat | ||||||
| fix | ||||||
| docs | ||||||
| style | ||||||
| refactor | ||||||
| perf | ||||||
| test | ||||||
| build | ||||||
| ci | ||||||
| chore | ||||||
| revert | ||||||
| requireScope: false | ||||||
| validateSingleCommit: false | ||||||
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.
3. License audit will drift
🐞 Bug☼ ReliabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools