Scans
Scan applications on private networks
NightVision can scan an application that the internet cannot reach: a service on your laptop, a container on a CI worker, a pod in a Kubernetes cluster, a host in a data center. You run the NightVision CLI on a machine that can reach the application, and the CLI carries the scan’s traffic to it.
There is nothing to deploy. No agent, no inbound firewall rule, no VPN to NightVision. The CLI makes outbound connections only, and they last only as long as the scan.
How the Smart Proxy works
Section titled “How the Smart Proxy works”The scanners run in the NightVision cloud. The Smart Proxy is the link between them and the CLI on your network.
- You run
nightvision scan. The CLI asks NightVision to start a scan. - NightVision starts the scanners.
- The scanners send their requests to the Smart Proxy.
- The Smart Proxy passes them down the connection the CLI opened.
- The CLI sends each request to the application and returns the response the same way.
The browser that signs in and crawls, and the checks that attack, all run in the NightVision cloud. Only their HTTP traffic passes through your machine. Results appear in the dashboard like any other scan.
What this means in practice:
- The CLI must be able to reach the application. It checks before the scan starts and stops with an error if it cannot.
- The CLI must be able to reach NightVision over outbound HTTPS. See Network access for the hosts to allow.
- Keep the CLI running until the scan finishes. If the machine sleeps or the job is killed, the scanners lose their path to the application.
Public or private: how NightVision decides
Section titled “Public or private: how NightVision decides”When you add an application, NightVision tests whether its URL answers from the internet. If it does not, the application is private. The New application dialog marks such a URL May be private, and the application’s page shows “private” beside its type.
The CLI makes the same test each time it starts a scan:
- The URL answers from the internet: the scan runs straight from the NightVision cloud.
- It does not: the scan runs through the Smart Proxy.
To send a scan through the Smart Proxy even though the URL is public, add --force-private-scan. Use it when the public address sits behind a WAF or an IP allowlist and you want the traffic to come from your own network instead:
nightvision scan customer-portal --force-private-scanScan a private application
Section titled “Scan a private application”In the CLI an application is called a target.
-
Install the CLI on a machine that can reach the application, and sign in:
Terminal window nightvision loginIn a pipeline, set a
NIGHTVISION_TOKENinstead. See API tokens. -
Create the application, if it does not exist yet:
Terminal window nightvision target create local-app http://localhost:3000 --type WEB -
Scan it:
Terminal window nightvision scan local-app
Add --auth with the name of an authentication to scan signed in. See Authentication.
Start from the dashboard
Section titled “Start from the dashboard”You can set a private scan up in the dashboard and let it write the command.
- Select New scan and choose the application.
- Set the authentication, duration and checks as usual.
- Under Where it runs, CLI helper (private network) is already selected for a private application, and NightVision Cloud is disabled. For a public application, select CLI helper (private network) yourself.
- Select Generate command.
- Copy the command and run it on a machine that can reach the application. There is a macOS and Linux version and a Windows PowerShell version.
- Select I started the scan to go to Scans and watch it.

Rescan works the same way. On a private application it opens Run this scan from the CLI with the command for the same application, project and authentication.

What is different for a private application
Section titled “What is different for a private application”- No schedules. A schedule runs from the NightVision cloud, which cannot reach the application. Run private scans on a timer from your own pipeline or scheduler instead. See Scan from a pipeline.
- No leaked credential check. It runs only on NightVision Cloud. See Leaked credential check.
- The command carries the setup. The CLI helper puts your authentication, duration, exclusions and switched-off checks into the command. Choices about single custom Nuclei templates are not part of it. From the CLI, skip a template with
--disable-nuclei-templates. See Custom Nuclei templates.
Everything else is the same: recorded logins, API specs, findings, Coverage, exports.
Where to run the CLI
Section titled “Where to run the CLI”Run it wherever the application’s address resolves and connects.
A web application on a CI worker
Section titled “A web application on a CI worker”Your pipeline builds the application, starts it in a container on the worker, and scans it at localhost before it is deployed anywhere.
nightvision target create local-app http://localhost:3000 --type WEBnightvision scan local-appThe pipeline guides have complete examples for GitHub Actions, GitLab, Azure DevOps, Bitbucket and Jenkins.
A service in a Kubernetes cluster
Section titled “A service in a Kubernetes cluster”Run the CLI in a pod or a job inside the cluster, where the service’s cluster DNS name resolves. This example scans a service called orders in the prod namespace, at its cluster DNS name orders.prod.svc.
nightvision target create orders-api https://orders.prod.svc:443 --type API --spec-file openapi.yamlnightvision scan orders-apiAn API in a data center
Section titled “An API in a data center”Run the CLI on any host on the internal network that can connect to the API.
nightvision target create vuln-api http://vuln.api.internal:8080 --type API --spec-file openapi.yamlnightvision scan vuln-api--type API with --spec-file creates an API application from its OpenAPI spec. Use --type WEB for a web application. See API specs.
Applications on the public internet
Section titled “Applications on the public internet”An application the internet can reach needs no CLI and no Smart Proxy. Start the scan from the dashboard, the CLI or the API, and the scanners connect to it directly.
If a public application sits behind a firewall or a WAF that blocks the scanners, either allow NightVision’s addresses or scan through the Smart Proxy with --force-private-scan. See the FAQ and Troubleshooting scans.