ajinabraham.njsscan.good.good_helmet_checks.helmet_header_dns_prefetch

profile photo of ajinabrahamajinabraham
Author
unknown
Download Count*
License

X-DNS-Prefetch-Control header is present and DNS Prefetch Control is enabled. More information: https://helmetjs.github.io/docs/dns-prefetch-control/

Run Locally

Run in CI

Defintion

rules:
  - id: helmet_header_dns_prefetch
    message: "X-DNS-Prefetch-Control header is present and DNS Prefetch Control is
      enabled. More information:
      https://helmetjs.github.io/docs/dns-prefetch-control/"
    languages:
      - javascript
    severity: INFO
    patterns:
      - pattern-not: |
          $HELMET(..., {dnsPrefetchControl: false}, ...)
      - pattern-either:
          - pattern: |
              $APP.use(helmet())
          - pattern: |
              helmet.dnsPrefetchControl()
          - pattern: |
              dnsPrefetchControl()
          - pattern: |
              helmet.dnsPrefetchControl({ allow: false })
          - pattern: |
              helmet({dnsPrefetchControl: {allow: false}})
          - pattern: |
              dnsPrefetchControl({ allow: false })
    metadata:
      license: LGPL-3.0-or-later