🔐 Fix: Remove hardcoded development secrets [#6]#7
Open
Jerrycyborg wants to merge 2 commits intomainfrom
Open
Conversation
- Add requireSecretInProduction() utility in src/utils/secrets.ts - Update JobTokenManager, NodeJwtManager, NodeTrustManager to fail-fast in production when secrets are missing - Secrets fall back to dev defaults only when NODE_ENV !== 'production' - Prevents accidental deployment with weak default credentials Closes #6
- Add import for requireSecretInProduction utility - Update adminSecret initialization to fail-fast in production - Consistent pattern with security.ts changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements fix for Issue #6 - removes hardcoded development secrets that could be exploited in production.
Changes
New utility:
src/utils/secrets.tsrequireSecretInProduction()functionNODE_ENV !== 'production'Updated:
src/security.tsJobTokenManagerconstructor uses utility forEDGEMESH_JOB_TOKEN_SECRETNodeJwtManagerconstructor uses utility forEDGEMESH_NODE_JWT_SECRETNodeTrustManagerconstructor uses utility forEDGEMESH_BOOTSTRAP_SECRETUpdated:
src/control-plane.tsrequireSecretInProductionadminSecretinitialization uses utility forEDGEMESH_ADMIN_SECRETBehavior
Testing
NODE_ENV=productionwithout secretsCloses
Next Steps
After merging, update deployment documentation to highlight required environment variables for production.