Skip to content
Open dashboard (opens in a new tab)

Scans

Custom Nuclei templates

A Nuclei template is a YAML file that describes one check: the request to send and what in the response counts as a hit. NightVision runs thousands of public and built-in templates on every scan. Custom templates let you add your own, for things only you know about your applications: an internal admin path, a banner that must never reach production, a misconfiguration you have been bitten by before.

In the dashboard: Nuclei templates

Open Nuclei templates (opens in a new tab)

A custom template works in three steps:

  1. Add it to a project, by uploading a file or writing it in the browser.
  2. Assign it to one or more applications in that project.
  3. Scan. The template runs on every scan of the applications it is assigned to, and a hit becomes a finding.

Select Nuclei templates in the rail.

The Nuclei templates page listing five templates with their severity, project, number of assigned applications, creator and upload date. One template, unfinished-upload, has a No file chip. Upload templates and Write template buttons are at the top right.
The Nuclei templates page.

Each row shows the template’s name and file, its severity, its project, how many applications it is assigned to, who added it and when. Search by name, filter by Severity, or sort by a column. The project scope at the top of the page narrows the list to the projects you choose.

A template belongs to one project. It can be assigned only to that project’s applications.

A No file chip means the template has a name but its YAML never arrived, usually because an upload was interrupted. No scan can run it. Open its menu and choose Upload the file, or delete it.

  1. Select Upload templates.
  2. Choose the Project.
  3. Drop your .yaml files on the dialog, or select browse.
  4. Check each file’s Name. It starts as the template’s info.name, and it is the finding name that scan results show. Add a description if you want one.
  5. Select Upload.
The Upload templates dialog with the Payments project chosen and two files added: staging-banner-exposed.yaml, rated Low, and backup-archive-reachable.yaml, rated High. Each has a Name and an optional Description field. A warning says templates cannot use the types code and javascript.
Uploading two templates to a project.

The rules for a file:

  • One template per file, with a .yaml or .yml extension.
  • Up to 1 MB per file, and up to 50 files in one upload.
  • A name of up to 100 characters, unique in the project. A description of up to 500 characters.
  • No restricted template types (see Restricted template types).

The severity is read from info.severity in the file. You do not set it in the dialog. To change a template’s severity, change it in the YAML.

NightVision validates every file on the server and shows the answer for each one in the dialog. A file that fails does not stop the others.

  1. Select Write template.
  2. Choose the Project.
  3. Type or paste the YAML under Template YAML.
  4. Check the Name (from info.name) field and add a description if you want one.
  5. Select Save template.
The Write a template dialog with the Payments project chosen and a short template in the YAML editor that requests a staging-banner path and matches a 200 status. Below the editor the name reads Staging banner exposed and the severity reads Low.
Writing a template in the browser. The name and severity are read from the YAML as you type.

A minimal template looks like this:

id: staging-banner-exposed
info:
name: Staging banner exposed
author: example-corp
severity: low
http:
- method: GET
path:
- "{{BaseURL}}/staging-banner"
matchers:
- type: status
status:
- 200

Use {{BaseURL}} for the application’s address, so the same template works on every application you assign it to. The Nuclei template guide covers the full syntax.

Select a template to open its side panel. Overview shows its project, severity, who uploaded it and when. Content shows the YAML.

The side panel for the template exposed-admin-panel on its Content tab, showing 15 lines of YAML with a Copy button. Above it are the buttons Edit YAML, Assign to applications, Run template command and Download.
A template's side panel, Content tab.

From the panel or the row menu you can:

  • Edit YAML: change the file. Saving replaces the file. New scans use the new file. The name and the assigned applications do not change.
  • Edit template info: change the name and description that NightVision shows. The YAML file is not changed.
  • Download: get the file.
  • Delete: remove the template. The applications it was assigned to stop running it.

A template does nothing until it is assigned.

  1. On the Nuclei templates page, open the template’s menu and choose Assign to applications. To assign several templates at once, tick them and use Assign to applications in the bar that appears. They must be from one project.
  2. Tick the applications.
  3. Select Assign.
The Assign to applications dialog for the template exposed-admin-panel in the Payments project. Two of three applications are ticked and the button reads Assign to 2 applications.
Assigning a template to two applications.

