Repository navigation
feat: redact runner environment variables by organization setting - #3846
Conversation
PR validation — ✅ 3 passing
AI Session Checks — 🟡 82% · ✅ 0 failing
|
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-a6ea45 |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-a6ea45 |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-a6ea45 |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-a6ea45 |
- |
Powered by Chainloop and Chainloop Trace
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/specs/issue-3841-runner-env-var-redaction.md">
<violation number="1" location="docs/specs/issue-3841-runner-env-var-redaction.md:61">
P2: The proposed CAS flow can upload a clear-value bundle after its pre-CAS check becomes stale. If the organization setting changes before `SaveAttestation`, the save rejects after upload, leaving the rejected attestation in CAS. Carry an organization-setting revision or snapshot through both checks, or delete the CAS blob on a mismatch.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Org-level setting that replaces identity runner environment variable values with [REDACTED] in new attestations, enforced at push. Refs #3841 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: a6ea453b-a3ca-450f-aba0-241be6b95a2b
Refs #3841 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: a6ea453b-a3ca-450f-aba0-241be6b95a2b
Make the check-before-storage ordering explicit in R-003, document the cross-runner effect of the known identity union in D-001, and align the plan with the implementation. Refs #3841 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: a6ea453b-a3ca-450f-aba0-241be6b95a2b
Add an organization setting that replaces the values of runner environment variables with [REDACTED]. Modes are none, known-identity (the identity variables that each runner integration marks) and custom. The control plane sends the resolved names at attestation init, the CLI applies them, and the control plane rejects a push that does not obey the setting. Refs #3841 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: a6ea453b-a3ca-450f-aba0-241be6b95a2b
Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: a6ea453b-a3ca-450f-aba0-241be6b95a2b
48b43a7 to
c19c23e
Compare
There was a problem hiding this comment.
All reported issues were addressed across 30 reviewed files. 45 files intentionally excluded from review.
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Re-trigger cubic
Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: a6ea453b-a3ca-450f-aba0-241be6b95a2b
On a pull_request CI run, GITHUB_BASE_REF, GITHUB_HEAD_REF and the event vars leak into the redaction cases of TestResolveEnvVars. Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: a6ea453b-a3ca-450f-aba0-241be6b95a2b
A custom name with leading or trailing whitespace never matches a variable, so its value stayed clear. An unknown EnvVarRedaction type became none and cleared the stored setting. Both now fail validation. Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: a6ea453b-a3ca-450f-aba0-241be6b95a2b
Adds an organization setting that redacts runner environment variables in new attestations, with its design spec and implementation plan.
Summary
Each attestation stores the environment variables that the CLI finds in the CI runner. Some of these variables identify a person, for example the user who started the pipeline. The new setting replaces the values of those variables with
[REDACTED]and keeps the names. It has three modes:none(default): no redaction.known-identity: the variables that each runner integration marks as identity:BUILD_REQUESTEDFOR,BUILD_REQUESTEDFOREMAIL,GITHUB_ACTOR,GITLAB_USER_EMAIL,GITLAB_USER_LOGIN,HOME,USER.custom: an explicit list of variable names.Changes
Optionalflag. The known identity list is the union of these marks (R-004, D-001).chainloop org update --env-var-redaction none|known-identity|customand the repeatable--redacted-env-var NAMEset the mode (R-001). The help text lists the known identity variables, andorg describeshows the setting.attestation initresponse (D-003). The CLI redacts the runner variables and the env allow list of the contract before it writes the attestation state. Thus a contract cannot show a redacted value (R-002, R-005, R-006).Spec:
docs/specs/issue-3841-runner-env-var-redaction.md. Plan:docs/plans/issue-3841-runner-env-var-redaction.md.The commit author and the pull request logins are out of scope and tracked in #3842.
We would like two reviewers to approve this spec before it merges.
AI assistance: Claude Code helped write the spec, the plan and the implementation.
Closes #3841
🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri