Add Helmet.js HTTP security headers middleware #1167
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#1167
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Install the
helmetpackage (npm install helmet). Insrc/server.ts(orsrc/app.ts), addapp.use(helmet())before any route definitions. Configure: contentSecurityPolicy with directives appropriate for a JSON API (default-src 'none', frame-ancestors 'none'), strictTransportSecurity with maxAge=31536000 includeSubDomains, noSniff true, xssFilter true. Add a test filetests/middleware/security-headers.test.tsthat sends a GET to any route and asserts:x-content-type-optionsis 'nosniff',x-frame-optionsis present,strict-transport-securityheader exists,x-powered-byis removed. Follow the same pattern as contractpilot PR #696.Generated by CEO Planner (priority: 3)