Skip to content

Data models: vaults, targets, scans and findings ​

The models of the research context: the vault and its scope, the targets inside it, scans with their lifecycle, findings and signatures. Part of the data model reference.

Vault ​

File: vault.py · Table: vaults · Exposure: API

A research program (bug bounty program or engagement). It is the context of the workstation: targets, scans, findings, proxy traffic and notes belong to one vault.

FieldTypeNotes
nameString(255)Not null, indexed
platformEnum PlatformTypeNot null, default CUSTOM
target_domainString(255)Not null
program_urlString(255)Nullable
scope_rulesJSONNot null, default {"in": [], "out": []}: lists of exact hosts, *. suffixes, IP literals or CIDR ranges, stored canonical
engagementJSONNullable: engagement rules (app/core/engagement); null allows everything
policy_versionIntegerNot null, default 1; grows with every scope or rules change

AuthorizationDecision (authorization_decisions, engagement.py): one decision of the engagement gate: vault_id (CASCADE), created_at, actor, agent_id (SET NULL), operation (scan, attack, repeater, replay), host, policy_version, outcome (allowed, refused), reason, message. EngagementUsage (engagement_usage): requests originated per vault and engagement day, unique per pair. Attacks and scans carry the agent_id that started them (SET NULL).

Relationships (backrefs defined on the child models): targets (1→N, cascade='all, delete-orphan'), proxy_flows (1→N, cascade='all, delete-orphan'), workflows (1→N). Notes and note folders reference the vault by foreign key only (no ORM relationship).

Methods: scope (property) builds an immutable ScopePolicy (app/core/scope.py) from scope_rules. is_in_scope(domain) is scope.allows(domain), so it is true when an in-pattern matches and no out-pattern does. is_out_scope(domain) is its negation.

Scope patterns (app/core/scope_patterns.py) are validated when a vault is saved: example.com matches only that host, *.example.com every name below it (not the apex), 10.0.0.0/24 every address in the range. Anything wider, such as *example.com (which would also match evilexample.com), is refused with 422 and the index of the pattern. Patterns stored by older versions stay conservative: an invalid in-pattern matches nothing, an invalid out-pattern keeps its old wildcard match.

PlatformType ​

HACKERONE, BUGCROWD, INTIGRITI, YESWEHACK, CUSTOM (stored as lowercase values, for example hackerone).


Target ​

File: target.py · Table: targets · Exposure: API

A specific asset inside a Vault. It is self-referential, so it supports hierarchies such as Domain → Subdomain → Endpoint.

FieldTypeNotes
identifierString(512)Not null, indexed
target_typeEnum TargetTypeNot null, default WEB
vault_idFK → vaults.idNullable, indexed, ON DELETE CASCADE
parent_idFK → targets.idNullable, ON DELETE SET NULL
statusEnum TargetStatusNot null, default ACTIVE
is_wildcardBooleanDefault False
ip_addressString(45)Nullable, IPv4 or IPv6
tech_stackJSONNullable
risk_scoreIntegerDefault 0
descriptionTextNullable
last_scanned_atDateTimeNullable, naive UTC

Relationships: vault (backref Vault.targets), children / parent (self, children has cascade='all, delete-orphan'), and the backrefs assets, scans, findings (1→N, each cascade='all, delete-orphan').

Methods: mark_scanned() sets last_scanned_at to datetime.utcnow().

TargetType ​

WEB, API, MOBILE, NETWORK, CLOUD, OTHER

TargetStatus ​

ACTIVE, ARCHIVED, BLACKLISTED, VULNERABLE


Scan ​

File: scan.py · Table: scans · Exposure: API

One execution of an engine pipeline against a target. The lifecycle is an explicit state machine. A transition it does not allow raises InvalidStateError.

FieldTypeNotes
target_idFK → targets.idNot null, indexed, ON DELETE CASCADE
module_idFK → modules.idNullable, ON DELETE SET NULL
scan_typeEnum ScanTypeNot null
statusEnum ScanStatusNot null, default QUEUED
configJSONDefault {}
result_summaryJSONDefault {}
error_messageTextNullable
assets_discoveredIntegerDefault 0
findings_countIntegerDefault 0
started_atDateTime (tz)Nullable; set by start()
completed_atDateTime (tz)Nullable
duration_secondsIntegerNullable
triggered_byString(50)Default 'manual'

Indexes: ix_scan_target_status (target_id, status), ix_scan_module_type (module_id, scan_type).

Relationships: target (backref Target.scans), module (backref Module.scans), findings (backref from Finding.scan, passive_deletes=True).

State machine (TRANSITIONS):

FromAllowed to
QUEUEDRUNNING, CANCELLED, FAILED
RUNNINGCOMPLETED, CANCELLED, FAILED
PAUSEDCANCELLED, FAILED

