diff --git a/alsdkdefs/apis/remediations/assets_query.v1.yaml b/alsdkdefs/apis/remediations/assets_query.v1.yaml index abeb328..8c7a65e 100644 --- a/alsdkdefs/apis/remediations/assets_query.v1.yaml +++ b/alsdkdefs/apis/remediations/assets_query.v1.yaml @@ -1656,6 +1656,7 @@ paths: - $ref: 'parameters.yaml#/ParamIncludeFilters' - $ref: 'parameters.yaml#/ParamIncludeRemediations' - $ref: 'parameters.yaml#/ParamIncludeRemediationItems' + - $ref: 'parameters.yaml#/ParamIncludeSummary' - $ref: 'parameters.yaml#/ParamLimit' - $ref: 'parameters.yaml#/ParamScopeTrue' - $ref: 'parameters.yaml#/ParamSort' @@ -1792,6 +1793,8 @@ paths: $ref: parameters.yaml#/IncludeRemediations include_remediation_items: $ref: parameters.yaml#/IncludeRemediationItems + include_summary: + $ref: parameters.yaml#/IncludeSummary limit: $ref: parameters.yaml#/ExposuresLimit scope: @@ -1921,7 +1924,7 @@ paths: schema: $ref: schemas.yaml#/QueryExposuresResponse examples: - 'Exposures (include_filters=false, include_exposures=false)': + 'Exposures (include_filters=false, include_exposures=false, include_summary=false)': $ref: examples.yaml#/QueryExposuresExample 'Exposures for whole account (details=true, include_filters=true)': $ref: examples.yaml#/QueryExposuresWholeAccountExample @@ -1951,6 +1954,61 @@ paths: $ref: responses.yaml#/NotFound '503': $ref: responses.yaml#/UnavailableError + + /assets_query/v2/{account_id}/exposure-filters: + parameters: + - $ref: 'parameters.yaml#/UrlParamAccountId' + get: + operationId: query_exposure_filters + summary: Query Exposure Filters + description: |- + Groups vulnerabilities for an account by exposure or remediation, then returns filters. + Only returns five filter properties if available: `deployment_id`, `deployment_name`, `key`, `name` and `type`. + + Exposure Filters can be reduced using the `filter` parameter in the query string. The `filter` param + can be used multiple times and filters supplied will limit the returned filters to those related to vulnerabilities + that match all supplied filters. The [remediation filters](#section/Remediation-filters) documented in the Usage + section are allowed. + tags: + - Exposures and Remediations + parameters: + - $ref: 'parameters.yaml#/ParamQueryExposuresFilter' + x-codeSamples: + - lang: Shell + label: Basic exposure-filters query + source: |- + curl "https://api.cloudinsight.alertlogic.com/assets_query/v2/12345678/exposure-filters" \ + -H "x-aims-auth-token: $TOKEN" -H "accept: application/json" + - lang: Shell + label: Exposure Filters with include_filter false + source: |- + curl "https://api.cloudinsight.alertlogic.com/assets_query/v2/12345678/exposure-filters?include_filters=false" \ + -H "x-aims-auth-token: $TOKEN" -H "accept: application/json" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: 'schemas.yaml#/QueryExposureFiltersResponse' + examples: + Exposure filters: + $ref: 'examples.yaml#/QueryExposureFiltersExample' + Exposures for whole account (include_filters=false): + $ref: 'examples.yaml#/QueryExposureFiltersExample' + "400": + $ref: 'responses.yaml#/InvalidValueError' + "401": + $ref: 'responses.yaml#/Unauthorized' + "403": + $ref: 'responses.yaml#/Forbidden' + "404": + $ref: 'responses.yaml#/NotFound' + "503": + $ref: 'responses.yaml#/UnavailableError' + security: + - x-aims-auth-token: [ ] + /assets_query/v2/{account_id}/remediation-items: parameters: - $ref: 'parameters.yaml#/UrlParamAccountId' diff --git a/alsdkdefs/apis/remediations/examples.yaml b/alsdkdefs/apis/remediations/examples.yaml index aa71310..972d373 100644 --- a/alsdkdefs/apis/remediations/examples.yaml +++ b/alsdkdefs/apis/remediations/examples.yaml @@ -2652,15 +2652,9 @@ QueryExposuresExample: filters: [] exposures: assets: [] - rows: 1 + rows: 0 exposures_count: 0 - summary: - severities: - all: 1 - high: 1 - info: 0 - low: 0 - medium: 0 + summary: {} QueryExposuresWholeAccountExample: value: filters: @@ -3365,6 +3359,20 @@ QueryExposuresMostVulnerableAssetsExample: info: 0 low: 0 medium: 0 +QueryExposureFiltersExample: + value: + filters: + - key: security + type: category + - deployment_id: 814C2911-09BB-1005-9916-7831C1BAC182 + deployment_name: Test Deployment 1 + key: 814C2911-09BB-1005-9916-7831C1BAC182 + name: Test Deployment 1 + type: deployment_id + - key: aws + type: deployment_type + - key: high + type: severity QueryTopologyExample: value: topology: diff --git a/alsdkdefs/apis/remediations/parameters.yaml b/alsdkdefs/apis/remediations/parameters.yaml index d2bdb1c..0121803 100644 --- a/alsdkdefs/apis/remediations/parameters.yaml +++ b/alsdkdefs/apis/remediations/parameters.yaml @@ -425,6 +425,15 @@ IncludeRemediationItems: type: boolean default: false description: Controls whether `remediation_items` are returned in the response body. +ParamIncludeSummary: + schema: + $ref: '#/IncludeSummary' + in: query + name: include_summary +IncludeSummary: + type: boolean + default: true + description: Controls whether `summary` is returned in the response body. ParamIncludeExposures: schema: $ref: '#/IncludeExposures' diff --git a/alsdkdefs/apis/remediations/schemas.yaml b/alsdkdefs/apis/remediations/schemas.yaml index 8c9d128..c4328e9 100644 --- a/alsdkdefs/apis/remediations/schemas.yaml +++ b/alsdkdefs/apis/remediations/schemas.yaml @@ -381,6 +381,15 @@ QueryExposuresResponse: type: integer medium: type: integer +QueryExposureFiltersResponse: + title: Query exposure filters response + type: object + properties: + filters: + type: array + items: + type: object + description: Filter item. QueryRemediationItemsResponse: title: Query remediation-items response type: object