Repository navigation
fix(security): bind repository scanners to exact PR head #799
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
Closed
Closed
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1a25b12
test(security): require literal PR-head scanner checkout
seonghobae 7d20fb7
ci(security): execute exact-head scanner contract
seonghobae e75172d
test(security): require literal-head SARIF attribution
seonghobae a7028f2
fix(security): scan and publish literal PR-head evidence
seonghobae 115b2fc
ci(security): verify exact-head checkout and SARIF contracts
seonghobae fc37844
docs(security): record literal-head scanner evidence
seonghobae 323c07b
docs: record exact-head security scanner repair
seonghobae 682088b
test(security): prove unavailable dependency review fails closed
seonghobae 2d1603f
test(security): execute dependency-review fail-closed contract
seonghobae 7c0b6f9
fix(security): fail closed on unavailable dependency review
seonghobae 3c1653a
docs(security): document fail-closed dependency review evidence
seonghobae 5996f89
docs(security): record dependency-review fail-closed gate
seonghobae dfa2878
test(security): accept explicit unavailable-status diagnostic
seonghobae a5f39a4
docs(security): surface exact-head scanner operator contract
seonghobae acc0da8
test: require bounded body-discarding dependency probe
seonghobae c395c0f
chore(security): stage bounded dependency-review probe
seonghobae 3ccb616
fix(security): bound dependency-review support probe
seonghobae e7690e3
chore(security): remove staged timeout patch artifact
seonghobae 4dfde68
chore(ci): stage bounded PR 799 repair
seonghobae 3a382eb
ci: bootstrap verified PR 799 repair
seonghobae 3ff61fd
fix(ci): reap fatal review process groups
github-actions[bot] e4b7f0c
chore(stack): isolate exact-head scanner repair on current main
seonghobae 667e9dd
chore(ci): restage bounded PR 799 repair
seonghobae 6732b24
ci: rerun verified PR 799 repair
seonghobae 9ad6b70
chore(ci): remove temporary PR 799 repair workflow
seonghobae a6cd746
chore(ci): remove encoded PR 799 repair payload
seonghobae 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 @@ | ||
| H4sICFVzdWoAA3ByNzk5LXJlcGFpci5wYXRjaAC1Wu1y20ay/S0+RS/trKiIAD8k68tXqZVt2WbFlrWWnP2RpMAhMCQR4SsYgBQ3u1X3Ie4T3ie5p2cGACmJ2ThVV1WiCGCmp6f7dPfpgYJwOiXHmYUFid7r9xdX7y4/fHrnxgFNNi5bYRLIezo8HvZPh4euK/ry0B8e0qDfPzo8bDmO82B+a39//6GMv/2NnMGwe0T7+DwmXN7IWCRF6NMPMldhmoTJjJZzmUsq5pJymaUqLNJ8RVk5iUI1l4oEbkdSKOm2qEXPnj2jt+G9DHCx79CtzOMwEYUMaCoKETlZni7CQOb0KZPJ6zSQJIpCxlkBQYr8NM4iWUjCMF8qRbM8LTNFYaIKKQJKp3QXRhFrlSbRSitVhLFMy4KWucgymXcxVy4kNoFBgVS+TAJsqZIIhad5GkPnQoRme2l+N43SJWVhxttJAlLQVC8i74VfOHNe2k8XMhczSZL1T3woPi2wD2OXRSiXFIky8WEsTAsLBXM49CotIS+Q2CxPWjl2qCqzLM2LLt3m4WLV1ave+GkufZFjrbn077AnRUWqF4hCLCUiWD2KIOLXUqqCtFprLtEy3l+8pIleVEt+IPjm4vPoLZVZlIqgFh6Lwp/zbse5nKoer9H7r6SMJzL/rseLjIl3XITF6qWWJ4IA/oStgRXcX9/eNJdy3Wq5nOWwOpBU282lN4/MIRYijMQkxD5XlMAXU1wDDlGqsFKZRIwF1lWLpgnQ1rNeiTORhwry4dEyTxS9v729pmG/36UgVLxrM7NMirxUDMSL6xEGqyxNlIStAmv+BKiBO3ORqAiAVXTYP+ji47BrbrK/tF5lLruU5piUFuztMrHqRxq3E0lwHRSTgC1MLABiKROaswNmkLwGjAkkkNXLKR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s8t6zAzzbxe4ODAV16U387AAjAGksb/Ads+MkvkJQAA |
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,73 @@ | ||
| name: Repair PR 799 exact-head evidence v2 | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - fix/security-scan-exact-head | ||
| paths: | ||
| - .github/repairs/pr799-repair-v2.patch.gz.b64 | ||
| - .github/workflows/repair-pr-799-evidence-v2.yml | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: repair-pr-799-exact-head-evidence-v2 | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| repair: | ||
| if: github.repository == 'ContextualWisdomLab/.github' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
| steps: | ||
| - name: Checkout repair head | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: fix/security-scan-exact-head | ||
| fetch-depth: 0 | ||
| persist-credentials: true | ||
|
|
||
| - name: Apply bounded repair and remove bootstrap files | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| base64 --decode .github/repairs/pr799-repair-v2.patch.gz.b64 | gzip --decompress > /tmp/pr799-repair.patch | ||
| git apply --check /tmp/pr799-repair.patch | ||
| git apply /tmp/pr799-repair.patch | ||
| rm -f .github/repairs/pr799-repair-v2.patch.gz.b64 | ||
| rm -f .github/workflows/repair-pr-799-evidence-v2.yml | ||
| rmdir .github/repairs 2>/dev/null || true | ||
| bash -n scripts/ci/run_opencode_review_model_pool.sh | ||
| git diff --check | ||
|
|
||
| - name: Install trusted test toolchain | ||
| run: python3 -m pip install --disable-pip-version-check --require-hashes -r requirements-opencode-review-ci-hashes.txt | ||
|
|
||
| - name: Verify focused regressions | ||
| env: | ||
| PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1" | ||
| run: | | ||
| python3 -m pytest -q \ | ||
| tests/test_required_workflow_queue_contract.py::test_security_scan_fails_closed_when_dependency_review_is_unavailable \ | ||
| tests/test_sandboxed_verify.py::test_main_reports_allowed_env_network_stderr_timeout_and_kept_sandbox \ | ||
| tests/test_opencode_model_pool_runner.py::test_fatal_provider_error_kills_hung_opencode_run_early | ||
|
|
||
| - name: Verify complete Python evidence | ||
| env: | ||
| PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1" | ||
| run: | | ||
| timeout --kill-after=30s 900 python3 -m coverage run -m pytest -q tests | ||
| python3 -m coverage report --show-missing --fail-under=100 | ||
| python3 -m interrogate scripts/ci --fail-under=100 | ||
|
|
||
| - name: Commit verified repair | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| git config user.name github-actions[bot] | ||
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
| git add --all | ||
| git diff --cached --check | ||
| git commit -m "fix(ci): reap fatal review process groups" | ||
| git push origin HEAD:fix/security-scan-exact-head | ||
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,44 @@ | ||
| name: Security Scan Exact-Head Quality CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - ".github/workflows/security-scan.yml" | ||
| - ".github/workflows/security-scan-exact-head-quality-ci.yml" | ||
| - "tests/test_security_scan_exact_head.py" | ||
| - "tests/test_security_scan_sarif_exact_head.py" | ||
|
|
||
| concurrency: | ||
| group: security-scan-exact-head-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| exact-head-contract: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout literal pull request head | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| persist-credentials: false | ||
| - name: Compile exact-head contracts | ||
| run: >- | ||
| python3 -m py_compile | ||
| tests/test_security_scan_exact_head.py | ||
| tests/test_security_scan_sarif_exact_head.py | ||
| - name: Execute dependency-free exact-head contracts | ||
| run: | | ||
| python3 - <<'PY' | ||
| from tests import test_security_scan_exact_head as checkout_contract | ||
| from tests import test_security_scan_sarif_exact_head as sarif_contract | ||
|
|
||
| checkout_contract.test_repository_scanners_checkout_the_literal_pull_request_head() | ||
| checkout_contract.test_dependency_review_checkout_is_bound_to_the_same_exact_head() | ||
| checkout_contract.test_dependency_review_support_probe_fails_closed_unless_api_returns_200() | ||
| sarif_contract.test_repository_scanner_sarif_is_attributed_to_the_literal_head() | ||
| print("security scan exact-head contracts passed") | ||
| PY |
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.