From 0286e3d9a02a584554b008d56659e7f9f7d896ec Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 16 Oct 2025 10:05:38 +0000 Subject: [PATCH] Regenerate client from commit 0050b10 of spec repo --- .generator/schemas/v2/openapi.yaml | 671 ++++++++++++------ .../frozen.json | 1 + .../recording.har | 65 ++ .../frozen.json | 1 + .../recording.har | 57 ++ .../frozen.json | 2 +- .../recording.har | 16 +- .../frozen.json | 2 +- .../recording.har | 12 +- features/v2/security_monitoring.feature | 23 + features/v2/undo.json | 18 +- .../src/support/scenarios_model_mapping.ts | 159 +++-- .../src/v2/SecurityMonitoringApi.ts | 314 +++++++- services/security_monitoring/src/v2/index.ts | 9 + .../src/v2/models/CloudAssetType.ts | 13 + .../src/v2/models/SBOMFormat.ts | 8 + .../src/v2/models/ScannedAssetMetadata.ts | 56 ++ .../v2/models/ScannedAssetMetadataAsset.ts | 56 ++ .../models/ScannedAssetMetadataAttributes.ts | 66 ++ .../models/ScannedAssetMetadataLastSuccess.ts | 61 ++ .../src/v2/models/ScannedAssetsMetadata.ts | 65 ++ .../src/v2/models/TypingInfo.ts | 14 + .../src/v2/models/VulnerabilityAdvisory.ts | 61 ++ .../src/v2/models/VulnerabilityAttributes.ts | 9 + 24 files changed, 1459 insertions(+), 300 deletions(-) create mode 100644 cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-Not-found-asset-not-found-response_329653307/frozen.json create mode 100644 cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-Not-found-asset-not-found-response_329653307/recording.har create mode 100644 cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-OK-response_1499793689/frozen.json create mode 100644 cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-OK-response_1499793689/recording.har create mode 100644 services/security_monitoring/src/v2/models/CloudAssetType.ts create mode 100644 services/security_monitoring/src/v2/models/SBOMFormat.ts create mode 100644 services/security_monitoring/src/v2/models/ScannedAssetMetadata.ts create mode 100644 services/security_monitoring/src/v2/models/ScannedAssetMetadataAsset.ts create mode 100644 services/security_monitoring/src/v2/models/ScannedAssetMetadataAttributes.ts create mode 100644 services/security_monitoring/src/v2/models/ScannedAssetMetadataLastSuccess.ts create mode 100644 services/security_monitoring/src/v2/models/ScannedAssetsMetadata.ts create mode 100644 services/security_monitoring/src/v2/models/VulnerabilityAdvisory.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9f43840f7549..0d0a0d67f3d2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9188,6 +9188,18 @@ components: required: - type type: object + CloudAssetType: + description: The cloud asset type + enum: + - Host + - HostImage + - Image + example: Host + type: string + x-enum-varnames: + - HOST + - HOST_IMAGE + - IMAGE CloudConfigurationComplianceRuleOptions: additionalProperties: {} description: 'Options for cloud_configuration rules. @@ -41130,6 +41142,16 @@ components: - MACHINE_LEARNING_MODEL - OPERATING_SYSTEM - PLATFORM + SBOMFormat: + description: The SBOM standard + enum: + - CycloneDX + - SPDX + example: CycloneDX + type: string + x-enum-varnames: + - CYCLONEDX + - SPDX SBOMMetadata: description: Provides additional information about a BOM. properties: @@ -41395,6 +41417,86 @@ components: type: $ref: '#/components/schemas/ScalarFormulaResponseType' type: object + ScannedAssetMetadata: + description: The metadata of a scanned asset. + properties: + attributes: + $ref: '#/components/schemas/ScannedAssetMetadataAttributes' + id: + description: The ID of the scanned asset metadata. + example: Host|i-0fc7edef1ab26d7ef + type: string + required: + - id + - attributes + type: object + ScannedAssetMetadataAsset: + description: The asset of a scanned asset metadata. + properties: + name: + description: The name of the asset. + example: i-0fc7edef1ab26d7ef + type: string + type: + $ref: '#/components/schemas/CloudAssetType' + required: + - type + - name + type: object + ScannedAssetMetadataAttributes: + description: The attributes of a scanned asset metadata. + properties: + asset: + $ref: '#/components/schemas/ScannedAssetMetadataAsset' + first_success_timestamp: + description: The timestamp when the scan of the asset was performed for + the first time. + example: '2025-07-08T07:24:53Z' + type: string + last_success: + $ref: '#/components/schemas/ScannedAssetMetadataLastSuccess' + required: + - asset + - last_success + - first_success_timestamp + type: object + ScannedAssetMetadataLastSuccess: + description: Metadata for the last successful scan of an asset. + properties: + env: + description: The environment of the last success scan of the asset. + example: prod + type: string + origin: + description: The list of origins of the last success scan of the asset. + example: + - production + items: + example: production + type: string + type: array + timestamp: + description: The timestamp of the last success scan of the asset. + example: '2025-07-08T07:24:53Z' + type: string + required: + - timestamp + type: object + ScannedAssetsMetadata: + description: The expected response schema when listing scanned assets metadata. + properties: + data: + description: List of scanned assets metadata. + items: + $ref: '#/components/schemas/ScannedAssetMetadata' + type: array + links: + $ref: '#/components/schemas/Links' + meta: + $ref: '#/components/schemas/Metadata' + required: + - data + type: object Schedule: description: Top-level container for a schedule object, including both the `data` payload and any related `included` resources (such as teams, layers, or members). @@ -51590,9 +51692,29 @@ components: - attributes - relationships type: object + VulnerabilityAdvisory: + description: Advisory associated with the vulnerability. + properties: + id: + description: Vulnerability advisory ID. + example: TRIVY-CVE-2023-0615 + type: string + last_modification_date: + description: Vulnerability advisory last modification date. + example: 2024-09-19 21:23:08+00:00 + type: string + publish_date: + description: Vulnerability advisory publish date. + example: 2024-09-19 21:23:08+00:00 + type: string + required: + - id + type: object VulnerabilityAttributes: description: The JSON:API attributes of the vulnerability. properties: + advisory: + $ref: '#/components/schemas/VulnerabilityAdvisory' advisory_id: description: Vulnerability advisory ID. example: TRIVY-CVE-2023-0615 @@ -71238,194 +71360,6 @@ paths: x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - /api/v2/security/assets: - get: - description: 'Get a list of vulnerable assets. - - - ### Pagination - - - Please review the [Pagination section for the "List Vulnerabilities"](#pagination) - endpoint. - - - ### Filtering - - - Please review the [Filtering section for the "List Vulnerabilities"](#filtering) - endpoint. - - - ### Metadata - - - Please review the [Metadata section for the "List Vulnerabilities"](#metadata) - endpoint.' - operationId: ListVulnerableAssets - parameters: - - description: Its value must come from the `links` section of the response - of the first request. Do not manually edit it. - example: b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 - in: query - name: page[token] - required: false - schema: - type: string - - description: The page number to be retrieved. It should be equal or greater - than `1` - example: 1 - in: query - name: page[number] - required: false - schema: - format: int64 - minimum: 1 - type: integer - - description: Filter by name. - example: datadog-agent - in: query - name: filter[name] - required: false - schema: - type: string - - description: Filter by type. - example: Host - in: query - name: filter[type] - required: false - schema: - $ref: '#/components/schemas/AssetType' - - description: Filter by the first version of the asset since it has been vulnerable. - example: v1.15.1 - in: query - name: filter[version.first] - required: false - schema: - type: string - - description: Filter by the last detected version of the asset. - example: v1.15.1 - in: query - name: filter[version.last] - required: false - schema: - type: string - - description: Filter by the repository url associated to the asset. - example: github.com/DataDog/datadog-agent.git - in: query - name: filter[repository_url] - required: false - schema: - type: string - - description: Filter whether the asset is in production or not. - example: false - in: query - name: filter[risks.in_production] - required: false - schema: - type: boolean - - description: Filter whether the asset (Service) is under attack or not. - example: false - in: query - name: filter[risks.under_attack] - required: false - schema: - type: boolean - - description: Filter whether the asset (Host) is publicly accessible or not. - example: false - in: query - name: filter[risks.is_publicly_accessible] - required: false - schema: - type: boolean - - description: Filter whether the asset (Host) has privileged access or not. - example: false - in: query - name: filter[risks.has_privileged_access] - required: false - schema: - type: boolean - - description: Filter whether the asset (Host) has access to sensitive data - or not. - example: false - in: query - name: filter[risks.has_access_to_sensitive_data] - required: false - schema: - type: boolean - - description: Filter by environment. - example: staging - in: query - name: filter[environments] - required: false - schema: - type: string - - description: Filter by teams. - example: compute - in: query - name: filter[teams] - required: false - schema: - type: string - - description: Filter by architecture. - example: arm64 - in: query - name: filter[arch] - required: false - schema: - type: string - - description: Filter by operating system name. - example: ubuntu - in: query - name: filter[operating_system.name] - required: false - schema: - type: string - - description: Filter by operating system version. - example: '24.04' - in: query - name: filter[operating_system.version] - required: false - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListVulnerableAssetsResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: 'Bad request: The server cannot process the request due to - invalid syntax in the request.' - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: 'Forbidden: Access denied' - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: 'Not found: There is no request associated with the provided - token.' - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: List vulnerable assets - tags: - - Security Monitoring - x-unstable: '**Note**: This endpoint is a private preview. - - If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' /api/v2/security/cloud_workload/policy/download: get: description: 'The download endpoint generates a Workload Protection policy file @@ -71610,6 +71544,13 @@ paths: required: false schema: type: string + - description: The standard of the SBOM. + example: CycloneDX + in: query + name: ext:format + required: false + schema: + $ref: '#/components/schemas/SBOMFormat' responses: '200': content: @@ -71647,6 +71588,120 @@ paths: x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' + /api/v2/security/scanned-assets-metadata: + get: + description: "Get a list of security scanned assets metadata for an organization.\n\n### + Pagination\n\nFor the \"List Vulnerabilities\" endpoint, see the [Pagination + section](#pagination).\n\n### Filtering\n\nFor the \"List Vulnerabilities\" + endpoint, see the [Filtering section](#filtering).\n\n### Metadata\n\n For + the \"List Vulnerabilities\" endpoint, see the [Metadata section](#metadata).\n\n### + Related endpoints\n\nThis endpoint returns additional metadata for cloud resources + that is not available from the standard resource endpoints. To access a richer + dataset, call this endpoint together with the relevant resource endpoint(s) + and merge (join) their results using the resource identifier.\n\n**Hosts**\n\nTo + enrich host data, join the response from the [Hosts](https://docs.datadoghq.com/api/latest/hosts/) + endpoint with the response from the scanned-assets-metadata endpoint on the + following key fields:\n\n| ENDPOINT | JOIN KEY | TYPE |\n| --- | --- | --- + |\n| [/api/v1/hosts](https://docs.datadoghq.com/api/latest/hosts/) | host_list.host_name + | string |\n| /api/v2/security/scanned-assets-metadata | data.attributes.asset.name + | string |\n\n**Host Images**\n\nTo enrich host image data, join the response + from the [Hosts](https://docs.datadoghq.com/api/latest/hosts/) endpoint with + the response from the scanned-assets-metadata endpoint on the following key + fields:\n\n| ENDPOINT | JOIN KEY | TYPE |\n| --- | --- | --- |\n| [/api/v1/hosts](https://docs.datadoghq.com/api/latest/hosts/) + | host_list.tags_by_source[\"Amazon Web Services\"][\"image\"] | string |\n| + /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string + |\n\n**Container Images**\n\nTo enrich container image data, join the response + from the [Container Images](https://docs.datadoghq.com/api/latest/container-images/) + endpoint with the response from the scanned-assets-metadata endpoint on the + following key fields:\n\n| ENDPOINT | JOIN KEY | TYPE |\n| --- | --- | --- + |\n| [/api/v2/container_images](https://docs.datadoghq.com/api/latest/container-images/) + | `data.attributes.name`@`data.attributes.repo_digest` | string |\n| /api/v2/security/scanned-assets-metadata + | data.attributes.asset.name | string |" + operationId: ListScannedAssetsMetadata + parameters: + - description: Its value must come from the `links` section of the response + of the first request. Do not manually edit it. + example: b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 + in: query + name: page[token] + required: false + schema: + type: string + - description: The page number to be retrieved. It should be equal to or greater + than 1. + example: 1 + in: query + name: page[number] + required: false + schema: + format: int64 + minimum: 1 + type: integer + - description: The type of the scanned asset. + example: Host + in: query + name: filter[asset.type] + required: false + schema: + $ref: '#/components/schemas/CloudAssetType' + - description: The name of the scanned asset. + example: i-0fc7edef1ab26d7ef + in: query + name: filter[asset.name] + required: false + schema: + type: string + - description: The origin of last success scan. + example: agent + in: query + name: filter[last_success.origin] + required: false + schema: + type: string + - description: The environment of last success scan. + example: prod + in: query + name: filter[last_success.env] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ScannedAssetsMetadata' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Bad request: The server cannot process the request due to + invalid syntax in the request.' + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Forbidden: Access denied' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Not found: asset not found' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List scanned assets metadata + tags: + - Security Monitoring + x-unstable: '**Note**: This endpoint is a private preview. + + If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' /api/v2/security/signals/notification_rules: get: description: Returns the list of notification rules for security signals. @@ -71837,27 +71892,34 @@ paths: consider a request to be the first request when there is no `page[token]` parameter.\n\nThe response of this first request contains the newly created token in the `links` section.\n\nThis token can then be used in the subsequent - paginated requests.\n\n#### Subsequent requests\n\nAny request containing + paginated requests.\n\n*Note: The first request may take longer to complete + than subsequent requests.*\n\n#### Subsequent requests\n\nAny request containing valid `page[token]` and `page[number]` parameters will be considered a subsequent request.\n\nIf the `token` is invalid, a `404` response will be returned.\n\nIf - the page `number` is invalid, a `400` response will be returned.\n\n### Filtering\n\nThe - request can include some filter parameters to filter the data to be retrieved. - The format of the filter parameters follows the [JSON:API format](https://jsonapi.org/format/#fetching-filtering): - `filter[$prop_name]`, where `prop_name` is the property name in the entity - being filtered by.\n\nAll filters can include multiple values, where data - will be filtered with an OR clause: `filter[title]=Title1,Title2` will filter - all vulnerabilities where title is equal to `Title1` OR `Title2`.\n\nString - filters are case sensitive.\n\nBoolean filters accept `true` or `false` as - values.\n\nNumber filters must include an operator as a second filter input: - `filter[$prop_name][$operator]`. For example, for the vulnerabilities endpoint: - `filter[cvss.base.score][lte]=8`.\n\nAvailable operators are: `eq` (==), `lt` - (<), `lte` (<=), `gt` (>) and `gte` (>=).\n\n### Metadata\n\nFollowing [JSON:API - format](https://jsonapi.org/format/#document-meta), object including non-standard - meta-information.\n\nThis endpoint includes the meta member in the response. - For more details on each of the properties included in this section, check - the endpoints response tables.\n\n```JSON\n{\n \"data\": [...],\n \"meta\": - {\n \"total\": 1500,\n \"count\": 18732,\n \"token\": \"some_token\"\n - \ },\n \"links\": {...}\n}\n```" + the page `number` is invalid, a `400` response will be returned.\n\nThe returned + `token` is valid for all requests in the pagination sequence. To send paginated + requests in parallel, reuse the same `token` and change only the `page[number]` + parameter.\n\n### Filtering\n\nThe request can include some filter parameters + to filter the data to be retrieved. The format of the filter parameters follows + the [JSON:API format](https://jsonapi.org/format/#fetching-filtering): `filter[$prop_name]`, + where `prop_name` is the property name in the entity being filtered by.\n\nAll + filters can include multiple values, where data will be filtered with an OR + clause: `filter[title]=Title1,Title2` will filter all vulnerabilities where + title is equal to `Title1` OR `Title2`.\n\nString filters are case sensitive.\n\nBoolean + filters accept `true` or `false` as values.\n\nNumber filters must include + an operator as a second filter input: `filter[$prop_name][$operator]`. For + example, for the vulnerabilities endpoint: `filter[cvss.base.score][lte]=8`.\n\nAvailable + operators are: `eq` (==), `lt` (<), `lte` (<=), `gt` (>) and `gte` (>=).\n\n### + Metadata\n\nFollowing [JSON:API format](https://jsonapi.org/format/#document-meta), + object including non-standard meta-information.\n\nThis endpoint includes + the meta member in the response. For more details on each of the properties + included in this section, check the endpoints response tables.\n\n```JSON\n{\n + \ \"data\": [...],\n \"meta\": {\n \"total\": 1500,\n \"count\": 18732,\n + \ \"token\": \"some_token\"\n },\n \"links\": {...}\n}\n```\n### Extensions\n\nRequests + may include extensions to modify the behavior of the requested endpoint. The + filter parameters follow the [JSON:API format](https://jsonapi.org/extensions/#extensions) + format: `ext:$extension_name`, where `extension_name` is the name of the modifier + that is being applied.\n\nExtensions can only include one value: `ext:modifier=value`." operationId: ListVulnerabilities parameters: - description: Its value must come from the `links` section of the response @@ -71963,9 +72025,9 @@ paths: schema: type: string - description: Filter by advisory ID. - example: TRIVY-CVE-2023-0615 + example: CVE-2023-0615 in: query - name: filter[advisory_id] + name: filter[advisory.id] required: false schema: type: string @@ -72065,7 +72127,8 @@ paths: required: false schema: type: string - - description: Filter by asset name. + - description: Filter by asset name. This field supports the usage of wildcards + (*). example: datadog-agent in: query name: filter[asset.name] @@ -72380,6 +72443,194 @@ paths: operator: OR permissions: - security_monitoring_notification_profiles_write + /api/v2/security/vulnerable-assets: + get: + description: 'Get a list of vulnerable assets. + + + ### Pagination + + + Please review the [Pagination section for the "List Vulnerabilities"](#pagination) + endpoint. + + + ### Filtering + + + Please review the [Filtering section for the "List Vulnerabilities"](#filtering) + endpoint. + + + ### Metadata + + + Please review the [Metadata section for the "List Vulnerabilities"](#metadata) + endpoint.' + operationId: ListVulnerableAssets + parameters: + - description: Its value must come from the `links` section of the response + of the first request. Do not manually edit it. + example: b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 + in: query + name: page[token] + required: false + schema: + type: string + - description: The page number to be retrieved. It should be equal or greater + than `1` + example: 1 + in: query + name: page[number] + required: false + schema: + format: int64 + minimum: 1 + type: integer + - description: Filter by name. This field supports the usage of wildcards (*). + example: datadog-agent + in: query + name: filter[name] + required: false + schema: + type: string + - description: Filter by type. + example: Host + in: query + name: filter[type] + required: false + schema: + $ref: '#/components/schemas/AssetType' + - description: Filter by the first version of the asset since it has been vulnerable. + example: v1.15.1 + in: query + name: filter[version.first] + required: false + schema: + type: string + - description: Filter by the last detected version of the asset. + example: v1.15.1 + in: query + name: filter[version.last] + required: false + schema: + type: string + - description: Filter by the repository url associated to the asset. + example: github.com/DataDog/datadog-agent.git + in: query + name: filter[repository_url] + required: false + schema: + type: string + - description: Filter whether the asset is in production or not. + example: false + in: query + name: filter[risks.in_production] + required: false + schema: + type: boolean + - description: Filter whether the asset (Service) is under attack or not. + example: false + in: query + name: filter[risks.under_attack] + required: false + schema: + type: boolean + - description: Filter whether the asset (Host) is publicly accessible or not. + example: false + in: query + name: filter[risks.is_publicly_accessible] + required: false + schema: + type: boolean + - description: Filter whether the asset (Host) has privileged access or not. + example: false + in: query + name: filter[risks.has_privileged_access] + required: false + schema: + type: boolean + - description: Filter whether the asset (Host) has access to sensitive data + or not. + example: false + in: query + name: filter[risks.has_access_to_sensitive_data] + required: false + schema: + type: boolean + - description: Filter by environment. + example: staging + in: query + name: filter[environments] + required: false + schema: + type: string + - description: Filter by teams. + example: compute + in: query + name: filter[teams] + required: false + schema: + type: string + - description: Filter by architecture. + example: arm64 + in: query + name: filter[arch] + required: false + schema: + type: string + - description: Filter by operating system name. + example: ubuntu + in: query + name: filter[operating_system.name] + required: false + schema: + type: string + - description: Filter by operating system version. + example: '24.04' + in: query + name: filter[operating_system.version] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListVulnerableAssetsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Bad request: The server cannot process the request due to + invalid syntax in the request.' + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Forbidden: Access denied' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Not found: There is no request associated with the provided + token.' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List vulnerable assets + tags: + - Security Monitoring + x-unstable: '**Note**: This endpoint is a private preview. + + If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' /api/v2/security_monitoring/cloud_workload_security/agent_rules: get: description: 'Get the list of agent rules. diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-Not-found-asset-not-found-response_329653307/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-Not-found-asset-not-found-response_329653307/frozen.json new file mode 100644 index 000000000000..6b4166381cce --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-Not-found-asset-not-found-response_329653307/frozen.json @@ -0,0 +1 @@ +"2025-10-15T08:41:14.545Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-Not-found-asset-not-found-response_329653307/recording.har b/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-Not-found-asset-not-found-response_329653307/recording.har new file mode 100644 index 000000000000..48b192320506 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-Not-found-asset-not-found-response_329653307/recording.har @@ -0,0 +1,65 @@ +{ + "log": { + "_recordingName": "Security Monitoring/List scanned assets metadata returns \"Not found: asset not found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "62e254343c98aa74afed678d589a7636", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 581, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "page", + "value": { + "number": "1", + "token": "unknown" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/security/scanned-assets-metadata?page%5Btoken%5D=unknown&page%5Bnumber%5D=1" + }, + "response": { + "bodySize": 65, + "content": { + "mimeType": "application/vnd.api+json", + "size": 65, + "text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Unexpected internal error\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 660, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-10-15T08:41:14.549Z", + "time": 450 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-OK-response_1499793689/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-OK-response_1499793689/frozen.json new file mode 100644 index 000000000000..577c05104420 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-OK-response_1499793689/frozen.json @@ -0,0 +1 @@ +"2025-10-15T08:42:14.735Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-OK-response_1499793689/recording.har b/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-OK-response_1499793689/recording.har new file mode 100644 index 000000000000..5e4a2db6165d --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-scanned-assets-metadata-returns-OK-response_1499793689/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Security Monitoring/List scanned assets metadata returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "df97e37bed679b44c3310ea3c5e9a0bf", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 538, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security/scanned-assets-metadata" + }, + "response": { + "bodySize": 11, + "content": { + "mimeType": "application/vnd.api+json", + "size": 11, + "text": "{\"data\":[]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 660, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-15T08:42:14.739Z", + "time": 651 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/frozen.json index e7454cd11d61..04afe0d2e6e8 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/frozen.json @@ -1 +1 @@ -"2025-01-31T12:04:52.159Z" +"2025-10-14T13:43:32.350Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/recording.har b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/recording.har index b63d1334854f..2b9324c34623 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "c6d229b3cd796e5e593c6ebc987186ec", + "_id": "9910b6cc2c33c0371794ef62062d3ec2", "_order": 0, "cache": {}, "request": { @@ -21,7 +21,7 @@ "value": "application/json" } ], - "headersSize": 559, + "headersSize": 568, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -33,14 +33,14 @@ } } ], - "url": "https://api.datadoghq.com/api/v2/security/assets?page%5Btoken%5D=unknown&page%5Bnumber%5D=1" + "url": "https://api.datadoghq.com/api/v2/security/vulnerable-assets?page%5Btoken%5D=unknown&page%5Bnumber%5D=1" }, "response": { - "bodySize": 131, + "bodySize": 65, "content": { "mimeType": "application/vnd.api+json", - "size": 131, - "text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"rpc error: code = Internal desc = no cached result set found for queryID: unknown\"}]}" + "size": 65, + "text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Unexpected internal error\"}]}" }, "cookies": [], "headers": [ @@ -55,8 +55,8 @@ "status": 404, "statusText": "Not Found" }, - "startedDateTime": "2025-01-31T12:04:52.166Z", - "time": 470 + "startedDateTime": "2025-10-14T13:43:32.354Z", + "time": 514 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/frozen.json index 8b95175310ae..8462f96426f0 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/frozen.json @@ -1 +1 @@ -"2025-01-31T12:05:04.773Z" +"2025-10-14T13:43:52.800Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/recording.har b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/recording.har index 56586af2b576..062783ec27ef 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "8b691c923faa0d44ea73715eceb660c3", + "_id": "e8a64c256dc34b4416b3c26a580df140", "_order": 0, "cache": {}, "request": { @@ -21,7 +21,7 @@ "value": "application/json" } ], - "headersSize": 631, + "headersSize": 642, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -34,7 +34,7 @@ } } ], - "url": "https://api.datadoghq.com/api/v2/security/assets?filter%5Btype%5D=Host&filter%5Brepository_url%5D=github.com%2Fdatadog%2Fdd-go&filter%5Brisks.in_production%5D=true" + "url": "https://api.datadoghq.com/api/v2/security/vulnerable-assets?filter%5Btype%5D=Host&filter%5Brepository_url%5D=github.com%2Fdatadog%2Fdd-go&filter%5Brisks.in_production%5D=true" }, "response": { "bodySize": 11, @@ -50,14 +50,14 @@ "value": "application/vnd.api+json" } ], - "headersSize": 660, + "headersSize": 659, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2025-01-31T12:05:04.782Z", - "time": 613 + "startedDateTime": "2025-10-14T13:43:52.805Z", + "time": 851 } ], "pages": [], diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index c83348e68981..8e5e22baade8 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -1065,6 +1065,29 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/asm-vm + Scenario: List scanned assets metadata returns "Bad request: The server cannot process the request due to invalid syntax in the request." response + Given operation "ListScannedAssetsMetadata" enabled + And new "ListScannedAssetsMetadata" request + When the request is sent + Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. + + @team:DataDog/asm-vm + Scenario: List scanned assets metadata returns "Not found: asset not found" response + Given operation "ListScannedAssetsMetadata" enabled + And new "ListScannedAssetsMetadata" request + And request contains "page[token]" parameter with value "unknown" + And request contains "page[number]" parameter with value 1 + When the request is sent + Then the response status is 404 Not found: asset not found + + @team:DataDog/asm-vm + Scenario: List scanned assets metadata returns "OK" response + Given operation "ListScannedAssetsMetadata" enabled + And new "ListScannedAssetsMetadata" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/asm-vm Scenario: List vulnerabilities returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListVulnerabilities" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 76bc60f80eba..6e05ad8acd50 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3223,12 +3223,6 @@ "type": "idempotent" } }, - "ListVulnerableAssets": { - "tag": "Security Monitoring", - "undo": { - "type": "safe" - } - }, "DownloadCloudWorkloadPolicyFile": { "tag": "CSM Threats", "undo": { @@ -3247,6 +3241,12 @@ "type": "safe" } }, + "ListScannedAssetsMetadata": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "GetSignalNotificationRules": { "tag": "Security Monitoring", "undo": { @@ -3327,6 +3327,12 @@ "type": "idempotent" } }, + "ListVulnerableAssets": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListCloudWorkloadSecurityAgentRules": { "tag": "CSM Threats", "undo": { diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 7d2211f34a86..79567a35d8fb 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -3656,7 +3656,7 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "GetFindingResponse", }, - "SecurityMonitoringApi.V2.ListVulnerableAssets": { + "SecurityMonitoringApi.V2.ListAssetsSBOMs": { pageToken: { type: "string", format: "", @@ -3665,69 +3665,52 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { type: "number", format: "int64", }, - filterName: { - type: "string", - format: "", - }, - filterType: { + filterAssetType: { type: "AssetType", format: "", }, - filterVersionFirst: { + filterAssetName: { type: "string", format: "", }, - filterVersionLast: { + filterPackageName: { type: "string", format: "", }, - filterRepositoryUrl: { + filterPackageVersion: { type: "string", format: "", }, - filterRisksInProduction: { - type: "boolean", - format: "", - }, - filterRisksUnderAttack: { - type: "boolean", - format: "", - }, - filterRisksIsPubliclyAccessible: { - type: "boolean", - format: "", - }, - filterRisksHasPrivilegedAccess: { - type: "boolean", - format: "", - }, - filterRisksHasAccessToSensitiveData: { - type: "boolean", + filterLicenseName: { + type: "string", format: "", }, - filterEnvironments: { - type: "string", + filterLicenseType: { + type: "SBOMComponentLicenseType", format: "", }, - filterTeams: { - type: "string", + operationResponseType: "ListAssetsSBOMsResponse", + }, + "SecurityMonitoringApi.V2.GetSBOM": { + assetType: { + type: "AssetType", format: "", }, - filterArch: { + filterAssetName: { type: "string", format: "", }, - filterOperatingSystemName: { + filterRepoDigest: { type: "string", format: "", }, - filterOperatingSystemVersion: { - type: "string", + extFormat: { + type: "SBOMFormat", format: "", }, - operationResponseType: "ListVulnerableAssetsResponse", + operationResponseType: "GetSBOMResponse", }, - "SecurityMonitoringApi.V2.ListAssetsSBOMs": { + "SecurityMonitoringApi.V2.ListScannedAssetsMetadata": { pageToken: { type: "string", format: "", @@ -3737,45 +3720,22 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { format: "int64", }, filterAssetType: { - type: "AssetType", + type: "CloudAssetType", format: "", }, filterAssetName: { type: "string", format: "", }, - filterPackageName: { - type: "string", - format: "", - }, - filterPackageVersion: { - type: "string", - format: "", - }, - filterLicenseName: { - type: "string", - format: "", - }, - filterLicenseType: { - type: "SBOMComponentLicenseType", - format: "", - }, - operationResponseType: "ListAssetsSBOMsResponse", - }, - "SecurityMonitoringApi.V2.GetSBOM": { - assetType: { - type: "AssetType", - format: "", - }, - filterAssetName: { + filterLastSuccessOrigin: { type: "string", format: "", }, - filterRepoDigest: { + filterLastSuccessEnv: { type: "string", format: "", }, - operationResponseType: "GetSBOMResponse", + operationResponseType: "ScannedAssetsMetadata", }, "SecurityMonitoringApi.V2.GetSignalNotificationRules": { operationResponseType: "NotificationRulesList", @@ -4018,6 +3978,77 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "NotificationRuleResponse", }, + "SecurityMonitoringApi.V2.ListVulnerableAssets": { + pageToken: { + type: "string", + format: "", + }, + pageNumber: { + type: "number", + format: "int64", + }, + filterName: { + type: "string", + format: "", + }, + filterType: { + type: "AssetType", + format: "", + }, + filterVersionFirst: { + type: "string", + format: "", + }, + filterVersionLast: { + type: "string", + format: "", + }, + filterRepositoryUrl: { + type: "string", + format: "", + }, + filterRisksInProduction: { + type: "boolean", + format: "", + }, + filterRisksUnderAttack: { + type: "boolean", + format: "", + }, + filterRisksIsPubliclyAccessible: { + type: "boolean", + format: "", + }, + filterRisksHasPrivilegedAccess: { + type: "boolean", + format: "", + }, + filterRisksHasAccessToSensitiveData: { + type: "boolean", + format: "", + }, + filterEnvironments: { + type: "string", + format: "", + }, + filterTeams: { + type: "string", + format: "", + }, + filterArch: { + type: "string", + format: "", + }, + filterOperatingSystemName: { + type: "string", + format: "", + }, + filterOperatingSystemVersion: { + type: "string", + format: "", + }, + operationResponseType: "ListVulnerableAssetsResponse", + }, "SecurityMonitoringApi.V2.ListSecurityFilters": { operationResponseType: "SecurityFiltersResponse", }, diff --git a/services/security_monitoring/src/v2/SecurityMonitoringApi.ts b/services/security_monitoring/src/v2/SecurityMonitoringApi.ts index 7b7eeb1d66fd..8d1463c494ca 100644 --- a/services/security_monitoring/src/v2/SecurityMonitoringApi.ts +++ b/services/security_monitoring/src/v2/SecurityMonitoringApi.ts @@ -26,6 +26,7 @@ import { APIErrorResponse } from "./models/APIErrorResponse"; import { AssetType } from "./models/AssetType"; import { BulkMuteFindingsRequest } from "./models/BulkMuteFindingsRequest"; import { BulkMuteFindingsResponse } from "./models/BulkMuteFindingsResponse"; +import { CloudAssetType } from "./models/CloudAssetType"; import { ConvertJobResultsToSignalsRequest } from "./models/ConvertJobResultsToSignalsRequest"; import { CreateCustomFrameworkRequest } from "./models/CreateCustomFrameworkRequest"; import { CreateCustomFrameworkResponse } from "./models/CreateCustomFrameworkResponse"; @@ -53,6 +54,8 @@ import { NotificationRulesList } from "./models/NotificationRulesList"; import { PatchNotificationRuleParameters } from "./models/PatchNotificationRuleParameters"; import { RunHistoricalJobRequest } from "./models/RunHistoricalJobRequest"; import { SBOMComponentLicenseType } from "./models/SBOMComponentLicenseType"; +import { SBOMFormat } from "./models/SBOMFormat"; +import { ScannedAssetsMetadata } from "./models/ScannedAssetsMetadata"; import { SecurityFilterCreateRequest } from "./models/SecurityFilterCreateRequest"; import { SecurityFilterResponse } from "./models/SecurityFilterResponse"; import { SecurityFiltersResponse } from "./models/SecurityFiltersResponse"; @@ -1475,6 +1478,7 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { assetType: AssetType, filterAssetName: string, filterRepoDigest?: string, + extFormat?: SBOMFormat, _options?: Configuration, ): Promise { const _config = _options || this.configuration; @@ -1534,6 +1538,13 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { "", ); } + if (extFormat !== undefined) { + requestContext.setQueryParam( + "ext:format", + serialize(extFormat, TypingInfo, "SBOMFormat", ""), + "", + ); + } // Apply auth methods applySecurityAuthentication(_config, requestContext, [ @@ -2517,6 +2528,101 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listScannedAssetsMetadata( + pageToken?: string, + pageNumber?: number, + filterAssetType?: CloudAssetType, + filterAssetName?: string, + filterLastSuccessOrigin?: string, + filterLastSuccessEnv?: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "SecurityMonitoringApi.v2.listScannedAssetsMetadata" + ] + ) { + throw new Error( + "Unstable operation 'listScannedAssetsMetadata' is disabled. Enable it by setting `configuration.unstableOperations['SecurityMonitoringApi.v2.listScannedAssetsMetadata'] = true`", + ); + } + + // Path Params + const localVarPath = "/api/v2/security/scanned-assets-metadata"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SecurityMonitoringApi.v2.listScannedAssetsMetadata", + SecurityMonitoringApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Query Params + if (pageToken !== undefined) { + requestContext.setQueryParam( + "page[token]", + serialize(pageToken, TypingInfo, "string", ""), + "", + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + serialize(pageNumber, TypingInfo, "number", "int64"), + "", + ); + } + if (filterAssetType !== undefined) { + requestContext.setQueryParam( + "filter[asset.type]", + serialize(filterAssetType, TypingInfo, "CloudAssetType", ""), + "", + ); + } + if (filterAssetName !== undefined) { + requestContext.setQueryParam( + "filter[asset.name]", + serialize(filterAssetName, TypingInfo, "string", ""), + "", + ); + } + if (filterLastSuccessOrigin !== undefined) { + requestContext.setQueryParam( + "filter[last_success.origin]", + serialize(filterLastSuccessOrigin, TypingInfo, "string", ""), + "", + ); + } + if (filterLastSuccessEnv !== undefined) { + requestContext.setQueryParam( + "filter[last_success.env]", + serialize(filterLastSuccessEnv, TypingInfo, "string", ""), + "", + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listSecurityFilters( _options?: Configuration, ): Promise { @@ -3019,7 +3125,7 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { } if (filterAdvisoryId !== undefined) { requestContext.setQueryParam( - "filter[advisory_id]", + "filter[advisory.id]", serialize(filterAdvisoryId, TypingInfo, "string", ""), "", ); @@ -3288,7 +3394,7 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { } // Path Params - const localVarPath = "/api/v2/security/assets"; + const localVarPath = "/api/v2/security/vulnerable-assets"; // Make Request Context const { server, overrides } = _config.getServerAndOverrides( @@ -6731,6 +6837,87 @@ export class SecurityMonitoringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listScannedAssetsMetadata + * @throws ApiException if the response code was not in [200, 299] + */ + public async listScannedAssetsMetadata( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: ScannedAssetsMetadata = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "ScannedAssetsMetadata", + ) as ScannedAssetsMetadata; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ScannedAssetsMetadata = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "ScannedAssetsMetadata", + "", + ) as ScannedAssetsMetadata; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -8387,6 +8574,11 @@ export interface SecurityMonitoringApiGetSBOMRequest { * @type string */ filterRepoDigest?: string; + /** + * The standard of the SBOM. + * @type SBOMFormat + */ + extFormat?: SBOMFormat; } export interface SecurityMonitoringApiGetSecurityFilterRequest { @@ -8642,6 +8834,39 @@ export interface SecurityMonitoringApiListHistoricalJobsRequest { filterQuery?: string; } +export interface SecurityMonitoringApiListScannedAssetsMetadataRequest { + /** + * Its value must come from the `links` section of the response of the first request. Do not manually edit it. + * @type string + */ + pageToken?: string; + /** + * The page number to be retrieved. It should be equal to or greater than 1. + * @type number + */ + pageNumber?: number; + /** + * The type of the scanned asset. + * @type CloudAssetType + */ + filterAssetType?: CloudAssetType; + /** + * The name of the scanned asset. + * @type string + */ + filterAssetName?: string; + /** + * The origin of last success scan. + * @type string + */ + filterLastSuccessOrigin?: string; + /** + * The environment of last success scan. + * @type string + */ + filterLastSuccessEnv?: string; +} + export interface SecurityMonitoringApiListSecurityMonitoringHistsignalsRequest { /** * The search query for security signals. @@ -8866,7 +9091,7 @@ export interface SecurityMonitoringApiListVulnerabilitiesRequest { */ filterOrigin?: string; /** - * Filter by asset name. + * Filter by asset name. This field supports the usage of wildcards (*). * @type string */ filterAssetName?: string; @@ -8954,7 +9179,7 @@ export interface SecurityMonitoringApiListVulnerableAssetsRequest { */ pageNumber?: number; /** - * Filter by name. + * Filter by name. This field supports the usage of wildcards (*). * @type string */ filterName?: string; @@ -9791,6 +10016,7 @@ export class SecurityMonitoringApi { param.assetType, param.filterAssetName, param.filterRepoDigest, + param.extFormat, options, ); return requestContextPromise.then((requestContext) => { @@ -10283,6 +10509,77 @@ export class SecurityMonitoringApi { }); } + /** + * Get a list of security scanned assets metadata for an organization. + * + * ### Pagination + * + * For the "List Vulnerabilities" endpoint, see the [Pagination section](#pagination). + * + * ### Filtering + * + * For the "List Vulnerabilities" endpoint, see the [Filtering section](#filtering). + * + * ### Metadata + * + * For the "List Vulnerabilities" endpoint, see the [Metadata section](#metadata). + * + * ### Related endpoints + * + * This endpoint returns additional metadata for cloud resources that is not available from the standard resource endpoints. To access a richer dataset, call this endpoint together with the relevant resource endpoint(s) and merge (join) their results using the resource identifier. + * + * **Hosts** + * + * To enrich host data, join the response from the [Hosts](https://docs.datadoghq.com/api/latest/hosts/) endpoint with the response from the scanned-assets-metadata endpoint on the following key fields: + * + * | ENDPOINT | JOIN KEY | TYPE | + * | --- | --- | --- | + * | [/api/v1/hosts](https://docs.datadoghq.com/api/latest/hosts/) | host_list.host_name | string | + * | /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | + * + * **Host Images** + * + * To enrich host image data, join the response from the [Hosts](https://docs.datadoghq.com/api/latest/hosts/) endpoint with the response from the scanned-assets-metadata endpoint on the following key fields: + * + * | ENDPOINT | JOIN KEY | TYPE | + * | --- | --- | --- | + * | [/api/v1/hosts](https://docs.datadoghq.com/api/latest/hosts/) | host_list.tags_by_source["Amazon Web Services"]["image"] | string | + * | /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | + * + * **Container Images** + * + * To enrich container image data, join the response from the [Container Images](https://docs.datadoghq.com/api/latest/container-images/) endpoint with the response from the scanned-assets-metadata endpoint on the following key fields: + * + * | ENDPOINT | JOIN KEY | TYPE | + * | --- | --- | --- | + * | [/api/v2/container_images](https://docs.datadoghq.com/api/latest/container-images/) | `data.attributes.name`@`data.attributes.repo_digest` | string | + * | /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | + * @param param The request object + */ + public listScannedAssetsMetadata( + param: SecurityMonitoringApiListScannedAssetsMetadataRequest = {}, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.listScannedAssetsMetadata( + param.pageToken, + param.pageNumber, + param.filterAssetType, + param.filterAssetName, + param.filterLastSuccessOrigin, + param.filterLastSuccessEnv, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listScannedAssetsMetadata( + responseContext, + ); + }); + }); + } + /** * Get the list of configured security filters with their definitions. * @param param The request object @@ -10510,6 +10807,8 @@ export class SecurityMonitoringApi { * * This token can then be used in the subsequent paginated requests. * + * *Note: The first request may take longer to complete than subsequent requests.* + * * #### Subsequent requests * * Any request containing valid `page[token]` and `page[number]` parameters will be considered a subsequent request. @@ -10518,6 +10817,8 @@ export class SecurityMonitoringApi { * * If the page `number` is invalid, a `400` response will be returned. * + * The returned `token` is valid for all requests in the pagination sequence. To send paginated requests in parallel, reuse the same `token` and change only the `page[number]` parameter. + * * ### Filtering * * The request can include some filter parameters to filter the data to be retrieved. The format of the filter parameters follows the [JSON:API format](https://jsonapi.org/format/#fetching-filtering): `filter[$prop_name]`, where `prop_name` is the property name in the entity being filtered by. @@ -10549,6 +10850,11 @@ export class SecurityMonitoringApi { * "links": {...} * } * ``` + * ### Extensions + * + * Requests may include extensions to modify the behavior of the requested endpoint. The filter parameters follow the [JSON:API format](https://jsonapi.org/extensions/#extensions) format: `ext:$extension_name`, where `extension_name` is the name of the modifier that is being applied. + * + * Extensions can only include one value: `ext:modifier=value`. * @param param The request object */ public listVulnerabilities( diff --git a/services/security_monitoring/src/v2/index.ts b/services/security_monitoring/src/v2/index.ts index b082a9953cba..0906852c8b01 100644 --- a/services/security_monitoring/src/v2/index.ts +++ b/services/security_monitoring/src/v2/index.ts @@ -38,6 +38,7 @@ export { SecurityMonitoringApiListAssetsSBOMsRequest, SecurityMonitoringApiListFindingsRequest, SecurityMonitoringApiListHistoricalJobsRequest, + SecurityMonitoringApiListScannedAssetsMetadataRequest, SecurityMonitoringApiListSecurityMonitoringHistsignalsRequest, SecurityMonitoringApiListSecurityMonitoringRulesRequest, SecurityMonitoringApiListSecurityMonitoringSignalsRequest, @@ -80,6 +81,7 @@ export { BulkMuteFindingsRequestProperties } from "./models/BulkMuteFindingsRequ export { BulkMuteFindingsResponse } from "./models/BulkMuteFindingsResponse"; export { BulkMuteFindingsResponseData } from "./models/BulkMuteFindingsResponseData"; export { CalculatedField } from "./models/CalculatedField"; +export { CloudAssetType } from "./models/CloudAssetType"; export { CloudConfigurationComplianceRuleOptions } from "./models/CloudConfigurationComplianceRuleOptions"; export { CloudConfigurationRegoRule } from "./models/CloudConfigurationRegoRule"; export { CloudConfigurationRuleCaseCreate } from "./models/CloudConfigurationRuleCaseCreate"; @@ -191,10 +193,16 @@ export { SBOMComponentLicenseType } from "./models/SBOMComponentLicenseType"; export { SBOMComponentProperty } from "./models/SBOMComponentProperty"; export { SBOMComponentSupplier } from "./models/SBOMComponentSupplier"; export { SBOMComponentType } from "./models/SBOMComponentType"; +export { SBOMFormat } from "./models/SBOMFormat"; export { SBOMMetadata } from "./models/SBOMMetadata"; export { SBOMMetadataAuthor } from "./models/SBOMMetadataAuthor"; export { SBOMMetadataComponent } from "./models/SBOMMetadataComponent"; export { SBOMType } from "./models/SBOMType"; +export { ScannedAssetMetadata } from "./models/ScannedAssetMetadata"; +export { ScannedAssetMetadataAsset } from "./models/ScannedAssetMetadataAsset"; +export { ScannedAssetMetadataAttributes } from "./models/ScannedAssetMetadataAttributes"; +export { ScannedAssetMetadataLastSuccess } from "./models/ScannedAssetMetadataLastSuccess"; +export { ScannedAssetsMetadata } from "./models/ScannedAssetsMetadata"; export { SecurityFilter } from "./models/SecurityFilter"; export { SecurityFilterAttributes } from "./models/SecurityFilterAttributes"; export { SecurityFilterCreateAttributes } from "./models/SecurityFilterCreateAttributes"; @@ -320,6 +328,7 @@ export { UpdateResourceEvaluationFiltersResponse } from "./models/UpdateResource export { UpdateResourceEvaluationFiltersResponseData } from "./models/UpdateResourceEvaluationFiltersResponseData"; export { VulnerabilitiesType } from "./models/VulnerabilitiesType"; export { Vulnerability } from "./models/Vulnerability"; +export { VulnerabilityAdvisory } from "./models/VulnerabilityAdvisory"; export { VulnerabilityAttributes } from "./models/VulnerabilityAttributes"; export { VulnerabilityCvss } from "./models/VulnerabilityCvss"; export { VulnerabilityDependencyLocations } from "./models/VulnerabilityDependencyLocations"; diff --git a/services/security_monitoring/src/v2/models/CloudAssetType.ts b/services/security_monitoring/src/v2/models/CloudAssetType.ts new file mode 100644 index 000000000000..8525905df814 --- /dev/null +++ b/services/security_monitoring/src/v2/models/CloudAssetType.ts @@ -0,0 +1,13 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The cloud asset type + */ +export type CloudAssetType = + | typeof HOST + | typeof HOST_IMAGE + | typeof IMAGE + | UnparsedObject; +export const HOST = "Host"; +export const HOST_IMAGE = "HostImage"; +export const IMAGE = "Image"; diff --git a/services/security_monitoring/src/v2/models/SBOMFormat.ts b/services/security_monitoring/src/v2/models/SBOMFormat.ts new file mode 100644 index 000000000000..524a230ec10d --- /dev/null +++ b/services/security_monitoring/src/v2/models/SBOMFormat.ts @@ -0,0 +1,8 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The SBOM standard + */ +export type SBOMFormat = typeof CYCLONEDX | typeof SPDX | UnparsedObject; +export const CYCLONEDX = "CycloneDX"; +export const SPDX = "SPDX"; diff --git a/services/security_monitoring/src/v2/models/ScannedAssetMetadata.ts b/services/security_monitoring/src/v2/models/ScannedAssetMetadata.ts new file mode 100644 index 000000000000..840da6d18984 --- /dev/null +++ b/services/security_monitoring/src/v2/models/ScannedAssetMetadata.ts @@ -0,0 +1,56 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScannedAssetMetadataAttributes } from "./ScannedAssetMetadataAttributes"; + +/** + * The metadata of a scanned asset. + */ +export class ScannedAssetMetadata { + /** + * The attributes of a scanned asset metadata. + */ + "attributes": ScannedAssetMetadataAttributes; + /** + * The ID of the scanned asset metadata. + */ + "id": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ScannedAssetMetadataAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScannedAssetMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/ScannedAssetMetadataAsset.ts b/services/security_monitoring/src/v2/models/ScannedAssetMetadataAsset.ts new file mode 100644 index 000000000000..4b437e6f0ea6 --- /dev/null +++ b/services/security_monitoring/src/v2/models/ScannedAssetMetadataAsset.ts @@ -0,0 +1,56 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CloudAssetType } from "./CloudAssetType"; + +/** + * The asset of a scanned asset metadata. + */ +export class ScannedAssetMetadataAsset { + /** + * The name of the asset. + */ + "name": string; + /** + * The cloud asset type + */ + "type": CloudAssetType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "CloudAssetType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScannedAssetMetadataAsset.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/ScannedAssetMetadataAttributes.ts b/services/security_monitoring/src/v2/models/ScannedAssetMetadataAttributes.ts new file mode 100644 index 000000000000..afe5047a4c89 --- /dev/null +++ b/services/security_monitoring/src/v2/models/ScannedAssetMetadataAttributes.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScannedAssetMetadataAsset } from "./ScannedAssetMetadataAsset"; +import { ScannedAssetMetadataLastSuccess } from "./ScannedAssetMetadataLastSuccess"; + +/** + * The attributes of a scanned asset metadata. + */ +export class ScannedAssetMetadataAttributes { + /** + * The asset of a scanned asset metadata. + */ + "asset": ScannedAssetMetadataAsset; + /** + * The timestamp when the scan of the asset was performed for the first time. + */ + "firstSuccessTimestamp": string; + /** + * Metadata for the last successful scan of an asset. + */ + "lastSuccess": ScannedAssetMetadataLastSuccess; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + asset: { + baseName: "asset", + type: "ScannedAssetMetadataAsset", + required: true, + }, + firstSuccessTimestamp: { + baseName: "first_success_timestamp", + type: "string", + required: true, + }, + lastSuccess: { + baseName: "last_success", + type: "ScannedAssetMetadataLastSuccess", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScannedAssetMetadataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/ScannedAssetMetadataLastSuccess.ts b/services/security_monitoring/src/v2/models/ScannedAssetMetadataLastSuccess.ts new file mode 100644 index 000000000000..75e6cdce9fa6 --- /dev/null +++ b/services/security_monitoring/src/v2/models/ScannedAssetMetadataLastSuccess.ts @@ -0,0 +1,61 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Metadata for the last successful scan of an asset. + */ +export class ScannedAssetMetadataLastSuccess { + /** + * The environment of the last success scan of the asset. + */ + "env"?: string; + /** + * The list of origins of the last success scan of the asset. + */ + "origin"?: Array; + /** + * The timestamp of the last success scan of the asset. + */ + "timestamp": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + env: { + baseName: "env", + type: "string", + }, + origin: { + baseName: "origin", + type: "Array", + }, + timestamp: { + baseName: "timestamp", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScannedAssetMetadataLastSuccess.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/ScannedAssetsMetadata.ts b/services/security_monitoring/src/v2/models/ScannedAssetsMetadata.ts new file mode 100644 index 000000000000..2b3f9a9edb58 --- /dev/null +++ b/services/security_monitoring/src/v2/models/ScannedAssetsMetadata.ts @@ -0,0 +1,65 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { Links } from "./Links"; +import { Metadata } from "./Metadata"; +import { ScannedAssetMetadata } from "./ScannedAssetMetadata"; + +/** + * The expected response schema when listing scanned assets metadata. + */ +export class ScannedAssetsMetadata { + /** + * List of scanned assets metadata. + */ + "data": Array; + /** + * The JSON:API links related to pagination. + */ + "links"?: Links; + /** + * The metadata related to this request. + */ + "meta"?: Metadata; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + links: { + baseName: "links", + type: "Links", + }, + meta: { + baseName: "meta", + type: "Metadata", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScannedAssetsMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/TypingInfo.ts b/services/security_monitoring/src/v2/models/TypingInfo.ts index 61fea6c3e5a6..f39b9ed91b5a 100644 --- a/services/security_monitoring/src/v2/models/TypingInfo.ts +++ b/services/security_monitoring/src/v2/models/TypingInfo.ts @@ -111,6 +111,11 @@ import { SBOMComponentSupplier } from "./SBOMComponentSupplier"; import { SBOMMetadata } from "./SBOMMetadata"; import { SBOMMetadataAuthor } from "./SBOMMetadataAuthor"; import { SBOMMetadataComponent } from "./SBOMMetadataComponent"; +import { ScannedAssetMetadata } from "./ScannedAssetMetadata"; +import { ScannedAssetMetadataAsset } from "./ScannedAssetMetadataAsset"; +import { ScannedAssetMetadataAttributes } from "./ScannedAssetMetadataAttributes"; +import { ScannedAssetMetadataLastSuccess } from "./ScannedAssetMetadataLastSuccess"; +import { ScannedAssetsMetadata } from "./ScannedAssetsMetadata"; import { SecurityFilter } from "./SecurityFilter"; import { SecurityFilterAttributes } from "./SecurityFilterAttributes"; import { SecurityFilterCreateAttributes } from "./SecurityFilterCreateAttributes"; @@ -200,6 +205,7 @@ import { UpdateResourceEvaluationFiltersRequestData } from "./UpdateResourceEval import { UpdateResourceEvaluationFiltersResponse } from "./UpdateResourceEvaluationFiltersResponse"; import { UpdateResourceEvaluationFiltersResponseData } from "./UpdateResourceEvaluationFiltersResponseData"; import { Vulnerability } from "./Vulnerability"; +import { VulnerabilityAdvisory } from "./VulnerabilityAdvisory"; import { VulnerabilityAttributes } from "./VulnerabilityAttributes"; import { VulnerabilityCvss } from "./VulnerabilityCvss"; import { VulnerabilityDependencyLocations } from "./VulnerabilityDependencyLocations"; @@ -212,6 +218,7 @@ export const TypingInfo: ModelTypingInfo = { enumsMap: { AssetEntityType: ["assets"], AssetType: ["Repository", "Service", "Host", "HostImage", "Image"], + CloudAssetType: ["Host", "HostImage", "Image"], CloudConfigurationRuleType: ["cloud_configuration"], ConvertJobResultsToSignalsDataType: [ "historicalDetectionsJobResultSignalConversion", @@ -284,6 +291,7 @@ export const TypingInfo: ModelTypingInfo = { "operating-system", "platform", ], + SBOMFormat: ["CycloneDX", "SPDX"], SBOMType: ["sboms"], SecurityFilterFilteredDataType: ["logs"], SecurityFilterType: ["security_filters"], @@ -601,6 +609,11 @@ export const TypingInfo: ModelTypingInfo = { SBOMMetadata: SBOMMetadata, SBOMMetadataAuthor: SBOMMetadataAuthor, SBOMMetadataComponent: SBOMMetadataComponent, + ScannedAssetMetadata: ScannedAssetMetadata, + ScannedAssetMetadataAsset: ScannedAssetMetadataAsset, + ScannedAssetMetadataAttributes: ScannedAssetMetadataAttributes, + ScannedAssetMetadataLastSuccess: ScannedAssetMetadataLastSuccess, + ScannedAssetsMetadata: ScannedAssetsMetadata, SecurityFilter: SecurityFilter, SecurityFilterAttributes: SecurityFilterAttributes, SecurityFilterCreateAttributes: SecurityFilterCreateAttributes, @@ -739,6 +752,7 @@ export const TypingInfo: ModelTypingInfo = { UpdateResourceEvaluationFiltersResponseData: UpdateResourceEvaluationFiltersResponseData, Vulnerability: Vulnerability, + VulnerabilityAdvisory: VulnerabilityAdvisory, VulnerabilityAttributes: VulnerabilityAttributes, VulnerabilityCvss: VulnerabilityCvss, VulnerabilityDependencyLocations: VulnerabilityDependencyLocations, diff --git a/services/security_monitoring/src/v2/models/VulnerabilityAdvisory.ts b/services/security_monitoring/src/v2/models/VulnerabilityAdvisory.ts new file mode 100644 index 000000000000..5d8078dba2a7 --- /dev/null +++ b/services/security_monitoring/src/v2/models/VulnerabilityAdvisory.ts @@ -0,0 +1,61 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Advisory associated with the vulnerability. + */ +export class VulnerabilityAdvisory { + /** + * Vulnerability advisory ID. + */ + "id": string; + /** + * Vulnerability advisory last modification date. + */ + "lastModificationDate"?: string; + /** + * Vulnerability advisory publish date. + */ + "publishDate"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + lastModificationDate: { + baseName: "last_modification_date", + type: "string", + }, + publishDate: { + baseName: "publish_date", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return VulnerabilityAdvisory.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/security_monitoring/src/v2/models/VulnerabilityAttributes.ts b/services/security_monitoring/src/v2/models/VulnerabilityAttributes.ts index 8166de566606..00f24246d2f2 100644 --- a/services/security_monitoring/src/v2/models/VulnerabilityAttributes.ts +++ b/services/security_monitoring/src/v2/models/VulnerabilityAttributes.ts @@ -3,6 +3,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; import { CodeLocation } from "./CodeLocation"; import { Library } from "./Library"; import { Remediation } from "./Remediation"; +import { VulnerabilityAdvisory } from "./VulnerabilityAdvisory"; import { VulnerabilityCvss } from "./VulnerabilityCvss"; import { VulnerabilityDependencyLocations } from "./VulnerabilityDependencyLocations"; import { VulnerabilityEcosystem } from "./VulnerabilityEcosystem"; @@ -15,6 +16,10 @@ import { VulnerabilityType } from "./VulnerabilityType"; * The JSON:API attributes of the vulnerability. */ export class VulnerabilityAttributes { + /** + * Advisory associated with the vulnerability. + */ + "advisory"?: VulnerabilityAdvisory; /** * Vulnerability advisory ID. */ @@ -114,6 +119,10 @@ export class VulnerabilityAttributes { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + advisory: { + baseName: "advisory", + type: "VulnerabilityAdvisory", + }, advisoryId: { baseName: "advisory_id", type: "string",