Custom Rules

Nullify performs DAST scanning using a number of tools under the hood to detect vulnerabilities in your APIs.

Nullify allows you to create custom DAST rules to detect vulnerabilities specific to your API.

All Nullify features are supported with custom rules:

  • AI false positive and prioritization

  • Auto-fix

  • Pull request comments

  • Web dashboard metrics and triage page

Setup

Currently, the only way to use custom DAST scanning rules is to create custom rule templates in your global private repository (e.g. .github-private).

  1. Create a .nullify/nuclei directory in the root of the repository .github-private.

  2. Add custom rule templates in the .nullify/nuclei directory (see example below).

Writing Rules

Custom rules use the same syntax as Nuclei templates.

https://docs.projectdiscovery.io/templates/structure

Example

This example rule detects a simple server-side request forgery (SSRF) vulnerability by attempting to access internal AWS metadata via the HTTP request's query or body.

id: custom-template-ssrf-aws-metadata

info:
  name: Custom Template SSRF AWS Metadata
  author: nullify-custom-dast-rules
  severity: critical
  metadata:
    max-request: 1
  tags: ssrf,dast,aws

http:
  - pre-condition:
      - type: dsl
        dsl:
          - 'method == "GET" || method == "POST"'

    payloads:
      ssrf:
        - "http://169.254.169.254/latest/meta-data/"

    fuzzing:
      - part: query
        mode: single
        fuzz:
          - "{{ssrf}}"
      - part: body
        mode: single
        fuzz:
          - "{{ssrf}}"

    stop-at-first-match: true
    matchers:
      - type: word
        part: body
        words:
          - "ami-id"
          - "instance-id"
          - "local-hostname"

Last updated

© 2023 Nullify | All Rights Reserved.