You can also work from the application’s side. Open the application and choose More settings > Nuclei templates. The panel lists the templates assigned to it. Assign templates adds more from the project, and Remove from this application in a row’s menu takes one off without deleting it.

Run only custom templates, or skip some for one scan

Section titled “Run only custom templates, or skip some for one scan”

Assigned templates run on every scan of their applications. You can change that for a single scan.

  1. Select New scan and choose the application.
  2. Open Advanced and find Checks.
  3. Under Nuclei templates, the Custom Nuclei templates list shows the templates assigned to the application. Untick the ones this scan should skip.
The Nuclei templates section of the checks in New scan. A Run only custom templates button is at the top. Below it are the public and built-in template folders, all ticked, then three custom templates, all ticked.
Choosing Nuclei templates for one scan.

To test just your own checks, select Run only custom templates. It turns ZAP and every built-in Nuclei folder off and keeps the custom templates on. This is the quickest way to try a template you have just written: every finding the scan raises is from your own checks.

Turning the Nuclei templates switch off skips every Nuclei template for the scan, custom ones included. A template marked “No file, never runs” is listed but cannot be selected.

At least one set of checks must stay on. If you turn ZAP off and leave no template to run, Start scan is disabled and the page says why.

A hit from a custom template is a finding like any other. It appears on the scan’s Findings tab under the template’s name, with the template’s severity and a Custom template label.

A finding named exposed-admin-panel, rated Critical and labelled Custom template. The Evidence tab shows the GET request to the admin path, the 200 response with the matched page title highlighted, and a curl command to reproduce it.
A finding raised by a custom template.

The finding page shows the request the template sent, the response, and the part of the response that matched. You can triage it, assign it and link it to a Jira issue. See Work with a finding.

NightVision has no remediation text for a check you wrote, so the finding has no fix guidance. Put what the reader needs in the template’s name and description.

To try a template against a URL from your own machine:

  1. Open the template’s menu and choose Run template command.
  2. Select Download in the template’s panel to get the file.
  3. Copy the command and run it from the folder the file is in. Replace $LOCATION with the URL to test.
The dialog titled Run exposed-admin-panel yourself. It shows a nuclei command with the template file name and a note that a local run uses your machine’s network and no NightVision authentication, so its results do not appear in NightVision.
The command to run a template with your own copy of Nuclei.
Terminal window
nuclei -u $LOCATION \
-t template-1.yaml \
-silent

Nuclei must be installed on your machine. A local run uses your network and sends no NightVision authentication, so it does not test signed-in pages, and its results do not appear in NightVision.

Some Nuclei template types run code instead of sending HTTP requests. NightVision does not accept them. The upload dialog names the restricted types, for example code and javascript, and a file that uses one is rejected with “Unsupported Nuclei template type”.

Write the check with the http type instead.

  • Adding, editing and deleting templates needs a role that can change the project.
  • Assigning templates needs a role that can change the project’s applications.
  • Anyone who can see the project can read its templates and download them.

When your role does not allow an action, its button is disabled and says why. See Members, roles and groups.

In the CLI, the API and the MCP server an application is called a target.

A scan started from the CLI runs the templates assigned to the application. These flags on nightvision scan change what runs:

Flag What it does
--disable-nuclei-templates Skips the custom templates you name, by template id. Takes a comma-separated list.
--disable-nuclei-folders Skips public and built-in template folders, by folder path. Takes a comma-separated list.
--no-nuclei Skips every Nuclei template.
--no-zap Turns ZAP off, so only Nuclei templates run.
Terminal window
nightvision scan payments-api --no-zap --disable-nuclei-templates 4f6d3a1e-2b7c-4d8e-9a10-6c5b4e3d2f1a

At least one of ZAP and Nuclei must stay on. The folder names are listed in the check catalog.

With the NightVision MCP server, a coding agent can manage templates for you:

Tool What it does
list-nuclei-templates Lists templates, filtered by project, target or severity.
create-nuclei-template Creates the template record in a project.
upload-nuclei-template Uploads the YAML file to that record.
assign-nuclei-template Assigns the template to a target.

To run a single custom template from an agent, start a scan with no_zap: true and run_only_nuclei_templates set to the template’s name.

The same operations are in the API under /api/v1/nuclei-templates/. See the API reference.