GraphQL
You want open critical findings for one repository, with the component and the fix version, and you do not want three REST calls and a join in your script. That is the job GraphQL does here.
The API is read-only. Commands such as waivers, severity overrides and rescans stay on the REST API.
Send a query
Post to /api/v1/graphql with an API key that holds findings:read.
curl -s "https://<your-console-host>/api/v1/graphql" \
-H "Authorization: Bearer $DWAAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"{ findingCounts { severity count } }"}'
Your tenant and your access come from the credential, never from query arguments. You cannot ask for another tenant's data by passing an id.
The limits that will shape your queries
- Every list is a cursor connection. Page with
firstandafter. firstis capped at 200.- A request can go at most 6 levels deep and has a complexity budget of 2000.
postureTrendreturns at most 400 days.
What it costs
Each call with an API key is charged in query units, about one unit per 100 rows and at most 20 for a request. The console's own pages are free.
The charge is the request's price, worked out from what it asks for, not from what came back. So first: 200 costs the same on an empty result, and asking for the page you need is the cheap habit. Units show up under Usage and limits. A limit on them warns and does not refuse the call.
The filter that surprises people
Every version of a resource, meaning each commit or image digest, has its own findings. Without current or snapshotIds in the filter, you only get findings of the versions your tracked refs point at now. Set current: false when you want older versions.
Ignored findings stay out of every result too, unless your filter names IGNORED in statuses or lifecycles. If your count looks low compared with what you expected, check this first. Findings explains the lifecycle.
Schema
"""
The console's read-only GraphQL API.
Served at POST /api/v1/graphql behind the session: the tenant and the caller's
access come from the session, never from arguments. Every list is a cursor
connection with `first` capped at 200; a request is bounded by a depth of 6
and a complexity budget. Commands (waivers, severity overrides, rescans) stay
on REST.
"""
scalar DateTime
scalar JSON
enum FindingType {
VULNERABILITY
MALICIOUS_PACKAGE
SECRET
MISCONFIGURATION
SAST
CI_WORKFLOW
LICENSE
CODE_QUALITY
CRYPTO
ATTESTATION
SKILL
MODEL
POSTURE
PROVENANCE
BASE_IMAGE
PRIVACY
}
enum Severity {
CRITICAL
HIGH
MEDIUM
LOW
INFO
UNKNOWN
}
"The effective status: the lifecycle status (OPEN, FIXED, IGNORED), with an active waiver applied to an open finding. Queries leave IGNORED out unless their filter names it."
enum FindingStatus {
OPEN
FIXED
ACCEPTED
FALSE_POSITIVE
"a Finding Configurations category (Scan Center) ignores it"
IGNORED
}
"Where a finding is in its life, as the lists show it."
enum FindingLifecycle {
"open, and only the run that found it has seen it"
NEW
"open, seen again since"
OPEN
"open again after a fix"
REOPENED
"a run of the current version looked and did not see it"
FIXED
"an active waiver: accepted risk or false positive"
WAIVED
"a Finding Configurations category (Scan Center) ignores it"
IGNORED
}
enum FindingOrder {
"effective severity, highest first, then first seen (newest first)"
SEVERITY
FIRST_SEEN
LAST_SEEN
}
"Who set a finding's severity override."
enum SeverityOverrideBy {
"a person, on this finding (or on another version of it); wins over the check severity"
PERSON
"the tenant's check severity of the rule id (Scan Center › Configurations)"
CHECKS
}
enum WaiverKind {
ACCEPTED
FALSE_POSITIVE
}
type Query {
"Totals by type, effective severity, effective status and currency; sum the cells you need."
findingCounts(filter: FindingFilter): [FindingCount!]!
findings(filter: FindingFilter, orderBy: FindingOrder, first: Int, after: String): FindingConnection!
finding(id: ID!): Finding
"A resource the tenant tracks (the console's asset: a repository, an image repository, a package)."
resource(id: ID!): Resource
resources(filter: ResourceFilter, first: Int, after: String): ResourceConnection!
"A component by canonical identity (PURL, crypto algorithm, model, …)."
component(identity: String!): Component
components(filter: ComponentFilter, first: Int, after: String): ComponentConnection!
"A vulnerability id (CVE, GHSA, …) across the tenant."
vulnerability(id: String!): Vulnerability
"Open, waived, new and fixed findings per UTC day, oldest first; at most 400 days."
postureTrend(days: Int = 30, filter: PostureFilter): [PostureDay!]!
}
input FindingFilter {
types: [FindingType!]
"effective severity"
severities: [Severity!]
"effective status; without IGNORED here or in lifecycles, ignored findings are left out"
statuses: [FindingStatus!]
lifecycles: [FindingLifecycle!]
"""
true: findings of the versions tracked refs point at now; false: of older versions.
Every resource version (commit, image digest) has its own findings, so without
this or snapshotIds only the current versions' findings are returned.
"""
current: Boolean
"findings of these resource versions (Snapshot ids), any currency unless current is set"
snapshotIds: [ID!]
resourceIds: [ID!]
"the resource's type: code | artifact | cloud | api | ai-agent | vendor | build-tool"
resourceTypes: [String!]
"what these connections bring: their settings-posture findings and the findings of the resources they discovered"
connections: [ID!]
componentIdentity: String
vulnId: String
ruleId: String
"any of these rule ids (checks)"
ruleIds: [String!]
"none of these rule ids: the Findings page's Hide"
excludeRuleIds: [String!]
"one scanner category key (code:sca); see categories for several"
category: String
"any of these scanner category keys"
categories: [String!]
firstSeenAfter: DateTime
"title, rule id, PURL or path"
search: String
}
input PostureFilter {
types: [FindingType!]
resourceTypes: [String!]
}
"One day of posture (UTC), per finding type and effective severity."
type PostureDay {
day: DateTime!
type: FindingType!
severity: Severity!
resourceType: String!
"open at the end of the day (the nightly run)"
open: Int!
waived: Int!
"first seen that day"
new: Int!
"fixed that day"
fixed: Int!
}
input ResourceFilter {
"code | artifact | cloud"
type: String
"comma-separated states (unscanned, healthy, archived)"
state: String
search: String
"'' (active, the default), only, include"
archived: String
"asset kinds (repo, image, package, account, function, instance, service, cluster, project)"
kind: [String!]
"cloud workloads of these account resources (ids)"
account: [ID!]
"cloud workloads in these regions"
region: [String!]
"cloud workloads with these exposures (public_url, public_ip, internet_lb, public_endpoint, public_domain, internal)"
exposure: [String!]
}
input ComponentFilter {
"repo | image | package"
kind: String
purlType: String
namespace: String
name: String
search: String
}
type PageInfo {
endCursor: String
hasNextPage: Boolean!
}
type FindingConnection {
nodes: [Finding!]!
pageInfo: PageInfo!
totalCount: Int!
}
type ResourceConnection {
nodes: [Resource!]!
pageInfo: PageInfo!
totalCount: Int!
}
type ComponentConnection {
nodes: [Component!]!
pageInfo: PageInfo!
totalCount: Int!
}
type ScanRunConnection {
nodes: [ScanRun!]!
totalCount: Int!
}
"One cell of the counts table."
type FindingCount {
type: FindingType!
severity: Severity!
status: FindingStatus!
current: Boolean!
count: Int!
}
type Finding {
id: ID!
dedupKey: String!
type: FindingType!
category: String!
ruleId: String!
title: String!
description: String!
"the pipeline's normalised severity"
severity: Severity!
"a tenant's override, if any"
severityOverride: Severity
"who set severityOverride: a person on this finding, or the tenant's check severity of the rule id; null without an override"
severityOverrideBy: SeverityOverrideBy
severityEffective: Severity!
"lifecycle status: OPEN, FIXED or IGNORED"
status: FindingStatus!
statusEffective: FindingStatus!
lifecycle: FindingLifecycle!
"its version is what a tracked ref points at now (always true for a settings-posture finding)"
current: Boolean!
"the resource version the finding is in (a commit, an image digest); null for a settings-posture finding"
version: FindingVersion
"the resource's type (code, artifact, …); code for a settings-posture finding"
resourceType: String!
"the connection whose organisation a settings-posture finding is about; null for every other finding"
connectionId: ID
subject: Subject!
"the component the finding is about, when it is an identity the console tracks"
component: Component
"the resource (asset) the finding belongs to; null when the caller lacks resources:read on it"
resource: Resource
vulnId: String
vulnIds: [String!]!
cwes: [String!]!
fix: String
"FIRST's EPSS score of the vulnerability id (null when unknown or the feed is off)"
epss: Epss
"CISA's Known Exploited Vulnerabilities entry of the vulnerability id (null when not listed or the feed is off)"
kev: Kev
sources: [String!]!
firstSeenAt: DateTime!
firstSeenRunId: ID!
lastSeenAt: DateTime!
lastSeenRunId: ID!
fixedAt: DateTime
fixedRunId: ID
reopenedCount: Int!
waiver: Waiver
"the Finding Configurations category that ignores it (tests, docs), with status IGNORED; null otherwise"
ignoredBy: String
"when the category started ignoring it"
ignoredAt: DateTime
"lifecycle events, newest first (at most 100)"
events(first: Int): [FindingEvent!]!
"what each run said: evidence, raw refs, tool severity (newest first, at most 100)"
observations(first: Int): [Observation!]!
}
"""
The resource version a finding is in. A resource is its type, its name and its
version: two branches or two digests of one repository have separate findings.
"""
type FindingVersion {
snapshotId: ID!
"the version's canonical identity (repository URL@commit, registry/repository@digest), the unique id a scan is keyed on"
identity: String!
"commit | platform | index"
kind: String!
commit: String
digest: String
"7-char sha or 12-char digest"
short: String!
"how it is named: the first ref pointing at it now, else the ref its last run scanned"
ref: String!
"the tracked refs (branches, tags) that point at it now, default first; empty for an older version"
refs: [String!]!
}
type Epss {
"probability of exploitation in the next 30 days, 0..1"
score: Float!
percentile: Float!
"the day the score is for"
date: DateTime
}
type Kev {
addedAt: DateTime
dueAt: DateTime
"known use in ransomware campaigns"
ransomware: Boolean!
}
type Subject {
kind: String!
identity: String!
purl: String
path: String
line: Int
endLine: Int
layer: String
setting: String
digest: String
name: String
version: String
"every lockfile a package was found in, when there are several (path is the first)"
paths: [String!]
}
type Waiver {
id: ID!
kind: WaiverKind!
reason: String!
expiresAt: DateTime
createdBy: ID!
createdAt: DateTime!
revokedAt: DateTime
active: Boolean!
}
type FindingEvent {
id: ID!
at: DateTime!
"opened | fixed | reopened | severity_changed | waived | unwaived | severity_override | ignored | unignored"
kind: String!
runId: ID
"principal id; null for the pipeline"
actor: ID
data: JSON
}
type Observation {
runId: ID!
"null for a settings-posture run (it has no snapshot)"
snapshotId: ID
observedAt: DateTime!
severity: Severity!
toolSeverity: String!
confidence: String!
subject: Subject!
evidence: JSON
rawRef: String!
rawRefs: [String!]!
sources: [String!]!
occurrences: [JSON!]!
parserVersion: String!
}
"A console asset (the REST Resource), with its findings and components."
type Resource {
id: ID!
"code | artifact | cloud"
type: String!
"repo | image | package | account | function | instance | service | cluster | project"
kind: String!
name: String!
technicalName: String!
identity: String!
provider: String!
"public | private"
visibility: String!
url: String!
"the account resource a cloud workload is deployed in (null for the account itself and for non-cloud resources)"
accountId: ID
"a cloud workload's region ('' when global or not a cloud resource)"
region: String!
"how a cloud workload is reachable: public_url | public_ip | internet_lb | public_endpoint | public_domain | internal ('' unknown)"
exposure: String!
state: String!
"the owner organization"
orgId: ID!
connectionId: ID
lastScanAt: DateTime
missingSince: DateTime
createdAt: DateTime!
archivedAt: DateTime
"tracked refs, defaults first"
refs: [ResourceRef!]!
"the snapshot of the first default ref (default branch, newest tag)"
currentVersion: Snapshot
findingCounts(filter: FindingFilter): [FindingCount!]!
findings(filter: FindingFilter, orderBy: FindingOrder, first: Int, after: String): FindingConnection!
"components of the current snapshots (edges `contains`)"
components(filter: ComponentFilter, first: Int, after: String): ComponentConnection!
"scan runs of this resource, live first then newest"
scans(first: Int): ScanRunConnection!
"the newest run's documents (SBOM, CBOM, AI-BOM, data map, attestations), downloaded from url (resourceDocument)"
documents: [Document!]!
}
"A document of a run (resourceDocument streams it after the read check)."
type Document {
id: ID!
"sbom | cbom | aibom | privacy | attestations"
kind: String!
"an image's platform (linux/arm64), else empty"
platform: String!
format: String!
fileName: String!
"the API path that downloads it"
url: String!
runId: ID!
}
type ResourceRef {
id: ID!
"branch | tag | image_tag"
kind: String!
name: String!
"default | rule | manual"
origin: String!
excluded: Boolean!
snapshot: Snapshot
resolvedAt: DateTime
}
type Snapshot {
id: ID!
"commit | platform | index"
kind: String!
commit: String
digest: String
"7-char sha or 12-char digest"
short: String!
lastScanAt: DateTime
}
type ScanRun {
id: ID!
"the UI status (queued, running, completed, failed, …)"
status: String!
"full | rematch"
mode: String!
trigger: String!
priority: String!
startedAt: DateTime
finishedAt: DateTime
createdAt: DateTime!
findingsNew: Int!
findingsTotal: Int!
error: String
target: ScanTarget!
}
type ScanTarget {
version: String!
ref: String!
}
"A resources / tenant_resources row: a package, image, crypto algorithm, model, … findings point at."
type Component {
identity: String!
kind: String!
purlType: String!
namespace: String!
name: String!
version: String!
public: Boolean!
"licenses, distro, crypto primitive, … as resources.json gave them"
attributes: JSON
"resources in scope that use the component"
usedBy(first: Int, after: String): ResourceConnection!
findingCounts(filter: FindingFilter): [FindingCount!]!
findings(filter: FindingFilter, orderBy: FindingOrder, first: Int, after: String): FindingConnection!
"the same name and namespace, other versions seen in the tenant"
versions: [Component!]!
}
type Vulnerability {
id: String!
findings(filter: FindingFilter, orderBy: FindingOrder, first: Int, after: String): FindingConnection!
"resources in scope with an open finding on this id"
affectedResourceCount: Int!
}
Try this next
Draft the query on the Query page first, where the check names what is wrong and shows how many rows it can return. Then run findingCounts with no filter, then add resourceIds for one repository. Compare it with the same repository in Findings. When the numbers match, you can trust your query in automation.