Missing Nginx HSTS
ID: file-missing-nginx-hsts
Severity: high
Author: pussycat0x
Tags: file,audit,nginx,hardening
Description
Section titled “Description”Ensures that HSTS (Strict-Transport-Security) is enabled in Nginx.
YAML Source
Section titled “YAML Source”id: file-missing-nginx-hsts
info: name: Missing Nginx HSTS author: pussycat0x severity: high description: | Ensures that HSTS (Strict-Transport-Security) is enabled in Nginx. remediation: | Add 'add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";' in /etc/nginx/nginx.conf under the server block. reference: - https://wiki.devsecopsguides.com/docs/checklists/nginx/ - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security metadata: verified: true tags: file,audit,nginx,hardening
file: - extensions: - conf
matchers-condition: and matchers: - type: word words: - "http" - "events" condition: and
- type: word words: - 'add_header Strict-Transport-Security ' negative: true# digest: 490a00463044022068d501fe41912d1e66beaffb5bf0a26772b8a5739d8f8ebe02c4e9f8f78011e902206171c0708c46e26b21e227e2d385d63366cb7f2bba81b7f59217a02903b48428:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "file/audit/nginx/file-nginx-hsts-missing.yaml"