Repository navigation
feat(backend)!: remove TORMAP_ADMIN_PASSWORD_BCRYPT support - #624
Conversation
Admin access is now configured only via TORMAP_ADMIN_PASSWORD. The value is always treated as plaintext and BCrypt-hashed in memory, so values that look like a BCrypt hash are no longer passed through. A warning is logged if the removed variable is still set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3c91UZ2YrQCJkppXzg6CZ
|
Generated by Claude Code |
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
HTTP Basic is now configured only on the actuator chain. The public chain has no authentication and denies paths that are not explicitly allowed (403 instead of 401). Log a warning for admin passwords shorter than 16 characters and document the recommendation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3c91UZ2YrQCJkppXzg6CZ
9d02678 to
239bda2
Compare
…ator chain The shared config now only holds stateless sessions and security headers. The actuator chain uses Spring's default CSRF matcher (all unsafe methods) and no CORS, since admins use it same-origin from a browser or curl. The public chain keeps CORS for the frontend and disables CSRF, as it has no authentication, sessions or cookies. AGENTS.md no longer bans csrf.disable outright, but still requires CSRF protection on the actuator chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3c91UZ2YrQCJkppXzg6CZ
Summary
Admin (actuator) access is now configured only via
TORMAP_ADMIN_PASSWORD, and HTTP Basic is scoped to the actuator.SecurityConfig: drop theTORMAP_ADMIN_PASSWORD_BCRYPTenv var and the BCrypt-hash passthrough (isBcrypt).TORMAP_ADMIN_PASSWORDis always treated as plaintext and BCrypt-hashed in memory at startup.TORMAP_ADMIN_PASSWORD_BCRYPTis still set, so a stale deployment does not silently lose admin access, and if the admin password is shorter than 16 characters.SecurityConfig: split the single filter chain in two:securityMatcher("/actuator/**")): roleADMINvia HTTP Basic, CSRF (double-submit cookie) on unsafe methods, no CORS.GETendpoints remain viewable in a browser, which prompts for the credentials.403instead of401.SecurityRulesTest/SecurityConfigTest: updated for the two chains, plus tests that public paths ignoreAuthorization: Basicheaders and that the actuator sends a BasicWWW-Authenticatechallenge.AGENTS.md: replace the blanketcsrf.disableban with "keep CSRF protection on the actuator chain".backend/README.md: remove the BCrypt variable andhtpasswdinstructions; document the 16-character minimum, browser access to the actuator and restricting/actuatorat the reverse proxy.THREAT_MODEL.md: update the secrets asset, the HTTP Basic boundary and theSecurityConfigcontrol.Deployment notes
TORMAP_ADMIN_PASSWORD_BCRYPT, replace it withTORMAP_ADMIN_PASSWORDset to the plaintext password (from your secret manager). The old variable is ignored and only produces a warning.TORMAP_ADMIN_PASSWORDcurrently contains a BCrypt hash ($2a$/$2b$/$2y$), it was previously used as a hash. It is now treated as the literal password, so set it to the plaintext password instead.401for unknown paths now gets403./actuator/**still answers401without credentials.Testing
Could not build locally in this environment (only JDK 21 available vs. required 25, no Docker for Testcontainers, Maven Central rate-limited). Relying on CI (
backend-test.yml).🤖 Generated with Claude Code
https://claude.ai/code/session_01Y3c91UZ2YrQCJkppXzg6CZ