refactor: remove env-leak consent model, enforce hard block on target repo .env#1167
refactor: remove env-leak consent model, enforce hard block on target repo .env#1167
Conversation
… repo .env (#1135) Target repo ambient .env is now unconditionally blocked. The consent/bypass model (allow_env_keys, allow_target_repo_keys, --allow-env-keys) has been removed end-to-end across scanner, config, DB, API, CLI, and Web UI. Repos with sensitive keys in auto-loaded .env files must remove or relocate those keys — no override path exists.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughRemoves the env-leak consent model end-to-end: eliminates Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing — wrong approach. Blocking repos is the wrong primitive. The correct fix is to prevent Bun from auto-loading target repo .env into subprocesses, not to refuse repos that have sensitive keys. Will re-implement with the right architecture. |
Summary
allow_env_keys,allow_target_repo_keys,--allow-env-keys) that could be overridden, weakening the security boundary.envsecrets should never leak into Archon or provider subprocesses — no bypass should exist.archon/config.yaml env:, DB-managed per-codebase env vars) still works. Boot-timestripCwdEnv()protection unchanged.UX Journey
Before
After
Label Snapshot
risk: mediumsize: Lcore,server,web,cli,config,testscore:env-leak-scanner,core:clone,core:config,server:api,web:settingsChange Metadata
securitymultiLinked Issue
Validation Evidence (required)
bun run validate # All pass: type-check, lint, format, testsSecurity Impact (required)
.envsecrets can no longer be consented to; they are unconditionally blocked--allow-env-keysor the UI toggle must now remove sensitive keys from their repo's auto-loaded.envfiles.Compatibility / Migration
.envfilesallow_target_repo_keysinconfig.yamlis no longer recognized (silently ignored)allow_env_keyscolumn remains in the schema (dead column, never read/written) for backwards compatHuman Verification (required)
bun run validatepasses (type-check, lint, format, tests)allow_env_keys=truerows — column is ignored, repos will be blocked on next registration attemptSide Effects / Blast Radius (required)
.envand previously consented will be blocked on next interactionRollback Plan (required)
.envkeysRisks and Mitigations
Summary by CodeRabbit
Breaking Changes
Updates