--session, --session-file, and --auth-config flags. This enables scanning behind login walls and detecting authorization bypass vulnerabilities (IDOR/BOLA).
Session config files can be written in YAML or JSON — the format is auto-detected by file extension (.json) or by content sniffing (leading { or [).
Quick Start
Authentication Flags
| Flag | Description |
|---|---|
--session | Inline session in name:Header:value format. Repeatable. |
--session-file | Path to an individual session file (YAML or JSON). Repeatable. |
--auth-config | Path to auth-config file with all session definitions (YAML or JSON). |
primary, the first session loaded is used as the primary.
Session Roles
Each session has a role that determines how it is used during the scan:primary— The main session. Used for discovery, spidering, and as the default requester during the audit phase. There should be exactly one primary session.compare— Comparison sessions for IDOR/BOLA testing. During the audit phase, every request made by the primary session is replayed with each compare session’s credentials. If a compare session can access resources it shouldn’t, theauthz-comparemodule flags it.
Inline Sessions
The--session flag accepts sessions in name:Header:value format:
Session Files
For sessions with multiple headers or login flows, use files. Both YAML and JSON formats are supported.Static Headers
YAML:session_dir (default ~/.vigolium/sessions/) if the path is not absolute. See Session Strategy Configuration below.
Login Flows
Session files can define automated login flows. The scanner executes the login request at scan start and extracts credentials from the response. YAML:Extraction Sources
| Source | Description | Example |
|---|---|---|
json | Extract a value from the JSON response body using dot-notation. | path: "$.token" |
cookie | Extract cookies from Set-Cookie response headers. Omit name to extract all cookies. | name: "session_id" |
header | Extract a value from a response header. | name: "X-Auth-Token" |
apply_as field defines how the extracted value is applied as a request header. Use {value} as a placeholder.
Auth Config File
An auth-config file defines all sessions in one place under asessions key.
YAML Format
JSON Format
When to Use JSON
JSON is a good choice when:- AI agents generate session configs — most LLMs produce cleaner JSON than YAML, and agent modes (pipeline, swarm) already output session config as JSON natively.
- Programmatic generation — scripts, CI pipelines, or tools that build session configs are often simpler in JSON.
- Embedding in other JSON payloads — e.g., the REST API
POST /api/agent/run/pipelinebody includes session config as a nested JSON object.
Format Detection
The format is detected automatically:- File extension —
.jsonfiles are parsed as JSON;.yaml/.ymlas YAML. - Content sniffing — if the extension is ambiguous (or missing), content starting with
{or[(after whitespace trimming) is parsed as JSON. - Fallback — everything else is parsed as YAML.
Session Config Schema Reference
Both YAML and JSON use the same field names. Here is the full schema:headers, login, or login_request can be set per session.
Environment Variables
Session files (both YAML and JSON) support${VAR} syntax for secrets. This keeps credentials out of config files:
${VAR} references are expanded from the environment at load time, before format parsing.
IDOR/BOLA Testing
To test for authorization bypass vulnerabilities, define at least two sessions — one primary and one or more compare sessions. YAML:authz-compare module automatically activates when compare sessions are present. It replays primary session requests with compare session credentials and flags responses that indicate broken access control.
How Detection Works
- The primary session makes a request and gets a response (e.g.,
GET /api/users/42-> 200 OK with user data). - The same request is replayed with each compare session’s credentials.
- If a compare session also receives a successful response with similar content, the module reports a potential IDOR/BOLA finding with High severity.
Filtering to Auth Modules Only
To run only authorization testing without other active modules:How Sessions Affect Scan Phases
| Phase | Session Usage |
|---|---|
| Discovery / Spidering | Primary session only (controlled by use_in_discovery) |
| Audit | Primary session for main scanning; compare sessions for IDOR/BOLA replay (controlled by compare_enabled) |
Session Strategy Configuration
Session behavior is configured underscanning_strategy.session in vigolium-configs.yaml (see public/vigolium-configs.example.yaml for the full annotated example).
Field Reference
| Field | Type | Default | Description |
|---|---|---|---|
session_dir | string | ~/.vigolium/sessions/ | Directory for session file lookup. --session-file myapp resolves to <session_dir>/myapp.yaml (tries .yaml, .yml, .json in order). Supports ~ expansion. |
use_in_discovery | bool | true | When true, the primary session’s headers are injected into the requester used for discovery and spidering. When false, those phases run unauthenticated — useful for mapping the public attack surface first, then scanning authenticated. |
compare_enabled | bool | true | When true, compare sessions are created and the authz-compare module is activated for IDOR/BOLA testing. When false, compare sessions are ignored even if defined — handy when you only need authenticated scanning without authorization comparison. |
reauth_interval | duration | "" (disabled) | Go duration string (e.g. "15m", "1h"). When set, login flows are re-executed at this interval to refresh tokens that expire mid-scan. |
reauth_on_status | []int | [] (disabled) | HTTP status codes that trigger reactive re-authentication. When the primary session receives one of these codes, its login flow is re-executed immediately and the request is retried. |
validate_url | string | "" (disabled) | Relative or absolute URL to GET after login. The scanner checks for a 2xx response to confirm credentials are working before proceeding. Catches bad credentials early. |
Session Directory Resolution
When--session-file receives a bare name (no path separators), the scanner resolves it from session_dir. Extensions are tried in order: .yaml, .yml, .json.
.yaml is appended as the default. Absolute paths and relative paths with directory separators (e.g. ./sessions/myapp.json) bypass session_dir and are used as-is.
To change the lookup directory:
Common Patterns
Unauthenticated discovery, authenticated scanning:authz-compare module stays inactive.
Long-running scan with token refresh:
validate_url confirms credentials work after each login before resuming scanning.
Team shared sessions directory:
--session-file staging-admin resolves the same file for everyone.
Scanning profiles (~/.vigolium/profiles/) can also override session strategy values — useful for having a “quick unauthenticated” profile alongside a “deep authenticated” profile.
Using Session Config with Agent Modes
Agent modes (pipeline, swarm, autopilot) can auto-generate session configs from source code analysis. The generated configs are always written as JSON to the session directory.
When running agent pipeline or swarm with --source, the source analysis phase discovers authentication flows in the codebase and produces a session-config.json (or auth-config.yaml in pipeline mode) in the session directory. This config is then fed into subsequent scan phases automatically.
You can also pass a pre-built session config to agent modes the same way as regular scans:
