Repository navigation
Fix dynamic secret selection false positives in strict linting - #80581
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. The No-op messageLean already. Ship.
|
|
✅ Test Quality Sentinel completed test quality analysis.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. The No-op messagePR #80581 advanced from reviewed head 45f22a6 to e6d6da4 before publication; discarded pending specification updates and did not publish a stale review.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Reviewed the changed lines. I found no actionable correctness, performance, or maintainability issues blocking this change. The dynamic selector behavior is covered by the added Actions and AW cases, while nested whole-context references remain rejected.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review to run again
Comment MemoryPeek at saved memory (review-history)History |
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd. The fix is correct and the core logic holds: dynamic single-secret selection is no longer flagged, while whole-context use (toJSON(secrets), wildcard projections, and whole-context inside a selector) stays blocked. Focused tests pass (go test ./pkg/workflow/lint/ -run OverprovisionedSecrets).
📋 Key Themes & Highlights
Key Themes
- Coverage gap: the removed
sandbox.agent.env.PICKexpectation leaves thesandbox.agent.envwalker without a blocking case (see inline comment). - Behavior change: dynamic
secrets[...]selectors are no longer reported here. The taint layer still tracks them into sinks, so disclosure checks are unchanged.
Positive Highlights
- ✅ Regression tests cover both sides of the distinction, including nested selectors.
- ✅ The
walkOverprovisionedSecretsEnvextraction is behavior-preserving. - ✅ The docs row accurately describes the new policy.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 7.1K
Comment /matt to run again
| "jobs.remote.secrets": Error, | ||
| "jobs.local.secrets": Warning, | ||
| "steps[0].env.ALL": Error, | ||
| "engine.env.ALL": Error, |
There was a problem hiding this comment.
[/tdd] This removes the only assertion covering whole-context exposure under sandbox.agent.env. The input still uses PICK as a dynamic index, which is now correctly allowed, so nothing exercises the sandbox branch of walkOverprovisionedSecretsEnv. Dropping that branch would still pass CI.
💡 Suggested test
Add a whole-context entry such as ALL: '${{ toJSON(secrets) }}' under sandbox.agent.env in the input, and expect sandbox.agent.env.ALL to be Error in the map. Keep PICK as the dynamic-index case that should pass.
@copilot please address this.
There was a problem hiding this comment.
Added the sandbox whole-context regression assertion in 3c4e3c96.
🧪 Test Quality Sentinel Report✅ Test Quality Score: 90/100 — Excellent
📊 Metrics (9 tests)
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 90/100. 0% implementation tests (threshold: 30%). No guideline violations. Non-blocking: see flagged coverage gap in the comment above.
🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 7.4K
Comment /review to run again
There was a problem hiding this comment.
🟡 Changes recommended
Critical secret-handling gaps allow computed references to bypass placement checks and redaction, while the threat-ID remapping can suppress previously reported strict-workflow errors.
3 open issues
What changed in this PR
This PR refines gh-aw’s secret-exposure linting so dynamic single-secret lookups are not mistaken for whole-context exposure. It retains checks for whole-context use nested inside selectors.
Changes:
- Accepts dynamic secret indexes and adds Actions/AW regression coverage.
- Extracts AW environment traversal into a helper.
- Maps
overprovisioned-secretsto CTR-017 and updates the specification and reference docs.
| File | Description |
|---|---|
specs/compiler-threat-detection-spec.md |
Defines the selection boundary in version 1.0.110 and adds the threat mapping. |
specs/compiler-threat-detection-changelog.md |
Records the policy clarification and regression evidence. |
pkg/workflow/lint/rule_contract_test.go |
Adds the CTR-017 mapping to the rule contract. |
pkg/workflow/lint/overprovisioned_secrets.go |
Accepts dynamic indexes and extracts environment traversal. |
pkg/workflow/lint/overprovisioned_secrets_test.go |
Covers accepted selectors and blocked nested exposure. |
docs/src/content/docs/reference/workflow-linters.md |
Documents the rule’s selection boundary and severity policy. |
Review effort: Max (adaptive)
| Targets: ActionsAST | AWAST, | ||
| Check: checkOverprovisionedSecrets, | ||
| ID: "overprovisioned-secrets", | ||
| ThreatRuleID: "CTR-017", |
There was a problem hiding this comment.
CTR-017 suppressions no longer suppress overprovisioned-secrets; added strict-mode regression coverage in 3c4e3c96.
| } | ||
| case *actionlint.IndexAccessNode: | ||
| if _, literal := parent.Index.(*actionlint.StringNode); literal && parent.Operand == child { | ||
| if parent.Operand == child { |
There was a problem hiding this comment.
Computed selectors are now fingerprinted for safe-update checks, redacted, and bounded by explicit workflow_call secret names. Added generated-workflow regression coverage in db5c641e.
| } | ||
| case *actionlint.IndexAccessNode: | ||
| if _, literal := parent.Index.(*actionlint.StringNode); literal && parent.Operand == child { | ||
| if parent.Operand == child { |
There was a problem hiding this comment.
Computed secret references are now included in step secret classification, so env bindings are rejected when the step writes to GITHUB_ENV; added a regression in db5c641e.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "e6d6da4035b31896f3907acf82330dc3f38cc07b",
"kind": "requested",
"schema_version": "1",
"state": "314633a37b767081a40d7aac0df568f73e0113c285b4a1754a5c1416e75a316f",
"work": [
"1cac9374b23e91c6955ec8e4640539b427aed92d430e517e469a3fa0c715aed0",
"8a7ab16d206078f4134482787035be96d5dfa43853c0ec6bff14f9f22a6e26ce",
"b1395227911e8585fc5940fee2929b8f5cca78da5c4d4e41d5ac2941029c8eff",
"ea087b1859de2bceb9aa0eab75e9c1e0de2411651472bea03484b917c9371973"
],
"workflow": "pr-sous-chef"
}
|
…low-compilation Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
| // buildSafeUpdateError creates a clear, structured error message that names the | ||
| // offending secrets, actions, and redirects and tells the user how to remediate. | ||
| func buildSafeUpdateError(secretViolations, addedActions, removedActions []string, addedRedirect, removedRedirect string, hasPullRequestTargetEscalation bool, memoryValidationScriptChanges []string) error { | ||
| func buildSafeUpdateError(secretViolations, addedActions, removedActions []string, addedRedirect, removedRedirect string, hasPullRequestTargetEscalation bool, memoryValidationScriptChanges []string, dynamicSecretViolations ...[]string) error { |

Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
e6d6da4035b31896f3907acf82330dc3f38cc07b↑ Threat-mapping contract tests and full repository validation pass; all 371 workflows compile successfully.
↑ Regression tests fail before the fix and pass afterward.
↓ Full gh-cao workflow compilation was not rerun.
Strict linting incorrectly reported dynamically indexed secret lookups as exposing the entire
secretscontext. A repository-to-secret-name mapping selects one value, rather than serializing all secrets.Allow indexed single-secret selection while continuing to inspect selector expressions for whole-context use.
toJSON(secrets), wildcard projections, and whole-context exposure nested inside selectors remain blocked. Selector trust and independent secret-disclosure checks are unchanged.Adds regression coverage for both Actions and AW inputs, documents the distinction, and extracts environment traversal into a helper to satisfy the function-length limit without changing behavior. Compiler threat specification 1.0.110 records the boundary, maps the rule to CTR-017, and keeps registry metadata and its contract tests synchronized.
Validation: workflow lint suite, focused regression and threat-mapping tests, and
make agent-report-progresspass. All 371 repository workflows compile successfully; existing warnings remain. No workflows were executed.