Skip to main content
Beta. Attack Surface Query (ASQ) is in beta. The query language is stable enough to build on, but resources and fields may still be added, and limits may change between releases.
Attack Surface Query (ASQ) is a small JSON query language over the data OASM collects about a workspace. One request can ask several questions at once — which domains appeared this week, which of them expose an admin panel, and how many hosts have each port open — and get back exactly the fields it asked for.

What you can ask

If OASM has recorded it, you can ask about it — and the shape of the question maps onto the language:

Why ASQ

One request, many questions

A batch holds up to ten named queries. Each comes back under its own name, and one failing query does not stop the others.

Only the fields you ask for

Pick fields of a row and of its related rows (host.value, http.title), and attach lists of related rows (include).

Filters as precise as the question

Any and/or/not combination, operators per field type (ranges, prefixes, subnets, empty values), and tests on whole lists of related rows: none, every, at least n.

Numbers ready for a table or a chart

count, countDistinct, sum, min, max, avg, a filter per aggregate, having, and time series with no gaps in your own time zone.

Reusable

Save a batch, give it params, run it again with other values, or render it as a PDF report.

Safe by construction

Every query is compiled to read-only SQL scoped to your workspace, with values passed as parameters. A query can never read another workspace.

Where you can use it

Key concepts

A request is a batch: an object with a queries map. Each key is a name you choose (newDomains), each value is a query. An optional batch-level window applies to every query that does not set its own.
A query reads one resource (from): targets, hosts, services, technologies, tls, urls, ips, dnsRecords, vulnerabilities or rollups. See Resources and fields.
A query either returns rows (select, include, paging) or counts them (groupBy + aggregate). See Counting and grouping.
technologies, tls and the http relation describe each service’s latest HTTP probe, so a technology that disappeared in the last scan no longer matches.

Permissions

ASQ follows the same permission matrix as the rest of the workspace. Any member can send a query; each resource the query touches then requires its read permission: A query that reaches a resource you cannot read — in select, include or where — is refused with PERMISSION_DENIED. Saved queries additionally need report.read / report.write (see Permissions).

Next steps

Your first query

Send a query to the API and read the response.

Query structure

from, select, related rows and include.

Composing queries

Combine queries, filters and lists to answer real questions.

Resources and fields

Every resource, field, type and relation.