You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(allowlist): cover per-environment .env.* files in secret-path protection #1265
#1240 adds built-in secret-path protection for .env, .env.local, and .env.*.local, but common per-environment files such as .env.production, .env.staging, and .env.development are still not covered.
These files are commonly used for environment-specific configuration and may contain real secrets, so they should receive the same protection as the existing .env patterns.
This was identified as a non-blocking follow-up during review of #1262.
Proposed Solution
Extend the built-in secret-path matching to cover .env.*, while keeping common committed template files reviewable.
For example:
Exclude .env.production
Exclude .env.staging
Exclude .env.development
Keep .env.example reviewable
Keep .env.sample reviewable
Keep .env.template reviewable
The existing secret-path behavior should stay the same:
Matches are reported as secret_exclude.
User include rules cannot override the protection.
The change remains limited to review/scan selection.
Agent runtime tools and content-based secret detection remain out of scope.
Alternatives Considered
Matching .env.* without exceptions would also exclude committed template files such as .env.example, .env.sample, and .env.template. Keeping the current patterns unchanged avoids those false positives but leaves common .env.<environment> files unprotected.
Hi @lizhengfeng101, now that #1262 has been merged, I’d be happy to take this follow-up if the direction above looks good.
My plan is to extend the built-in .env.* matching while explicitly keeping .env.example, .env.sample, and .env.template reviewable. I’ll keep the existing secret_exclude precedence and review/scan scope unchanged, and add focused tests for both protected per-environment files and the template exceptions.
Activity
hyy321 commentedon Sep 15, 2026
Hi @lizhengfeng101, now that #1262 has been merged, I’d be happy to take this follow-up if the direction above looks good.
My plan is to extend the built-in .env.* matching while explicitly keeping .env.example, .env.sample, and .env.template reviewable. I’ll keep the existing secret_exclude precedence and review/scan scope unchanged, and add focused tests for both protected per-environment files and the template exceptions.