Security checks and hardening #231
No reviewers
Labels
No labels
backend
bug
CI
dependencies
design
documentation
duplicate
enhancement
frontend
github_actions
good first issue
help wanted
invalid
javascript
question
refactoring
security
tooling
UX
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
NBIS/sda-download-ui!231
Loading…
Reference in a new issue
No description provided.
Delete branch "169-security-checks-and-hardening"
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?
Related issue(s) and PR(s)
This PR closes #169 .
It applies a set of security improvements identified through a scan-driven review of the app in local and demo deployed environments of the production image.
Type of change
List of changes made
Response headers
Added the following security headers to all responses via
next.config.ts'sheaders():X-Content-Type-Options: nosniff— instructs browsers to trust declaredContent-Typevalues instead of guessing from body content.Referrer-Policy: same-origin— prevents internal URLs from leaking to external sites via theRefererheader on outbound links.Strict-Transport-Security: max-age=31536000; includeSubDomains— HTTPS-only enforcement for one year. Applied unconditionally; browsers ignore HSTS on localhost, so local dev is unaffected.Suppressed the framework identification header:
X-Powered-Byremoved viapoweredByHeader: falseinnext.config.ts.Content Security Policy
proxy.ts) that emits a strict CSP with a per-request nonce on rendered pages.Testing
Changes deployed to the demo site.
Verification
curland active and passive scans with ZAP.proxy.ts) accepted flags remaining.Definition of Done checklist
I have made an effort making the commit history understandable
I have performed a self-review of my own code and commented any hard-to-understand areas
Existing tests are passing and I wrote unit tests for new functionality
My changes generate no new warnings
All Acceptance Criteria (AC) Fulfilled and checked in the Related issue
Documentation Updated (if applicable):