forked from 0xWheatyz/SPARC
Refuse to start with default JWT secret in non-development environments #733
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap reference: P1 - Security hardening
auth.pyships a fallbacksparc-secret-key-change-in-productionthat will be used ifJWT_SECRETis unset. This is a critical security risk in production deployments.What to do
Add a startup check in
auth.py(or application startup inapi.py) that:JWT_SECRETenvironment variablesparc-secret-key-change-in-productiondevelopment(check viaENVIRONMENTorAPP_ENVenv var) and the default secret is in use, raises aRuntimeErrorand refuses to startAcceptance criteria
JWT_SECRETis unset or set to the default valuedevelopmentenvironment, a warning is logged but startup is not blocked