Repository navigation
feat(allowlist): exclude secret paths from review - #1262
Conversation
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 7 selected item(s). |
There was a problem hiding this comment.
Why do we have all these workarounds here, because in my solution these are just no allowed (not even supported), so they are excluded at first.
This is my way of solving this problem. Just asking, thanks!
There was a problem hiding this comment.
Thanks for asking. I followed the design in #1240 here. I kept the secret-path check separate from the extension allowlist so files like Dockerfile and Makefile keep their current behavior.
Secret paths are different because include rules shouldn't be able to make them reviewable again, and they need their own secret_exclude reason. #1240 also discussed handling dotfiles through the extension path, but that would change the existing extensionless-file behavior.
There was a problem hiding this comment.
Sorry, I didn't read the issue. My bad. I will speak to the maintainer.
|
@hyy321 Thanks — the implementation is clean and the rename/ 1. The patterns cover
2. Missing documentation
|
Thanks, that makes sense. I’ll keep the current secret patterns scoped to #1240, note the .env. limitation in the PR, and open a follow-up issue for broader .env.* coverage. I’ll also add an explanation of secret_exclude to the localized review-rules.md files. |
@hyy321 Will you add an explanation regarding |
Yes, I’ll include that in the current PR. I’m updating the localized review-rules.md files to explain secret_exclude and that include cannot override it. |
|
I’ve added it to the current PR. The localized review-rules.md files now explain secret_exclude, including that it is a built-in protection that include cannot override. |
* feat(allowlist): exclude secret paths from review * docs(review-rules): document secret exclusions Built on the security finding by @wu21-web and the initial implementation in #1244 by @katepallewarprathmesh-sketch. Co-authored-by: Prathmesh Katepallewar <[email protected]> Co-authored-by: Tao Xin <[email protected]>
* feat(allowlist): exclude secret paths from review * docs(review-rules): document secret exclusions Built on the security finding by @wu21-web and the initial implementation in alibaba#1244 by @katepallewarprathmesh-sketch. Co-authored-by: Prathmesh Katepallewar <[email protected]> Co-authored-by: Tao Xin <[email protected]>
…m rules The v1.12.9 merge passed build, vet and the full test suite, yet the branch-only coreFilterReason still lacked the secret-path gate upstream added in alibaba#1262/alibaba#1279. Both parity tables only knew the old cases, so they stayed green until matching secret cases were added. Record the procedure: diff upstream's source-of-truth filter and allowlist data across the tag range, add parity cases for each new branch first and check that only the copy fails, pick fixture paths that no built-in list covers, and diff the merge result against the upstream tag to catch resurrected dead code such as executePlanPhase. CONCEPTS.md: refine Exclude Reason (secret, provider-directory and too-large reasons now exist), File Filter (include cannot admit credential paths or provider directories) and Review parity (tests assert only the cases they list). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Description
This PR adds built-in path-based protection for common secret files such as
.env, SSH private keys,.netrc,.npmrc,.pypirc, and.dockercfg.The secret-path patterns are kept separate from the existing default exclude patterns because they have different precedence: default excludes can be overridden by an include rule, while secret paths cannot.
Both review and scan apply the secret-path check before user include/exclude rules and report matches as
secret_exclude. For review diffs, bothOldPathandNewPathare checked so a rename from a protected path to an allowed path cannot expose content from the protected source path.Agent runtime tools are intentionally left unchanged, following the scope discussed in #1240.
Known limitation: This PR keeps the secret patterns scoped to #1240, so files such as
.env.production,.env.staging, and.env.developmentare not covered yet. Broader .env.* coverage is tracked in #1265.Type of Change
How Has This Been Tested?
make testpasses locallyAdditional validation:
make checkmake buildgit diff --check upstream/main...HEADdeepseek-v4-pro: 0 findings across 7 selected itemsTests cover secret-path matching, include/exclude precedence, rename handling, logging, and review/scan selection behavior.
Checklist
go fmt,go vet)AI/LLM Disclosure
AI/LLM tools were used during implementation and review.
Tools: Codex and OpenCodeReview.
OCR self-review model:
deepseek-v4-pro.I reviewed the final changes and test results before submission.
Related Issues
Closes #1240
Follow-up: #1265