fix: auth/2FA security — stdout-log code delivery is dev/test-only, production fails closed until email/SMS; verification-code hashing, lockout recovery, sabredav fail-closed
- TWO_FACTOR_ALLOW_LOG_DELIVERY production opt-in REMOVED: plaintext codes are written to the stdout log ([2FA]/[VERIFY]) only in dev/test builds as a local DEV ONLY feature while email/SMS delivery (P6) is implemented. Production builds have no delivery channel and code issuance fails closed (503) under any configuration — no silent log-based code leak - verification/2FA codes hashed at rest (HMAC-SHA256 via TWO_FACTOR_PEPPER, CHAR(64)); [VERIFY] dev log relay; per-user brute-force budget; password_reset purpose clears lockout for self-service recovery; dummy-bcrypt on login no-user path kills timing oracle - sabredav weak-password list + entropy gate; .env.example ships fail-closed DAV_ADMIN_PASSWORD - delete-account re-auth (current_password + fresh 2FA code when enforced) - prod-tag suite (run-prod-tag-tests.sh) compiles and runs the production 2FA issuance gate: production ALWAYS reports no delivery channel and refuses issuance after the pepper check - startup_checks_test SNAPSHOT_ENC_KEY values built at runtime so gitleaks sees no secret-shaped literals - env-docs parity updated (flag removed, 38 vars)
This commit is contained in:
@@ -95,6 +95,12 @@ def find_env_vars_in_code():
|
||||
# itself and cannot be defined in .env.example — never treat them as user env vars.
|
||||
env_vars -= {'DEV', 'PROD', 'SSR', 'MODE', 'BASE_URL', 'BUILD'}
|
||||
|
||||
# GO_WANT_HELPER_PROCESS is the conventional Go test-internal sentinel for
|
||||
# the "re-exec self as helper process" pattern (startup_checks_test.go sets
|
||||
# it via cmd.Env on the re-exec'd binary). It is NOT a user-configurable
|
||||
# variable — it never belongs in .env.example, so never flag it.
|
||||
env_vars -= {'GO_WANT_HELPER_PROCESS'}
|
||||
|
||||
return sorted(env_vars)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user