Skip to content

Run DAST scans from the CLI

AlertaVuln’s dynamic analysis (DAST) scans a running web application or API - crawling it and probing its live responses - normalises what the scanners find into one set, and tiers each finding RED / YELLOW / GREEN. It runs from the av CLI against any URL you can reach, and lands results on the project’s Dynamic Scan page.

A passive scan of a running staging site is one command:

Terminal window
av dast scan --target https://staging.example.com

Scans are passive by default: the scanners observe the app’s responses without sending attack traffic, so a passive scan is non-intrusive and safe to run anywhere. Add --active to also run attack-payload rules (see Active scans).

DAST has two authorization gates, and a scan of a public URL clears both:

  1. You attest. Every scan prints the disclaimer above and then asks for authorization. Confirm at the interactive [y/N] prompt, or attest up front with --i-am-authorized. In a non-interactive context (CI, no TTY) the scan is refused unless --i-am-authorized is passed.

  2. Your organisation proves domain control. Before AlertaVuln authorizes a scan of a non-loopback target, your org must hold a verified claim on the target’s domain. Add the domain in the web app under Settings and complete the DNS check; once verified, scans of that domain and its subdomains are authorized. Targets on localhost / 127.0.0.1 are exempt from this check, so you can scan a service on the runner without registering a domain.

If the domain is not verified, the scan is refused with an explanation rather than run.

Point av dast scan at a running target. You confirm authorization at the prompt:

Terminal window
av dast scan --target https://staging.example.com
What a run prints
$ av dast scan --target https://staging.example.com
This sends live requests to https://staging.example.com. Only scan systems you
own or are authorized to test. Continue? [y/N] y
Scanning https://staging.example.com (passive)
SEVERITY COUNT
RED 0
YELLOW 3
GREEN 11
YELLOW GET / Missing Content-Security-Policy header
Run with --project <id> to upload these findings.

Add --json for machine-readable output, or --export ./reports to write a self-contained HTML report you can share.

To see findings on the project’s Dynamic Scan page and track them over time, pass --project. That uploads the findings (never your traffic or credentials), so the CLI needs to be authenticated.

Sign in once and the CLI remembers you:

Terminal window
av login
av dast scan --target https://staging.example.com --project <projectId>

The first av dast scan of a URL auto-registers it as a target on the project. --no-upload keeps a scan local-only even when --project is set.

--active runs attack-payload rules in addition to the passive checks. --intensity (low / medium / high) tunes the request rate, concurrency, and time budget, and --environment (staging / production / internal) declares what you are pointing at:

Terminal window
av dast scan --target https://staging.example.com \
--active --intensity high --i-am-authorized

Running --active against an --environment production target additionally requires --i-am-authorized and fails fast without it - a guard against accidentally firing attack traffic at production.

Terminal window
av dast scan --target https://app.example.com \
--environment production --active --i-am-authorized

By default the scanner tests your unauthenticated surface. To reach pages behind a sign-in, set the ALERTAVULN_DAST_AUTH_* environment variables before the scan - the credentials stay in your environment and are never uploaded:

Terminal window
export ALERTAVULN_DAST_AUTH_KIND=bearer
export ALERTAVULN_DAST_AUTH_BEARER_TOKEN="<token>"
av dast scan --target https://staging.example.com --project <projectId>

header, bearer, cookie, and oauth credential kinds work for a local or CI scan. See av dast targets auth for every kind, the exact variables, and the caveats on what an authenticated local scan covers today.

  1. Verify the target’s domain. In the web app, open Settings, add the domain you want to scan, and complete the DNS check (skip this for a localhost target).

  2. Create an organisation API key with ReadWrite scope for uploads. In Settings -> API Keys (org-admin only), create a ReadWrite key - it looks like av_live_ followed by 64 hex characters and is shown once, so copy it immediately.

  3. Find the project ID. Run av project list and copy the ID from the first column (it is also on the project’s page in the web app).

  4. (CI) Store the key as a secret in your CI platform, and the project ID as a plain variable. Never commit either or print the key in logs.

The job installs the CLI and scans a deployed URL. In CI there is no TTY, so authorization is attested with --i-am-authorized; --fail-on turns a bad finding into a failed build.

.github/workflows/alertavuln-dast.yml
name: DAST scan
on:
# Run after your app is deployed to staging - e.g. on a deploy event,
# a schedule, or manual dispatch.
workflow_dispatch:
schedule:
- cron: '0 3 * * 1' # weekly, Monday 03:00 UTC
jobs:
dast:
runs-on: ubuntu-latest
env:
# Injected from the repository/organisation secret; read by the CLI.
ALERTAVULN_API_KEY: ${{ secrets.ALERTAVULN_API_KEY }}
TARGET_URL: https://staging.example.com
steps:
- name: Install the AlertaVuln CLI
run: |
curl -fsSL https://get.alertavuln.com/cli/install.sh | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Scan the running app
run: |
av dast scan --target "$TARGET_URL" \
--project "${{ vars.ALERTAVULN_PROJECT_ID }}" \
--i-am-authorized --fail-on red

A passive run like this is safe on a schedule. Keep --active for deliberate, authorized runs against non-production targets rather than every pipeline.

Pull the consolidated findings the server holds for the project, from the pipeline or your machine:

av dast findings
$ av dast findings --project "$ALERTAVULN_PROJECT_ID" --severity red
SEVERITY STATE ENGINE RULE METHOD URL
RED Open web-scanner sql-injection POST /api/search

The same findings appear on the project’s Dynamic Scan page, and any new or reopened RED / YELLOW finding raises an alert through whatever notification channels you have configured.

  • Use a dedicated ReadWrite key for CI, separate from any personal login, so you can rotate or revoke it without disrupting anyone else.
  • Keep it in your platform’s secret store. Do not echo it, and prefer a Key Vault-backed variable group on Azure DevOps.
  • If a key is exposed, revoke it in Settings -> API Keys and issue a new one.