Skip to content

Commit 7136428

Browse files
author
cibot
committed
Definitions Update assets_query
1 parent 164de78 commit 7136428

File tree

2 files changed

+86
-77
lines changed

2 files changed

+86
-77
lines changed

alsdkdefs/apis/assets_query/assets_query.v1.yaml

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,25 @@ info:
216216
on the security group with that key and assets within that security group. These classes are
217217
identified with `I` and `R` in the table below.
218218
219+
#### Using CSVs in filters
220+
Some filters allow passing a comma-separated list (CSV) of limiting property values, indicating
221+
that only remediations/exposures that contain **at least one** of the given values will be
222+
returned. This is identified with `C` in the table below.
223+
224+
#### Using negation in filters
225+
Some filters allow prefixing a value (or a comma-separated list (CSV)) with `!`, indicating
226+
that only remediations/exposures that **do not** meet the filter criteria will be returned. This
227+
is identified with `!` in the table below.
228+
219229
#### The `any` limiting property value
220230
Some filters allow the limiting property value to be `any`, indicating that only
221-
`remediation-items` that apply to the specific filter type will be returned. These are part of
231+
remediations/exposures that apply to the specific filter type will be returned. These are part of
222232
the `any` class of filters. E.g. the filter `"s3-bucket:any"` yields only vulnerabilities on
223233
s3-buckets. This is identified with `A` in the table below.
224234
225235
#### The `none` limiting property value
226236
Some filters allow the limiting property value to be `none`, indicating that only
227-
`remediation-items` that do not apply to the specific filter type will be returned. These are
237+
remediations/exposures that do not apply to the specific filter type will be returned. These are
228238
part of the `none` class of filters. E.g. the filter `"cve:none"` yields only exposures whose
229239
vulnerabilities `cve` field isn't set. This is identified with `N` in the table below.
230240
@@ -234,48 +244,42 @@ info:
234244
235245
| Type | Limiting Property | Class<sup>1</sup> | Example | Notes |
236246
|---------------------|-------------------|-------------------|----------|------|
237-
| `acl` | `key` | I | `"acl:/aws/us-east-1/acl/acl-7ada4a1c"` | |
238-
| `application` | `type` | A, R | `"application:any"`, `"application:Apache"` | |
239-
| `asset-group` | `key` | I | `"asset-group:PCI Assets"` | |
240-
| `cloud-trail` | `key` | I | `"cloud-trail:/aws/us-west-2/cloud-trail/trail/Rackspace"` | |
241-
| `cve` | `key` | A, N, R | `"cve:any"`, `"cve:none"`, `"cve:CVE-2013-1937"` | |
242-
| `cwe` | `key` | A, N, R | `"cwe:any"`, `"cwe:none"`, `"cwe:CWE-121"` | |
243-
| `db-instance` | `key` | I | `"db-instance:/aws/us-east-1/db-instance/db-12345678"` | |
244-
| `dns-zone` | `key` | A, I | `"dns-zone:/a/dns-zone/key"` | |
245-
| `deployment` | `key` | A, I | `"deployment:/al/12345678/deployment/aws/00001111-2222-3333-4444-555566667777"` | |
246-
| `host` | `key` | I | `"host:/aws/us-east-1/host/i-1234567890abcdef0"` | |
247-
| `image` | `key` | I, R | `"image:/aws/us-east-1/ami/ami-12345678"` | |
248-
| `instance-profile` | `key` | A, I | `"instance-profile:/an/instance-profile/key"` | |
249-
| `kms-key` | `key` | I | `"kms-key:/aws/us-east-1/kms-key/1"` | |
250-
| `load-balancer` | `key` | I, R | `"load-balancer:/aws/us-east-1/load-balancer/s-12345678"` ||
251-
| `redshift-cluster` | `key` | I | `"redshift-cluster:/aws/us-east-1/redshift-cluster/rc-12345678"` | |
252-
| `remediation` | `remediation_id` | R | `"remediation:00001111-2222-3333-4444-555566667777"` | |
253-
| `region` | `key` | I | `"region:/aws/us-east-1"` | <sup>2</sup> |
254-
| `role` | `key` | A, I | `"role:/a/role/key"` | |
255-
| `route` | `key` | I | `"route:/aws/eu-west-2/route/rtb-0e738966"` | |
256-
| `s3-bucket` | `key` | A, I | `"s3-bucket:any"`, `"s3-bucket:/an/s3-bucket/key"` | |
257-
| `sg` | `key` | I, R | `"sg:/aws/us-east-1/sg/s-12345678"` ||
258-
| `user` | `key` | A, I | `"user:any"`, `"user:/aws/123456789012/user/jdoe"` | |
259-
| `volume` | `key` | I | `"volume:/aws/us-east-1/volume/vol-12345678"` | |
260-
| `vulnerability` | `vulnerability_id`| R | `"vulnerability:09876543210fedcba0987654321fedcba"` | |
261-
| `vulnerability:id` | `vulnerability_id`| R | `"vulnerability:id:09876543210fedcba0987654321fedcba"` | |
262-
| `vulnerability:key` | `key` | R | `"vulnerability:/aws/us-east-1/host/i-1234567890abcdef0/vulnerability/09876543210fedcba0987654321fedcba/tcp/22"` | <sup>3</sup> |
263-
| `vpc` | `key` | R | `"vpc:/aws/us-east-1/vpc/vpc-12345678"` | |
247+
| `acl` | `key` | I | `"acl:/aws/us-east-1/acl/acl-7ada4a1c"` | |
248+
| `application` | `type` | A, R | `"application:any"`, `"application:Apache"` | |
249+
| `asset_type` | `type` | I | `"asset_type:host"` | Applies to the `"type"` of the vulnerable asset. Only one `asset_type` filter of a single asset type is supported in a request. This filter must be present in the exposures query request to be included in the response. |
250+
| `cloud-trail` | `key` | I | `"cloud-trail:/aws/us-west-2/cloud-trail/trail/Rackspace"` | |
251+
| `category` | `categories` | !, C, R | `"category:security"`| Applies to the `"categories"` property of the related vulnerability. |
252+
| `cve` | `cve` | !, A, C, N, R | `"cve:CVE-2013-1937"` | Applies to the `"cve"` property of the related vulnerability.|
253+
| `cwe` | `cwe` | !, A, C, N, R | `"cwe:CWE-121"` | Applies to the `"cwe"` property of the related vulnerability. |
254+
| `db-instance` | `key` | I | `"db-instance:/aws/us-east-1/db-instance/db-12345678"` | |
255+
| `deployment_id` | `deployment_id` | I | `"deployment_id:825283AC-8244-412C-8674-4DBF931E6C16"` | Only one deployment_id filter may be passed per request. |
256+
| `dns-zone` | `key` | A, I | `"dns-zone:/a/dns-zone/key"` | |
257+
| `deployment` | `key` | A, I | `"deployment:/al/12345678/deployment/aws/00001111-2222-3333-4444-555566667777"` | |
258+
| `host` | `key` | I | `"host:/aws/us-east-1/host/i-1234567890abcdef0"` | |
259+
| `image` | `key` | I, R | `"image:/aws/us-east-1/ami/ami-12345678"` | |
260+
| `instance-profile` | `key` | A, I | `"instance-profile:/an/instance-profile/key"` | |
261+
| `kms-key` | `key` | I | `"kms-key:/aws/us-east-1/kms-key/1"` | |
262+
| `load-balancer` | `key` | I, R | `"load-balancer:/aws/us-east-1/load-balancer/s-12345678"` ||
263+
| `redshift-cluster` | `key` | I | `"redshift-cluster:/aws/us-east-1/redshift-cluster/rc-12345678"` | |
264+
| `remediation` | `remediation_id` | !, C, R | `"remediation:00001111-2222-3333-4444-555566667777"` | |
265+
| `region` | `key` | I | `"region:/aws/us-east-1"` | <sup>2</sup> |
266+
| `role` | `key` | A, I | `"role:/a/role/key"` | |
267+
| `route` | `key` | I | `"route:/aws/eu-west-2/route/rtb-0e738966"` | |
268+
| `s3-bucket` | `key` | A, I | `"s3-bucket:any"`, `"s3-bucket:/an/s3-bucket/key"` | |
269+
| `severity` | `severity` | !, C, R | `"severity:high"` | Applies to the `"severity"` property of the related vulnerability. |
270+
| `sg` | `key` | I, R | `"sg:/aws/us-east-1/sg/s-12345678"` | |
271+
| `user` | `key` | A, I | `"user:any"`, `"user:/aws/123456789012/user/jdoe"` | |
272+
| `volume` | `key` | I | `"volume:/aws/us-east-1/volume/vol-12345678"` | |
273+
| `vulnerability` | `vulnerability_id`| !, C, R | `"vulnerability:09876543210fedcba0987654321fedcba"` | |
274+
| `vulnerability:id` | `vulnerability_id`| !, C, R | `"vulnerability:id:09876543210fedcba0987654321fedcba"` | |
275+
| `vulnerability:key` | `key` | !, C, R | `"vulnerability:key:/aws/us-east-1/host/i-1234567890abcdef0/vulnerability/09876543210fedcba0987654321fedcba/tcp/22"` | <sup>3</sup> |
276+
| `vpc` | `key` | R | `"vpc:/aws/us-east-1/vpc/vpc-12345678"` | |
264277
265278
Notes:
266-
1. A = `any` allowed, I = identity, R = relational, N = none.
279+
1. ! = negation allowed, A = `any` allowed, C = CSV allowed, I = identity, R = relational, N = `none` allowed.
267280
2. The region filter will also be relational in the near future.
268281
3. This selects only assets that have the vulnerability specified by the vulnerability key.
269282
This will only ever return a single remediation on a single asset.
270-
271-
#### Additional remediations query filters
272-
273-
| Type | Example | Notes |
274-
|---------------------|---------|-------|
275-
|`deployment_id` | `deployment_id:825283AC-8244-412C-8674-4DBF931E6C16` | |
276-
|`category` | `category:security`, `category:configuration,security`, `category:!security` | |
277-
|`severity` | `severity:high` | |
278-
|`asset_type` | `asset_type:host` | Only one asset_type filter of a single asset type is supported in a request. This filter must be present in the exposures query request to be included in the response. |
279283
paths:
280284
/assets_query/v1/{account_id}/assets:
281285
parameters:

