Skip to content

Commit 08a7fbe

Browse files
flyersworderclaude
andcommitted
security: harden CI with locked installs, vuln scanning, and minimal permissions
- Add permissions: {} at workflow level; each job opts in to contents: read only - Use --frozen flag on uv sync to fail fast on stale lockfile - Add security job using uvx uv-secure to scan uv.lock on every push/PR - Gate publish on security job passing - Add SECURITY.md with private disclosure path via GitHub Security Advisories Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d2fe718 commit 08a7fbe

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,28 @@ on:
2323
required: false
2424
default: 'false'
2525

26+
permissions: {}
27+
2628
jobs:
2729
lint:
2830
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
2933
steps:
3034
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3135
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3236
with:
3337
enable-cache: true
3438
cache-dependency-glob: "pyproject.toml"
3539
- run: uv python install 3.13
36-
- run: uv sync --all-extras --dev
40+
- run: uv sync --all-extras --dev --frozen
3741
- run: uv run ruff check src/ tests/
3842
- run: uv run ruff format --check src/ tests/
3943

4044
test:
4145
runs-on: ubuntu-latest
46+
permissions:
47+
contents: read
4248
strategy:
4349
matrix:
4450
python-version: ["3.12", "3.13"]
@@ -49,11 +55,20 @@ jobs:
4955
enable-cache: true
5056
cache-dependency-glob: "pyproject.toml"
5157
- run: uv python install ${{ matrix.python-version }}
52-
- run: uv sync --all-extras --dev
58+
- run: uv sync --all-extras --dev --frozen
5359
- run: uv run pytest --cov=agentic_data_contracts --cov-report=term-missing
5460

61+
security:
62+
runs-on: ubuntu-latest
63+
permissions:
64+
contents: read
65+
steps:
66+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
67+
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
68+
- run: uvx uv-secure uv.lock
69+
5570
publish:
56-
needs: [lint, test]
71+
needs: [lint, test, security]
5772
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_publish == 'true')
5873
runs-on: ubuntu-latest
5974
permissions:

SECURITY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Only the latest release receives security fixes.
6+
7+
## Reporting a Vulnerability
8+
9+
Please **do not** open a public GitHub issue for security vulnerabilities.
10+
11+
Report them privately via [GitHub Security Advisories](https://github.com/flyersworder/agentic-data-contracts/security/advisories/new). Include a description of the issue, steps to reproduce, and the potential impact.
12+
13+
You can expect an acknowledgement within 48 hours and a patch or mitigation plan within 14 days for confirmed issues.

0 commit comments

Comments
 (0)