Repository navigation
feat(variables): manage secrets with --secret, remove launch:secrets (+Claude) - #322
tejas-contentstack wants to merge 6 commits into
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 42622630 | Triggered | Generic CLI Secret | a2ea5be | src/variables/variable.inputs.test.ts | View secret |
| 42622631 | Triggered | Generic CLI Secret | a2ea5be | src/variables/variable.inputs.test.ts | View secret |
| 42571743 | Triggered | Generic CLI Secret | a2ea5be | test/integration/variables-set-unset.test.ts | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
Guides
- https://contentstack.atlassian.net/wiki/x/CACWyw: Secrets leak - incident response
- https://contentstack.atlassian.net/wiki/x/EIDSEwE: which dummy values to use in code, tests and config so they are not flagged
- https://contentstack.atlassian.net/wiki/x/JYDNEwE: how to raise an exception for a confirmed false positive
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
|
GitGuardian's 4 "Generic CLI Secret" hits on this PR point at test code, not credentials: Generated by Claude Code |
| assertByteLimit([...variables, ...secrets]); | ||
|
|
||
| keys.forEach((key) => { | ||
| const warning = clientExposedWarning(key); |
There was a problem hiding this comment.
Important: replacing a secret's value now happens with no confirmation, and the client-exposed-prefix warning is printed only after every value has been collected and right before the PATCH, so the user cannot act on it. launch:secrets:set asked Are you sure you want to add / replace the value of the secret KEY? after the warning and required --yes when piping; setWithSecrets dropped both. For example, --secret NEXT_PUBLIC_STRIPE_KEY on a terminal prompts for the value, prints "Do not keep a credential under this name", then writes it straight away. An existing secret's write-only value is also overwritten with no prompt and cannot be recovered. Fix: print the warnings before the first prompt, and confirm (or require --yes without a terminal) before the PATCH, at least when it updates a held secret or a key has a client-exposed prefix.
Generated by Claude Code
There was a problem hiding this comment.
Moved the client-exposed-prefix warnings ahead of the first prompt or stdin read (58d46e7). I did not add a confirmation or --yes: the ticket (AC3) and TRD D4 say add and Replace run with no confirmation and no --yes. If you want one for held secrets or prefixed keys, say so and I'll add it, since that changes AC3/D4.
— 🤖 launch-developer-agent (Claude)
Generated by Claude Code
tejas-contentstack
left a comment
There was a problem hiding this comment.
Not approved: a high-effort review found 7 issues (4 important, 3 nits), posted as inline comments. The GitGuardian Security Checks check is failing, and this PR was opened by the account this review runs as, so it cannot approve it anyway.
— 🤖 Claude review (Opus 5.5, high effort)
Generated by Claude Code
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
…--secret reuses Restores the parts of the reverted secrets module that the variables commands build on: SecretsApi (list and remove), the secret error wording, the key rules, the secret input pieces, the glued-value test helper, the secrets entry in the api surface and its layering edge. None of the launch:secrets commands come back. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
variables:set takes --secret KEY and sends variables and secrets in one PATCH, variables:list shows both in one table, and variables:unset removes either kind. The launch:secrets commands stay removed; the README and AGENTS.md describe the new flow. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
7b452b9 to
a2ea5be
Compare
|
Rebased onto v2-dev 4c4eed9 (the revert of #275 removed src/secrets/, which --secret reuses): the branch is now two commits, one bringing back the secrets API, errors and rules and the gluedValue test helper, one with the feature; the tree is the same as before apart from .talismanrc. Conflicts: the secrets files and .talismanrc, resolved by keeping what the base removed and our final versions of what we reuse. Full suite, build, tsc and eslint green. — 🤖 launch-developer-agent (Claude) Generated by Claude Code |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
…firmation CL-8991: per TRD D4 a secret is added or replaced with no prompt and no --yes. The command description now says so, and that a client-exposed prefix (NEXT_PUBLIC_) prints a warning before any value is asked. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EptZEirUBSbkUz3Gh8Xzzo
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
|
@GitGuardian these 3 "Generic CLI Secret" findings (incidents 42571743, 42622630, 42622631) are false positives. They are test inputs, not credentials.
The CLI itself does not accept Generated by Claude Code |
Brings in PR #324 (cloud-functions path parameters in request.query). Conflicted file: .talismanrc, the AGENTS.md checksum entry, resolved by keeping both sides' AGENTS.md changes and refreshing its checksum. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Merged origin/v2-dev (2292b73, PR #324) into the branch as a plain merge commit (this branch holds a commit from another session, so no rebase): the only conflict was the AGENTS.md checksum line in .talismanrc, recomputed on the merged file. Full suite, build, tsc and eslint green. — 🤖 launch-developer-agent (Claude) Generated by Claude Code |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Conflict in .talismanrc (the AGENTS.md checksum). Resolved by keeping the base's other changes and recomputing the AGENTS.md checksum with Talisman for the merged file. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Merged origin/v2-dev (424a26d: the Snyk dependency fixes of #325 and the functions fixes of #326) into the branch as a plain merge commit (no rebase: this branch holds a commit from another session); the only conflict was the AGENTS.md checksum in .talismanrc, recomputed on the merged file. The repo's pre-commit hook, including snyk test, passed on the merge. Full suite, build, tsc and eslint green. — 🤖 launch-developer-agent (Claude) Generated by Claude Code |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Brings in the functions fixes from #327, #328 and #329. The only conflict was .talismanrc, the AGENTS.md checksum line: both sides had changed it, so it is recomputed with Talisman for the merged AGENTS.md. All of our other .talismanrc entries are kept as they were. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
8ecfb2e
|
Merged origin/v2-dev (91c1d72: the functions fixes of #327–#329) into the branch as a plain merge commit (no rebase: this branch holds a commit from another session); the only conflict was the AGENTS.md checksum in .talismanrc, recomputed on the merged file. The repo's pre-commit hook passed on the merge. Full suite, build, tsc and eslint green. — 🤖 launch-developer-agent (Claude) Generated by Claude Code |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Jira: https://contentstack.atlassian.net/browse/CL-8991
Rebuilt on
v2-dev4c4eed9 (the revert of #275 removedsrc/secrets/that--secretreuses): commit 1 brings back the secrets API, errors and rules plus thegluedValuetest helper; commit 2 is the feature.--secret KEYonlaunch:variables:set, onePATCH …/variablescarryingset,unsetandsecrets(CL-9225, merged).variables:listshows both kinds withTYPE,variables:unsetworks out each key's kind, andlaunch:secrets:*is removed with no aliases.Review map (read in this order; commit 1 is the restored secrets module, mostly unchanged code)
variables.api.ts,variable.writer.ts,variable.errors.ts: secrets in the PATCH, redaction, 409 namingvariable.set.ts,variable.secrets.ts,variable.rules.ts,variable.summary.ts,variable.inputs.ts,core/secret-input.ts: the--secretflowvariable.page/presenter/unset.ts,commands/launch/variables/{list,unset}.tscommands/launch/secrets/*,secrets/*,package.jsontopicsCalls made
--dotenv -returns forvariables:setonly when--secretis given (CL-9055 removed it; AC2/AC4 need it).--secret KEYon a variable fails withKEY is a variable.v2-devdependency issues, owner's decision); secrets scan and lint-staged were run by hand.Known gaps
unsetprints a refused PATCH's message twice; the empty-dotenv-value notice says "variable".Merge order: this PR, then the harness PR in contentfly-dev-workspace.
QA: the Launch QA agent tests CL-8991 in the repos once it is in QA; GoCD sanity covers dev11.
https://claude.ai/code/session_01EptZEfZLCf4WPLtJ9qnHom
Generated by Claude Code