security: production hardening (seeding, CORS/HSTS, CSP, password policy, HttpOnly refresh cookie, dependabot) - #113
Merged
Merged
Conversation
…on to Development
…n password 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.
Production Security Hardening —
harden/prod-securityThe app is live on a real domain, so this PR tightens the production security posture. Each item is a self-contained, reviewable commit.
What's included
IsDevelopment()only.appsettings.Production.json; HSTS enabled (1yr, includeSubDomains, preload); forwarded-headers on for nginx TLS termination.Content-Security-Policyon the JSON API (default-src 'none') + a SPA CSP on the nginx layer.HttpClientwith a 3s fail-open timeout. Change-password now returns a human-readable rejection reason.Path=/api/v1/auth). Angular updated to usewithCredentials; CORS already allows credentials./docanalytics-web), and GitHub Actions.Dropped
Testing
dotnet build -warnaserror:CS1591clean.ng buildclean.withCredentials; backend CORS hasAllowCredentials().Jwt__Key/ConnectionStrings__*into Secrets Manager, rotate any keys ever committed, set RDSPublicly accessible = No+ SG lockdown, ACM/TLS + HTTP→HTTPS at the ALB/nginx, and a DML-only DB role for the app.