alsdkdefs/apis/assets_query/remediations.v1.yaml

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,25 @@ info:
8282
on the security group with that key and assets within that security group. These classes are
8383
identified with `I` and `R` in the table below.
8484
85+
#### Using CSVs in filters
86+
Some filters allow passing a comma-separated list (CSV) of limiting property values, indicating
87+
that only remediations/exposures that contain **at least one** of the given values will be
88+
returned. This is identified with `C` in the table below.
89+
90+
#### Using negation in filters
91+
Some filters allow prefixing a value (or a comma-separated list (CSV)) with `!`, indicating
92+
that only remediations/exposures that **do not** meet the filter criteria will be returned. This
93+
is identified with `!` in the table below.
94+
8595
#### The `any` limiting property value
8696
Some filters allow the limiting property value to be `any`, indicating that only
87-
`remediation-items` that apply to the specific filter type will be returned. These are part of
97+
remediations/exposures that apply to the specific filter type will be returned. These are part of
8898
the `any` class of filters. E.g. the filter `"s3-bucket:any"` yields only vulnerabilities on
8999
s3-buckets. This is identified with `A` in the table below.
90100
91101
#### The `none` limiting property value
92102
Some filters allow the limiting property value to be `none`, indicating that only
93-
`remediation-items` that do not apply to the specific filter type will be returned. These are
103+
remediations/exposures that do not apply to the specific filter type will be returned. These are
94104
part of the `none` class of filters. E.g. the filter `"cve:none"` yields only exposures whose
95105
vulnerabilities `cve` field isn't set. This is identified with `N` in the table below.
96106
@@ -100,47 +110,42 @@ info:
100110
101111
| Type | Limiting Property | Class<sup>1</sup> | Example | Notes |
102112
|---------------------|-------------------|-------------------|----------|------|
103-
| `acl` | `key` | I | `"acl:/aws/us-east-1/acl/acl-7ada4a1c"` | |
104-
| `application` | `type` | A, R | `"application:any"`, `"application:Apache"` | |
105-
| `cloud-trail` | `key` | I | `"cloud-trail:/aws/us-west-2/cloud-trail/trail/Rackspace"` | |
106-
| `cve` | `key` | A, N, R | `"cve:any"`, `"cve:none"`, `"cve:CVE-2013-1937"` | |
107-
| `cwe` | `key` | A, N, R | `"cwe:any"`, `"cwe:none"`, `"cwe:CWE-121"` | |
108-
| `db-instance` | `key` | I | `"db-instance:/aws/us-east-1/db-instance/db-12345678"` | |
109-
| `dns-zone` | `key` | A, I | `"dns-zone:/a/dns-zone/key"` | |
110-
| `deployment` | `key` | A, I | `"deployment:/al/12345678/deployment/aws/00001111-2222-3333-4444-555566667777"` | |
111-
| `host` | `key` | I | `"host:/aws/us-east-1/host/i-1234567890abcdef0"` | |
112-
| `image` | `key` | I, R | `"image:/aws/us-east-1/ami/ami-12345678"` | |
113-
| `instance-profile` | `key` | A, I | `"instance-profile:/an/instance-profile/key"` | |
114-
| `kms-key` | `key` | I | `"kms-key:/aws/us-east-1/kms-key/1"` | |
115-
| `load-balancer` | `key` | I, R | `"load-balancer:/aws/us-east-1/load-balancer/s-12345678"` ||
116-
| `redshift-cluster` | `key` | I | `"redshift-cluster:/aws/us-east-1/redshift-cluster/rc-12345678"` | |
117-
| `remediation` | `remediation_id` | R | `"remediation:00001111-2222-3333-4444-555566667777"` | |
118-
| `region` | `key` | I | `"region:/aws/us-east-1"` | <sup>2</sup> |
119-
| `role` | `key` | A, I | `"role:/a/role/key"` | |
120-
| `route` | `key` | I | `"route:/aws/eu-west-2/route/rtb-0e738966"` | |
121-
| `s3-bucket` | `key` | A, I | `"s3-bucket:any"`, `"s3-bucket:/an/s3-bucket/key"` | |
122-
| `sg` | `key` | I, R | `"sg:/aws/us-east-1/sg/s-12345678"` ||
123-
| `user` | `key` | A, I | `"user:any"`, `"user:/aws/123456789012/user/jdoe"` | |
124-
| `volume` | `key` | I | `"volume:/aws/us-east-1/volume/vol-12345678"` | |
125-
| `vulnerability` | `vulnerability_id`| R | `"vulnerability:09876543210fedcba0987654321fedcba"` | |
126-
| `vulnerability:id` | `vulnerability_id`| R | `"vulnerability:id:09876543210fedcba0987654321fedcba"` | |
127-
| `vulnerability:key` | `key` | R | `"vulnerability:/aws/us-east-1/host/i-1234567890abcdef0/vulnerability/09876543210fedcba0987654321fedcba/tcp/22"` | <sup>3</sup> |
128-
| `vpc` | `key` | R | `"vpc:/aws/us-east-1/vpc/vpc-12345678"` | |
113+
| `acl` | `key` | I | `"acl:/aws/us-east-1/acl/acl-7ada4a1c"` | |
114+
| `application` | `type` | A, R | `"application:any"`, `"application:Apache"` | |
115+
| `asset_type` | `type` | I | `"asset_type:host"` | Applies to the `"type"` of the vulnerable asset. Only one `asset_type` filter of a single asset type is supported in a request. This filter must be present in the exposures query request to be included in the response. |
116+
| `cloud-trail` | `key` | I | `"cloud-trail:/aws/us-west-2/cloud-trail/trail/Rackspace"` | |
117+
| `category` | `categories` | !, C, R | `"category:security"`| Applies to the `"categories"` property of the related vulnerability. |
118+
| `cve` | `cve` | !, A, C, N, R | `"cve:CVE-2013-1937"` | Applies to the `"cve"` property of the related vulnerability.|
119+
| `cwe` | `cwe` | !, A, C, N, R | `"cwe:CWE-121"` | Applies to the `"cwe"` property of the related vulnerability. |
120+
| `db-instance` | `key` | I | `"db-instance:/aws/us-east-1/db-instance/db-12345678"` | |
121+
| `deployment_id` | `deployment_id` | I | `"deployment_id:825283AC-8244-412C-8674-4DBF931E6C16"` | Only one deployment_id filter may be passed per request. |
122+
| `dns-zone` | `key` | A, I | `"dns-zone:/a/dns-zone/key"` | |
123+
| `deployment` | `key` | A, I | `"deployment:/al/12345678/deployment/aws/00001111-2222-3333-4444-555566667777"` | |
124+
| `host` | `key` | I | `"host:/aws/us-east-1/host/i-1234567890abcdef0"` | |
125+
| `image` | `key` | I, R | `"image:/aws/us-east-1/ami/ami-12345678"` | |
126+
| `instance-profile` | `key` | A, I | `"instance-profile:/an/instance-profile/key"` | |
127+
| `kms-key` | `key` | I | `"kms-key:/aws/us-east-1/kms-key/1"` | |
128+
| `load-balancer` | `key` | I, R | `"load-balancer:/aws/us-east-1/load-balancer/s-12345678"` ||
129+
| `redshift-cluster` | `key` | I | `"redshift-cluster:/aws/us-east-1/redshift-cluster/rc-12345678"` | |
130+
| `remediation` | `remediation_id` | !, C, R | `"remediation:00001111-2222-3333-4444-555566667777"` | |
131+
| `region` | `key` | I | `"region:/aws/us-east-1"` | <sup>2</sup> |
132+
| `role` | `key` | A, I | `"role:/a/role/key"` | |
133+
| `route` | `key` | I | `"route:/aws/eu-west-2/route/rtb-0e738966"` | |
134+
| `s3-bucket` | `key` | A, I | `"s3-bucket:any"`, `"s3-bucket:/an/s3-bucket/key"` | |
135+
| `severity` | `severity` | !, C, R | `"severity:high"` | Applies to the `"severity"` property of the related vulnerability. |
136+
| `sg` | `key` | I, R | `"sg:/aws/us-east-1/sg/s-12345678"` | |
137+
| `user` | `key` | A, I | `"user:any"`, `"user:/aws/123456789012/user/jdoe"` | |
138+
| `volume` | `key` | I | `"volume:/aws/us-east-1/volume/vol-12345678"` | |
139+
| `vulnerability` | `vulnerability_id`| !, C, R | `"vulnerability:09876543210fedcba0987654321fedcba"` | |
140+
| `vulnerability:id` | `vulnerability_id`| !, C, R | `"vulnerability:id:09876543210fedcba0987654321fedcba"` | |
141+
| `vulnerability:key` | `key` | !, C, R | `"vulnerability:key:/aws/us-east-1/host/i-1234567890abcdef0/vulnerability/09876543210fedcba0987654321fedcba/tcp/22"` | <sup>3</sup> |
142+
| `vpc` | `key` | R | `"vpc:/aws/us-east-1/vpc/vpc-12345678"` | |
129143
130144
Notes:
131-
1. A = `any` allowed, I = identity, R = relational, N = none.
145+
1. ! = negation allowed, A = `any` allowed, C = CSV allowed, I = identity, R = relational, N = `none` allowed.
132146
2. The region filter will also be relational in the near future.
133147
3. This selects only assets that have the vulnerability specified by the vulnerability key.
134148
This will only ever return a single remediation on a single asset.
135-
136-
#### Additional remediations query filters
137-
138-
| Type | Example | Notes |
139-
|---------------------|---------|-------|
140-
|`deployment_id` | `deployment_id:825283AC-8244-412C-8674-4DBF931E6C16` | |
141-
|`category` | `category:security`, `category:configuration,security`, `category:!security` | |
142-
|`severity` | `severity:high` | |
143-
|`asset_type` | `asset_type:host` | Only one asset_type filter of a single asset type is supported in a request. This filter must be present in the exposures query request to be included in the response. |
144149
paths:
145150
############################## COLLECTION HEALTH ##############################
146151

0 commit comments

Comments
 (0)