PAUSED is reserved and unreachable: the runner cannot pause a scan (pausing needs checkpointing in the signature engine, see the roadmap), so no transition leads into it and it cannot resume to RUNNING. It stays in the enum for the stored column type and counts as active; a legacy row in that state can only be failed or cancelled, which the runner's startup recovery does. Terminal statuses have no outgoing transitions (tests/test_model_fixes.py).

Methods: is_active (property: status in ACTIVE_STATUSES), start() (to RUNNING, sets started_at), complete(), cancel(), fail(error). The last three set completed_at and duration_seconds, and fail also records error_message.

Module constants: ACTIVE_STATUSES = {QUEUED, RUNNING, PAUSED}, TERMINAL_STATUSES = {COMPLETED, CANCELLED, FAILED} (both exported from app.models).

ScanType ​

SUBDOMAIN_ENUM (subdomain_enumeration), JAVASCRIPT_ANALYSIS, SERVICE_DETECTION, DNS_RESOLUTION, PORT_SCAN, WEB_CRAWL, TECHNOLOGY_DETECTION, SSL_ANALYSIS, VULNERABILITY_SCAN, CUSTOM_SIGNATURE, FULL_RECON

ScanStatus ​

QUEUED, RUNNING, PAUSED, COMPLETED, CANCELLED, FAILED


Finding ​

File: finding.py · Table: findings · Exposure: API

A discovered vulnerability or security issue, with triage status, evidence and bounty information.

FieldTypeNotes
scan_idFK → scans.idNullable, indexed, ON DELETE SET NULL (findings survive scan deletion; manual findings have no scan)
target_idFK → targets.idNot null, indexed, ON DELETE CASCADE
signature_idFK → signatures.idNullable, ON DELETE SET NULL
titleString(500)Not null
descriptionTextNullable
severityEnum SeverityNot null, indexed, default INFO
statusEnum FindingStatusNot null, default NEW
cvss_scoreString(10)Nullable
cve_idString(50)Nullable
cwe_idString(50)Nullable
evidenceJSONDefault {}
remediationTextNullable
affected_urlTextNullable
affected_parameterString(255)Nullable
pocTextNullable, proof of concept
is_duplicateBooleanDefault False
duplicate_of_idFK → findings.idNullable, ON DELETE SET NULL; no ORM relationship is defined
reported_atDateTime (tz)Nullable; aware UTC (migration b5c8e2f41d07)
bounty_amountIntegerNullable

Relationships: scan (backref Scan.findings), target (backref Target.findings), signature (backref Signature.findings).

Methods: mark_false_positive(), mark_reported(). mark_reported() sets REPORTED and records reported_at as an aware UTC time; the first report time is kept if the finding is reported again, as in the API.

Severity ​

INFO, LOW, MEDIUM, HIGH, CRITICAL

FindingStatus ​

NEW, TRIAGING, VALIDATED, REPORTED, ACCEPTED, RESOLVED, DUPLICATE, FALSE_POSITIVE, WONT_FIX


Signature ​

File: signature.py · Table: signatures · Exposure: API

Detection signatures (templates): what to look for and how to detect it. Built-in signatures are synced from the bundled template directory and are read-only. User signatures are created and edited in the workstation.

FieldTypeNotes
nameString(255)Not null, indexed (not unique)
signature_idString(100)Not null, unique, indexed
signature_typeEnum SignatureTypeNot null
versionString(50)Not null, default '1.0'
authorString(100)Nullable
descriptionTextNullable
iconString(50)Nullable
severityString(20)Default 'info' (a plain string, not the Severity enum)
languageEnum SignatureLanguageNot null, default YAML
templateTextNot null, the signature body
matchersJSONDefault []
extractorsJSONDefault []
referencesJSONDefault []
tagsJSONDefault []
cve_idString(50)Nullable
cwe_idString(50)Nullable
is_activeBooleanIndexed, default True
is_verifiedBooleanDefault False
false_positive_rateIntegerDefault 0
execution_countIntegerDefault 0
success_countIntegerDefault 0
categoryString(100)Nullable, indexed
requires_authBooleanDefault False
sourceEnum SignatureSourceNot null, indexed, default USER
source_pathString(500)Nullable, template file of a built-in signature
signature_metadataJSONDefault {}

Indexes: ix_signature_type_active (signature_type, is_active).

Relationships: findings (backref from Finding.signature).

Methods: increment_execution(), increment_success(), activate(), deactivate(), success_rate (property, integer percentage, 0 when never executed).

SignatureType ​

VULNERABILITY, CONFIGURATION, INFORMATION_DISCLOSURE, TECHNOLOGY_DETECTION, CUSTOM

SignatureSource ​

BUILTIN (synced from templates, read-only), USER

SignatureLanguage ​

YAML, JSON