Repository navigation
ci: lock vsce/ovsx, least-privilege permissions, environment gates and SHA-pin enforcement (#9303) - #9527
Conversation
…ment gates (#9303) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
…orkflows (#9303) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 39 minutes. View limit details
Comment |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Keep main's receipt/digest/vsix-verify publish flow; re-apply job-level permissions, environment gates and step-scoped PATs on main's publish jobs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
|
Proof for head 79c0eb5 (after merging origin/main, which added the #9311 receipt/digest flow; its publish steps are kept and the hardening re-applied on main's publish jobs).
Admin prerequisite (prominent): the 🤖 Generated with Claude Code https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh Generated by Claude Code |
…9303) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
There was a problem hiding this comment.
Confirmed findings
- ripr and actionlint sensors both failed (exit 2 / exit 1) but no receipt is included; actionlint specifically targets the workflow files this PR modifies, so the absence of an actionlint receipt is a meaningful source-route gap.
- The scanner only recognizes
permissions:when it begins at column zero, so valid top-level YAML indentation can bypass the workflow-level write-permission rule. - .github/workflows/publish-extension.yml:363 — PR description claims publishers use
npx --no-install vsce\|ovsx; the jobs actually run the lockfile-installed binaries ($PWD/editors/vscode/node_modules/.bin/vsceand the.github/ovsxexact-pin). Update the description to match the actual commands so readers don't thinknpx --no-installis the contract. - Sibling path audit found no other crypto/compression/runtime helpers introduced or modified in this diff. tools/repo-policy/src/lib.rs and workflow_tests.rs are pure policy-lint additions. Publish workflow is YAML only. No new native/unsafe code paths to scan.
- is_full_commit_sha only checks
len()==40; a future bump to allow 64-char SHA-256 or 7-char short SHAs would silently change semantics with no test.
Verification questions
- Confirm actionlint and ripr sensors failed in this lane; zizmor missing. The two failed sensors flag workflow lint and Rust-dependency churn respectively. The PR is YAML+Rust with workflow + source changes, so failed
actionlint(exit 1) means the policy-of-record linter is not green for this diff at the time of review. This is a high-severity evidence gap:check-workflowsis the in-repo linter the PR itself adds logic to, but the standalone actionlint run is red. A human must runcargo xtask check-workflows(or the local actionlint) and post its output before merge to confirm the new pin/permission rules do not regress existing workflows outside the allowlist. - Confirm publish_jobs_run_locked_tools_without_the_registry_latest asserts job text contains
node_modules/.bin/ORnpx --no-installAND notnpx -y/npx @. The OR makes the check reach-only: a job withnpx --no-installand nonode_modules/.bin/passes, even though the PR claim is vsce runs from the lockfile-installed bin (editors/vscode/node_modules/.bin/vsce) and ovsx from .github/ovsx isolated install. Asserting the actual command per job would discriminate. - Confirm unpinned_allowlist_row_for_a_missing_workflow_is_rejected constructs the BTreeMap directly, bypassing parse_count_allowlist; missing-malformed row, max_count<=0, and pipe-in-path all go uncovered by this test. Tightening
is_full_commit_sha(e.g. 7-40 chars) is also untested. - Confirm repo_workflow(name) reads .github/workflows/ from disk; secret_and_write_token_workflows_have_no_unpinned_third_party_actions asserts each holds at least one third-party step. publish-extension.yml uses actions/checkout (first-party) only on publish jobs (no third-party), so the test would fail except the OR-clause
\|\| name == 'publish-extension.yml'quietly excuses it. That weakens the test - if a future refactor drops all third-party uses from coverage.yml/badge-endpoints.yml, the test still passes with empty third_party_action_refs. - Confirm the pin checker is lexical rather than schema-aware and only treats comment-prefixed uses lines as references.
Refuted
- The new policy code may retain a stale active-view length while scanning mutable inputs.; refuted because: The functions hold only path/reference/count metadata, iterate the complete current string on each call, and derive all counts from the current text; no slice view, byte length, allocation, resize, detachment, or transfer state is retained.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…ool oracle (#9303) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
|
Review of record, head 0f1b49b. Independent read-only reviews, no blocking findings:
Findings taken: dtolnay pin relabelled Proof: Merging this does not make the publish gate real: Steven still has to create and protect the Generated by Claude Code |
There was a problem hiding this comment.
Verification questions
- Confirm the third-party action pin scanner can miss YAML forms that are valid but not represented by its line-oriented uses: detection, such as quoted keys, explicit mapping keys, or other block-style forms.
- Confirm is_full_commit_sha only checks len==40 and hex; an extension to short-SHA or SHA-256 would silently change semantics, and the published comment in the PR already flagged this.
- Confirm the two named environment declarations provide no approval or branch restriction until repository administrators create and protect those environments.
- Add red/green coverage for the SHA oracle boundary so a future extension to short SHAs or SHA-256 is enforced by a test instead of becoming a silent behavior change. Negative cases: 7-hex ref (must be rejected today), 64-hex SHA-256 ref (must be rejected today, so a future
len()==64change is a behavior-changing PR); positive: 40-hex lower- and upper-case (current impl rejects upper, so pin to lower to match CI usage). (tools/repo-policy/src/lib.rs:781). - Confirm the SHA-pin and workflow-permission enforcement is implemented with negative controls, but its safety scope still relies on textual classification rather than parsed YAML/job-level secret analysis.
Refuted
- A changed path uses an active-view region or stale backing-store length snapshot.; refuted because: No buffer, typed-array, resize, detach, transfer, slice-view, or native unsafe implementation appears in the changed Rust code; the scanners operate on owned workflow text and do not expose mutable backing storage.
- The unsafe/native-risk flag implies a changed unsafe memory-management path in this PR.; refuted because: unsafe-review reports zero new gaps or worsened findings, and the seeded sibling-path audit found no new unsafe/native helper path; changed Rust implements text-based workflow policy checks.
- No changed route introduces JavaScript objects or values crossing a worker, async, GC, detach, or transfer boundary.
- The change requires review of JavaScript worker/async/GC handoff code.; refuted because: False premise: the patch contains no JavaScript runtime or worker implementation; its executable additions are YAML orchestration and pure Rust text-policy functions/tests.
Evidence gaps
- The environment declarations do not prove approval gates exist or restrict deployment branches; this remains an explicitly acknowledged administrative prerequisite.
- Model proof intent was rejected by deterministic validation.
- Actionlint failed on the workflow-heavy diff, so valid YAML and GitHub Actions schema validation remains unproven in this packet.
|
Generated by Claude Code |
|
Independent bounded owner handoff for #9529; existing #9527 writer and source candidate preserved. Refreshed this PR at 2026-10-22 10:47 UTC: head remains Composition finding for this candidate: #9572 added two third-party steps in
The original head's policy command passes. Git composition itself is clean (latest combined tree Zero-count control for #9529's final ratchet: appending Observed locally on the exact PR head with installed Rust 1.95.0, Linux x86_64:
All disposable edits were restored; submitted candidate untouched. No hosted CI, full ci-policy/precommit, environment protection, tag-resolution freshness, or final merge clearance is claimed. Initial setup-only failures (offline missing locked serde_json, then rustc absent from PATH for the first direct-binary probe) were corrected before the substantive observations above. #9529 remains open toward implementation after prerequisite disposition and coordinated GitHub access. |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
…ond rust-toolchain@stable Merged main added Swatinem/rust-cache@v2 and a second dtolnay/rust-toolchain@stable to first-run-install.yml. Pin rust-cache to the already-used v2.9.3 SHA; raise the toolchain allowlist row to the exact count of 2. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
|
Review of record update, head b5e5c6d. Delta over the previously reviewed head: merge of current main (0daf27f, no conflicts) plus b5e5c6d, which pins the new
Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Independent current-head inspection and continuation evidence; active source writer/integrator in 6339642809 retained. No competing source or #9529 pin writer, CI request, readiness toggle, merge, release, or settings action performed.
reviewed_head_sha: b5e5c6ddfaae4c67d213a0967ff72937e2ad0c68
integration_basis: refreshed main 52cfcabdd615a597edf7710a2a92de0282a8751f; observed GitHub merge subject 0f54863f2d62a19ae40ff421319cf13fe9ff5c51, ordered parents main + reviewed head, tree ced667a98835e741fb306aefacdba79b642d4b8a. Local merge-tree agrees. This is a remote-ref observation and local combined-tree policy proof, not verification of the running job's actual checkout.
claim_boundary: #9303 enforcement/publish hardening; #9529 burn-down remains separately owned.
Observed fresh local proof on this head, Rust 1.95.0, Linux x86_64, serialized --locked -p repo-policy -j 2:
cargo test --lib workflow: 32 passed / 57 filtered.--test future_clippy pinned_component_and_failure_evidence_are_wired: 1 passed / 5 filtered.--test hosted_cache_continuity: 7 passed.--test rust_only_routing rust_step_contract_refuses_missing_guards_and_misplaced_commands: 1 passed / 11 filtered.- Actual
repo-policy check-workflows: exit 0 on this head AND the complete observed GitHub merge subject above. These are 41 freshly executed focused tests, not the 41 carried from the earlier handoff; no full local ci-policy/precommit claim.
Composition: the earlier b2d7eda head combined with fetched main b8ad136 failed the actual policy command on both #9572 additions, reproducing 6338906848. The active writer's b5 update now pins the added cache and records both existing stable-toolchain steps, and the combined-tree policy command passes. The residual allowlist is now 38 occurrences; preserve the stable toolchain input semantics and the existing #9529 owner.
Nonblocking P2 oracle hardening: publish_job_violations in tools/repo-policy/src/workflow_tests.rs checks presence of the locked executable path, not the executed command. In a disposable b2d7eda review tree, keeping vsce="$PWD/editors/vscode/node_modules/.bin/vsce" while replacing both "$vsce" show and "$vsce" publish with bare vsce calls still lets publish_jobs_run_locked_tools_with_scoped_pat_and_gate pass (1/1, exit 0). The production workflow currently invokes the locked absolute executable correctly, so this is an oracle limitation, not an observed production defect. Add that retained-assignment/wrong-invocation control, or narrow the claim that the test enforces the exact command. The test helper and publish workflow are byte-identical b2d7eda..b5e5c6d, so this control is carried forward with its original subject explicitly retained.
Other actual b2d7eda controls, with policy source unchanged on b5: unpinned ordinary block step -> exit 1; equivalent flow-map/quoted-key steps -> exit 0; stale positive-count row -> exit 1; missing-workflow zero-count row -> exit 1; extant-workflow retired-ref zero-count row -> exit 0. Preserve the accepted nonblocking YAML-classifier/SHA-boundary follow-ups in #9529 comment 6337487371; the final empty-list ratchet must reject even a zero-count row. These controls do not constitute a new exception or a request to loosen policy.
Inspected surfaces: full claim diff, policy scanner and CLI consumer, per-job publish/PAT/permissions tests, immutable pin/tool inputs, receipt/digest/needs wiring, workflow triggers, current reviews, four resolved inline threads including the outdated one, and ordinary Conversation. Actual publish commands remain lockfile-installed, PATs are step-scoped, and marketplace publication remains explicit manual dispatch. Environment protection remains the acknowledged separate admin prerequisite; no settings acquisition attempted.
CI observed: old 39762011296 succeeded but its actual job inventory omits Schema producer sweep. It is not equivalent current-gate qualification. Current 39770937250, attempt 1 is in progress; Rust gates job 119798277176 explicitly includes Schema producer sweep, pending at inspection. No duplicate CI requested.
blocking_findings: no new blocking production defect established; current qualification remains unfinished.
proof_or_review_missing: terminal current-head required qualification, actual checkout identity and completed Schema producer sweep, then the current Conversation/threads/checks and final integration judgment.
affected_currentness_dimensions: #9572 composition and #9560 qualification path refreshed; unchanged policy/publish source and accepted follow-ups retained.
disposition: REVIEW_INCOMPLETE / WAITING_REQUIRED_CHECKS, not final merge clearance.
Next: the existing writer/integrator inspects complete current run results and actual checkout, dispositions the P2 oracle limit, refreshes final native gates, then performs the authorized expected-head protected squash and in-scope landing verification if qualified. A green older run, this review's completion, or the bounded worker return does not transfer or complete that integration responsibility.
|
Merged as c92a770 (squash, expected head b5e5c6d). Generated by Claude Code |
Governing issue or accepted claim: #9303 (T6 F-B/F-G from the #3807 trust audit)
Acceptance delta (one sentence): The extension publish path runs only lockfile-pinned vsce/ovsx under job-level permissions behind named environments with each PAT visible to its publish step only, the secret/write-token workflows use SHA-pinned third-party actions, and
check-workflowsnow fails unpinned third-partyuses:and workflow-level write permissions.Needs repository admin before the gate is real (not done here; no settings touched)
Create and protect two GitHub Environments:
vs-marketplace-publishandopen-vsx-publish(required reviewers, deployment branches limited to main; move or exposeVSCE_PAT/OVSX_PATthere). Until they exist GitHub auto-creates an unprotected environment on first run, soenvironment:gates nothing.Changes
publish-extension.yml(merged with main's Bind VS Code extension publish to the receipted candidate and server manifest #9311 receipt/digest flow, which is kept): workflow defaultcontents: read;contents: writeonly onattach-release-asset. Publish jobs declarepermissions: contents: read,persist-credentials: falseon checkout,npm ci --ignore-scripts, and invoke the lockfile-installed binaries directly (editors/vscode/node_modules/.bin/vsce,.github/ovsx/node_modules/.bin/ovsx; ovsx from the isolated exact-pin lock.github/ovsx, Add isolated locked ovsx install for the Open VSX publish job #9355). Nonpx -yremains.env:of the publish step only, so checkout, setup-node andnpm cido not see it. Thesecretscontext is unavailable inif:, so the missing-token check is inside the step. The tool code itself (from the lock) still runs in the PAT step; this narrows exposure, it does not make the tools untrusted-safe.environment:on the token-holding jobs:vs-marketplace-publish,open-vsx-publish.badge-endpoints.yml,coverage.yml,test-analytics.ymland the rust-cache step ofub-review.yml;badge-endpoints.ymlwrite scopes moved to job level. dtolnay/rust-toolchain (commit 683b588c, themasterhead, commented# master) and taiki-e/install-action pins carry explicitwith: toolchain:/tool:.check-workflows(tools/repo-policy): fails third-partyuses:not pinned to a 40-hex SHA (first-partyactions/*and local./exempt, matching existing tag policy); fails workflow-levelcontents: writeandwrite-allin block or flow style, with trailing comments, quotes and uniform document indentation handled. Remaining tag pins in secret-free read-only build jobs are a ratcheted allowlistpolicy/workflow_unpinned_action_allowlist.txt; stale/over-count rows and rows naming a missing workflow fail.contents: read, no PAT at job level, the exact locked tool command andpersist-credentials: false, with mutation negatives and the checked-in file as positive control.changelog.d/9303-publish-workflow-hardening.md.git ls-remoteagainst upstream (the GitHub MCP here cannot read third-party repos): create-pull-request v8.1.1 = 5f6978fa, codecov-action v6.0.2 = fb8b3582, rust-cache v2.9.3 = d1527c8f, install-action v2.87.30 = a4d3f3f7, rust-toolchain master = 683b588c.Residuals
cache: npmin the PAT jobs restores a cache that other dispatch refs can write; mitigated by npm lockfile integrity hashes.tools/repo-policy/src/ci_scratch/tests.rs), so the T6 residual is stale; no test added.coverage_diagnosticsreal-LLVM tests fail in this container (missing llvm tooling); environmental, touch nothing in this diff.Proof
Posted as a PR comment (check-workflows, negative experiment, precommit); head 0f1b49b:
cargo test -p repo-policy --lib workflow32 pass,cargo xtask check-workflowspass,check-changelog-fragmentspass. Full localprecommitwas an instrument timeout on a shared cargo lock (not a source failure).🤖 Generated with Claude Code
https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh