[WEB-7805] fix: remove hardcoded SECRET_KEY from community deployment manifests#9291
[WEB-7805] fix: remove hardcoded SECRET_KEY from community deployment manifests#9291mguptahub wants to merge 2 commits into
Conversation
…(GHSA-cmwv-pjmw-8483) Replace the publicly-known default SECRET_KEY and LIVE_SERVER_SECRET_KEY values in AIO and CLI community deployment manifests with a safe placeholder. - deployments/aio: variables.env now ships with placeholder values; start.sh auto-generates a random key on first boot (or on upgrade from the old insecure default) and persists it in plane.env across restarts - deployments/cli: variables.env ships with placeholder; docker-compose.yml fallbacks that referenced the publicly-known default are removed - apps/api/plane/settings/common.py: SECRET_KEY resolution now uses `or` so an empty env var falls back to get_random_secret_key() (not ""); adds a startup warning if the known insecure default or placeholder is detected Closes WEB-7805 Co-authored-by: Plane AI <noreply@plane.so>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR hardens secret key handling across the Plane stack: Django settings now detects known insecure/placeholder key values and emits a critical warning to stderr. The AIO startup script gains first-boot auto-generation logic that preserves previously stored keys across restarts. Deployment config files replace hardcoded secret defaults with ChangesSecret Key Security Hardening
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 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 |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
…ning Address code review feedback — replace module-level print() with _logger.critical() and move _logger definition before the SECRET_KEY block to avoid duplicate assignment. Also removes the now-unused `import sys`. Co-authored-by: Plane AI <noreply@plane.so>
Summary
SECRET_KEYandLIVE_SERVER_SECRET_KEYin AIO and CLI community deployment templates with a safe placeholder (change-this-key-on-deployment)start.shnow auto-generates a cryptographically random key on first boot and persists it across restarts — no operator action required; also detects and replaces the old insecure default on upgradedocker-compose.ymlremoves all:-hardcoded-valuefallbackscommon.pystrengthensSECRET_KEYresolution to treat an empty env var the same as unset (usingor), and prints aCRITICAL SECURITY WARNINGto stderr if the known insecure default or placeholder is active at startupFiles changed
deployments/aio/community/variables.envSECRET_KEY+LIVE_SERVER_SECRET_KEYwith placeholderdeployments/aio/community/start.shdeployments/cli/community/variables.envSECRET_KEY+LIVE_SERVER_SECRET_KEYwith placeholderdeployments/cli/community/docker-compose.yml:-hardcodedfallbacks for both secret keysapps/api/plane/settings/common.pyorfor empty-env fallback; warn on startup for insecure/placeholder keysUpgrade behaviour
start.shrun, any instance using the old compromised default is automatically rotated to a fresh random key. Existing custom keys are preserved.variables.env.Test plan
plane.envgets a randomSECRET_KEY(not the old default or placeholder)plane.env): confirm key is rotated to new random valueSECRET_KEY=change-this-key-on-deploymentinvariables.envworks for local devCRITICAL SECURITY WARNINGappears in container logsCo-authored-by: Plane AI noreply@plane.so
Summary by CodeRabbit
SECRET_KEYandLIVE_SERVER_SECRET_KEY.