Skip to content

Session Store

Every netinject run is recorded as a session in a local SQLite database. This enables regression tracking, historical comparison, and result replay.

Location

The database is stored at .netinject/sessions.db relative to the project root (created by netinject init).

Schema

Sessions Table

ColumnTypeDescription
idTEXTUUID (primary key)
nameTEXTOptional user-provided name
commandTEXTSubcommand that created the session
targetTEXTPrimary target URL or file
created_atTEXTISO 8601 timestamp
statusTEXTrunning, completed, failed

Findings Table

ColumnTypeDescription
idTEXTUUID (primary key)
session_idTEXTForeign key to sessions
sourceTEXTAdapter name
categoryTEXTFinding category
severityTEXTSeverity level
titleTEXTShort description
descriptionTEXTDetailed description
urlTEXTAffected URL
evidenceTEXTProof or reproduction details
raw_outputTEXTOriginal JSONL line
timestampTEXTISO 8601 timestamp

Session Lifecycle

  1. Create: A new session is created when any command runs with --session
  2. Record: Findings are inserted as adapters produce them
  3. Complete: Session status is updated to completed or failed
  4. Query: netinject sessions lists past runs
  5. Replay: netinject replay <session-id> re-displays findings

Session Naming

bash
# Auto-generated name
netinject scan --target https://api.example.com

# Explicit name
netinject scan --target https://api.example.com --session weekly-scan

# List sessions
netinject sessions

# Show findings from a specific session
netinject replay <session-id>

Data Retention

Sessions persist until manually deleted. There is no automatic cleanup. Use SQLite directly to prune old sessions if needed.