Skip to content

feat(gateway): PEN-5146 Send HSTS and nosniff on every API response - #3

Merged
umaan1982 merged 1 commit into
developfrom
feature/usmansaeed/pen-5146-api-security-headers
Nov 24, 2026
Merged

umaan1982 merged 1 commit into
developfrom
feature/usmansaeed/pen-5146-api-security-headers

Conversation

@umaan1982

Copy link
Copy Markdown
Collaborator

api.packmatic.io sends no Strict-Transport-Security or X-Content-Type-Options (pentest L1). The ALB sets them since aws-infrastructure#178, but our API Gateway integrations are non-proxy, so API Gateway only returns headers mapped per response and drops them.

Linear: PEN-5146

  • New SecurityHeadersProcessor, last in the default pipeline: declares both headers on every method response and maps fixed values (max-age=31536000; includeSubDomains, nosniff) in the matching http integration response
  • Skips CORS preflight mocks and integration responses without a declared method response (default → 500)
  • Always on, so every API deployed with this image gets the headers; API Gateway's own 4xx/5xx replies are PEN-5178
  • Spec size stays under the 6 MiB put-rest-api limit: packaging 4.60 → 5.22 MB
  • Compile test targets updated: only the new header lines change
Compiled with our 5 service specs (develop vs this branch)
service        responses with both headers   everything else unchanged   size
packaging      1648 / 1648                   yes                         4.60 -> 5.22 MB
users           177 / 177                    yes                         0.83 -> 0.89 MB
notifications    12 / 12                     yes                         0.31 -> 0.32 MB
projects        731 / 731                    yes                         3.18 -> 3.45 MB
tasks           216 / 216                    yes                         0.76 -> 0.84 MB

@umaan1982
umaan1982 marked this pull request as ready for review November 23, 2026 09:50
@umaan1982
umaan1982 requested a review from a team November 23, 2026 10:47
@umaan1982
umaan1982 merged commit 4b587a3 into develop Nov 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants