> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oasm.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Data model

> The entities behind the inventory — workspaces, targets, assets, services, HTTP facets, findings, issues and projects — how scan results are merged into them, and how a finding is deduplicated and closed

Everything OASM knows about an attack surface lives in PostgreSQL as a small number of related entities. This page maps them, explains how raw scanner output is merged into them, and describes the rules that keep the data consistent across thousands of re-scans.

For how a job produces those results, see [Job registry](https://docs.oasm.io/architecture/job-registry.md). For how the data is queried, see [Attack Surface Query engine](https://docs.oasm.io/architecture/attack-surface-query-engine.md).

## The entities

```mermaid theme={null}
erDiagram
    WORKSPACE ||--o{ TARGET : "scopes"
    WORKSPACE ||--o{ PROJECT : "groups work"
    WORKSPACE ||--o{ WORKFLOW : "automates"
    WORKSPACE ||--o{ ISSUE : "tracks"
    TARGET ||--o{ ASSET : "discovered under"
    ASSET ||--o{ ASSET_SERVICE : "host:port"
    ASSET ||--o{ DNS_RECORD : "resolves to"
    ASSET ||--o{ VULNERABILITY : "affected"
    ASSET_SERVICE ||--o{ HTTP_RESPONSE : "probed"
    ASSET_SERVICE ||--o{ DISCOVERED_URL : "crawled"
    ASSET_SERVICE ||--o{ TAG : "labelled"
    HTTP_RESPONSE ||--o| TLS_CERTIFICATE : "presented"
    HTTP_RESPONSE ||--o{ TECHNOLOGY : "fingerprinted"
    HTTP_RESPONSE ||--o{ IP_OBSERVATION : "resolved"
    VULNERABILITY ||--o{ VULNERABILITY_EVENT : "timeline"
    VULNERABILITY ||--o{ VULNERABILITY_SOURCE : "reported by"
    ISSUE ||--o{ ISSUE_LINK : "links"
    PROJECT ||--o{ PROJECT_ASSET : "contains"
    PROJECT_ASSET }o--|| ASSET : ""
    WORKFLOW ||--o{ JOB_HISTORY : "runs"
    JOB_HISTORY ||--o{ JOB : "fans out"
    JOB }o--|| ASSET : "scans"
```

| Entity | What it is |
| - | - |
| **Workspace** | The tenant. Every other entity belongs to exactly one. See [Tenancy](https://docs.oasm.io/architecture/tenancy.md). |
| **Target** | A unit of scope you declare: a domain, an IP, a CIDR range or a Git organization. See [Targets](https://docs.oasm.io/target.md). |
| **Asset** | A host discovered under a target: a subdomain, an IP address, or a repository. Unique per `(value, target)`. The target's own host is its **primary** asset; a CIDR expands into one asset per address. |
| **Asset service** | One open port on an asset (`host:port`). Unique per `(asset, port)`. This is the row the [Assets](https://docs.oasm.io/asset.md) list shows. |
| **HTTP response** | One probe of a service. A service keeps a history of responses and points at its latest one. |
| **HTTP facets** | Data split out of each response into their own tables so they can be filtered and aggregated: **TLS certificate**, **technologies** (name and version), **IP observations**, and **status codes** (including the redirect chain). |
| **DNS record**, **discovered URL**, **tag** | Resolution data per asset, crawled URLs per service, and manual or AI-suggested labels per service. |
| **Vulnerability** | A finding on an asset, with its lifecycle, sources (tool, AI agent or person) and an event timeline. See [Vulnerabilities](https://docs.oasm.io/vulnerability.md). |
| **Issue** | A unit of remediation work. It links to findings, assets, targets or runs through polymorphic links. See [Issues](https://docs.oasm.io/issue.md). |
| **Project** | A curated set of assets with its own workflows, triggers and finding history. See [Projects](https://docs.oasm.io/project.md). |
| **Workflow**, **run**, **job** | The automation definition, one execution of it, and one tool execution on one asset. See [Workflow engine](https://docs.oasm.io/architecture/workflow-engine.md) and [Job registry](https://docs.oasm.io/architecture/job-registry.md). |

Deleting a target removes its assets, and with them services, responses and findings. Assets have no delete of their own; they can be **disabled**, which keeps their history but stops them from being scanned.

## From scanner output to rows

Raw results reach the **data adapter**, a component of the core API that maps each job category onto the entities above:

| Category | Writes |
| - | - |
| Subdomain discovery | New **assets** under the target, plus their DNS records. |
| Port scanning | **Asset services** for each open port. |
| HTTP probing | An **HTTP response** per service, split into TLS, technology, IP and status-code facets. |
| URL discovery | **Discovered URLs**, attached to the service the URL belongs to. |
| Vulnerability scanning | **Vulnerabilities** linked to the asset, plus project finding history when the run belongs to a [project](https://docs.oasm.io/project.md). |
| Screenshots | A PNG in object storage, referenced from the service. |

The merge is designed to be replayed safely:

* **Idempotent writes.** Assets, services and URLs are inserted with conflict handling on their natural keys, so re-reporting a host or a port never duplicates it — it only refreshes its `lastSeenAt`.
* **Large batches are chunked** to stay under PostgreSQL's bind-parameter limit, so a run with tens of thousands of hosts merges in one pass.
* **Events after commit.** `asset.discovered`, `vulnerability.detected` and `vulnerability.resurfaced` are published to the [event bridge](https://docs.oasm.io/architecture/event-bridge.md) only after the rows are committed, once per batch rather than once per row. Consumers such as [project](https://docs.oasm.io/project.md) scope rules, [issue](https://docs.oasm.io/issue.md) rules and notifications can therefore always read what the event describes.
* **New assets** are enabled or disabled according to the workspace setting for auto-enabling discovered assets. See [Assets](https://docs.oasm.io/asset.md#auto-enable-assets).

## Finding identity

A scanner reports the same finding again on every run, so the platform needs a stable identity to tell "seen again" from "new". Every vulnerability has a **fingerprint** derived from the finding name, the asset and the tool. The fingerprint is unique: re-detection is an upsert on it, never a new row.

For findings in code repositories, the connector's own fingerprint (which pins file and line) is part of the identity, so two leaks of the same secret type in different files stay separate findings.

### Fields a scanner cannot set

Lifecycle and triage fields — detection status, review status, fix claims, due dates, AI analysis, sources — are stripped from connector output before the merge. Only the platform stamps them. A connector, however it is written, cannot close a finding, approve itself or move an SLA date.

## Finding lifecycle

```mermaid theme={null}
stateDiagram-v2
    [*] --> New: first detection
    New --> Active: reported again
    Active --> Fixed: missed by covering scans
    New --> Fixed: missed by covering scans
    Fixed --> Resurfaced: reported again
    Resurfaced --> Active: reported again
    Resurfaced --> Fixed: missed by covering scans
```

The user-facing behaviour is described in [Vulnerability lifecycle](https://docs.oasm.io/vulnerability.md#vulnerability-lifecycle). Underneath it, three mechanisms do the work:

* **Re-detection** is the conflict clause of the merge. It refreshes the scanner-owned columns, resets the miss counter, counts the detection once per run, moves New or Resurfaced to Active, and moves Fixed to Resurfaced — clearing the fix and restarting the SLA when the workspace says so. Columns the new report leaves empty keep their stored value.
* **Auto-close** uses a **scan scope key**: a hash of the asset, tool, service, inputs, configuration and profile of the scan. Only a later scan with the *same* key can count a miss, and only after the configured number of consecutive misses does the finding move to Fixed. A narrower scan — another template set, another port — never closes anything. Findings without a key (AI-proposed or manual) are never auto-closed.
* **The timeline** records transitions and user actions only, not every re-detection, so a finding seen ten thousand times still has a readable history.

### AI proposals

Findings proposed by the [Security Agent](https://docs.oasm.io/architecture/ai-agent.md) enter with a review status of **pending review**. Their fingerprints live in a separate namespace, so they can never collide with a scanner finding. Until a reviewer approves them, they are excluded from every count, and the re-detection path never touches them. At proposal time the platform checks each piece of evidence the agent cites against the stored tool output and records the verdict for the reviewer.

### One definition of "open"

A finding is **open** when it is approved, its status is New, Active or Resurfaced, and it has no unexpired dismissal or risk acceptance. That single condition is shared by the dashboard, the vulnerability list, reports, projects, targets and Attack Surface Query, which is why their numbers always agree. The same is true of the security score: one formula serves both the dashboard and PDF reports.

## From findings to issues

The `issues` consumer of the event bridge turns finding events into remediation work:

* `vulnerability.detected` runs the [issue rules](https://docs.oasm.io/issue.md#issue-rules): an open, approved finding that matches a rule joins the open issue with the same group key, or opens a new one. A rule can only raise priority or pull a due date earlier.
* `vulnerability.resurfaced` reopens a resolved issue linked to the finding.
* `vulnerability.fixed` resolves an open remediation issue once every linked finding is finished — fixed, dismissed, or a rejected AI proposal.

Every automatic change writes a system comment on the issue in the same transaction, and status changes are conditional updates, so a redelivered event changes nothing.

## Related

> [card] [Job registry](https://docs.oasm.io/architecture/job-registry.md)
>
> How results arrive and are staged before the merge

> [card] [Attack Surface Query engine](https://docs.oasm.io/architecture/attack-surface-query-engine.md)
>
> Query every entity on this page with one JSON language

> [card] [Tenancy and access control](https://docs.oasm.io/architecture/tenancy.md)
>
> How the workspace boundary is enforced on these tables

> [card] [Vulnerabilities](https://docs.oasm.io/vulnerability.md)
>
> The lifecycle as users see it


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.