av dast targets auth
Give a DAST scan the credentials it needs to reach pages behind a login, so the scanner tests your authenticated surface instead of stopping at the sign-in wall. There are two ways to supply them, covered below.
The binary ships as alertavuln; av is the common alias - they are
interchangeable in every example.
Two ways to authenticate
Section titled “Two ways to authenticate”| Approach | Use when | Where the secret lives |
|---|---|---|
ALERTAVULN_DAST_AUTH_* environment variables |
You run av dast scan yourself (local or CI) |
In your shell/CI only - never uploaded |
Stored profile (av dast targets auth set) |
You want AlertaVuln’s hosted worker to scan on a schedule | Encrypted at rest on the server, per target |
Both describe the same five credential kinds - header, bearer,
cookie, form, and oauth - with the caveats noted below.
Local scan: environment variables
Section titled “Local scan: environment variables”For a scan you run yourself, set ALERTAVULN_DAST_AUTH_* in the environment
before av dast scan. Nothing is stored server-side and no round trip is
needed. If ALERTAVULN_DAST_AUTH_KIND is unset the scan runs unauthenticated,
exactly as before.
| Kind | Required variables | Optional |
|---|---|---|
header |
ALERTAVULN_DAST_AUTH_KIND=header, ALERTAVULN_DAST_AUTH_HEADER_NAME, ALERTAVULN_DAST_AUTH_HEADER_VALUE |
- |
bearer |
ALERTAVULN_DAST_AUTH_KIND=bearer, ALERTAVULN_DAST_AUTH_BEARER_TOKEN |
- |
cookie |
ALERTAVULN_DAST_AUTH_KIND=cookie, ALERTAVULN_DAST_AUTH_COOKIE_NAME, ALERTAVULN_DAST_AUTH_COOKIE_VALUE |
- |
oauth |
ALERTAVULN_DAST_AUTH_KIND=oauth, ALERTAVULN_DAST_AUTH_OAUTH_TOKEN_URL, ALERTAVULN_DAST_AUTH_OAUTH_CLIENT_ID, ALERTAVULN_DAST_AUTH_OAUTH_CLIENT_SECRET |
ALERTAVULN_DAST_AUTH_OAUTH_SCOPE |
Examples
Section titled “Examples”Scan with a static header (for example an API gateway key):
export ALERTAVULN_DAST_AUTH_KIND=headerexport ALERTAVULN_DAST_AUTH_HEADER_NAME="X-API-Key"export ALERTAVULN_DAST_AUTH_HEADER_VALUE="<key>"av dast scan --target https://staging.example.comScan with a bearer token:
export ALERTAVULN_DAST_AUTH_KIND=bearerexport ALERTAVULN_DAST_AUTH_BEARER_TOKEN="<token>"av dast scan --target https://staging.example.comScan with an OAuth client-credentials grant (the CLI fetches a token from the token endpoint before scanning):
export ALERTAVULN_DAST_AUTH_KIND=oauthexport ALERTAVULN_DAST_AUTH_OAUTH_TOKEN_URL="https://id.example.com/oauth/token"export ALERTAVULN_DAST_AUTH_OAUTH_CLIENT_ID="<client-id>"export ALERTAVULN_DAST_AUTH_OAUTH_CLIENT_SECRET="<client-secret>"av dast scan --target https://staging.example.comStored profile: av dast targets auth set
Section titled “Stored profile: av dast targets auth set”Store an encrypted auth profile against a registered target so AlertaVuln’s hosted worker can scan it for you. The secret is encrypted at rest on the server; only the hosted worker decrypts it at scan time.
av dast targets auth set --project <projectId> --target <targetId> --kind <kind> --secret <value> [kind flags]av dast targets auth clear --project <projectId> --target <targetId>--target here is the target ID (from av dast targets),
not a URL. You must be logged in (av login).
Options
Section titled “Options”| Flag | Kind | Description |
|---|---|---|
--project |
all | Project ID (required) |
--target |
all | Target ID (required) |
--kind |
all | header, bearer, cookie, form, or oauth (required) |
--secret |
all | The secret value: header value / bearer token / cookie value / password / client secret (required) |
--header-name |
header |
Header name |
--cookie-name |
cookie |
Cookie name |
--login-url |
form |
Login form URL |
--username-field |
form |
Username field name |
--password-field |
form |
Password field name |
--username |
form |
Username value |
--logged-in-indicator |
form |
Text present only when logged in |
--logged-out-indicator |
form |
Text present only when logged out (optional) |
--token-url |
oauth |
Token endpoint |
--client-id |
oauth |
Client ID |
--scope |
oauth |
Scope (optional) |
Examples
Section titled “Examples”Store a bearer token for a target:
av dast targets auth set --project <projectId> --target <targetId> \ --kind bearer --secret "<token>"Store a form-login profile (hosted worker signs in before scanning):
av dast targets auth set --project <projectId> --target <targetId> \ --kind form --secret "<password>" \ --login-url https://app.example.com/login \ --username-field email --password-field password \ --logged-in-indicator "Sign out"Remove a stored profile:
av dast targets auth clear --project <projectId> --target <targetId>Security
Section titled “Security”Credentials supplied through ALERTAVULN_DAST_AUTH_* stay in your environment -
they are never uploaded with a scan’s findings. Stored profiles are encrypted at
rest and only decrypted by the hosted worker at scan time. Either way, any
credential the scanner sees reflected back in a response is scrubbed from finding
evidence before it is uploaded or displayed, the same as every other DAST
finding.
See also
Section titled “See also”av dast scan- run a scan (readsALERTAVULN_DAST_AUTH_*)av dast targets- list a project’s registered targets and their IDs- Dynamic scanning (DAST) - what DAST covers, passive vs active, hosted vs self-hosted