diff --git a/.apigentools-info b/.apigentools-info index c9142bf3341..5b6b0fbc269 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-19 07:26:26.500720", - "spec_repo_commit": "5dd2cbe4" + "regenerated": "2024-12-19 16:39:53.266828", + "spec_repo_commit": "efdd370c" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-19 07:26:26.515806", - "spec_repo_commit": "5dd2cbe4" + "regenerated": "2024-12-19 16:39:53.281613", + "spec_repo_commit": "efdd370c" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3480f9db3a7..7ede378d7c0 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1601,6 +1601,25 @@ components: type: string x-enum-varnames: - BILLING_DIMENSIONS + Advisory: + description: Advisory. + properties: + base_severity: + description: Advisory base severity. + example: Critical + type: string + id: + description: Advisory id. + example: GHSA-4wrc-f8pq-fpqp + type: string + severity: + description: Advisory Datadog severity. + example: Medium + type: string + required: + - id + - base_severity + type: object ApiID: description: API identifier. example: 90646597-5fdb-4a17-a240-647003f8c028 @@ -1907,6 +1926,131 @@ components: - CREATED_AT_DESC - UPDATED_AT_DESC - USER_NAME_DESC + Asset: + description: A single vulnerable asset + properties: + attributes: + $ref: '#/components/schemas/AssetAttributes' + id: + description: The unique ID for this asset. + example: Repository|github.com/DataDog/datadog-agent.git + type: string + type: + $ref: '#/components/schemas/AssetEntityType' + required: + - id + - type + - attributes + type: object + AssetAttributes: + description: The JSON:API attributes of the asset. + properties: + arch: + description: Asset architecture. + example: arm64 + type: string + environments: + description: List of environments where the asset is deployed. + example: + - staging + items: + example: staging + type: string + type: array + name: + description: Asset name. + example: github.com/DataDog/datadog-agent.git + type: string + operating_system: + $ref: '#/components/schemas/AssetAttributesOperatingSystem' + risks: + $ref: '#/components/schemas/AssetAttributesRisks' + type: + $ref: '#/components/schemas/AssetType' + version: + $ref: '#/components/schemas/AssetAttributesVersion' + required: + - name + - type + - risks + - environments + type: object + AssetAttributesOperatingSystem: + description: Asset operating system. + properties: + description: + description: Operating system version. + example: '24.04' + type: string + name: + description: Operating system name. + example: ubuntu + type: string + required: + - name + type: object + AssetAttributesRisks: + description: Asset risks. + properties: + has_access_to_sensitive_data: + description: Whether the asset has access to sensitive data or not. + example: false + type: boolean + has_privileged_access: + description: Whether the asset has privileged access or not. + example: false + type: boolean + in_production: + description: Whether the asset is in production or not. + example: false + type: boolean + is_publicly_accessible: + description: Whether the asset is publicly accessible or not. + example: false + type: boolean + under_attack: + description: Whether the asset is under attack or not. + example: false + type: boolean + required: + - in_production + type: object + AssetAttributesVersion: + description: Asset version. + properties: + first: + description: Asset first version. + example: _latest + type: string + last: + description: Asset last version. + example: _latest + type: string + type: object + AssetEntityType: + description: The JSON:API type. + enum: + - assets + example: assets + type: string + x-enum-varnames: + - ASSETS + AssetType: + description: The asset type + enum: + - Repository + - Service + - Host + - HostImage + - Image + example: Repository + type: string + x-enum-varnames: + - REPOSITORY + - SERVICE + - HOST + - HOSTIMAGE + - IMAGE AuditLogsEvent: description: Object description of an Audit Logs event after it is processed and stored by Datadog. @@ -4508,6 +4652,25 @@ components: type: string x-enum-varnames: - DATADOG_AGENT + CVSS: + description: Vulnerability severity. + properties: + score: + description: Vulnerability severity score. + example: 4.5 + format: double + type: number + severity: + $ref: '#/components/schemas/Severity' + vector: + description: Vulnerability CVSS vector. + example: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H + type: string + required: + - score + - severity + - vector + type: object CalculatedField: description: Calculated field. properties: @@ -5669,6 +5832,24 @@ components: $ref: '#/components/schemas/CloudflareAccountResponseData' type: array type: object + CodeLocation: + description: Code vulnerability location. + properties: + file_path: + description: Vulnerability location file path. + example: src/Class.java:100 + type: string + location: + description: Vulnerability extracted location. + example: com.example.Class:100 + type: string + method: + description: Vulnerability location method. + example: FooBar + type: string + required: + - location + type: object Component: description: The definition of `Component` object. properties: @@ -8676,6 +8857,40 @@ components: type: string x-enum-varnames: - APPDEFINITIONS + DependencyLocation: + description: Static library vulnerability location. + properties: + column_end: + description: Location column end. + example: 140 + format: int64 + type: integer + column_start: + description: Location column start. + example: 5 + format: int64 + type: integer + file_name: + description: Location file name. + example: src/go.mod + type: string + line_end: + description: Location line end. + example: 10 + format: int64 + type: integer + line_start: + description: Location line start. + example: 1 + format: int64 + type: integer + required: + - file_name + - line_start + - line_end + - column_start + - column_end + type: object DeployAppResponse: description: The definition of `DeployAppResponse` object. properties: @@ -9709,6 +9924,47 @@ components: - type - attributes type: object + EPSS: + description: Vulnerability EPSS severity. + properties: + score: + description: Vulnerability EPSS severity score. + example: 0.2 + format: double + type: number + severity: + $ref: '#/components/schemas/Severity' + required: + - score + - severity + type: object + Ecosystem: + description: The related vulnerability asset ecosystem. + enum: + - PyPI + - Maven + - NuGet + - Npm + - RubyGems + - Go + - Packagist + - Ddeb + - Rpm + - Apk + - Windows + type: string + x-enum-varnames: + - PYPI + - MAVEN + - NUGET + - NPM + - RUBYGEMS + - GO + - PACKAGIST + - DDEB + - RPM + - APK + - WINDOWS EntityAttributes: description: Entity attributes. properties: @@ -15021,6 +15277,48 @@ components: type: string x-enum-varnames: - LEAKED_KEYS + Library: + description: Vulnerability library. + properties: + name: + description: Vulnerability library name. + example: linux-aws-5.15 + type: string + version: + description: Vulnerability library version. + example: 5.15.0 + type: string + required: + - name + type: object + Links: + description: The JSON:API links related to pagination. + properties: + first: + description: First page link. + example: https://api.datadoghq.com/api/v2/security/vulnerabilities?page%5Bnumber%5D=1&page%5Btoken%5D=b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 + type: string + last: + description: Last page link. + example: https://api.datadoghq.com/api/v2/security/vulnerabilities?page%5Bnumber%5D=15&page%5Btoken%5D=b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 + type: string + next: + description: Next page link. + example: https://api.datadoghq.com/api/v2/security/vulnerabilities?page%5Bnumber%5D=16&page%5Btoken%5D=b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 + type: string + previous: + description: Previous page link. + example: https://api.datadoghq.com/api/v2/security/vulnerabilities?page%5Bnumber%5D=14&page%5Btoken%5D=b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 + type: string + self: + description: Request link. + example: https://api.datadoghq.com/api/v2/security/vulnerabilities?filter%5Btool%5D=Infra + type: string + required: + - self + - first + - last + type: object ListAPIsResponse: description: Response for `ListAPIs`. properties: @@ -15417,6 +15715,36 @@ components: - _NAME - USER_COUNT - _USER_COUNT + ListVulnerabilitiesResponse: + description: The expected response schema when listing vulnerabilities. + properties: + data: + description: List of vulnerabilities. + items: + $ref: '#/components/schemas/Vulnerability' + type: array + links: + $ref: '#/components/schemas/Links' + meta: + $ref: '#/components/schemas/Metadata' + required: + - data + type: object + ListVulnerableAssetsResponse: + description: The expected response schema when listing vulnerable assets. + properties: + data: + description: List of vulnerable assets. + items: + $ref: '#/components/schemas/Asset' + type: array + links: + $ref: '#/components/schemas/Links' + meta: + $ref: '#/components/schemas/Metadata' + required: + - data + type: object Log: description: Object description of a log after being processed and stored by Datadog. @@ -16579,6 +16907,28 @@ components: - ms_channel_name - redirect_url type: object + Metadata: + description: The metadata related to this request. + properties: + count: + description: Number of entities included in the response. + example: 150 + format: int64 + type: integer + token: + description: The token that identifies the request. + example: b82cef018aab81ed1d4bb4xb35xxfc065da7efa685fbcecdbd338f3015e3afabbbfa3a911b4984_721ee28a-zecb-4e45-9960-c42065b574f4 + type: string + total: + description: Total number of entities across all pages. + example: 152431 + format: int64 + type: integer + required: + - count + - total + - token + type: object Metric: description: Object for a single metric tag configuration. example: @@ -21264,6 +21614,56 @@ components: required: - data type: object + Remediation: + description: Vulnerability remediation. + properties: + auto_solvable: + description: Whether the vulnerability can be resolved when recompiling + the package or not. + example: false + type: boolean + avoided_advisories: + description: Avoided advisories. + items: + $ref: '#/components/schemas/Advisory' + type: array + fixed_advisories: + description: Remediation fixed advisories. + items: + $ref: '#/components/schemas/Advisory' + type: array + library_name: + description: Library name remediating the vulnerability. + example: stdlib + type: string + library_version: + description: Library version remediating the vulnerability. + example: Upgrade to a version >= 1.20.0 + type: string + new_advisories: + description: New advisories. + items: + $ref: '#/components/schemas/Advisory' + type: array + remaining_advisories: + description: Remaining advisories. + items: + $ref: '#/components/schemas/Advisory' + type: array + type: + description: Remediation type. + example: text + type: string + required: + - type + - library_name + - library_version + - auto_solvable + - fixed_advisories + - remaining_advisories + - new_advisories + - avoided_advisories + type: object ReorderRetentionFiltersRequest: description: A list of retention filters to reorder. properties: @@ -26422,6 +26822,24 @@ components: description: Link to the Incident created on ServiceNow type: string type: object + Severity: + description: The vulnerability severity. + enum: + - Unknown + - None + - Low + - Medium + - High + - Critical + example: Medium + type: string + x-enum-varnames: + - UNKNOWN + - NONE + - LOW + - MEDIUM + - HIGH + - CRITICAL SlackIntegrationMetadata: description: Incident integration metadata for the Slack integration. properties: @@ -27392,6 +27810,22 @@ components: - PASS - FAIL - SKIP + Status: + description: The vulnerability status. + enum: + - Open + - Muted + - Remediated + - InProgress + - AutoClosed + example: Open + type: string + x-enum-varnames: + - OPEN + - MUTED + - REMEDIATED + - INPROGRESS + - AUTOCLOSED TagsEventAttribute: description: Array of tags associated with your event. example: @@ -28155,6 +28589,18 @@ components: items: $ref: '#/components/schemas/TimeseriesResponseValues' type: array + Tool: + description: The vulnerability tool. + enum: + - IAST + - SCA + - Infra + example: SCA + type: string + x-enum-varnames: + - IAST + - SCA + - INFRA Unit: description: Object containing the metric unit family, scale factor, name, and short name. @@ -29036,6 +29482,313 @@ components: type: string x-enum-varnames: - USERS + Vulnerability: + description: A single vulnerability + properties: + attributes: + $ref: '#/components/schemas/VulnerabilityAttributes' + id: + description: The unique ID for this vulnerability. + example: 3ecdfea798f2ce8f6e964805a344945f + type: string + relationships: + $ref: '#/components/schemas/VulnerabilityRelationships' + type: + $ref: '#/components/schemas/VulnerabilityEntityType' + required: + - id + - type + - attributes + - relationships + type: object + VulnerabilityAttributes: + description: The JSON:API attributes of the vulnerability. + properties: + advisory_id: + description: Vulnerability advisory ID. + example: TRIVY-CVE-2023-0615 + type: string + code_location: + $ref: '#/components/schemas/CodeLocation' + cve_list: + description: Vulnerability CVE list. + example: + - CVE-2023-0615 + items: + example: CVE-2023-0615 + type: string + type: array + cvss: + $ref: '#/components/schemas/VulnerabilityAttributesCvss' + dependency_locations: + $ref: '#/components/schemas/VulnerabilityAttributesDependencyLocations' + description: + description: Vulnerability description. + example: LDAP Injection is a security vulnerability that occurs when untrusted + user input is improperly handled and directly incorporated into LDAP queries + without appropriate sanitization or validation. This vulnerability enables + attackers to manipulate LDAP queries and potentially gain unauthorized + access, modify data, or extract sensitive information from the directory + server. By exploiting the LDAP injection vulnerability, attackers can + execute malicious commands, bypass authentication mechanisms, and perform + unauthorized actions within the directory service. + type: string + ecosystem: + $ref: '#/components/schemas/Ecosystem' + exposure_time: + description: Vulnerability exposure time in seconds. + example: 5618604 + format: int64 + type: integer + first_detection: + description: First detection of the vulnerability in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) + format + example: 2024-09-19 21:23:08+00:00 + type: string + fix_available: + description: Whether the vulnerability has a remediation or not. + example: false + type: boolean + language: + description: Vulnerability language. + example: ubuntu + type: string + last_detection: + description: Last detection of the vulnerability in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) + format + example: 2024-09-01 21:23:08+00:00 + type: string + library: + $ref: '#/components/schemas/Library' + remediations: + description: List of remediations. + items: + $ref: '#/components/schemas/Remediation' + type: array + repo_digests: + description: Vulnerability `repo_digest` list (when the vulnerability is + related to `Image` asset). + items: + example: sha256:0ae7da091191787229d321e3638e39c319a97d6e20f927d465b519d699215bf7 + type: string + type: array + risks: + $ref: '#/components/schemas/VulnerabilityRisks' + status: + $ref: '#/components/schemas/Status' + title: + description: Vulnerability title. + example: LDAP Injection + type: string + tool: + $ref: '#/components/schemas/Tool' + type: + $ref: '#/components/schemas/VulnerabilityType' + required: + - type + - cvss + - status + - tool + - title + - description + - cve_list + - risks + - language + - first_detection + - last_detection + - exposure_time + - remediations + - fix_available + type: object + VulnerabilityAttributesCvss: + description: Vulnerability severities. + properties: + base: + $ref: '#/components/schemas/CVSS' + datadog: + $ref: '#/components/schemas/CVSS' + required: + - base + - datadog + type: object + VulnerabilityAttributesDependencyLocations: + description: Static library vulnerability location. + properties: + block: + $ref: '#/components/schemas/DependencyLocation' + name: + $ref: '#/components/schemas/DependencyLocation' + version: + $ref: '#/components/schemas/DependencyLocation' + required: + - block + type: object + VulnerabilityEntityType: + description: The JSON:API type. + enum: + - vulnerabilities + example: vulnerabilities + type: string + x-enum-varnames: + - VULNERABILITIES + VulnerabilityRelationships: + description: Related entities object. + properties: + affects: + $ref: '#/components/schemas/VulnerabilityRelationshipsAffects' + required: + - affects + type: object + VulnerabilityRelationshipsAffects: + description: Relationship type. + properties: + data: + $ref: '#/components/schemas/VulnerabilityRelationshipsAffectsData' + required: + - data + type: object + VulnerabilityRelationshipsAffectsData: + description: Asset affected by this vulnerability. + properties: + id: + description: The unique ID for this related asset. + example: Repository|github.com/DataDog/datadog-agent.git + type: string + type: + $ref: '#/components/schemas/VulnerabilityRelationshipsAffectsDataType' + required: + - id + - type + type: object + VulnerabilityRelationshipsAffectsDataType: + description: The JSON:API type + enum: + - assets + example: assets + type: string + x-enum-varnames: + - ASSETS + VulnerabilityRisks: + description: Vulnerability risks. + properties: + epss: + $ref: '#/components/schemas/EPSS' + exploit_available: + description: Vulnerability public exploit availability. + example: false + type: boolean + exploit_sources: + description: Vulnerability exploit sources. + example: + - NIST + items: + example: NIST + type: string + type: array + exploitation_probability: + description: Vulnerability exploitation probability. + example: false + type: boolean + poc_exploit_available: + description: Vulnerability POC exploit availability. + example: false + type: boolean + required: + - exploitation_probability + - poc_exploit_available + - exploit_available + - exploit_sources + type: object + VulnerabilityType: + description: The vulnerability type. + enum: + - AdminConsoleActive + - CodeInjection + - CommandInjection + - ComponentWithKnownVulnerability + - DangerousWorkflows + - DefaultAppDeployed + - DefaultHtmlEscapeInvalid + - DirectoryListingLeak + - EmailHtmlInjection + - EndOfLife + - HardcodedPassword + - HardcodedSecret + - HeaderInjection + - HstsHeaderMissing + - InsecureAuthProtocol + - InsecureCookie + - InsecureJspLayout + - LdapInjection + - MaliciousPackage + - MandatoryRemediation + - NoHttpOnlyCookie + - NoSameSiteCookie + - NoSqlMongoDbInjection + - PathTraversal + - ReflectionInjection + - RiskyLicense + - SessionRewriting + - SessionTimeout + - SqlInjection + - Ssrf + - StackTraceLeak + - TrustBoundaryViolation + - Unmaintained + - UntrustedDeserialization + - UnvalidatedRedirect + - VerbTampering + - WeakCipher + - WeakHash + - WeakRandomness + - XContentTypeHeaderMissing + - XPathInjection + - Xss + example: WeakCipher + type: string + x-enum-varnames: + - ADMINCONSOLEACTIVE + - CODEINJECTION + - COMMANDINJECTION + - COMPONENTWITHKNOWNVULNERABILITY + - DANGEROUSWORKFLOWS + - DEFAULTAPPDEPLOYED + - DEFAULTHTMLESCAPEINVALID + - DIRECTORYLISTINGLEAK + - EMAILHTMLINJECTION + - ENDOFLIFE + - HARDCODEDPASSWORD + - HARDCODEDSECRET + - HEADERINJECTION + - HSTSHEADERMISSING + - INSECUREAUTHPROTOCOL + - INSECURECOOKIE + - INSECUREJSPLAYOUT + - LDAPINJECTION + - MALICIOUSPACKAGE + - MANDATORYREMEDIATION + - NOHTTPONLYCOOKIE + - NOSAMESITECOOKIE + - NOSQLMONGODBINJECTION + - PATHTRAVERSAL + - REFLECTIONINJECTION + - RISKYLICENSE + - SESSIONREWRITING + - SESSIONTIMEOUT + - SQLINJECTION + - SSRF + - STACKTRACELEAK + - TRUSTBOUNDARYVIOLATION + - UNMAINTAINED + - UNTRUSTEDDESERIALIZATION + - UNVALIDATEDREDIRECT + - VERBTAMPERING + - WEAKCIPHER + - WEAKHASH + - WEAKRANDOMNESS + - XCONTENTTYPEHEADERMISSING + - XPATHINJECTION + - XSS WidgetLiveSpan: description: The available timeframes depend on the widget you are using. enum: @@ -41427,6 +42180,203 @@ 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 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Internal server error: An unexpected issue occurred on the + server. Please try again later or contact support if the problem persists.' + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Gateway Timeout: The server took too long to respond. Please + try again later or contact support if the issue continues.' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List vulnerable assets + tags: + - Security Monitoring + x-unstable: '**Note**: Note: This endpoint is a private preview. + + If you are interested in accessing this API, please [fill this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' /api/v2/security/cloud_workload/policy/download: get: description: 'The download endpoint generates a Cloud Workload Security policy @@ -41456,6 +42406,399 @@ paths: operator: OR permissions: - security_monitoring_cws_agent_rules_read + /api/v2/security/vulnerabilities: + get: + description: "Get a list of vulnerabilities.\n\n### Pagination\n\nPagination + is enabled by default in both `vulnerabilities` and `assets`. The size of + the page varies depending on the endpoint and cannot be modified. To automate + the request of the next page, you can use the links section in the response.\n\nThis + endpoint will return paginated responses. The pages are stored in the links + section of the response:\n\n```JSON\n{\n \"data\": [...],\n \"meta\": {...},\n + \ \"links\": {\n \"self\": \"https://.../api/v2/security/vulnerabilities\",\n + \ \"first\": \"https://.../api/v2/security/vulnerabilities?page[number]=1&page[token]=abc\",\n + \ \"last\": \"https://.../api/v2/security/vulnerabilities?page[number]=43&page[token]=abc\",\n + \ \"next\": \"https://.../api/v2/security/vulnerabilities?page[number]=2&page[token]=abc\"\n + \ }\n}\n```\n\n\n- `links.previous` is empty if the first page is requested.\n- + `links.next` is empty if the last page is requested.\n\n#### Token\n\nVulnerabilities + can be created, updated or deleted at any point in time.\n\nUpon the first + request, a token is created to ensure consistency across subsequent paginated + requests.\n\nA token is valid only for 24 hours.\n\n#### First request\n\nWe + 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 + 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```\n" + operationId: ListVulnerabilities + 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 vulnerability type. + example: WeakCipher + in: query + name: filter[type] + required: false + schema: + $ref: '#/components/schemas/VulnerabilityType' + - description: Filter by vulnerability base (i.e. from the original advisory) + severity score. + example: 5.5 + in: query + name: filter[cvss.base.score][`$op`] + required: false + schema: + format: double + maximum: 10 + minimum: 0 + type: number + - description: Filter by vulnerability base severity. + example: Medium + in: query + name: filter[cvss.base.severity] + required: false + schema: + $ref: '#/components/schemas/Severity' + - description: Filter by vulnerability base CVSS vector. + example: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H + in: query + name: filter[cvss.base.vector] + required: false + schema: + type: string + - description: Filter by vulnerability Datadog severity score. + example: 4.3 + in: query + name: filter[cvss.datadog.score][`$op`] + required: false + schema: + format: double + maximum: 10 + minimum: 0 + type: number + - description: Filter by vulnerability Datadog severity. + example: Medium + in: query + name: filter[cvss.datadog.severity] + required: false + schema: + $ref: '#/components/schemas/Severity' + - description: Filter by vulnerability Datadog CVSS vector. + example: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H/E:U/RL:X/RC:X/CR:X/IR:X/AR:X/MAV:L/MAC:H/MPR:L/MUI:N/MS:U/MC:N/MI:N/MA:H + in: query + name: filter[cvss.datadog.vector] + required: false + schema: + type: string + - description: Filter by the status of the vulnerability. + example: Open + in: query + name: filter[status] + required: false + schema: + $ref: '#/components/schemas/Status' + - description: Filter by the tool of the vulnerability. + example: SCA + in: query + name: filter[tool] + required: false + schema: + $ref: '#/components/schemas/Tool' + - description: Filter by library name. + example: linux-aws-5.15 + in: query + name: filter[library.name] + required: false + schema: + type: string + - description: Filter by library version. + example: 5.15.0 + in: query + name: filter[library.version] + required: false + schema: + type: string + - description: Filter by advisory ID. + example: TRIVY-CVE-2023-0615 + in: query + name: filter[advisory_id] + required: false + schema: + type: string + - description: Filter by exploitation probability. + example: false + in: query + name: filter[risks.exploitation_probability] + required: false + schema: + type: boolean + - description: Filter by POC exploit availability. + example: false + in: query + name: filter[risks.poc_exploit_available] + required: false + schema: + type: boolean + - description: Filter by public exploit availability. + example: false + in: query + name: filter[risks.exploit_available] + required: false + schema: + type: boolean + - description: Filter by vulnerability [EPSS](https://www.first.org/epss/) severity + score. + example: 0.00042 + in: query + name: filter[risks.epss.score][`$op`] + required: false + schema: + format: double + maximum: 1 + minimum: 0 + type: number + - description: Filter by vulnerability [EPSS](https://www.first.org/epss/) severity. + example: Low + in: query + name: filter[risks.epss.severity] + required: false + schema: + $ref: '#/components/schemas/Severity' + - description: Filter by language. + example: ubuntu + in: query + name: filter[language] + required: false + schema: + type: string + - description: Filter by ecosystem. + example: Deb + in: query + name: filter[ecosystem] + required: false + schema: + $ref: '#/components/schemas/Ecosystem' + - description: Filter by vulnerability location. + example: com.example.Class:100 + in: query + name: filter[code_location.location] + required: false + schema: + type: string + - description: Filter by vulnerability file path. + example: src/Class.java:100 + in: query + name: filter[code_location.file_path] + required: false + schema: + type: string + - description: Filter by method. + example: FooBar + in: query + name: filter[code_location.method] + required: false + schema: + type: string + - description: Filter by fix availability. + example: false + in: query + name: filter[fix_available] + required: false + schema: + type: boolean + - description: Filter by vulnerability `repo_digest` (when the vulnerability + is related to `Image` asset). + example: sha256:0ae7da091191787229d321e3638e39c319a97d6e20f927d465b519d699215bf7 + in: query + name: filter[repo_digests] + required: false + schema: + type: string + - description: Filter by asset name. + example: datadog-agent + in: query + name: filter[asset.name] + required: false + schema: + type: string + - description: Filter by asset type. + example: Host + in: query + name: filter[asset.type] + required: false + schema: + $ref: '#/components/schemas/AssetType' + - description: Filter by the first version of the asset this vulnerability has + been detected on. + example: v1.15.1 + in: query + name: filter[asset.version.first] + required: false + schema: + type: string + - description: Filter by the last version of the asset this vulnerability has + been detected on. + example: v1.15.1 + in: query + name: filter[asset.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[asset.repository_url] + required: false + schema: + type: string + - description: Filter whether the asset is in production or not. + example: false + in: query + name: filter[asset.risks.in_production] + required: false + schema: + type: boolean + - description: Filter whether the asset is under attack or not. + example: false + in: query + name: filter[asset.risks.under_attack] + required: false + schema: + type: boolean + - description: Filter whether the asset is publicly accessible or not. + example: false + in: query + name: filter[asset.risks.is_publicly_accessible] + required: false + schema: + type: boolean + - description: Filter whether the asset is publicly accessible or not. + example: false + in: query + name: filter[asset.risks.has_privileged_access] + required: false + schema: + type: boolean + - description: Filter whether the asset has access to sensitive data or not. + example: false + in: query + name: filter[asset.risks.has_access_to_sensitive_data] + required: false + schema: + type: boolean + - description: Filter by asset environments. + example: staging + in: query + name: filter[asset.environments] + required: false + schema: + type: string + - description: Filter by asset architecture. + example: arm64 + in: query + name: filter[asset.arch] + required: false + schema: + type: string + - description: Filter by asset operating system name. + example: ubuntu + in: query + name: filter[asset.operating_system.name] + required: false + schema: + type: string + - description: Filter by asset operating system version. + example: '24.04' + in: query + name: filter[asset.operating_system.version] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListVulnerabilitiesResponse' + 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Internal server error: An unexpected issue occurred on the + server. Please try again later or contact support if the problem persists.' + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: 'Gateway Timeout: The server took too long to respond. Please + try again later or contact support if the issue continues.' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List vulnerabilities + tags: + - Security Monitoring + x-unstable: '**Note**: Note: This endpoint is a private preview. + + If you are interested in accessing this API, please [fill 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-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-t_4208064063/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-t_4208064063/frozen.json new file mode 100644 index 00000000000..9ba8daedc53 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-t_4208064063/frozen.json @@ -0,0 +1 @@ +"2024-12-19T16:15:23.508Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-t_4208064063/recording.har b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-t_4208064063/recording.har new file mode 100644 index 00000000000..a69001f5e76 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-Not-found-There-is-no-request-associated-with-the-provided-t_4208064063/recording.har @@ -0,0 +1,65 @@ +{ + "log": { + "_recordingName": "Security Monitoring/List vulnerabilities returns \"Not found: There is no request associated with the provided token.\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "d24629393ece04f99b606fa5b870bfaf", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 567, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "page", + "value": { + "number": "1", + "token": "unknown" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/security/vulnerabilities?page%5Btoken%5D=unknown&page%5Bnumber%5D=1" + }, + "response": { + "bodySize": 49, + "content": { + "mimeType": "application/vnd.api+json", + "size": 49, + "text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 660, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2024-12-19T16:15:23.893Z", + "time": 188 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-OK-response_2451060917/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-OK-response_2451060917/frozen.json new file mode 100644 index 00000000000..54fde9627b1 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-OK-response_2451060917/frozen.json @@ -0,0 +1 @@ +"2024-12-19T16:15:24.088Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-OK-response_2451060917/recording.har b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-OK-response_2451060917/recording.har new file mode 100644 index 00000000000..a65cdef463e --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerabilities-returns-OK-response_2451060917/recording.har @@ -0,0 +1,66 @@ +{ + "log": { + "_recordingName": "Security Monitoring/List vulnerabilities returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "aa3145b4bac23bdc07022a2044dc3294", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 613, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "filter", + "value": { + "asset.type": "Service", + "cvss.base.severity": "High", + "tool": "Infra" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/security/vulnerabilities?filter%5Bcvss.base.severity%5D=High&filter%5Basset.type%5D=Service&filter%5Btool%5D=Infra" + }, + "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": "2024-12-19T16:15:24.092Z", + "time": 433 + } + ], + "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 new file mode 100644 index 00000000000..6097b7eec6a --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/frozen.json @@ -0,0 +1 @@ +"2024-12-19T16:15:24.530Z" 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 new file mode 100644 index 00000000000..4bf97431c54 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-Not-found-There-is-no-request-associated-with-the-provided_3107541696/recording.har @@ -0,0 +1,65 @@ +{ + "log": { + "_recordingName": "Security Monitoring/List vulnerable assets returns \"Not found: There is no request associated with the provided token.\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "c6d229b3cd796e5e593c6ebc987186ec", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "page", + "value": { + "number": "1", + "token": "unknown" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/security/assets?page%5Btoken%5D=unknown&page%5Bnumber%5D=1" + }, + "response": { + "bodySize": 49, + "content": { + "mimeType": "application/vnd.api+json", + "size": 49, + "text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 660, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2024-12-19T16:15:24.533Z", + "time": 161 + } + ], + "pages": [], + "version": "1.2" + } +} 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 new file mode 100644 index 00000000000..41d810107a2 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/frozen.json @@ -0,0 +1 @@ +"2024-12-19T16:15:24.699Z" 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 new file mode 100644 index 00000000000..86050ccf56e --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/List-vulnerable-assets-returns-OK-response_1088765122/recording.har @@ -0,0 +1,66 @@ +{ + "log": { + "_recordingName": "Security Monitoring/List vulnerable assets returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "8b691c923faa0d44ea73715eceb660c3", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 631, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "filter", + "value": { + "repository_url": "github.com/datadog/dd-go", + "risks.in_production": "true", + "type": "Host" + } + } + ], + "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" + }, + "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": "2024-12-19T16:15:24.702Z", + "time": 253 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/security-monitoring/ListVulnerabilities.ts b/examples/v2/security-monitoring/ListVulnerabilities.ts new file mode 100644 index 00000000000..5f1b9ebef8a --- /dev/null +++ b/examples/v2/security-monitoring/ListVulnerabilities.ts @@ -0,0 +1,24 @@ +/** + * List vulnerabilities returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listVulnerabilities"] = true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +const params: v2.SecurityMonitoringApiListVulnerabilitiesRequest = { + filterCvssBaseSeverity: "High", + filterTool: "Infra", + filterAssetType: "Service", +}; + +apiInstance + .listVulnerabilities(params) + .then((data: v2.ListVulnerabilitiesResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/security-monitoring/ListVulnerableAssets.ts b/examples/v2/security-monitoring/ListVulnerableAssets.ts new file mode 100644 index 00000000000..c6c18a7e6eb --- /dev/null +++ b/examples/v2/security-monitoring/ListVulnerableAssets.ts @@ -0,0 +1,24 @@ +/** + * List vulnerable assets returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listVulnerableAssets"] = true; +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +const params: v2.SecurityMonitoringApiListVulnerableAssetsRequest = { + filterType: "Host", + filterRepositoryUrl: "github.com/datadog/dd-go", + filterRisksInProduction: true, +}; + +apiInstance + .listVulnerableAssets(params) + .then((data: v2.ListVulnerableAssetsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index d9333e2391e..f3030f4ff69 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -5070,6 +5070,236 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "GetFindingResponse", }, + "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": "", + }, + "filterArch": { + "type": "string", + "format": "", + }, + "filterOperatingSystemName": { + "type": "string", + "format": "", + }, + "filterOperatingSystemVersion": { + "type": "string", + "format": "", + }, + "operationResponseType": "ListVulnerableAssetsResponse", + }, + "v2.ListVulnerabilities": { + "pageToken": { + "type": "string", + "format": "", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "filterType": { + "type": "VulnerabilityType", + "format": "", + }, + "filterCvssBaseScoreOp": { + "type": "number", + "format": "double", + }, + "filterCvssBaseSeverity": { + "type": "Severity", + "format": "", + }, + "filterCvssBaseVector": { + "type": "string", + "format": "", + }, + "filterCvssDatadogScoreOp": { + "type": "number", + "format": "double", + }, + "filterCvssDatadogSeverity": { + "type": "Severity", + "format": "", + }, + "filterCvssDatadogVector": { + "type": "string", + "format": "", + }, + "filterStatus": { + "type": "Status", + "format": "", + }, + "filterTool": { + "type": "Tool", + "format": "", + }, + "filterLibraryName": { + "type": "string", + "format": "", + }, + "filterLibraryVersion": { + "type": "string", + "format": "", + }, + "filterAdvisoryId": { + "type": "string", + "format": "", + }, + "filterRisksExploitationProbability": { + "type": "boolean", + "format": "", + }, + "filterRisksPocExploitAvailable": { + "type": "boolean", + "format": "", + }, + "filterRisksExploitAvailable": { + "type": "boolean", + "format": "", + }, + "filterRisksEpssScoreOp": { + "type": "number", + "format": "double", + }, + "filterRisksEpssSeverity": { + "type": "Severity", + "format": "", + }, + "filterLanguage": { + "type": "string", + "format": "", + }, + "filterEcosystem": { + "type": "Ecosystem", + "format": "", + }, + "filterCodeLocationLocation": { + "type": "string", + "format": "", + }, + "filterCodeLocationFilePath": { + "type": "string", + "format": "", + }, + "filterCodeLocationMethod": { + "type": "string", + "format": "", + }, + "filterFixAvailable": { + "type": "boolean", + "format": "", + }, + "filterRepoDigests": { + "type": "string", + "format": "", + }, + "filterAssetName": { + "type": "string", + "format": "", + }, + "filterAssetType": { + "type": "AssetType", + "format": "", + }, + "filterAssetVersionFirst": { + "type": "string", + "format": "", + }, + "filterAssetVersionLast": { + "type": "string", + "format": "", + }, + "filterAssetRepositoryUrl": { + "type": "string", + "format": "", + }, + "filterAssetRisksInProduction": { + "type": "boolean", + "format": "", + }, + "filterAssetRisksUnderAttack": { + "type": "boolean", + "format": "", + }, + "filterAssetRisksIsPubliclyAccessible": { + "type": "boolean", + "format": "", + }, + "filterAssetRisksHasPrivilegedAccess": { + "type": "boolean", + "format": "", + }, + "filterAssetRisksHasAccessToSensitiveData": { + "type": "boolean", + "format": "", + }, + "filterAssetEnvironments": { + "type": "string", + "format": "", + }, + "filterAssetArch": { + "type": "string", + "format": "", + }, + "filterAssetOperatingSystemName": { + "type": "string", + "format": "", + }, + "filterAssetOperatingSystemVersion": { + "type": "string", + "format": "", + }, + "operationResponseType": "ListVulnerabilitiesResponse", + }, "v2.ListSecurityFilters": { "operationResponseType": "SecurityFiltersResponse", }, diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index a2d77f04939..1c3c32c5a85 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -638,6 +638,58 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @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 + And new "ListVulnerabilities" 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 vulnerabilities returns "Not found: There is no request associated with the provided token." response + Given operation "ListVulnerabilities" enabled + And new "ListVulnerabilities" 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: There is no request associated with the provided token. + + @team:DataDog/asm-vm + Scenario: List vulnerabilities returns "OK" response + Given operation "ListVulnerabilities" enabled + And new "ListVulnerabilities" request + And request contains "filter[cvss.base.severity]" parameter with value "High" + And request contains "filter[asset.type]" parameter with value "Service" + And request contains "filter[tool]" parameter with value "Infra" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/asm-vm + Scenario: List vulnerable assets returns "Bad request: The server cannot process the request due to invalid syntax in the request." response + Given operation "ListVulnerableAssets" enabled + And new "ListVulnerableAssets" 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 vulnerable assets returns "Not found: There is no request associated with the provided token." response + Given operation "ListVulnerableAssets" enabled + And new "ListVulnerableAssets" 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: There is no request associated with the provided token. + + @team:DataDog/asm-vm + Scenario: List vulnerable assets returns "OK" response + Given operation "ListVulnerableAssets" enabled + And new "ListVulnerableAssets" request + And request contains "filter[type]" parameter with value "Host" + And request contains "filter[repository_url]" parameter with value "github.com/datadog/dd-go" + And request contains "filter[risks.in_production]" parameter with value true + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Modify the triage assignee of a security signal returns "Bad Request" response Given new "EditSecurityMonitoringSignalAssignee" request diff --git a/features/v2/undo.json b/features/v2/undo.json index b1ed2db693d..b54d9e43a45 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1994,12 +1994,24 @@ "type": "idempotent" } }, + "ListVulnerableAssets": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "DownloadCloudWorkloadPolicyFile": { "tag": "CSM Threats", "undo": { "type": "safe" } }, + "ListVulnerabilities": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListCloudWorkloadSecurityAgentRules": { "tag": "CSM Threats", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 13a26483dbb..b9c86b8ee1f 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -281,6 +281,8 @@ export function createConfiguration( "v2.getHistoricalJob": false, "v2.listFindings": false, "v2.listHistoricalJobs": false, + "v2.listVulnerabilities": false, + "v2.listVulnerableAssets": false, "v2.muteFindings": false, "v2.runHistoricalJob": false, "v2.createScorecardOutcomesBatch": false, diff --git a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts index b5c979f7a78..a25c5628a42 100644 --- a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts +++ b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts @@ -17,9 +17,11 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { AssetType } from "../models/AssetType"; import { BulkMuteFindingsRequest } from "../models/BulkMuteFindingsRequest"; import { BulkMuteFindingsResponse } from "../models/BulkMuteFindingsResponse"; import { ConvertJobResultsToSignalsRequest } from "../models/ConvertJobResultsToSignalsRequest"; +import { Ecosystem } from "../models/Ecosystem"; import { Finding } from "../models/Finding"; import { FindingEvaluation } from "../models/FindingEvaluation"; import { FindingStatus } from "../models/FindingStatus"; @@ -30,6 +32,8 @@ import { JobCreateResponse } from "../models/JobCreateResponse"; import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; import { ListFindingsResponse } from "../models/ListFindingsResponse"; import { ListHistoricalJobsResponse } from "../models/ListHistoricalJobsResponse"; +import { ListVulnerabilitiesResponse } from "../models/ListVulnerabilitiesResponse"; +import { ListVulnerableAssetsResponse } from "../models/ListVulnerableAssetsResponse"; import { RunHistoricalJobRequest } from "../models/RunHistoricalJobRequest"; import { SecurityFilterCreateRequest } from "../models/SecurityFilterCreateRequest"; import { SecurityFilterResponse } from "../models/SecurityFilterResponse"; @@ -58,6 +62,10 @@ import { SecurityMonitoringSuppressionCreateRequest } from "../models/SecurityMo import { SecurityMonitoringSuppressionResponse } from "../models/SecurityMonitoringSuppressionResponse"; import { SecurityMonitoringSuppressionsResponse } from "../models/SecurityMonitoringSuppressionsResponse"; import { SecurityMonitoringSuppressionUpdateRequest } from "../models/SecurityMonitoringSuppressionUpdateRequest"; +import { Severity } from "../models/Severity"; +import { Status } from "../models/Status"; +import { Tool } from "../models/Tool"; +import { VulnerabilityType } from "../models/VulnerabilityType"; export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { public async cancelHistoricalJob( @@ -1304,6 +1312,560 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listVulnerabilities( + pageToken?: string, + pageNumber?: number, + filterType?: VulnerabilityType, + filterCvssBaseScoreOp?: number, + filterCvssBaseSeverity?: Severity, + filterCvssBaseVector?: string, + filterCvssDatadogScoreOp?: number, + filterCvssDatadogSeverity?: Severity, + filterCvssDatadogVector?: string, + filterStatus?: Status, + filterTool?: Tool, + filterLibraryName?: string, + filterLibraryVersion?: string, + filterAdvisoryId?: string, + filterRisksExploitationProbability?: boolean, + filterRisksPocExploitAvailable?: boolean, + filterRisksExploitAvailable?: boolean, + filterRisksEpssScoreOp?: number, + filterRisksEpssSeverity?: Severity, + filterLanguage?: string, + filterEcosystem?: Ecosystem, + filterCodeLocationLocation?: string, + filterCodeLocationFilePath?: string, + filterCodeLocationMethod?: string, + filterFixAvailable?: boolean, + filterRepoDigests?: string, + filterAssetName?: string, + filterAssetType?: AssetType, + filterAssetVersionFirst?: string, + filterAssetVersionLast?: string, + filterAssetRepositoryUrl?: string, + filterAssetRisksInProduction?: boolean, + filterAssetRisksUnderAttack?: boolean, + filterAssetRisksIsPubliclyAccessible?: boolean, + filterAssetRisksHasPrivilegedAccess?: boolean, + filterAssetRisksHasAccessToSensitiveData?: boolean, + filterAssetEnvironments?: string, + filterAssetArch?: string, + filterAssetOperatingSystemName?: string, + filterAssetOperatingSystemVersion?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listVulnerabilities'"); + if (!_config.unstableOperations["v2.listVulnerabilities"]) { + throw new Error("Unstable operation 'listVulnerabilities' is disabled"); + } + + // Path Params + const localVarPath = "/api/v2/security/vulnerabilities"; + + // Make Request Context + const requestContext = _config + .getServer("v2.SecurityMonitoringApi.listVulnerabilities") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageToken !== undefined) { + requestContext.setQueryParam( + "page[token]", + ObjectSerializer.serialize(pageToken, "string", ""), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + if (filterType !== undefined) { + requestContext.setQueryParam( + "filter[type]", + ObjectSerializer.serialize(filterType, "VulnerabilityType", ""), + "" + ); + } + if (filterCvssBaseScoreOp !== undefined) { + requestContext.setQueryParam( + "filter[cvss.base.score][`$op`]", + ObjectSerializer.serialize(filterCvssBaseScoreOp, "number", "double"), + "" + ); + } + if (filterCvssBaseSeverity !== undefined) { + requestContext.setQueryParam( + "filter[cvss.base.severity]", + ObjectSerializer.serialize(filterCvssBaseSeverity, "Severity", ""), + "" + ); + } + if (filterCvssBaseVector !== undefined) { + requestContext.setQueryParam( + "filter[cvss.base.vector]", + ObjectSerializer.serialize(filterCvssBaseVector, "string", ""), + "" + ); + } + if (filterCvssDatadogScoreOp !== undefined) { + requestContext.setQueryParam( + "filter[cvss.datadog.score][`$op`]", + ObjectSerializer.serialize( + filterCvssDatadogScoreOp, + "number", + "double" + ), + "" + ); + } + if (filterCvssDatadogSeverity !== undefined) { + requestContext.setQueryParam( + "filter[cvss.datadog.severity]", + ObjectSerializer.serialize(filterCvssDatadogSeverity, "Severity", ""), + "" + ); + } + if (filterCvssDatadogVector !== undefined) { + requestContext.setQueryParam( + "filter[cvss.datadog.vector]", + ObjectSerializer.serialize(filterCvssDatadogVector, "string", ""), + "" + ); + } + if (filterStatus !== undefined) { + requestContext.setQueryParam( + "filter[status]", + ObjectSerializer.serialize(filterStatus, "Status", ""), + "" + ); + } + if (filterTool !== undefined) { + requestContext.setQueryParam( + "filter[tool]", + ObjectSerializer.serialize(filterTool, "Tool", ""), + "" + ); + } + if (filterLibraryName !== undefined) { + requestContext.setQueryParam( + "filter[library.name]", + ObjectSerializer.serialize(filterLibraryName, "string", ""), + "" + ); + } + if (filterLibraryVersion !== undefined) { + requestContext.setQueryParam( + "filter[library.version]", + ObjectSerializer.serialize(filterLibraryVersion, "string", ""), + "" + ); + } + if (filterAdvisoryId !== undefined) { + requestContext.setQueryParam( + "filter[advisory_id]", + ObjectSerializer.serialize(filterAdvisoryId, "string", ""), + "" + ); + } + if (filterRisksExploitationProbability !== undefined) { + requestContext.setQueryParam( + "filter[risks.exploitation_probability]", + ObjectSerializer.serialize( + filterRisksExploitationProbability, + "boolean", + "" + ), + "" + ); + } + if (filterRisksPocExploitAvailable !== undefined) { + requestContext.setQueryParam( + "filter[risks.poc_exploit_available]", + ObjectSerializer.serialize( + filterRisksPocExploitAvailable, + "boolean", + "" + ), + "" + ); + } + if (filterRisksExploitAvailable !== undefined) { + requestContext.setQueryParam( + "filter[risks.exploit_available]", + ObjectSerializer.serialize(filterRisksExploitAvailable, "boolean", ""), + "" + ); + } + if (filterRisksEpssScoreOp !== undefined) { + requestContext.setQueryParam( + "filter[risks.epss.score][`$op`]", + ObjectSerializer.serialize(filterRisksEpssScoreOp, "number", "double"), + "" + ); + } + if (filterRisksEpssSeverity !== undefined) { + requestContext.setQueryParam( + "filter[risks.epss.severity]", + ObjectSerializer.serialize(filterRisksEpssSeverity, "Severity", ""), + "" + ); + } + if (filterLanguage !== undefined) { + requestContext.setQueryParam( + "filter[language]", + ObjectSerializer.serialize(filterLanguage, "string", ""), + "" + ); + } + if (filterEcosystem !== undefined) { + requestContext.setQueryParam( + "filter[ecosystem]", + ObjectSerializer.serialize(filterEcosystem, "Ecosystem", ""), + "" + ); + } + if (filterCodeLocationLocation !== undefined) { + requestContext.setQueryParam( + "filter[code_location.location]", + ObjectSerializer.serialize(filterCodeLocationLocation, "string", ""), + "" + ); + } + if (filterCodeLocationFilePath !== undefined) { + requestContext.setQueryParam( + "filter[code_location.file_path]", + ObjectSerializer.serialize(filterCodeLocationFilePath, "string", ""), + "" + ); + } + if (filterCodeLocationMethod !== undefined) { + requestContext.setQueryParam( + "filter[code_location.method]", + ObjectSerializer.serialize(filterCodeLocationMethod, "string", ""), + "" + ); + } + if (filterFixAvailable !== undefined) { + requestContext.setQueryParam( + "filter[fix_available]", + ObjectSerializer.serialize(filterFixAvailable, "boolean", ""), + "" + ); + } + if (filterRepoDigests !== undefined) { + requestContext.setQueryParam( + "filter[repo_digests]", + ObjectSerializer.serialize(filterRepoDigests, "string", ""), + "" + ); + } + if (filterAssetName !== undefined) { + requestContext.setQueryParam( + "filter[asset.name]", + ObjectSerializer.serialize(filterAssetName, "string", ""), + "" + ); + } + if (filterAssetType !== undefined) { + requestContext.setQueryParam( + "filter[asset.type]", + ObjectSerializer.serialize(filterAssetType, "AssetType", ""), + "" + ); + } + if (filterAssetVersionFirst !== undefined) { + requestContext.setQueryParam( + "filter[asset.version.first]", + ObjectSerializer.serialize(filterAssetVersionFirst, "string", ""), + "" + ); + } + if (filterAssetVersionLast !== undefined) { + requestContext.setQueryParam( + "filter[asset.version.last]", + ObjectSerializer.serialize(filterAssetVersionLast, "string", ""), + "" + ); + } + if (filterAssetRepositoryUrl !== undefined) { + requestContext.setQueryParam( + "filter[asset.repository_url]", + ObjectSerializer.serialize(filterAssetRepositoryUrl, "string", ""), + "" + ); + } + if (filterAssetRisksInProduction !== undefined) { + requestContext.setQueryParam( + "filter[asset.risks.in_production]", + ObjectSerializer.serialize(filterAssetRisksInProduction, "boolean", ""), + "" + ); + } + if (filterAssetRisksUnderAttack !== undefined) { + requestContext.setQueryParam( + "filter[asset.risks.under_attack]", + ObjectSerializer.serialize(filterAssetRisksUnderAttack, "boolean", ""), + "" + ); + } + if (filterAssetRisksIsPubliclyAccessible !== undefined) { + requestContext.setQueryParam( + "filter[asset.risks.is_publicly_accessible]", + ObjectSerializer.serialize( + filterAssetRisksIsPubliclyAccessible, + "boolean", + "" + ), + "" + ); + } + if (filterAssetRisksHasPrivilegedAccess !== undefined) { + requestContext.setQueryParam( + "filter[asset.risks.has_privileged_access]", + ObjectSerializer.serialize( + filterAssetRisksHasPrivilegedAccess, + "boolean", + "" + ), + "" + ); + } + if (filterAssetRisksHasAccessToSensitiveData !== undefined) { + requestContext.setQueryParam( + "filter[asset.risks.has_access_to_sensitive_data]", + ObjectSerializer.serialize( + filterAssetRisksHasAccessToSensitiveData, + "boolean", + "" + ), + "" + ); + } + if (filterAssetEnvironments !== undefined) { + requestContext.setQueryParam( + "filter[asset.environments]", + ObjectSerializer.serialize(filterAssetEnvironments, "string", ""), + "" + ); + } + if (filterAssetArch !== undefined) { + requestContext.setQueryParam( + "filter[asset.arch]", + ObjectSerializer.serialize(filterAssetArch, "string", ""), + "" + ); + } + if (filterAssetOperatingSystemName !== undefined) { + requestContext.setQueryParam( + "filter[asset.operating_system.name]", + ObjectSerializer.serialize( + filterAssetOperatingSystemName, + "string", + "" + ), + "" + ); + } + if (filterAssetOperatingSystemVersion !== undefined) { + requestContext.setQueryParam( + "filter[asset.operating_system.version]", + ObjectSerializer.serialize( + filterAssetOperatingSystemVersion, + "string", + "" + ), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listVulnerableAssets( + pageToken?: string, + pageNumber?: number, + filterName?: string, + filterType?: AssetType, + filterVersionFirst?: string, + filterVersionLast?: string, + filterRepositoryUrl?: string, + filterRisksInProduction?: boolean, + filterRisksUnderAttack?: boolean, + filterRisksIsPubliclyAccessible?: boolean, + filterRisksHasPrivilegedAccess?: boolean, + filterRisksHasAccessToSensitiveData?: boolean, + filterEnvironments?: string, + filterArch?: string, + filterOperatingSystemName?: string, + filterOperatingSystemVersion?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listVulnerableAssets'"); + if (!_config.unstableOperations["v2.listVulnerableAssets"]) { + throw new Error("Unstable operation 'listVulnerableAssets' is disabled"); + } + + // Path Params + const localVarPath = "/api/v2/security/assets"; + + // Make Request Context + const requestContext = _config + .getServer("v2.SecurityMonitoringApi.listVulnerableAssets") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageToken !== undefined) { + requestContext.setQueryParam( + "page[token]", + ObjectSerializer.serialize(pageToken, "string", ""), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + if (filterName !== undefined) { + requestContext.setQueryParam( + "filter[name]", + ObjectSerializer.serialize(filterName, "string", ""), + "" + ); + } + if (filterType !== undefined) { + requestContext.setQueryParam( + "filter[type]", + ObjectSerializer.serialize(filterType, "AssetType", ""), + "" + ); + } + if (filterVersionFirst !== undefined) { + requestContext.setQueryParam( + "filter[version.first]", + ObjectSerializer.serialize(filterVersionFirst, "string", ""), + "" + ); + } + if (filterVersionLast !== undefined) { + requestContext.setQueryParam( + "filter[version.last]", + ObjectSerializer.serialize(filterVersionLast, "string", ""), + "" + ); + } + if (filterRepositoryUrl !== undefined) { + requestContext.setQueryParam( + "filter[repository_url]", + ObjectSerializer.serialize(filterRepositoryUrl, "string", ""), + "" + ); + } + if (filterRisksInProduction !== undefined) { + requestContext.setQueryParam( + "filter[risks.in_production]", + ObjectSerializer.serialize(filterRisksInProduction, "boolean", ""), + "" + ); + } + if (filterRisksUnderAttack !== undefined) { + requestContext.setQueryParam( + "filter[risks.under_attack]", + ObjectSerializer.serialize(filterRisksUnderAttack, "boolean", ""), + "" + ); + } + if (filterRisksIsPubliclyAccessible !== undefined) { + requestContext.setQueryParam( + "filter[risks.is_publicly_accessible]", + ObjectSerializer.serialize( + filterRisksIsPubliclyAccessible, + "boolean", + "" + ), + "" + ); + } + if (filterRisksHasPrivilegedAccess !== undefined) { + requestContext.setQueryParam( + "filter[risks.has_privileged_access]", + ObjectSerializer.serialize( + filterRisksHasPrivilegedAccess, + "boolean", + "" + ), + "" + ); + } + if (filterRisksHasAccessToSensitiveData !== undefined) { + requestContext.setQueryParam( + "filter[risks.has_access_to_sensitive_data]", + ObjectSerializer.serialize( + filterRisksHasAccessToSensitiveData, + "boolean", + "" + ), + "" + ); + } + if (filterEnvironments !== undefined) { + requestContext.setQueryParam( + "filter[environments]", + ObjectSerializer.serialize(filterEnvironments, "string", ""), + "" + ); + } + if (filterArch !== undefined) { + requestContext.setQueryParam( + "filter[arch]", + ObjectSerializer.serialize(filterArch, "string", ""), + "" + ); + } + if (filterOperatingSystemName !== undefined) { + requestContext.setQueryParam( + "filter[operating_system.name]", + ObjectSerializer.serialize(filterOperatingSystemName, "string", ""), + "" + ); + } + if (filterOperatingSystemVersion !== undefined) { + requestContext.setQueryParam( + "filter[operating_system.version]", + ObjectSerializer.serialize(filterOperatingSystemVersion, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async muteFindings( body: BulkMuteFindingsRequest, _options?: Configuration @@ -3316,7 +3878,182 @@ export class SecurityMonitoringApiResponseProcessor { ) as SecurityMonitoringSuppressionsResponse; return body; } - if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: SecurityMonitoringSuppressionsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringSuppressionsResponse", + "" + ) as SecurityMonitoringSuppressionsResponse; + 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 + * + * @params response Response returned by the server for a request to listVulnerabilities + * @throws ApiException if the response code was not in [200, 299] + */ + public async listVulnerabilities( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ListVulnerabilitiesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListVulnerabilitiesResponse" + ) as ListVulnerabilitiesResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 500 || + response.httpStatusCode === 504 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: ListVulnerabilitiesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListVulnerabilitiesResponse", + "" + ) as ListVulnerabilitiesResponse; + 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 + * + * @params response Response returned by the server for a request to listVulnerableAssets + * @throws ApiException if the response code was not in [200, 299] + */ + public async listVulnerableAssets( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ListVulnerableAssetsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListVulnerableAssetsResponse" + ) as ListVulnerableAssetsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 500 || + response.httpStatusCode === 504 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.parse( await response.body.text(), contentType @@ -3339,12 +4076,11 @@ export class SecurityMonitoringApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: SecurityMonitoringSuppressionsResponse = - ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringSuppressionsResponse", - "" - ) as SecurityMonitoringSuppressionsResponse; + const body: ListVulnerableAssetsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListVulnerableAssetsResponse", + "" + ) as ListVulnerableAssetsResponse; return body; } @@ -4249,6 +4985,292 @@ export interface SecurityMonitoringApiListSecurityMonitoringSignalsRequest { pageLimit?: number; } +export interface SecurityMonitoringApiListVulnerabilitiesRequest { + /** + * 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 or greater than `1` + * @type number + */ + pageNumber?: number; + /** + * Filter by vulnerability type. + * @type VulnerabilityType + */ + filterType?: VulnerabilityType; + /** + * Filter by vulnerability base (i.e. from the original advisory) severity score. + * @type number + */ + filterCvssBaseScoreOp?: number; + /** + * Filter by vulnerability base severity. + * @type Severity + */ + filterCvssBaseSeverity?: Severity; + /** + * Filter by vulnerability base CVSS vector. + * @type string + */ + filterCvssBaseVector?: string; + /** + * Filter by vulnerability Datadog severity score. + * @type number + */ + filterCvssDatadogScoreOp?: number; + /** + * Filter by vulnerability Datadog severity. + * @type Severity + */ + filterCvssDatadogSeverity?: Severity; + /** + * Filter by vulnerability Datadog CVSS vector. + * @type string + */ + filterCvssDatadogVector?: string; + /** + * Filter by the status of the vulnerability. + * @type Status + */ + filterStatus?: Status; + /** + * Filter by the tool of the vulnerability. + * @type Tool + */ + filterTool?: Tool; + /** + * Filter by library name. + * @type string + */ + filterLibraryName?: string; + /** + * Filter by library version. + * @type string + */ + filterLibraryVersion?: string; + /** + * Filter by advisory ID. + * @type string + */ + filterAdvisoryId?: string; + /** + * Filter by exploitation probability. + * @type boolean + */ + filterRisksExploitationProbability?: boolean; + /** + * Filter by POC exploit availability. + * @type boolean + */ + filterRisksPocExploitAvailable?: boolean; + /** + * Filter by public exploit availability. + * @type boolean + */ + filterRisksExploitAvailable?: boolean; + /** + * Filter by vulnerability [EPSS](https://www.first.org/epss/) severity score. + * @type number + */ + filterRisksEpssScoreOp?: number; + /** + * Filter by vulnerability [EPSS](https://www.first.org/epss/) severity. + * @type Severity + */ + filterRisksEpssSeverity?: Severity; + /** + * Filter by language. + * @type string + */ + filterLanguage?: string; + /** + * Filter by ecosystem. + * @type Ecosystem + */ + filterEcosystem?: Ecosystem; + /** + * Filter by vulnerability location. + * @type string + */ + filterCodeLocationLocation?: string; + /** + * Filter by vulnerability file path. + * @type string + */ + filterCodeLocationFilePath?: string; + /** + * Filter by method. + * @type string + */ + filterCodeLocationMethod?: string; + /** + * Filter by fix availability. + * @type boolean + */ + filterFixAvailable?: boolean; + /** + * Filter by vulnerability `repo_digest` (when the vulnerability is related to `Image` asset). + * @type string + */ + filterRepoDigests?: string; + /** + * Filter by asset name. + * @type string + */ + filterAssetName?: string; + /** + * Filter by asset type. + * @type AssetType + */ + filterAssetType?: AssetType; + /** + * Filter by the first version of the asset this vulnerability has been detected on. + * @type string + */ + filterAssetVersionFirst?: string; + /** + * Filter by the last version of the asset this vulnerability has been detected on. + * @type string + */ + filterAssetVersionLast?: string; + /** + * Filter by the repository url associated to the asset. + * @type string + */ + filterAssetRepositoryUrl?: string; + /** + * Filter whether the asset is in production or not. + * @type boolean + */ + filterAssetRisksInProduction?: boolean; + /** + * Filter whether the asset is under attack or not. + * @type boolean + */ + filterAssetRisksUnderAttack?: boolean; + /** + * Filter whether the asset is publicly accessible or not. + * @type boolean + */ + filterAssetRisksIsPubliclyAccessible?: boolean; + /** + * Filter whether the asset is publicly accessible or not. + * @type boolean + */ + filterAssetRisksHasPrivilegedAccess?: boolean; + /** + * Filter whether the asset has access to sensitive data or not. + * @type boolean + */ + filterAssetRisksHasAccessToSensitiveData?: boolean; + /** + * Filter by asset environments. + * @type string + */ + filterAssetEnvironments?: string; + /** + * Filter by asset architecture. + * @type string + */ + filterAssetArch?: string; + /** + * Filter by asset operating system name. + * @type string + */ + filterAssetOperatingSystemName?: string; + /** + * Filter by asset operating system version. + * @type string + */ + filterAssetOperatingSystemVersion?: string; +} + +export interface SecurityMonitoringApiListVulnerableAssetsRequest { + /** + * 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 or greater than `1` + * @type number + */ + pageNumber?: number; + /** + * Filter by name. + * @type string + */ + filterName?: string; + /** + * Filter by type. + * @type AssetType + */ + filterType?: AssetType; + /** + * Filter by the first version of the asset since it has been vulnerable. + * @type string + */ + filterVersionFirst?: string; + /** + * Filter by the last detected version of the asset. + * @type string + */ + filterVersionLast?: string; + /** + * Filter by the repository url associated to the asset. + * @type string + */ + filterRepositoryUrl?: string; + /** + * Filter whether the asset is in production or not. + * @type boolean + */ + filterRisksInProduction?: boolean; + /** + * Filter whether the asset (Service) is under attack or not. + * @type boolean + */ + filterRisksUnderAttack?: boolean; + /** + * Filter whether the asset (Host) is publicly accessible or not. + * @type boolean + */ + filterRisksIsPubliclyAccessible?: boolean; + /** + * Filter whether the asset (Host) has privileged access or not. + * @type boolean + */ + filterRisksHasPrivilegedAccess?: boolean; + /** + * Filter whether the asset (Host) has access to sensitive data or not. + * @type boolean + */ + filterRisksHasAccessToSensitiveData?: boolean; + /** + * Filter by environment. + * @type string + */ + filterEnvironments?: string; + /** + * Filter by architecture. + * @type string + */ + filterArch?: string; + /** + * Filter by operating system name. + * @type string + */ + filterOperatingSystemName?: string; + /** + * Filter by operating system version. + * @type string + */ + filterOperatingSystemVersion?: string; +} + export interface SecurityMonitoringApiMuteFindingsRequest { /** * ### Attributes @@ -5126,6 +6148,193 @@ export class SecurityMonitoringApi { }); } + /** + * Get a list of vulnerabilities. + * + * ### Pagination + * + * Pagination is enabled by default in both `vulnerabilities` and `assets`. The size of the page varies depending on the endpoint and cannot be modified. To automate the request of the next page, you can use the links section in the response. + * + * This endpoint will return paginated responses. The pages are stored in the links section of the response: + * + * ```JSON + * { + * "data": [...], + * "meta": {...}, + * "links": { + * "self": "https://.../api/v2/security/vulnerabilities", + * "first": "https://.../api/v2/security/vulnerabilities?page[number]=1&page[token]=abc", + * "last": "https://.../api/v2/security/vulnerabilities?page[number]=43&page[token]=abc", + * "next": "https://.../api/v2/security/vulnerabilities?page[number]=2&page[token]=abc" + * } + * } + * ``` + * + * + * - `links.previous` is empty if the first page is requested. + * - `links.next` is empty if the last page is requested. + * + * #### Token + * + * Vulnerabilities can be created, updated or deleted at any point in time. + * + * Upon the first request, a token is created to ensure consistency across subsequent paginated requests. + * + * A token is valid only for 24 hours. + * + * #### First request + * + * We consider a request to be the first request when there is no `page[token]` parameter. + * + * The response of this first request contains the newly created token in the `links` section. + * + * This token can then be used in the subsequent paginated requests. + * + * #### Subsequent requests + * + * Any request containing valid `page[token]` and `page[number]` parameters will be considered a subsequent request. + * + * If the `token` is invalid, a `404` response will be returned. + * + * If the page `number` is invalid, a `400` response will be returned. + * + * ### 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. + * + * All 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`. + * + * String filters are case sensitive. + * + * Boolean filters accept `true` or `false` as values. + * + * Number 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`. + * + * Available operators are: `eq` (==), `lt` (<), `lte` (<=), `gt` (>) and `gte` (>=). + * + * ### Metadata + * + * Following [JSON:API format](https://jsonapi.org/format/#document-meta), object including non-standard meta-information. + * + * This 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. + * + * ```JSON + * { + * "data": [...], + * "meta": { + * "total": 1500, + * "count": 18732, + * "token": "some_token" + * }, + * "links": {...} + * } + * ``` + * @param param The request object + */ + public listVulnerabilities( + param: SecurityMonitoringApiListVulnerabilitiesRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listVulnerabilities( + param.pageToken, + param.pageNumber, + param.filterType, + param.filterCvssBaseScoreOp, + param.filterCvssBaseSeverity, + param.filterCvssBaseVector, + param.filterCvssDatadogScoreOp, + param.filterCvssDatadogSeverity, + param.filterCvssDatadogVector, + param.filterStatus, + param.filterTool, + param.filterLibraryName, + param.filterLibraryVersion, + param.filterAdvisoryId, + param.filterRisksExploitationProbability, + param.filterRisksPocExploitAvailable, + param.filterRisksExploitAvailable, + param.filterRisksEpssScoreOp, + param.filterRisksEpssSeverity, + param.filterLanguage, + param.filterEcosystem, + param.filterCodeLocationLocation, + param.filterCodeLocationFilePath, + param.filterCodeLocationMethod, + param.filterFixAvailable, + param.filterRepoDigests, + param.filterAssetName, + param.filterAssetType, + param.filterAssetVersionFirst, + param.filterAssetVersionLast, + param.filterAssetRepositoryUrl, + param.filterAssetRisksInProduction, + param.filterAssetRisksUnderAttack, + param.filterAssetRisksIsPubliclyAccessible, + param.filterAssetRisksHasPrivilegedAccess, + param.filterAssetRisksHasAccessToSensitiveData, + param.filterAssetEnvironments, + param.filterAssetArch, + param.filterAssetOperatingSystemName, + param.filterAssetOperatingSystemVersion, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listVulnerabilities(responseContext); + }); + }); + } + + /** + * 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. + * @param param The request object + */ + public listVulnerableAssets( + param: SecurityMonitoringApiListVulnerableAssetsRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listVulnerableAssets( + param.pageToken, + param.pageNumber, + param.filterName, + param.filterType, + param.filterVersionFirst, + param.filterVersionLast, + param.filterRepositoryUrl, + param.filterRisksInProduction, + param.filterRisksUnderAttack, + param.filterRisksIsPubliclyAccessible, + param.filterRisksHasPrivilegedAccess, + param.filterRisksHasAccessToSensitiveData, + param.filterEnvironments, + param.filterArch, + param.filterOperatingSystemName, + param.filterOperatingSystemVersion, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listVulnerableAssets(responseContext); + }); + }); + } + /** * Mute or unmute findings. * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index a24acd5fb60..3aaa2d492d1 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -469,6 +469,8 @@ export { SecurityMonitoringApiListHistoricalJobsRequest, SecurityMonitoringApiListSecurityMonitoringRulesRequest, SecurityMonitoringApiListSecurityMonitoringSignalsRequest, + SecurityMonitoringApiListVulnerabilitiesRequest, + SecurityMonitoringApiListVulnerableAssetsRequest, SecurityMonitoringApiMuteFindingsRequest, SecurityMonitoringApiRunHistoricalJobRequest, SecurityMonitoringApiSearchSecurityMonitoringSignalsRequest, @@ -614,6 +616,7 @@ export { ActiveBillingDimensionsAttributes } from "./models/ActiveBillingDimensi export { ActiveBillingDimensionsBody } from "./models/ActiveBillingDimensionsBody"; export { ActiveBillingDimensionsResponse } from "./models/ActiveBillingDimensionsResponse"; export { ActiveBillingDimensionsType } from "./models/ActiveBillingDimensionsType"; +export { Advisory } from "./models/Advisory"; export { APIErrorResponse } from "./models/APIErrorResponse"; export { APIKeyCreateAttributes } from "./models/APIKeyCreateAttributes"; export { APIKeyCreateData } from "./models/APIKeyCreateData"; @@ -651,6 +654,13 @@ export { ApplicationKeyUpdateData } from "./models/ApplicationKeyUpdateData"; export { ApplicationKeyUpdateRequest } from "./models/ApplicationKeyUpdateRequest"; export { AppMeta } from "./models/AppMeta"; export { AppsSortField } from "./models/AppsSortField"; +export { Asset } from "./models/Asset"; +export { AssetAttributes } from "./models/AssetAttributes"; +export { AssetAttributesOperatingSystem } from "./models/AssetAttributesOperatingSystem"; +export { AssetAttributesRisks } from "./models/AssetAttributesRisks"; +export { AssetAttributesVersion } from "./models/AssetAttributesVersion"; +export { AssetEntityType } from "./models/AssetEntityType"; +export { AssetType } from "./models/AssetType"; export { AuditLogsEvent } from "./models/AuditLogsEvent"; export { AuditLogsEventAttributes } from "./models/AuditLogsEventAttributes"; export { AuditLogsEventsResponse } from "./models/AuditLogsEventsResponse"; @@ -908,6 +918,7 @@ export { CloudWorkloadSecurityAgentRuleUpdateAttributes } from "./models/CloudWo export { CloudWorkloadSecurityAgentRuleUpdateData } from "./models/CloudWorkloadSecurityAgentRuleUpdateData"; export { CloudWorkloadSecurityAgentRuleUpdaterAttributes } from "./models/CloudWorkloadSecurityAgentRuleUpdaterAttributes"; export { CloudWorkloadSecurityAgentRuleUpdateRequest } from "./models/CloudWorkloadSecurityAgentRuleUpdateRequest"; +export { CodeLocation } from "./models/CodeLocation"; export { Component } from "./models/Component"; export { ComponentGrid } from "./models/ComponentGrid"; export { ComponentGridProperties } from "./models/ComponentGridProperties"; @@ -1057,6 +1068,7 @@ export { CustomDestinationType } from "./models/CustomDestinationType"; export { CustomDestinationUpdateRequest } from "./models/CustomDestinationUpdateRequest"; export { CustomDestinationUpdateRequestAttributes } from "./models/CustomDestinationUpdateRequestAttributes"; export { CustomDestinationUpdateRequestDefinition } from "./models/CustomDestinationUpdateRequestDefinition"; +export { CVSS } from "./models/CVSS"; export { DashboardListAddItemsRequest } from "./models/DashboardListAddItemsRequest"; export { DashboardListAddItemsResponse } from "./models/DashboardListAddItemsResponse"; export { DashboardListDeleteItemsRequest } from "./models/DashboardListDeleteItemsRequest"; @@ -1081,6 +1093,7 @@ export { DeleteAppsRequestDataItemsType } from "./models/DeleteAppsRequestDataIt export { DeleteAppsResponse } from "./models/DeleteAppsResponse"; export { DeleteAppsResponseDataItems } from "./models/DeleteAppsResponseDataItems"; export { DeleteAppsResponseDataItemsType } from "./models/DeleteAppsResponseDataItemsType"; +export { DependencyLocation } from "./models/DependencyLocation"; export { DeployAppResponse } from "./models/DeployAppResponse"; export { DeployAppResponseData } from "./models/DeployAppResponseData"; export { DeployAppResponseDataAttributes } from "./models/DeployAppResponseDataAttributes"; @@ -1162,6 +1175,7 @@ export { DowntimeStatus } from "./models/DowntimeStatus"; export { DowntimeUpdateRequest } from "./models/DowntimeUpdateRequest"; export { DowntimeUpdateRequestAttributes } from "./models/DowntimeUpdateRequestAttributes"; export { DowntimeUpdateRequestData } from "./models/DowntimeUpdateRequestData"; +export { Ecosystem } from "./models/Ecosystem"; export { EntityAttributes } from "./models/EntityAttributes"; export { EntityData } from "./models/EntityData"; export { EntityMeta } from "./models/EntityMeta"; @@ -1215,6 +1229,7 @@ export { EntityV3System } from "./models/EntityV3System"; export { EntityV3SystemDatadog } from "./models/EntityV3SystemDatadog"; export { EntityV3SystemKind } from "./models/EntityV3SystemKind"; export { EntityV3SystemSpec } from "./models/EntityV3SystemSpec"; +export { EPSS } from "./models/EPSS"; export { Event } from "./models/Event"; export { EventAttributes } from "./models/EventAttributes"; export { EventCategory } from "./models/EventCategory"; @@ -1495,6 +1510,8 @@ export { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; export { LeakedKey } from "./models/LeakedKey"; export { LeakedKeyAttributes } from "./models/LeakedKeyAttributes"; export { LeakedKeyType } from "./models/LeakedKeyType"; +export { Library } from "./models/Library"; +export { Links } from "./models/Links"; export { ListAPIsResponse } from "./models/ListAPIsResponse"; export { ListAPIsResponseData } from "./models/ListAPIsResponseData"; export { ListAPIsResponseDataAttributes } from "./models/ListAPIsResponseDataAttributes"; @@ -1528,6 +1545,8 @@ export { ListTagsResponseData } from "./models/ListTagsResponseData"; export { ListTagsResponseDataAttributes } from "./models/ListTagsResponseDataAttributes"; export { ListTeamsInclude } from "./models/ListTeamsInclude"; export { ListTeamsSort } from "./models/ListTeamsSort"; +export { ListVulnerabilitiesResponse } from "./models/ListVulnerabilitiesResponse"; +export { ListVulnerableAssetsResponse } from "./models/ListVulnerableAssetsResponse"; export { Log } from "./models/Log"; export { LogAttributes } from "./models/LogAttributes"; export { LogsAggregateBucket } from "./models/LogsAggregateBucket"; @@ -1603,6 +1622,7 @@ export { LogsSortOrder } from "./models/LogsSortOrder"; export { LogsStorageTier } from "./models/LogsStorageTier"; export { LogsWarning } from "./models/LogsWarning"; export { LogType } from "./models/LogType"; +export { Metadata } from "./models/Metadata"; export { Metric } from "./models/Metric"; export { MetricActiveConfigurationType } from "./models/MetricActiveConfigurationType"; export { MetricAllTags } from "./models/MetricAllTags"; @@ -1885,6 +1905,7 @@ export { RelationshipToUserTeamTeamData } from "./models/RelationshipToUserTeamT export { RelationshipToUserTeamUser } from "./models/RelationshipToUserTeamUser"; export { RelationshipToUserTeamUserData } from "./models/RelationshipToUserTeamUserData"; export { RelationType } from "./models/RelationType"; +export { Remediation } from "./models/Remediation"; export { ReorderRetentionFiltersRequest } from "./models/ReorderRetentionFiltersRequest"; export { ResponseMetaAttributes } from "./models/ResponseMetaAttributes"; export { RestrictionPolicy } from "./models/RestrictionPolicy"; @@ -2250,6 +2271,7 @@ export { ServiceDefinitionV2SlackType } from "./models/ServiceDefinitionV2SlackT export { ServiceDefinitionV2Version } from "./models/ServiceDefinitionV2Version"; export { ServiceNowTicket } from "./models/ServiceNowTicket"; export { ServiceNowTicketResult } from "./models/ServiceNowTicketResult"; +export { Severity } from "./models/Severity"; export { SlackIntegrationMetadata } from "./models/SlackIntegrationMetadata"; export { SlackIntegrationMetadataChannelItem } from "./models/SlackIntegrationMetadataChannelItem"; export { SloReportCreateRequest } from "./models/SloReportCreateRequest"; @@ -2323,6 +2345,7 @@ export { SpansSortOrder } from "./models/SpansSortOrder"; export { SpansType } from "./models/SpansType"; export { SpansWarning } from "./models/SpansWarning"; export { State } from "./models/State"; +export { Status } from "./models/Status"; export { Team } from "./models/Team"; export { TeamAttributes } from "./models/TeamAttributes"; export { TeamCreate } from "./models/TeamCreate"; @@ -2370,6 +2393,7 @@ export { TimeseriesQuery } from "./models/TimeseriesQuery"; export { TimeseriesResponse } from "./models/TimeseriesResponse"; export { TimeseriesResponseAttributes } from "./models/TimeseriesResponseAttributes"; export { TimeseriesResponseSeries } from "./models/TimeseriesResponseSeries"; +export { Tool } from "./models/Tool"; export { Unit } from "./models/Unit"; export { UpdateAppRequest } from "./models/UpdateAppRequest"; export { UpdateAppRequestData } from "./models/UpdateAppRequestData"; @@ -2439,6 +2463,17 @@ export { UserTeamUserType } from "./models/UserTeamUserType"; export { UserUpdateAttributes } from "./models/UserUpdateAttributes"; export { UserUpdateData } from "./models/UserUpdateData"; export { UserUpdateRequest } from "./models/UserUpdateRequest"; +export { Vulnerability } from "./models/Vulnerability"; +export { VulnerabilityAttributes } from "./models/VulnerabilityAttributes"; +export { VulnerabilityAttributesCvss } from "./models/VulnerabilityAttributesCvss"; +export { VulnerabilityAttributesDependencyLocations } from "./models/VulnerabilityAttributesDependencyLocations"; +export { VulnerabilityEntityType } from "./models/VulnerabilityEntityType"; +export { VulnerabilityRelationships } from "./models/VulnerabilityRelationships"; +export { VulnerabilityRelationshipsAffects } from "./models/VulnerabilityRelationshipsAffects"; +export { VulnerabilityRelationshipsAffectsData } from "./models/VulnerabilityRelationshipsAffectsData"; +export { VulnerabilityRelationshipsAffectsDataType } from "./models/VulnerabilityRelationshipsAffectsDataType"; +export { VulnerabilityRisks } from "./models/VulnerabilityRisks"; +export { VulnerabilityType } from "./models/VulnerabilityType"; export { WidgetLiveSpan } from "./models/WidgetLiveSpan"; export { WorkflowInstanceCreateMeta } from "./models/WorkflowInstanceCreateMeta"; export { WorkflowInstanceCreateRequest } from "./models/WorkflowInstanceCreateRequest"; diff --git a/packages/datadog-api-client-v2/models/Advisory.ts b/packages/datadog-api-client-v2/models/Advisory.ts new file mode 100644 index 00000000000..2b327f48229 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Advisory.ts @@ -0,0 +1,70 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Advisory. + */ +export class Advisory { + /** + * Advisory base severity. + */ + "baseSeverity": string; + /** + * Advisory id. + */ + "id": string; + /** + * Advisory Datadog severity. + */ + "severity"?: 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 = { + baseSeverity: { + baseName: "base_severity", + type: "string", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + severity: { + baseName: "severity", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Advisory.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/Asset.ts b/packages/datadog-api-client-v2/models/Asset.ts new file mode 100644 index 00000000000..b97dd53b4c0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Asset.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { AssetAttributes } from "./AssetAttributes"; +import { AssetEntityType } from "./AssetEntityType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A single vulnerable asset + */ +export class Asset { + /** + * The JSON:API attributes of the asset. + */ + "attributes": AssetAttributes; + /** + * The unique ID for this asset. + */ + "id": string; + /** + * The JSON:API type. + */ + "type": AssetEntityType; + + /** + * 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: "AssetAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "AssetEntityType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Asset.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AssetAttributes.ts b/packages/datadog-api-client-v2/models/AssetAttributes.ts new file mode 100644 index 00000000000..44b31730ae6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AssetAttributes.ts @@ -0,0 +1,108 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { AssetAttributesOperatingSystem } from "./AssetAttributesOperatingSystem"; +import { AssetAttributesRisks } from "./AssetAttributesRisks"; +import { AssetAttributesVersion } from "./AssetAttributesVersion"; +import { AssetType } from "./AssetType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API attributes of the asset. + */ +export class AssetAttributes { + /** + * Asset architecture. + */ + "arch"?: string; + /** + * List of environments where the asset is deployed. + */ + "environments": Array; + /** + * Asset name. + */ + "name": string; + /** + * Asset operating system. + */ + "operatingSystem"?: AssetAttributesOperatingSystem; + /** + * Asset risks. + */ + "risks": AssetAttributesRisks; + /** + * The asset type + */ + "type": AssetType; + /** + * Asset version. + */ + "version"?: AssetAttributesVersion; + + /** + * 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 = { + arch: { + baseName: "arch", + type: "string", + }, + environments: { + baseName: "environments", + type: "Array", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + operatingSystem: { + baseName: "operating_system", + type: "AssetAttributesOperatingSystem", + }, + risks: { + baseName: "risks", + type: "AssetAttributesRisks", + required: true, + }, + type: { + baseName: "type", + type: "AssetType", + required: true, + }, + version: { + baseName: "version", + type: "AssetAttributesVersion", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AssetAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AssetAttributesOperatingSystem.ts b/packages/datadog-api-client-v2/models/AssetAttributesOperatingSystem.ts new file mode 100644 index 00000000000..015a32edd0b --- /dev/null +++ b/packages/datadog-api-client-v2/models/AssetAttributesOperatingSystem.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Asset operating system. + */ +export class AssetAttributesOperatingSystem { + /** + * Operating system version. + */ + "description"?: string; + /** + * Operating system name. + */ + "name": 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 = { + description: { + baseName: "description", + type: "string", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AssetAttributesOperatingSystem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AssetAttributesRisks.ts b/packages/datadog-api-client-v2/models/AssetAttributesRisks.ts new file mode 100644 index 00000000000..f4243b74255 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AssetAttributesRisks.ts @@ -0,0 +1,85 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Asset risks. + */ +export class AssetAttributesRisks { + /** + * Whether the asset has access to sensitive data or not. + */ + "hasAccessToSensitiveData"?: boolean; + /** + * Whether the asset has privileged access or not. + */ + "hasPrivilegedAccess"?: boolean; + /** + * Whether the asset is in production or not. + */ + "inProduction": boolean; + /** + * Whether the asset is publicly accessible or not. + */ + "isPubliclyAccessible"?: boolean; + /** + * Whether the asset is under attack or not. + */ + "underAttack"?: boolean; + + /** + * 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 = { + hasAccessToSensitiveData: { + baseName: "has_access_to_sensitive_data", + type: "boolean", + }, + hasPrivilegedAccess: { + baseName: "has_privileged_access", + type: "boolean", + }, + inProduction: { + baseName: "in_production", + type: "boolean", + required: true, + }, + isPubliclyAccessible: { + baseName: "is_publicly_accessible", + type: "boolean", + }, + underAttack: { + baseName: "under_attack", + type: "boolean", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AssetAttributesRisks.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AssetAttributesVersion.ts b/packages/datadog-api-client-v2/models/AssetAttributesVersion.ts new file mode 100644 index 00000000000..233628a3dd9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AssetAttributesVersion.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Asset version. + */ +export class AssetAttributesVersion { + /** + * Asset first version. + */ + "first"?: string; + /** + * Asset last version. + */ + "last"?: 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 = { + first: { + baseName: "first", + type: "string", + }, + last: { + baseName: "last", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AssetAttributesVersion.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AssetEntityType.ts b/packages/datadog-api-client-v2/models/AssetEntityType.ts new file mode 100644 index 00000000000..ae7ff41b0b6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AssetEntityType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API type. + */ + +export type AssetEntityType = typeof ASSETS | UnparsedObject; +export const ASSETS = "assets"; diff --git a/packages/datadog-api-client-v2/models/AssetType.ts b/packages/datadog-api-client-v2/models/AssetType.ts new file mode 100644 index 00000000000..166ead4ee84 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AssetType.ts @@ -0,0 +1,24 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The asset type + */ + +export type AssetType = + | typeof REPOSITORY + | typeof SERVICE + | typeof HOST + | typeof HOSTIMAGE + | typeof IMAGE + | UnparsedObject; +export const REPOSITORY = "Repository"; +export const SERVICE = "Service"; +export const HOST = "Host"; +export const HOSTIMAGE = "HostImage"; +export const IMAGE = "Image"; diff --git a/packages/datadog-api-client-v2/models/CVSS.ts b/packages/datadog-api-client-v2/models/CVSS.ts new file mode 100644 index 00000000000..e5c86aa523d --- /dev/null +++ b/packages/datadog-api-client-v2/models/CVSS.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { Severity } from "./Severity"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Vulnerability severity. + */ +export class CVSS { + /** + * Vulnerability severity score. + */ + "score": number; + /** + * The vulnerability severity. + */ + "severity": Severity; + /** + * Vulnerability CVSS vector. + */ + "vector": 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 = { + score: { + baseName: "score", + type: "number", + required: true, + format: "double", + }, + severity: { + baseName: "severity", + type: "Severity", + required: true, + }, + vector: { + baseName: "vector", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CVSS.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CodeLocation.ts b/packages/datadog-api-client-v2/models/CodeLocation.ts new file mode 100644 index 00000000000..5e7a587dff5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CodeLocation.ts @@ -0,0 +1,69 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Code vulnerability location. + */ +export class CodeLocation { + /** + * Vulnerability location file path. + */ + "filePath"?: string; + /** + * Vulnerability extracted location. + */ + "location": string; + /** + * Vulnerability location method. + */ + "method"?: 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 = { + filePath: { + baseName: "file_path", + type: "string", + }, + location: { + baseName: "location", + type: "string", + required: true, + }, + method: { + baseName: "method", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CodeLocation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/DependencyLocation.ts b/packages/datadog-api-client-v2/models/DependencyLocation.ts new file mode 100644 index 00000000000..cebdc6ed06b --- /dev/null +++ b/packages/datadog-api-client-v2/models/DependencyLocation.ts @@ -0,0 +1,93 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Static library vulnerability location. + */ +export class DependencyLocation { + /** + * Location column end. + */ + "columnEnd": number; + /** + * Location column start. + */ + "columnStart": number; + /** + * Location file name. + */ + "fileName": string; + /** + * Location line end. + */ + "lineEnd": number; + /** + * Location line start. + */ + "lineStart": number; + + /** + * 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 = { + columnEnd: { + baseName: "column_end", + type: "number", + required: true, + format: "int64", + }, + columnStart: { + baseName: "column_start", + type: "number", + required: true, + format: "int64", + }, + fileName: { + baseName: "file_name", + type: "string", + required: true, + }, + lineEnd: { + baseName: "line_end", + type: "number", + required: true, + format: "int64", + }, + lineStart: { + baseName: "line_start", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DependencyLocation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EPSS.ts b/packages/datadog-api-client-v2/models/EPSS.ts new file mode 100644 index 00000000000..9becc0571b2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EPSS.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { Severity } from "./Severity"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Vulnerability EPSS severity. + */ +export class EPSS { + /** + * Vulnerability EPSS severity score. + */ + "score": number; + /** + * The vulnerability severity. + */ + "severity": Severity; + + /** + * 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 = { + score: { + baseName: "score", + type: "number", + required: true, + format: "double", + }, + severity: { + baseName: "severity", + type: "Severity", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EPSS.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/Ecosystem.ts b/packages/datadog-api-client-v2/models/Ecosystem.ts new file mode 100644 index 00000000000..27e08924f7f --- /dev/null +++ b/packages/datadog-api-client-v2/models/Ecosystem.ts @@ -0,0 +1,36 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The related vulnerability asset ecosystem. + */ + +export type Ecosystem = + | typeof PYPI + | typeof MAVEN + | typeof NUGET + | typeof NPM + | typeof RUBYGEMS + | typeof GO + | typeof PACKAGIST + | typeof DDEB + | typeof RPM + | typeof APK + | typeof WINDOWS + | UnparsedObject; +export const PYPI = "PyPI"; +export const MAVEN = "Maven"; +export const NUGET = "NuGet"; +export const NPM = "Npm"; +export const RUBYGEMS = "RubyGems"; +export const GO = "Go"; +export const PACKAGIST = "Packagist"; +export const DDEB = "Ddeb"; +export const RPM = "Rpm"; +export const APK = "Apk"; +export const WINDOWS = "Windows"; diff --git a/packages/datadog-api-client-v2/models/Library.ts b/packages/datadog-api-client-v2/models/Library.ts new file mode 100644 index 00000000000..1f633174b77 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Library.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Vulnerability library. + */ +export class Library { + /** + * Vulnerability library name. + */ + "name": string; + /** + * Vulnerability library version. + */ + "version"?: 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 = { + name: { + baseName: "name", + type: "string", + required: true, + }, + version: { + baseName: "version", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Library.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/Links.ts b/packages/datadog-api-client-v2/models/Links.ts new file mode 100644 index 00000000000..654ba907484 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Links.ts @@ -0,0 +1,87 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API links related to pagination. + */ +export class Links { + /** + * First page link. + */ + "first": string; + /** + * Last page link. + */ + "last": string; + /** + * Next page link. + */ + "next"?: string; + /** + * Previous page link. + */ + "previous"?: string; + /** + * Request link. + */ + "self": 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 = { + first: { + baseName: "first", + type: "string", + required: true, + }, + last: { + baseName: "last", + type: "string", + required: true, + }, + next: { + baseName: "next", + type: "string", + }, + previous: { + baseName: "previous", + type: "string", + }, + self: { + baseName: "self", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Links.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ListVulnerabilitiesResponse.ts b/packages/datadog-api-client-v2/models/ListVulnerabilitiesResponse.ts new file mode 100644 index 00000000000..a532c528f25 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ListVulnerabilitiesResponse.ts @@ -0,0 +1,72 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { Links } from "./Links"; +import { Metadata } from "./Metadata"; +import { Vulnerability } from "./Vulnerability"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The expected response schema when listing vulnerabilities. + */ +export class ListVulnerabilitiesResponse { + /** + * List of vulnerabilities. + */ + "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: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ListVulnerabilitiesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ListVulnerableAssetsResponse.ts b/packages/datadog-api-client-v2/models/ListVulnerableAssetsResponse.ts new file mode 100644 index 00000000000..8e9fcf6340c --- /dev/null +++ b/packages/datadog-api-client-v2/models/ListVulnerableAssetsResponse.ts @@ -0,0 +1,72 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { Asset } from "./Asset"; +import { Links } from "./Links"; +import { Metadata } from "./Metadata"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The expected response schema when listing vulnerable assets. + */ +export class ListVulnerableAssetsResponse { + /** + * List of vulnerable assets. + */ + "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: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ListVulnerableAssetsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/Metadata.ts b/packages/datadog-api-client-v2/models/Metadata.ts new file mode 100644 index 00000000000..fdfd6b41439 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Metadata.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The metadata related to this request. + */ +export class Metadata { + /** + * Number of entities included in the response. + */ + "count": number; + /** + * The token that identifies the request. + */ + "token": string; + /** + * Total number of entities across all pages. + */ + "total": number; + + /** + * 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 = { + count: { + baseName: "count", + type: "number", + required: true, + format: "int64", + }, + token: { + baseName: "token", + type: "string", + required: true, + }, + total: { + baseName: "total", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Metadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 3e70904b9de..8f5c68e2dcd 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -44,6 +44,7 @@ import { AWSTracesConfig } from "./AWSTracesConfig"; import { ActiveBillingDimensionsAttributes } from "./ActiveBillingDimensionsAttributes"; import { ActiveBillingDimensionsBody } from "./ActiveBillingDimensionsBody"; import { ActiveBillingDimensionsResponse } from "./ActiveBillingDimensionsResponse"; +import { Advisory } from "./Advisory"; import { AppBuilderError } from "./AppBuilderError"; import { AppBuilderErrorErrorsItems } from "./AppBuilderErrorErrorsItems"; import { AppBuilderErrorErrorsItemsSource } from "./AppBuilderErrorErrorsItemsSource"; @@ -59,6 +60,11 @@ import { ApplicationKeyResponseMetaPage } from "./ApplicationKeyResponseMetaPage import { ApplicationKeyUpdateAttributes } from "./ApplicationKeyUpdateAttributes"; import { ApplicationKeyUpdateData } from "./ApplicationKeyUpdateData"; import { ApplicationKeyUpdateRequest } from "./ApplicationKeyUpdateRequest"; +import { Asset } from "./Asset"; +import { AssetAttributes } from "./AssetAttributes"; +import { AssetAttributesOperatingSystem } from "./AssetAttributesOperatingSystem"; +import { AssetAttributesRisks } from "./AssetAttributesRisks"; +import { AssetAttributesVersion } from "./AssetAttributesVersion"; import { AuditLogsEvent } from "./AuditLogsEvent"; import { AuditLogsEventAttributes } from "./AuditLogsEventAttributes"; import { AuditLogsEventsResponse } from "./AuditLogsEventsResponse"; @@ -164,6 +170,7 @@ import { CIAppTestsGroupBy } from "./CIAppTestsGroupBy"; import { CIAppTestsQueryFilter } from "./CIAppTestsQueryFilter"; import { CIAppWarning } from "./CIAppWarning"; import { CSMAgentsMetadata } from "./CSMAgentsMetadata"; +import { CVSS } from "./CVSS"; import { CalculatedField } from "./CalculatedField"; import { CancelDataDeletionResponseBody } from "./CancelDataDeletionResponseBody"; import { Case } from "./Case"; @@ -224,6 +231,7 @@ import { CloudflareAccountUpdateRequest } from "./CloudflareAccountUpdateRequest import { CloudflareAccountUpdateRequestAttributes } from "./CloudflareAccountUpdateRequestAttributes"; import { CloudflareAccountUpdateRequestData } from "./CloudflareAccountUpdateRequestData"; import { CloudflareAccountsResponse } from "./CloudflareAccountsResponse"; +import { CodeLocation } from "./CodeLocation"; import { Component } from "./Component"; import { ComponentGrid } from "./ComponentGrid"; import { ComponentGridProperties } from "./ComponentGridProperties"; @@ -365,6 +373,7 @@ import { DeleteAppsRequest } from "./DeleteAppsRequest"; import { DeleteAppsRequestDataItems } from "./DeleteAppsRequestDataItems"; import { DeleteAppsResponse } from "./DeleteAppsResponse"; import { DeleteAppsResponseDataItems } from "./DeleteAppsResponseDataItems"; +import { DependencyLocation } from "./DependencyLocation"; import { DeployAppResponse } from "./DeployAppResponse"; import { DeployAppResponseData } from "./DeployAppResponseData"; import { DeployAppResponseDataAttributes } from "./DeployAppResponseDataAttributes"; @@ -417,6 +426,7 @@ import { DowntimeScheduleRecurrencesUpdateRequest } from "./DowntimeScheduleRecu import { DowntimeUpdateRequest } from "./DowntimeUpdateRequest"; import { DowntimeUpdateRequestAttributes } from "./DowntimeUpdateRequestAttributes"; import { DowntimeUpdateRequestData } from "./DowntimeUpdateRequestData"; +import { EPSS } from "./EPSS"; import { EntityAttributes } from "./EntityAttributes"; import { EntityData } from "./EntityData"; import { EntityMeta } from "./EntityMeta"; @@ -680,6 +690,8 @@ import { JobDefinition } from "./JobDefinition"; import { JobDefinitionFromRule } from "./JobDefinitionFromRule"; import { LeakedKey } from "./LeakedKey"; import { LeakedKeyAttributes } from "./LeakedKeyAttributes"; +import { Library } from "./Library"; +import { Links } from "./Links"; import { ListAPIsResponse } from "./ListAPIsResponse"; import { ListAPIsResponseData } from "./ListAPIsResponseData"; import { ListAPIsResponseDataAttributes } from "./ListAPIsResponseDataAttributes"; @@ -709,6 +721,8 @@ import { ListRulesResponseLinks } from "./ListRulesResponseLinks"; import { ListTagsResponse } from "./ListTagsResponse"; import { ListTagsResponseData } from "./ListTagsResponseData"; import { ListTagsResponseDataAttributes } from "./ListTagsResponseDataAttributes"; +import { ListVulnerabilitiesResponse } from "./ListVulnerabilitiesResponse"; +import { ListVulnerableAssetsResponse } from "./ListVulnerableAssetsResponse"; import { Log } from "./Log"; import { LogAttributes } from "./LogAttributes"; import { LogsAggregateBucket } from "./LogsAggregateBucket"; @@ -765,6 +779,7 @@ import { LogsResponseMetadataPage } from "./LogsResponseMetadataPage"; import { LogsWarning } from "./LogsWarning"; import { MSTeamsIntegrationMetadata } from "./MSTeamsIntegrationMetadata"; import { MSTeamsIntegrationMetadataTeamsItem } from "./MSTeamsIntegrationMetadataTeamsItem"; +import { Metadata } from "./Metadata"; import { Metric } from "./Metric"; import { MetricAllTags } from "./MetricAllTags"; import { MetricAllTagsAttributes } from "./MetricAllTagsAttributes"; @@ -1029,6 +1044,7 @@ import { RelationshipToUserTeamTeamData } from "./RelationshipToUserTeamTeamData import { RelationshipToUserTeamUser } from "./RelationshipToUserTeamUser"; import { RelationshipToUserTeamUserData } from "./RelationshipToUserTeamUserData"; import { RelationshipToUsers } from "./RelationshipToUsers"; +import { Remediation } from "./Remediation"; import { ReorderRetentionFiltersRequest } from "./ReorderRetentionFiltersRequest"; import { ResponseMetaAttributes } from "./ResponseMetaAttributes"; import { RestrictionPolicy } from "./RestrictionPolicy"; @@ -1414,6 +1430,14 @@ import { UserUpdateData } from "./UserUpdateData"; import { UserUpdateRequest } from "./UserUpdateRequest"; import { UsersRelationship } from "./UsersRelationship"; import { UsersResponse } from "./UsersResponse"; +import { Vulnerability } from "./Vulnerability"; +import { VulnerabilityAttributes } from "./VulnerabilityAttributes"; +import { VulnerabilityAttributesCvss } from "./VulnerabilityAttributesCvss"; +import { VulnerabilityAttributesDependencyLocations } from "./VulnerabilityAttributesDependencyLocations"; +import { VulnerabilityRelationships } from "./VulnerabilityRelationships"; +import { VulnerabilityRelationshipsAffects } from "./VulnerabilityRelationshipsAffects"; +import { VulnerabilityRelationshipsAffectsData } from "./VulnerabilityRelationshipsAffectsData"; +import { VulnerabilityRisks } from "./VulnerabilityRisks"; import { WorkflowInstanceCreateMeta } from "./WorkflowInstanceCreateMeta"; import { WorkflowInstanceCreateRequest } from "./WorkflowInstanceCreateRequest"; import { WorkflowInstanceCreateResponse } from "./WorkflowInstanceCreateResponse"; @@ -1516,6 +1540,8 @@ const enumsMap: { [key: string]: any[] } = { "-updated_at", "-user_name", ], + AssetEntityType: ["assets"], + AssetType: ["Repository", "Service", "Host", "HostImage", "Image"], AuditLogsEventType: ["audit"], AuditLogsResponseStatus: ["done", "timeout"], AuditLogsSort: ["timestamp", "-timestamp"], @@ -1684,6 +1710,19 @@ const enumsMap: { [key: string]: any[] } = { DowntimeNotifyEndStateTypes: ["alert", "no data", "warn"], DowntimeResourceType: ["downtime"], DowntimeStatus: ["active", "canceled", "ended", "scheduled"], + Ecosystem: [ + "PyPI", + "Maven", + "NuGet", + "Npm", + "RubyGems", + "Go", + "Packagist", + "Ddeb", + "Rpm", + "Apk", + "Windows", + ], EntityV3APIVersion: ["v3"], EntityV3DatastoreKind: ["datastore"], EntityV3QueueKind: ["queue"], @@ -2095,6 +2134,7 @@ const enumsMap: { [key: string]: any[] } = { ServiceDefinitionV2OpsgenieRegion: ["US", "EU"], ServiceDefinitionV2SlackType: ["slack"], ServiceDefinitionV2Version: ["v2"], + Severity: ["Unknown", "None", "Low", "Medium", "High", "Critical"], SortDirection: ["desc", "asc"], SpansAggregateBucketType: ["bucket"], SpansAggregateRequestType: ["aggregate_request"], @@ -2122,6 +2162,7 @@ const enumsMap: { [key: string]: any[] } = { SpansSortOrder: ["asc", "desc"], SpansType: ["spans"], State: ["pass", "fail", "skip"], + Status: ["Open", "Muted", "Remediated", "InProgress", "AutoClosed"], TeamLinkType: ["team_links"], TeamPermissionSettingSerializerAction: ["manage_membership", "edit"], TeamPermissionSettingType: ["team_permission_settings"], @@ -2152,6 +2193,7 @@ const enumsMap: { [key: string]: any[] } = { ], TimeseriesFormulaRequestType: ["timeseries_request"], TimeseriesFormulaResponseType: ["timeseries_response"], + Tool: ["IAST", "SCA", "Infra"], UpdateAppRequestDataType: ["appDefinitions"], UpdateAppResponseDataType: ["appDefinitions"], UsageTimeSeriesType: ["usage_timeseries"], @@ -2163,6 +2205,52 @@ const enumsMap: { [key: string]: any[] } = { UserTeamType: ["team_memberships"], UserTeamUserType: ["users"], UsersType: ["users"], + VulnerabilityEntityType: ["vulnerabilities"], + VulnerabilityRelationshipsAffectsDataType: ["assets"], + VulnerabilityType: [ + "AdminConsoleActive", + "CodeInjection", + "CommandInjection", + "ComponentWithKnownVulnerability", + "DangerousWorkflows", + "DefaultAppDeployed", + "DefaultHtmlEscapeInvalid", + "DirectoryListingLeak", + "EmailHtmlInjection", + "EndOfLife", + "HardcodedPassword", + "HardcodedSecret", + "HeaderInjection", + "HstsHeaderMissing", + "InsecureAuthProtocol", + "InsecureCookie", + "InsecureJspLayout", + "LdapInjection", + "MaliciousPackage", + "MandatoryRemediation", + "NoHttpOnlyCookie", + "NoSameSiteCookie", + "NoSqlMongoDbInjection", + "PathTraversal", + "ReflectionInjection", + "RiskyLicense", + "SessionRewriting", + "SessionTimeout", + "SqlInjection", + "Ssrf", + "StackTraceLeak", + "TrustBoundaryViolation", + "Unmaintained", + "UntrustedDeserialization", + "UnvalidatedRedirect", + "VerbTampering", + "WeakCipher", + "WeakHash", + "WeakRandomness", + "XContentTypeHeaderMissing", + "XPathInjection", + "Xss", + ], WidgetLiveSpan: [ "1m", "5m", @@ -2229,6 +2317,7 @@ const typeMap: { [index: string]: any } = { ActiveBillingDimensionsAttributes: ActiveBillingDimensionsAttributes, ActiveBillingDimensionsBody: ActiveBillingDimensionsBody, ActiveBillingDimensionsResponse: ActiveBillingDimensionsResponse, + Advisory: Advisory, AppBuilderError: AppBuilderError, AppBuilderErrorErrorsItems: AppBuilderErrorErrorsItems, AppBuilderErrorErrorsItemsSource: AppBuilderErrorErrorsItemsSource, @@ -2244,6 +2333,11 @@ const typeMap: { [index: string]: any } = { ApplicationKeyUpdateAttributes: ApplicationKeyUpdateAttributes, ApplicationKeyUpdateData: ApplicationKeyUpdateData, ApplicationKeyUpdateRequest: ApplicationKeyUpdateRequest, + Asset: Asset, + AssetAttributes: AssetAttributes, + AssetAttributesOperatingSystem: AssetAttributesOperatingSystem, + AssetAttributesRisks: AssetAttributesRisks, + AssetAttributesVersion: AssetAttributesVersion, AuditLogsEvent: AuditLogsEvent, AuditLogsEventAttributes: AuditLogsEventAttributes, AuditLogsEventsResponse: AuditLogsEventsResponse, @@ -2355,6 +2449,7 @@ const typeMap: { [index: string]: any } = { CIAppTestsQueryFilter: CIAppTestsQueryFilter, CIAppWarning: CIAppWarning, CSMAgentsMetadata: CSMAgentsMetadata, + CVSS: CVSS, CalculatedField: CalculatedField, CancelDataDeletionResponseBody: CancelDataDeletionResponseBody, Case: Case, @@ -2432,6 +2527,7 @@ const typeMap: { [index: string]: any } = { CloudflareAccountUpdateRequestAttributes, CloudflareAccountUpdateRequestData: CloudflareAccountUpdateRequestData, CloudflareAccountsResponse: CloudflareAccountsResponse, + CodeLocation: CodeLocation, Component: Component, ComponentGrid: ComponentGrid, ComponentGridProperties: ComponentGridProperties, @@ -2594,6 +2690,7 @@ const typeMap: { [index: string]: any } = { DeleteAppsRequestDataItems: DeleteAppsRequestDataItems, DeleteAppsResponse: DeleteAppsResponse, DeleteAppsResponseDataItems: DeleteAppsResponseDataItems, + DependencyLocation: DependencyLocation, DeployAppResponse: DeployAppResponse, DeployAppResponseData: DeployAppResponseData, DeployAppResponseDataAttributes: DeployAppResponseDataAttributes, @@ -2651,6 +2748,7 @@ const typeMap: { [index: string]: any } = { DowntimeUpdateRequest: DowntimeUpdateRequest, DowntimeUpdateRequestAttributes: DowntimeUpdateRequestAttributes, DowntimeUpdateRequestData: DowntimeUpdateRequestData, + EPSS: EPSS, EntityAttributes: EntityAttributes, EntityData: EntityData, EntityMeta: EntityMeta, @@ -2938,6 +3036,8 @@ const typeMap: { [index: string]: any } = { JobDefinitionFromRule: JobDefinitionFromRule, LeakedKey: LeakedKey, LeakedKeyAttributes: LeakedKeyAttributes, + Library: Library, + Links: Links, ListAPIsResponse: ListAPIsResponse, ListAPIsResponseData: ListAPIsResponseData, ListAPIsResponseDataAttributes: ListAPIsResponseDataAttributes, @@ -2968,6 +3068,8 @@ const typeMap: { [index: string]: any } = { ListTagsResponse: ListTagsResponse, ListTagsResponseData: ListTagsResponseData, ListTagsResponseDataAttributes: ListTagsResponseDataAttributes, + ListVulnerabilitiesResponse: ListVulnerabilitiesResponse, + ListVulnerableAssetsResponse: ListVulnerableAssetsResponse, Log: Log, LogAttributes: LogAttributes, LogsAggregateBucket: LogsAggregateBucket, @@ -3025,6 +3127,7 @@ const typeMap: { [index: string]: any } = { LogsWarning: LogsWarning, MSTeamsIntegrationMetadata: MSTeamsIntegrationMetadata, MSTeamsIntegrationMetadataTeamsItem: MSTeamsIntegrationMetadataTeamsItem, + Metadata: Metadata, Metric: Metric, MetricAllTags: MetricAllTags, MetricAllTagsAttributes: MetricAllTagsAttributes, @@ -3317,6 +3420,7 @@ const typeMap: { [index: string]: any } = { RelationshipToUserTeamUser: RelationshipToUserTeamUser, RelationshipToUserTeamUserData: RelationshipToUserTeamUserData, RelationshipToUsers: RelationshipToUsers, + Remediation: Remediation, ReorderRetentionFiltersRequest: ReorderRetentionFiltersRequest, ResponseMetaAttributes: ResponseMetaAttributes, RestrictionPolicy: RestrictionPolicy, @@ -3756,6 +3860,15 @@ const typeMap: { [index: string]: any } = { UserUpdateRequest: UserUpdateRequest, UsersRelationship: UsersRelationship, UsersResponse: UsersResponse, + Vulnerability: Vulnerability, + VulnerabilityAttributes: VulnerabilityAttributes, + VulnerabilityAttributesCvss: VulnerabilityAttributesCvss, + VulnerabilityAttributesDependencyLocations: + VulnerabilityAttributesDependencyLocations, + VulnerabilityRelationships: VulnerabilityRelationships, + VulnerabilityRelationshipsAffects: VulnerabilityRelationshipsAffects, + VulnerabilityRelationshipsAffectsData: VulnerabilityRelationshipsAffectsData, + VulnerabilityRisks: VulnerabilityRisks, WorkflowInstanceCreateMeta: WorkflowInstanceCreateMeta, WorkflowInstanceCreateRequest: WorkflowInstanceCreateRequest, WorkflowInstanceCreateResponse: WorkflowInstanceCreateResponse, diff --git a/packages/datadog-api-client-v2/models/Remediation.ts b/packages/datadog-api-client-v2/models/Remediation.ts new file mode 100644 index 00000000000..02242f04f7c --- /dev/null +++ b/packages/datadog-api-client-v2/models/Remediation.ts @@ -0,0 +1,117 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { Advisory } from "./Advisory"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Vulnerability remediation. + */ +export class Remediation { + /** + * Whether the vulnerability can be resolved when recompiling the package or not. + */ + "autoSolvable": boolean; + /** + * Avoided advisories. + */ + "avoidedAdvisories": Array; + /** + * Remediation fixed advisories. + */ + "fixedAdvisories": Array; + /** + * Library name remediating the vulnerability. + */ + "libraryName": string; + /** + * Library version remediating the vulnerability. + */ + "libraryVersion": string; + /** + * New advisories. + */ + "newAdvisories": Array; + /** + * Remaining advisories. + */ + "remainingAdvisories": Array; + /** + * Remediation type. + */ + "type": 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 = { + autoSolvable: { + baseName: "auto_solvable", + type: "boolean", + required: true, + }, + avoidedAdvisories: { + baseName: "avoided_advisories", + type: "Array", + required: true, + }, + fixedAdvisories: { + baseName: "fixed_advisories", + type: "Array", + required: true, + }, + libraryName: { + baseName: "library_name", + type: "string", + required: true, + }, + libraryVersion: { + baseName: "library_version", + type: "string", + required: true, + }, + newAdvisories: { + baseName: "new_advisories", + type: "Array", + required: true, + }, + remainingAdvisories: { + baseName: "remaining_advisories", + type: "Array", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Remediation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/Severity.ts b/packages/datadog-api-client-v2/models/Severity.ts new file mode 100644 index 00000000000..dd897a894ea --- /dev/null +++ b/packages/datadog-api-client-v2/models/Severity.ts @@ -0,0 +1,26 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The vulnerability severity. + */ + +export type Severity = + | typeof UNKNOWN + | typeof NONE + | typeof LOW + | typeof MEDIUM + | typeof HIGH + | typeof CRITICAL + | UnparsedObject; +export const UNKNOWN = "Unknown"; +export const NONE = "None"; +export const LOW = "Low"; +export const MEDIUM = "Medium"; +export const HIGH = "High"; +export const CRITICAL = "Critical"; diff --git a/packages/datadog-api-client-v2/models/Status.ts b/packages/datadog-api-client-v2/models/Status.ts new file mode 100644 index 00000000000..9b16663d3d7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Status.ts @@ -0,0 +1,24 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The vulnerability status. + */ + +export type Status = + | typeof OPEN + | typeof MUTED + | typeof REMEDIATED + | typeof INPROGRESS + | typeof AUTOCLOSED + | UnparsedObject; +export const OPEN = "Open"; +export const MUTED = "Muted"; +export const REMEDIATED = "Remediated"; +export const INPROGRESS = "InProgress"; +export const AUTOCLOSED = "AutoClosed"; diff --git a/packages/datadog-api-client-v2/models/Tool.ts b/packages/datadog-api-client-v2/models/Tool.ts new file mode 100644 index 00000000000..9fbe5c8ca91 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Tool.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The vulnerability tool. + */ + +export type Tool = typeof IAST | typeof SCA | typeof INFRA | UnparsedObject; +export const IAST = "IAST"; +export const SCA = "SCA"; +export const INFRA = "Infra"; diff --git a/packages/datadog-api-client-v2/models/Vulnerability.ts b/packages/datadog-api-client-v2/models/Vulnerability.ts new file mode 100644 index 00000000000..425a4a82266 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Vulnerability.ts @@ -0,0 +1,83 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { VulnerabilityAttributes } from "./VulnerabilityAttributes"; +import { VulnerabilityEntityType } from "./VulnerabilityEntityType"; +import { VulnerabilityRelationships } from "./VulnerabilityRelationships"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A single vulnerability + */ +export class Vulnerability { + /** + * The JSON:API attributes of the vulnerability. + */ + "attributes": VulnerabilityAttributes; + /** + * The unique ID for this vulnerability. + */ + "id": string; + /** + * Related entities object. + */ + "relationships": VulnerabilityRelationships; + /** + * The JSON:API type. + */ + "type": VulnerabilityEntityType; + + /** + * 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: "VulnerabilityAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "VulnerabilityRelationships", + required: true, + }, + type: { + baseName: "type", + type: "VulnerabilityEntityType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Vulnerability.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/VulnerabilityAttributes.ts b/packages/datadog-api-client-v2/models/VulnerabilityAttributes.ts new file mode 100644 index 00000000000..9f48acc7189 --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityAttributes.ts @@ -0,0 +1,229 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { CodeLocation } from "./CodeLocation"; +import { Ecosystem } from "./Ecosystem"; +import { Library } from "./Library"; +import { Remediation } from "./Remediation"; +import { Status } from "./Status"; +import { Tool } from "./Tool"; +import { VulnerabilityAttributesCvss } from "./VulnerabilityAttributesCvss"; +import { VulnerabilityAttributesDependencyLocations } from "./VulnerabilityAttributesDependencyLocations"; +import { VulnerabilityRisks } from "./VulnerabilityRisks"; +import { VulnerabilityType } from "./VulnerabilityType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API attributes of the vulnerability. + */ +export class VulnerabilityAttributes { + /** + * Vulnerability advisory ID. + */ + "advisoryId"?: string; + /** + * Code vulnerability location. + */ + "codeLocation"?: CodeLocation; + /** + * Vulnerability CVE list. + */ + "cveList": Array; + /** + * Vulnerability severities. + */ + "cvss": VulnerabilityAttributesCvss; + /** + * Static library vulnerability location. + */ + "dependencyLocations"?: VulnerabilityAttributesDependencyLocations; + /** + * Vulnerability description. + */ + "description": string; + /** + * The related vulnerability asset ecosystem. + */ + "ecosystem"?: Ecosystem; + /** + * Vulnerability exposure time in seconds. + */ + "exposureTime": number; + /** + * First detection of the vulnerability in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) format + */ + "firstDetection": string; + /** + * Whether the vulnerability has a remediation or not. + */ + "fixAvailable": boolean; + /** + * Vulnerability language. + */ + "language": string; + /** + * Last detection of the vulnerability in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) format + */ + "lastDetection": string; + /** + * Vulnerability library. + */ + "library"?: Library; + /** + * List of remediations. + */ + "remediations": Array; + /** + * Vulnerability `repo_digest` list (when the vulnerability is related to `Image` asset). + */ + "repoDigests"?: Array; + /** + * Vulnerability risks. + */ + "risks": VulnerabilityRisks; + /** + * The vulnerability status. + */ + "status": Status; + /** + * Vulnerability title. + */ + "title": string; + /** + * The vulnerability tool. + */ + "tool": Tool; + /** + * The vulnerability type. + */ + "type": VulnerabilityType; + + /** + * 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 = { + advisoryId: { + baseName: "advisory_id", + type: "string", + }, + codeLocation: { + baseName: "code_location", + type: "CodeLocation", + }, + cveList: { + baseName: "cve_list", + type: "Array", + required: true, + }, + cvss: { + baseName: "cvss", + type: "VulnerabilityAttributesCvss", + required: true, + }, + dependencyLocations: { + baseName: "dependency_locations", + type: "VulnerabilityAttributesDependencyLocations", + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + ecosystem: { + baseName: "ecosystem", + type: "Ecosystem", + }, + exposureTime: { + baseName: "exposure_time", + type: "number", + required: true, + format: "int64", + }, + firstDetection: { + baseName: "first_detection", + type: "string", + required: true, + }, + fixAvailable: { + baseName: "fix_available", + type: "boolean", + required: true, + }, + language: { + baseName: "language", + type: "string", + required: true, + }, + lastDetection: { + baseName: "last_detection", + type: "string", + required: true, + }, + library: { + baseName: "library", + type: "Library", + }, + remediations: { + baseName: "remediations", + type: "Array", + required: true, + }, + repoDigests: { + baseName: "repo_digests", + type: "Array", + }, + risks: { + baseName: "risks", + type: "VulnerabilityRisks", + required: true, + }, + status: { + baseName: "status", + type: "Status", + required: true, + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + tool: { + baseName: "tool", + type: "Tool", + required: true, + }, + type: { + baseName: "type", + type: "VulnerabilityType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return VulnerabilityAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/VulnerabilityAttributesCvss.ts b/packages/datadog-api-client-v2/models/VulnerabilityAttributesCvss.ts new file mode 100644 index 00000000000..ca3a5166200 --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityAttributesCvss.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { CVSS } from "./CVSS"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Vulnerability severities. + */ +export class VulnerabilityAttributesCvss { + /** + * Vulnerability severity. + */ + "base": CVSS; + /** + * Vulnerability severity. + */ + "datadog": CVSS; + + /** + * 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 = { + base: { + baseName: "base", + type: "CVSS", + required: true, + }, + datadog: { + baseName: "datadog", + type: "CVSS", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return VulnerabilityAttributesCvss.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/VulnerabilityAttributesDependencyLocations.ts b/packages/datadog-api-client-v2/models/VulnerabilityAttributesDependencyLocations.ts new file mode 100644 index 00000000000..b367345edb1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityAttributesDependencyLocations.ts @@ -0,0 +1,70 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { DependencyLocation } from "./DependencyLocation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Static library vulnerability location. + */ +export class VulnerabilityAttributesDependencyLocations { + /** + * Static library vulnerability location. + */ + "block": DependencyLocation; + /** + * Static library vulnerability location. + */ + "name"?: DependencyLocation; + /** + * Static library vulnerability location. + */ + "version"?: DependencyLocation; + + /** + * 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 = { + block: { + baseName: "block", + type: "DependencyLocation", + required: true, + }, + name: { + baseName: "name", + type: "DependencyLocation", + }, + version: { + baseName: "version", + type: "DependencyLocation", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return VulnerabilityAttributesDependencyLocations.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/VulnerabilityEntityType.ts b/packages/datadog-api-client-v2/models/VulnerabilityEntityType.ts new file mode 100644 index 00000000000..ab5442a200f --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityEntityType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API type. + */ + +export type VulnerabilityEntityType = typeof VULNERABILITIES | UnparsedObject; +export const VULNERABILITIES = "vulnerabilities"; diff --git a/packages/datadog-api-client-v2/models/VulnerabilityRelationships.ts b/packages/datadog-api-client-v2/models/VulnerabilityRelationships.ts new file mode 100644 index 00000000000..6bbe348b1cf --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityRelationships.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { VulnerabilityRelationshipsAffects } from "./VulnerabilityRelationshipsAffects"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Related entities object. + */ +export class VulnerabilityRelationships { + /** + * Relationship type. + */ + "affects": VulnerabilityRelationshipsAffects; + + /** + * 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 = { + affects: { + baseName: "affects", + type: "VulnerabilityRelationshipsAffects", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return VulnerabilityRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffects.ts b/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffects.ts new file mode 100644 index 00000000000..7fb8a2d6b0a --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffects.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { VulnerabilityRelationshipsAffectsData } from "./VulnerabilityRelationshipsAffectsData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship type. + */ +export class VulnerabilityRelationshipsAffects { + /** + * Asset affected by this vulnerability. + */ + "data": VulnerabilityRelationshipsAffectsData; + + /** + * 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: "VulnerabilityRelationshipsAffectsData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return VulnerabilityRelationshipsAffects.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffectsData.ts b/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffectsData.ts new file mode 100644 index 00000000000..0bbe41ff262 --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffectsData.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { VulnerabilityRelationshipsAffectsDataType } from "./VulnerabilityRelationshipsAffectsDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Asset affected by this vulnerability. + */ +export class VulnerabilityRelationshipsAffectsData { + /** + * The unique ID for this related asset. + */ + "id": string; + /** + * The JSON:API type + */ + "type": VulnerabilityRelationshipsAffectsDataType; + + /** + * 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, + }, + type: { + baseName: "type", + type: "VulnerabilityRelationshipsAffectsDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return VulnerabilityRelationshipsAffectsData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffectsDataType.ts b/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffectsDataType.ts new file mode 100644 index 00000000000..34ae8de9fee --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityRelationshipsAffectsDataType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API type + */ + +export type VulnerabilityRelationshipsAffectsDataType = + | typeof ASSETS + | UnparsedObject; +export const ASSETS = "assets"; diff --git a/packages/datadog-api-client-v2/models/VulnerabilityRisks.ts b/packages/datadog-api-client-v2/models/VulnerabilityRisks.ts new file mode 100644 index 00000000000..e956ed79ae4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityRisks.ts @@ -0,0 +1,89 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { EPSS } from "./EPSS"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Vulnerability risks. + */ +export class VulnerabilityRisks { + /** + * Vulnerability EPSS severity. + */ + "epss"?: EPSS; + /** + * Vulnerability public exploit availability. + */ + "exploitAvailable": boolean; + /** + * Vulnerability exploit sources. + */ + "exploitSources": Array; + /** + * Vulnerability exploitation probability. + */ + "exploitationProbability": boolean; + /** + * Vulnerability POC exploit availability. + */ + "pocExploitAvailable": boolean; + + /** + * 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 = { + epss: { + baseName: "epss", + type: "EPSS", + }, + exploitAvailable: { + baseName: "exploit_available", + type: "boolean", + required: true, + }, + exploitSources: { + baseName: "exploit_sources", + type: "Array", + required: true, + }, + exploitationProbability: { + baseName: "exploitation_probability", + type: "boolean", + required: true, + }, + pocExploitAvailable: { + baseName: "poc_exploit_available", + type: "boolean", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return VulnerabilityRisks.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/VulnerabilityType.ts b/packages/datadog-api-client-v2/models/VulnerabilityType.ts new file mode 100644 index 00000000000..a21b6b2a3d0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/VulnerabilityType.ts @@ -0,0 +1,99 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The vulnerability type. + */ + +export type VulnerabilityType = + | typeof ADMINCONSOLEACTIVE + | typeof CODEINJECTION + | typeof COMMANDINJECTION + | typeof COMPONENTWITHKNOWNVULNERABILITY + | typeof DANGEROUSWORKFLOWS + | typeof DEFAULTAPPDEPLOYED + | typeof DEFAULTHTMLESCAPEINVALID + | typeof DIRECTORYLISTINGLEAK + | typeof EMAILHTMLINJECTION + | typeof ENDOFLIFE + | typeof HARDCODEDPASSWORD + | typeof HARDCODEDSECRET + | typeof HEADERINJECTION + | typeof HSTSHEADERMISSING + | typeof INSECUREAUTHPROTOCOL + | typeof INSECURECOOKIE + | typeof INSECUREJSPLAYOUT + | typeof LDAPINJECTION + | typeof MALICIOUSPACKAGE + | typeof MANDATORYREMEDIATION + | typeof NOHTTPONLYCOOKIE + | typeof NOSAMESITECOOKIE + | typeof NOSQLMONGODBINJECTION + | typeof PATHTRAVERSAL + | typeof REFLECTIONINJECTION + | typeof RISKYLICENSE + | typeof SESSIONREWRITING + | typeof SESSIONTIMEOUT + | typeof SQLINJECTION + | typeof SSRF + | typeof STACKTRACELEAK + | typeof TRUSTBOUNDARYVIOLATION + | typeof UNMAINTAINED + | typeof UNTRUSTEDDESERIALIZATION + | typeof UNVALIDATEDREDIRECT + | typeof VERBTAMPERING + | typeof WEAKCIPHER + | typeof WEAKHASH + | typeof WEAKRANDOMNESS + | typeof XCONTENTTYPEHEADERMISSING + | typeof XPATHINJECTION + | typeof XSS + | UnparsedObject; +export const ADMINCONSOLEACTIVE = "AdminConsoleActive"; +export const CODEINJECTION = "CodeInjection"; +export const COMMANDINJECTION = "CommandInjection"; +export const COMPONENTWITHKNOWNVULNERABILITY = + "ComponentWithKnownVulnerability"; +export const DANGEROUSWORKFLOWS = "DangerousWorkflows"; +export const DEFAULTAPPDEPLOYED = "DefaultAppDeployed"; +export const DEFAULTHTMLESCAPEINVALID = "DefaultHtmlEscapeInvalid"; +export const DIRECTORYLISTINGLEAK = "DirectoryListingLeak"; +export const EMAILHTMLINJECTION = "EmailHtmlInjection"; +export const ENDOFLIFE = "EndOfLife"; +export const HARDCODEDPASSWORD = "HardcodedPassword"; +export const HARDCODEDSECRET = "HardcodedSecret"; +export const HEADERINJECTION = "HeaderInjection"; +export const HSTSHEADERMISSING = "HstsHeaderMissing"; +export const INSECUREAUTHPROTOCOL = "InsecureAuthProtocol"; +export const INSECURECOOKIE = "InsecureCookie"; +export const INSECUREJSPLAYOUT = "InsecureJspLayout"; +export const LDAPINJECTION = "LdapInjection"; +export const MALICIOUSPACKAGE = "MaliciousPackage"; +export const MANDATORYREMEDIATION = "MandatoryRemediation"; +export const NOHTTPONLYCOOKIE = "NoHttpOnlyCookie"; +export const NOSAMESITECOOKIE = "NoSameSiteCookie"; +export const NOSQLMONGODBINJECTION = "NoSqlMongoDbInjection"; +export const PATHTRAVERSAL = "PathTraversal"; +export const REFLECTIONINJECTION = "ReflectionInjection"; +export const RISKYLICENSE = "RiskyLicense"; +export const SESSIONREWRITING = "SessionRewriting"; +export const SESSIONTIMEOUT = "SessionTimeout"; +export const SQLINJECTION = "SqlInjection"; +export const SSRF = "Ssrf"; +export const STACKTRACELEAK = "StackTraceLeak"; +export const TRUSTBOUNDARYVIOLATION = "TrustBoundaryViolation"; +export const UNMAINTAINED = "Unmaintained"; +export const UNTRUSTEDDESERIALIZATION = "UntrustedDeserialization"; +export const UNVALIDATEDREDIRECT = "UnvalidatedRedirect"; +export const VERBTAMPERING = "VerbTampering"; +export const WEAKCIPHER = "WeakCipher"; +export const WEAKHASH = "WeakHash"; +export const WEAKRANDOMNESS = "WeakRandomness"; +export const XCONTENTTYPEHEADERMISSING = "XContentTypeHeaderMissing"; +export const XPATHINJECTION = "XPathInjection"; +export const XSS = "Xss";