diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb71549..99e3fa2e67 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5249,6 +5249,79 @@ components: example: _latest type: string type: object + AttachCaseRequest: + description: Request for attaching security findings to a case. + properties: + data: + $ref: '#/components/schemas/AttachCaseRequestData' + type: object + AttachCaseRequestData: + description: Data of the case to attach security findings to. + properties: + id: + description: The unique identifier of the case. + example: c1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/AttachCaseRequestDataRelationships' + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + - id + type: object + AttachCaseRequestDataRelationships: + description: Relationships of the case to attach security findings to. + properties: + findings: + $ref: '#/components/schemas/Findings' + description: Security findings to attach to the case. + required: + - findings + type: object + AttachJiraIssueRequest: + description: Request for attaching security findings to a Jira issue. + properties: + data: + $ref: '#/components/schemas/AttachJiraIssueRequestData' + type: object + AttachJiraIssueRequestData: + description: Data of the Jira issue to attach security findings to. + properties: + attributes: + $ref: '#/components/schemas/AttachJiraIssueRequestDataAttributes' + id: + description: The unique identifier of the Jira issue attachment request. + example: j1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/AttachJiraIssueRequestDataRelationships' + type: + $ref: '#/components/schemas/JiraIssuesDataType' + required: + - type + type: object + AttachJiraIssueRequestDataAttributes: + description: Attributes of the Jira issue to attach security findings to. + properties: + jira_issue_url: + description: The URL of the Jira issue to attach security findings to. + example: https://domain.atlassian.net/browse/PROJ-123 + type: string + required: + - jira_issue_url + type: object + AttachJiraIssueRequestDataRelationships: + description: Relationships of the Jira issue to attach security findings to. + properties: + findings: + $ref: '#/components/schemas/Findings' + project: + $ref: '#/components/schemas/CaseManagementProject' + required: + - findings + - project + type: object AuditLogsEvent: description: Object description of an Audit Logs event after it is processed and stored by Datadog. @@ -8921,6 +8994,15 @@ components: required: - data type: object + CaseDataType: + default: cases + description: Cases resource type. + enum: + - cases + example: cases + type: string + x-enum-varnames: + - CASES CaseEmpty: description: Case empty request data properties: @@ -8937,6 +9019,53 @@ components: required: - data type: object + CaseInsightsItems: + description: An insight of the case. + properties: + ref: + description: The reference of the insight. + example: /security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static + type: string + resource_id: + description: The unique identifier of the resource. For example, the unique + identifier of a security finding. + example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== + type: string + type: + description: The type of the resource. For example, the type of a security + finding is "SECURITY_FINDING". + example: SECURITY_FINDING + type: string + type: object + CaseManagementProject: + description: Case management project. + properties: + data: + $ref: '#/components/schemas/CaseManagementProjectData' + required: + - data + type: object + CaseManagementProjectData: + properties: + id: + description: The unique identifier of the case management project. + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + type: + $ref: '#/components/schemas/CaseManagementProjectDataType' + required: + - type + - id + type: object + CaseManagementProjectDataType: + default: projects + description: Projects resource type. + enum: + - projects + example: projects + type: string + x-enum-varnames: + - PROJECTS CaseObjectAttributes: additionalProperties: items: @@ -12581,6 +12710,68 @@ components: required: - type type: object + CreateCaseRequestArray: + description: List of requests to create cases for security findings. + properties: + data: + items: + $ref: '#/components/schemas/CreateCaseRequestData' + type: array + required: + - data + type: object + CreateCaseRequestData: + description: Data of the case to create. + properties: + attributes: + $ref: '#/components/schemas/CreateCaseRequestDataAttributes' + id: + description: The unique identifier of the case. + example: c1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/CreateCaseRequestDataRelationships' + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + type: object + CreateCaseRequestDataAttributes: + description: Attributes of the case to create. + properties: + assignee_id: + description: The unique identifier of the user assigned to the case. + example: f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0 + type: string + description: + description: The description of the case. If not provided, the description + will be automatically generated. + example: A description of the case. + type: string + priority: + $ref: '#/components/schemas/CasePriority' + description: The priority of the case. If not provided, the priority will + be automatically set to "NOT_DEFINED". + example: P4 + title: + description: The title of the case. If not provided, the title will be automatically + generated. + example: A title for the case. + type: string + type: object + CreateCaseRequestDataRelationships: + description: Relationships of the case to create. + properties: + findings: + $ref: '#/components/schemas/Findings' + description: Security findings of the case to create. + project: + $ref: '#/components/schemas/CaseManagementProject' + description: Project of the case to create. + required: + - findings + - project + type: object CreateConnectionRequest: example: data: @@ -12852,6 +13043,89 @@ components: required: - data type: object + CreateJiraIssueRequestArray: + description: List of requests to create Jira issues for security findings. + properties: + data: + items: + $ref: '#/components/schemas/CreateJiraIssueRequestData' + type: array + included: + items: + $ref: '#/components/schemas/CreateJiraIssueRequestArrayIncluded' + type: array + required: + - data + type: object + CreateJiraIssueRequestArrayIncluded: + description: 'Attributes and relationships of the case linked to the Jira issue. + Should contain all of the following: case, project, and security findings.' + oneOf: + - $ref: '#/components/schemas/CreateCaseRequestData' + - $ref: '#/components/schemas/CaseManagementProjectData' + - $ref: '#/components/schemas/FindingData' + CreateJiraIssueRequestData: + description: Data of the Jira issue to create. + properties: + attributes: + $ref: '#/components/schemas/CreateJiraIssueRequestDataAttributes' + id: + description: The unique identifier of the Jira issue creation request. + example: j1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationships' + type: + $ref: '#/components/schemas/JiraIssuesDataType' + required: + - type + type: object + CreateJiraIssueRequestDataAttributes: + description: Attributes of the Jira issue to create. + properties: + fields: + $ref: '#/components/schemas/CreateJiraIssueRequestDataAttributesFields' + type: object + CreateJiraIssueRequestDataAttributesFields: + description: Custom fields of the Jira issue to create. For the list of available + fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + properties: + fields: + example: + customfield_10001: Value 1 + customfield_10002: + - Value 2 + - Value 3 + type: object + type: object + CreateJiraIssueRequestDataRelationships: + description: Relationships of the Jira issue to create. + properties: + case: + $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationshipsCase' + required: + - case + type: object + CreateJiraIssueRequestDataRelationshipsCase: + description: Case linked to the Jira issue. + properties: + data: + $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationshipsCaseData' + required: + - data + type: object + CreateJiraIssueRequestDataRelationshipsCaseData: + description: Case linked to the Jira issue. + properties: + id: + example: c1234567-89ab-cdef-0123-456789abcdef + type: string + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + - id + type: object CreateNotificationRuleParameters: description: Body of the notification rule create request. properties: @@ -16841,6 +17115,35 @@ components: oneOf: - $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetection' - $ref: '#/components/schemas/DeploymentRuleOptionsMonitor' + DetachCaseRequest: + description: Request for detaching security findings from their case. + properties: + data: + $ref: '#/components/schemas/DetachCaseRequestData' + type: object + DetachCaseRequestData: + description: Data for detaching security findings from their case. + properties: + id: + description: The unique identifier of the detachment request. + example: f8b9e3b1-24ec-4413-8be5-1b12b98533c6 + type: string + relationships: + $ref: '#/components/schemas/DetachCaseRequestDataRelationships' + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + type: object + DetachCaseRequestDataRelationships: + description: Relationships detaching security findings from their case. + properties: + findings: + $ref: '#/components/schemas/Findings' + description: Security findings to detach from their case. + required: + - findings + type: object DetailedFinding: description: A single finding with with message and resource configuration. properties: @@ -20691,6 +20994,153 @@ components: vulnerability_type: $ref: '#/components/schemas/FindingVulnerabilityType' type: object + FindingCaseResponse: + description: Case response. + properties: + data: + $ref: '#/components/schemas/FindingCaseResponseData' + type: object + FindingCaseResponseArray: + description: List of case responses. + properties: + data: + items: + $ref: '#/components/schemas/FindingCaseResponseData' + type: array + required: + - data + type: object + FindingCaseResponseData: + description: Data of the case. + properties: + attributes: + $ref: '#/components/schemas/FindingCaseResponseDataAttributes' + id: + description: The unique identifier of the case. + example: c1234567-89ab-cdef-0123-456789abcdef + type: string + relationships: + $ref: '#/components/schemas/FindingCaseResponseDataRelationships' + type: + $ref: '#/components/schemas/CaseDataType' + required: + - type + type: object + FindingCaseResponseDataAttributes: + description: Attributes of the case. + properties: + archived_at: + description: Timestamp of when the case was archived. + example: '2025-01-01T00:00:00.000Z' + format: date-time + type: string + assigned_to: + $ref: '#/components/schemas/RelationshipToUser' + description: User assigned to the case. + attributes: + additionalProperties: + items: + type: string + type: array + type: object + closed_at: + description: Timestamp of when the case was closed. + example: '2025-01-01T00:00:00.000Z' + format: date-time + type: string + created_at: + description: Timestamp of when the case was created. + example: '2025-01-01T00:00:00.000Z' + format: date-time + type: string + creation_source: + description: Source of the case creation. + example: CS_SECURITY_FINDING + type: string + description: + description: Description of the case. + example: A description of the case. + type: string + due_date: + description: Due date of the case. + example: '2025-01-01' + type: string + insights: + description: Insights of the case. + items: + $ref: '#/components/schemas/CaseInsightsItems' + type: array + jira_issue: + $ref: '#/components/schemas/FindingJiraIssue' + description: Jira issue associated with the case. + key: + description: Key of the case. + example: PROJ-123 + type: string + modified_at: + description: Timestamp of when the case was last modified. + example: '2025-01-01T00:00:00.000Z' + format: date-time + type: string + priority: + description: Priority of the case. + example: P4 + type: string + status: + description: Status of the case. + example: OPEN + type: string + status_group: + description: Status group of the case. + example: SG_OPEN + type: string + status_name: + description: Status name of the case. + example: Open + type: string + title: + description: Title of the case. + example: A title for the case. + type: string + type: + description: Type of the case. For security cases, this is always "SECURITY". + example: SECURITY + type: string + type: object + FindingCaseResponseDataRelationships: + description: Relationships of the case. + properties: + created_by: + $ref: '#/components/schemas/RelationshipToUser' + description: User who created the case. + modified_by: + $ref: '#/components/schemas/RelationshipToUser' + description: User who last modified the case. + project: + $ref: '#/components/schemas/CaseManagementProject' + description: Project in which the case was created. + type: object + FindingData: + properties: + id: + description: The unique identifier of the security finding. + example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== + type: string + type: + $ref: '#/components/schemas/FindingDataType' + required: + - type + - id + type: object + FindingDataType: + default: findings + description: Security findings resource type. + enum: + - findings + example: findings + type: string + x-enum-varnames: + - FINDINGS FindingDatadogLink: description: The Datadog relative link for this finding. example: /security/compliance?panels=cpfinding%7Cevent%7CruleId%3Adef-000-u5t%7CresourceId%3Ae8c9ab7c52ebd7bf2fdb4db641082d7d%7CtabId%3Aoverview @@ -20732,6 +21182,42 @@ components: description: The unique ID for this finding. example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== type: string + FindingJiraIssue: + description: Jira issue associated with the case. + properties: + error_message: + description: The error message if the Jira issue creation failed. + example: '{"errorMessages":["An error occured."],"errors":{}}' + type: string + result: + $ref: '#/components/schemas/FindingJiraIssueResult' + status: + description: The status of the Jira issue creation. Can be "COMPLETED" if + the Jira issue was created successfully, or "FAILED" if the Jira issue + creation failed. + example: COMPLETED + type: string + type: object + FindingJiraIssueResult: + description: Result of the Jira issue creation. + properties: + account_id: + description: The account ID of the Jira issue. + example: 463a8631-680e-455c-bfd3-3ed04d326eb7 + type: string + issue_id: + description: The unique identifier of the Jira issue. + example: '2871276' + type: string + issue_key: + description: The key of the Jira issue. + example: PROJ-123 + type: string + issue_url: + description: The URL of the Jira issue. + example: https://domain.atlassian.net/browse/PROJ-123 + type: string + type: object FindingMute: additionalProperties: false description: Information about the mute status of this finding. @@ -20857,6 +21343,14 @@ components: - ATTACK_PATH - IDENTITY_RISK - API_SECURITY + Findings: + description: A list of security findings. + properties: + data: + items: + $ref: '#/components/schemas/FindingData' + type: array + type: object FlakyTest: description: A flaky test object. properties: @@ -28274,6 +28768,15 @@ components: description: Jira project key type: string type: object + JiraIssuesDataType: + default: jira_issues + description: Jira issues resource type. + enum: + - jira_issues + example: jira_issues + type: string + x-enum-varnames: + - JIRA_ISSUES JobCreateResponse: description: Run a threat hunting job response. properties: @@ -73566,10 +74069,16 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] + - AuthZ: [] summary: Mute or unmute a batch of findings tags: - Security Monitoring x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -77253,6 +77762,208 @@ paths: operator: OR permissions: - security_monitoring_cws_agent_rules_read + /api/v2/security/findings/cases: + delete: + description: Detach security findings from their case. This operation dissociates + security findings from their associated cases without deleting the cases themselves. + You can detach security findings from multiple different cases in a single + request, with a limit of 50 security findings per request. Security findings + that are not currently attached to any case will be ignored. + operationId: DetachCase + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DetachCaseRequest' + required: true + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Detach security findings from their case + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + post: + description: Create cases for security findings. You can create up to 50 cases + per request and associate up to 50 security findings per case. Security findings + that are already attached to another case will be detached from their previous + case and attached to the newly created case. + operationId: CreateCases + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCaseRequestArray' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/FindingCaseResponseArray' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create cases for security findings + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + /api/v2/security/findings/cases/{case_id}: + patch: + description: Attach security findings to a case. You can attach up to 50 security + findings per case. Security findings that are already attached to another + case will be detached from their previous case and attached to the specified + case. + operationId: AttachCase + parameters: + - description: The unique identifier of the case to attach security findings + to + in: path + name: case_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AttachCaseRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FindingCaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Attach security findings to a case + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + /api/v2/security/findings/jira_issues: + patch: + description: Attach security findings to a Jira issue by providing the Jira + issue URL. You can attach up to 50 security findings per Jira issue. If the + Jira issue is not linked to any case, this operation will create a case for + the security findings and link the Jira issue to the newly created case. Security + findings that are already attached to another Jira issue will be detached + from their previous Jira issue and attached to the specified Jira issue. + operationId: AttachJiraIssue + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AttachJiraIssueRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FindingCaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Attach security findings to a Jira issue + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + post: + description: Create Jira issues for security findings. This operation creates + a case in Datadog and a Jira issue linked to that case for bidirectional sync + between Datadog and Jira. You can create up to 50 Jira issues per request + and associate up to 50 security findings per Jira issue. Security findings + that are already attached to another Jira issue will be detached from their + previous Jira issue and attached to the newly created Jira issue. + operationId: CreateJiraIssues + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateJiraIssueRequestArray' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/FindingCaseResponseArray' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create Jira issues for security findings + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write /api/v2/security/sboms: get: description: 'Get a list of assets SBOMs for an organization. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 60fdfd49e2..75c7f62021 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -1222,6 +1222,55 @@ datadog\_api\_client.v2.model.asset\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.attach\_case\_request module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attach_case_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attach\_case\_request\_data module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attach_case_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attach\_case\_request\_data\_relationships module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attach_case_request_data_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attach\_jira\_issue\_request module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attach_jira_issue_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attach\_jira\_issue\_request\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attach_jira_issue_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attach\_jira\_issue\_request\_data\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attach_jira_issue_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attach\_jira\_issue\_request\_data\_relationships module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attach_jira_issue_request_data_relationships + :members: + :show-inheritance: + datadog\_api\_client.v2.model.audit\_logs\_event module ------------------------------------------------------- @@ -2755,6 +2804,13 @@ datadog\_api\_client.v2.model.case\_create\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.case\_data\_type module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.case\_empty module ------------------------------------------------ @@ -2769,6 +2825,34 @@ datadog\_api\_client.v2.model.case\_empty\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.case\_insights\_items module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_insights_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_management\_project module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_management_project + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_management\_project\_data module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_management_project_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_management\_project\_data\_type module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_management_project_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.case\_object\_attributes module ------------------------------------------------------------- @@ -4953,6 +5037,34 @@ datadog\_api\_client.v2.model.create\_apps\_datastore\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_case\_request\_array module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_case_request_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_case\_request\_data module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_case_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_case\_request\_data\_attributes module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_case_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_case\_request\_data\_relationships module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_case_request_data_relationships + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_connection\_request module ---------------------------------------------------------------- @@ -5086,6 +5198,62 @@ datadog\_api\_client.v2.model.create\_incident\_notification\_template\_request :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_jira\_issue\_request\_array module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_jira\_issue\_request\_array\_included module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_array_included + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_attributes\_fields module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data_attributes_fields + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_relationships module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_relationships\_case module +-------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_relationships\_case\_data module +-------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_notification\_rule\_parameters module --------------------------------------------------------------------------- @@ -6696,6 +6864,27 @@ datadog\_api\_client.v2.model.deployment\_rules\_options module :members: :show-inheritance: +datadog\_api\_client.v2.model.detach\_case\_request module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.detach_case_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.detach\_case\_request\_data module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.detach_case_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.detach\_case\_request\_data\_relationships module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.detach_case_request_data_relationships + :members: + :show-inheritance: + datadog\_api\_client.v2.model.detailed\_finding module ------------------------------------------------------ @@ -8691,6 +8880,55 @@ datadog\_api\_client.v2.model.finding\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.finding\_case\_response module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.finding_case_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.finding\_case\_response\_array module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.finding_case_response_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.finding\_case\_response\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.finding_case_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.finding\_case\_response\_data\_attributes module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.finding_case_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.finding\_case\_response\_data\_relationships module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.finding_case_response_data_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.finding\_data module +-------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.finding_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.finding\_data\_type module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.finding_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.finding\_evaluation module -------------------------------------------------------- @@ -8698,6 +8936,20 @@ datadog\_api\_client.v2.model.finding\_evaluation module :members: :show-inheritance: +datadog\_api\_client.v2.model.finding\_jira\_issue module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.finding_jira_issue + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.finding\_jira\_issue\_result module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.finding_jira_issue_result + :members: + :show-inheritance: + datadog\_api\_client.v2.model.finding\_mute module -------------------------------------------------- @@ -8740,6 +8992,13 @@ datadog\_api\_client.v2.model.finding\_vulnerability\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.findings module +--------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.findings + :members: + :show-inheritance: + datadog\_api\_client.v2.model.flaky\_test module ------------------------------------------------ @@ -12079,6 +12338,13 @@ datadog\_api\_client.v2.model.jira\_issue\_result module :members: :show-inheritance: +datadog\_api\_client.v2.model.jira\_issues\_data\_type module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.jira_issues_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.job\_create\_response module ---------------------------------------------------------- diff --git a/examples/v2/security-monitoring/AttachCase.py b/examples/v2/security-monitoring/AttachCase.py new file mode 100644 index 0000000000..b80d05d3cb --- /dev/null +++ b/examples/v2/security-monitoring/AttachCase.py @@ -0,0 +1,41 @@ +""" +Attach security findings to a case returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.attach_case_request import AttachCaseRequest +from datadog_api_client.v2.model.attach_case_request_data import AttachCaseRequestData +from datadog_api_client.v2.model.attach_case_request_data_relationships import AttachCaseRequestDataRelationships +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings + +body = AttachCaseRequest( + data=AttachCaseRequestData( + id="7d16945b-baf8-411e-ab2a-20fe43af1ea3", + relationships=AttachCaseRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type=FindingDataType.FINDINGS, + ), + FindingData( + id="MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=", + type=FindingDataType.FINDINGS, + ), + ], + ), + ), + type=CaseDataType.CASES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.attach_case(case_id="7d16945b-baf8-411e-ab2a-20fe43af1ea3", body=body) + + print(response) diff --git a/examples/v2/security-monitoring/AttachCase_897782765.py b/examples/v2/security-monitoring/AttachCase_897782765.py new file mode 100644 index 0000000000..34f50b43bf --- /dev/null +++ b/examples/v2/security-monitoring/AttachCase_897782765.py @@ -0,0 +1,37 @@ +""" +Attach security finding to a case returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.attach_case_request import AttachCaseRequest +from datadog_api_client.v2.model.attach_case_request_data import AttachCaseRequestData +from datadog_api_client.v2.model.attach_case_request_data_relationships import AttachCaseRequestDataRelationships +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings + +body = AttachCaseRequest( + data=AttachCaseRequestData( + id="7d16945b-baf8-411e-ab2a-20fe43af1ea3", + relationships=AttachCaseRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type=FindingDataType.FINDINGS, + ), + ], + ), + ), + type=CaseDataType.CASES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.attach_case(case_id="7d16945b-baf8-411e-ab2a-20fe43af1ea3", body=body) + + print(response) diff --git a/examples/v2/security-monitoring/AttachJiraIssue.py b/examples/v2/security-monitoring/AttachJiraIssue.py new file mode 100644 index 0000000000..76d2f2c8e2 --- /dev/null +++ b/examples/v2/security-monitoring/AttachJiraIssue.py @@ -0,0 +1,55 @@ +""" +Attach security findings to a Jira issue returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.attach_jira_issue_request import AttachJiraIssueRequest +from datadog_api_client.v2.model.attach_jira_issue_request_data import AttachJiraIssueRequestData +from datadog_api_client.v2.model.attach_jira_issue_request_data_attributes import AttachJiraIssueRequestDataAttributes +from datadog_api_client.v2.model.attach_jira_issue_request_data_relationships import ( + AttachJiraIssueRequestDataRelationships, +) +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings +from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + +body = AttachJiraIssueRequest( + data=AttachJiraIssueRequestData( + attributes=AttachJiraIssueRequestDataAttributes( + jira_issue_url="https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476", + ), + relationships=AttachJiraIssueRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + type=FindingDataType.FINDINGS, + ), + FindingData( + id="MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + type=FindingDataType.FINDINGS, + ), + ], + ), + project=CaseManagementProject( + data=CaseManagementProjectData( + id="959a6f71-bac8-4027-b1d3-2264f569296f", + type=CaseManagementProjectDataType.PROJECTS, + ), + ), + ), + type=JiraIssuesDataType.JIRA_ISSUES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.attach_jira_issue(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/AttachJiraIssue_3042842144.py b/examples/v2/security-monitoring/AttachJiraIssue_3042842144.py new file mode 100644 index 0000000000..7efc3b141c --- /dev/null +++ b/examples/v2/security-monitoring/AttachJiraIssue_3042842144.py @@ -0,0 +1,51 @@ +""" +Attach security finding to a Jira issue returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.attach_jira_issue_request import AttachJiraIssueRequest +from datadog_api_client.v2.model.attach_jira_issue_request_data import AttachJiraIssueRequestData +from datadog_api_client.v2.model.attach_jira_issue_request_data_attributes import AttachJiraIssueRequestDataAttributes +from datadog_api_client.v2.model.attach_jira_issue_request_data_relationships import ( + AttachJiraIssueRequestDataRelationships, +) +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings +from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + +body = AttachJiraIssueRequest( + data=AttachJiraIssueRequestData( + attributes=AttachJiraIssueRequestDataAttributes( + jira_issue_url="https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476", + ), + relationships=AttachJiraIssueRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + type=FindingDataType.FINDINGS, + ), + ], + ), + project=CaseManagementProject( + data=CaseManagementProjectData( + id="959a6f71-bac8-4027-b1d3-2264f569296f", + type=CaseManagementProjectDataType.PROJECTS, + ), + ), + ), + type=JiraIssuesDataType.JIRA_ISSUES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.attach_jira_issue(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateCases.py b/examples/v2/security-monitoring/CreateCases.py new file mode 100644 index 0000000000..cc6c0dfc6f --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases.py @@ -0,0 +1,75 @@ +""" +Create cases for security findings returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.create_case_request_array import CreateCaseRequestArray +from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData +from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes +from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings + +body = CreateCaseRequestArray( + data=[ + CreateCaseRequestData( + attributes=CreateCaseRequestDataAttributes( + title="A title", + description="A description", + ), + relationships=CreateCaseRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type=FindingDataType.FINDINGS, + ), + ], + ), + project=CaseManagementProject( + data=CaseManagementProjectData( + id="959a6f71-bac8-4027-b1d3-2264f569296f", + type=CaseManagementProjectDataType.PROJECTS, + ), + ), + ), + type=CaseDataType.CASES, + ), + CreateCaseRequestData( + attributes=CreateCaseRequestDataAttributes( + title="A title", + description="A description", + ), + relationships=CreateCaseRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", + type=FindingDataType.FINDINGS, + ), + ], + ), + project=CaseManagementProject( + data=CaseManagementProjectData( + id="959a6f71-bac8-4027-b1d3-2264f569296f", + type=CaseManagementProjectDataType.PROJECTS, + ), + ), + ), + type=CaseDataType.CASES, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_cases(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateCases_2385516013.py b/examples/v2/security-monitoring/CreateCases_2385516013.py new file mode 100644 index 0000000000..5fe89194f9 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases_2385516013.py @@ -0,0 +1,52 @@ +""" +Create case for security finding returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.create_case_request_array import CreateCaseRequestArray +from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData +from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes +from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings + +body = CreateCaseRequestArray( + data=[ + CreateCaseRequestData( + attributes=CreateCaseRequestDataAttributes( + title="A title", + description="A description", + ), + relationships=CreateCaseRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type=FindingDataType.FINDINGS, + ), + ], + ), + project=CaseManagementProject( + data=CaseManagementProjectData( + id="959a6f71-bac8-4027-b1d3-2264f569296f", + type=CaseManagementProjectDataType.PROJECTS, + ), + ), + ), + type=CaseDataType.CASES, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_cases(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateCases_2798851680.py b/examples/v2/security-monitoring/CreateCases_2798851680.py new file mode 100644 index 0000000000..7192ad73aa --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases_2798851680.py @@ -0,0 +1,56 @@ +""" +Create case for security findings returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.create_case_request_array import CreateCaseRequestArray +from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData +from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes +from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings + +body = CreateCaseRequestArray( + data=[ + CreateCaseRequestData( + attributes=CreateCaseRequestDataAttributes( + title="A title", + description="A description", + ), + relationships=CreateCaseRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type=FindingDataType.FINDINGS, + ), + FindingData( + id="MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", + type=FindingDataType.FINDINGS, + ), + ], + ), + project=CaseManagementProject( + data=CaseManagementProjectData( + id="959a6f71-bac8-4027-b1d3-2264f569296f", + type=CaseManagementProjectDataType.PROJECTS, + ), + ), + ), + type=CaseDataType.CASES, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_cases(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateJiraIssues.py b/examples/v2/security-monitoring/CreateJiraIssues.py new file mode 100644 index 0000000000..31b056ca34 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues.py @@ -0,0 +1,127 @@ +""" +Create Jira issues for security findings returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData +from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes +from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships +from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray +from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData +from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import CreateJiraIssueRequestDataAttributes +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( + CreateJiraIssueRequestDataRelationships, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( + CreateJiraIssueRequestDataRelationshipsCase, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( + CreateJiraIssueRequestDataRelationshipsCaseData, +) +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings +from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + +body = CreateJiraIssueRequestArray( + data=[ + CreateJiraIssueRequestData( + type=JiraIssuesDataType.JIRA_ISSUES, + attributes=CreateJiraIssueRequestDataAttributes(), + relationships=CreateJiraIssueRequestDataRelationships( + case=CreateJiraIssueRequestDataRelationshipsCase( + data=CreateJiraIssueRequestDataRelationshipsCaseData( + type=CaseDataType.CASES, + id="53e242c6-a7d6-46ad-9680-b8d14753f716", + ), + ), + ), + ), + CreateJiraIssueRequestData( + type=JiraIssuesDataType.JIRA_ISSUES, + attributes=CreateJiraIssueRequestDataAttributes(), + relationships=CreateJiraIssueRequestDataRelationships( + case=CreateJiraIssueRequestDataRelationshipsCase( + data=CreateJiraIssueRequestDataRelationshipsCaseData( + type=CaseDataType.CASES, + id="195772b2-1f53-41d2-b81e-48c8e6c21d33", + ), + ), + ), + ), + ], + included=[ + CreateCaseRequestData( + type=CaseDataType.CASES, + attributes=CreateCaseRequestDataAttributes( + title="A title", + description="A description", + ), + relationships=CreateCaseRequestDataRelationships( + project=CaseManagementProject( + data=CaseManagementProjectData( + type=CaseManagementProjectDataType.PROJECTS, + id="959a6f71-bac8-4027-b1d3-2264f569296f", + ), + ), + findings=Findings( + data=[ + FindingData( + type=FindingDataType.FINDINGS, + id="OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + ), + ], + ), + ), + id="53e242c6-a7d6-46ad-9680-b8d14753f716", + ), + CreateCaseRequestData( + type=CaseDataType.CASES, + attributes=CreateCaseRequestDataAttributes( + title="A title", + description="A description", + ), + relationships=CreateCaseRequestDataRelationships( + project=CaseManagementProject( + data=CaseManagementProjectData( + type=CaseManagementProjectDataType.PROJECTS, + id="959a6f71-bac8-4027-b1d3-2264f569296f", + ), + ), + findings=Findings( + data=[ + FindingData( + type=FindingDataType.FINDINGS, + id="MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + ), + ], + ), + ), + id="195772b2-1f53-41d2-b81e-48c8e6c21d33", + ), + CaseManagementProjectData( + type=CaseManagementProjectDataType.PROJECTS, + id="959a6f71-bac8-4027-b1d3-2264f569296f", + ), + FindingData( + type=FindingDataType.FINDINGS, + id="OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + ), + FindingData( + type=FindingDataType.FINDINGS, + id="MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_jira_issues(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_379590688.py b/examples/v2/security-monitoring/CreateJiraIssues_379590688.py new file mode 100644 index 0000000000..82debd188e --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_379590688.py @@ -0,0 +1,87 @@ +""" +Create Jira issue for security finding returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData +from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes +from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships +from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray +from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData +from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import CreateJiraIssueRequestDataAttributes +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( + CreateJiraIssueRequestDataRelationships, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( + CreateJiraIssueRequestDataRelationshipsCase, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( + CreateJiraIssueRequestDataRelationshipsCaseData, +) +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings +from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + +body = CreateJiraIssueRequestArray( + data=[ + CreateJiraIssueRequestData( + type=JiraIssuesDataType.JIRA_ISSUES, + attributes=CreateJiraIssueRequestDataAttributes(), + relationships=CreateJiraIssueRequestDataRelationships( + case=CreateJiraIssueRequestDataRelationshipsCase( + data=CreateJiraIssueRequestDataRelationshipsCaseData( + type=CaseDataType.CASES, + id="6a773295-8729-4034-aada-53b64cbe02e7", + ), + ), + ), + ), + ], + included=[ + CreateCaseRequestData( + type=CaseDataType.CASES, + attributes=CreateCaseRequestDataAttributes( + title="A title", + description="A description", + ), + relationships=CreateCaseRequestDataRelationships( + project=CaseManagementProject( + data=CaseManagementProjectData( + type=CaseManagementProjectDataType.PROJECTS, + id="959a6f71-bac8-4027-b1d3-2264f569296f", + ), + ), + findings=Findings( + data=[ + FindingData( + type=FindingDataType.FINDINGS, + id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + ), + ], + ), + ), + id="6a773295-8729-4034-aada-53b64cbe02e7", + ), + CaseManagementProjectData( + type=CaseManagementProjectDataType.PROJECTS, + id="959a6f71-bac8-4027-b1d3-2264f569296f", + ), + FindingData( + type=FindingDataType.FINDINGS, + id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_jira_issues(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_829823123.py b/examples/v2/security-monitoring/CreateJiraIssues_829823123.py new file mode 100644 index 0000000000..5c5b32c8c3 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_829823123.py @@ -0,0 +1,95 @@ +""" +Create Jira issue for security findings returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData +from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes +from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships +from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray +from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData +from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import CreateJiraIssueRequestDataAttributes +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( + CreateJiraIssueRequestDataRelationships, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( + CreateJiraIssueRequestDataRelationshipsCase, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( + CreateJiraIssueRequestDataRelationshipsCaseData, +) +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings +from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + +body = CreateJiraIssueRequestArray( + data=[ + CreateJiraIssueRequestData( + type=JiraIssuesDataType.JIRA_ISSUES, + attributes=CreateJiraIssueRequestDataAttributes(), + relationships=CreateJiraIssueRequestDataRelationships( + case=CreateJiraIssueRequestDataRelationshipsCase( + data=CreateJiraIssueRequestDataRelationshipsCaseData( + type=CaseDataType.CASES, + id="e469ceda-957a-4557-a607-9ff25032e9ca", + ), + ), + ), + ), + ], + included=[ + CreateCaseRequestData( + type=CaseDataType.CASES, + attributes=CreateCaseRequestDataAttributes( + title="A title", + description="A description", + ), + relationships=CreateCaseRequestDataRelationships( + project=CaseManagementProject( + data=CaseManagementProjectData( + type=CaseManagementProjectDataType.PROJECTS, + id="959a6f71-bac8-4027-b1d3-2264f569296f", + ), + ), + findings=Findings( + data=[ + FindingData( + type=FindingDataType.FINDINGS, + id="MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + ), + FindingData( + type=FindingDataType.FINDINGS, + id="ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + ), + ], + ), + ), + id="e469ceda-957a-4557-a607-9ff25032e9ca", + ), + CaseManagementProjectData( + type=CaseManagementProjectDataType.PROJECTS, + id="959a6f71-bac8-4027-b1d3-2264f569296f", + ), + FindingData( + type=FindingDataType.FINDINGS, + id="MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + ), + FindingData( + type=FindingDataType.FINDINGS, + id="ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_jira_issues(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/DetachCase.py b/examples/v2/security-monitoring/DetachCase.py new file mode 100644 index 0000000000..39e3e3b970 --- /dev/null +++ b/examples/v2/security-monitoring/DetachCase.py @@ -0,0 +1,34 @@ +""" +Detach security findings from their case returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.case_data_type import CaseDataType +from datadog_api_client.v2.model.detach_case_request import DetachCaseRequest +from datadog_api_client.v2.model.detach_case_request_data import DetachCaseRequestData +from datadog_api_client.v2.model.detach_case_request_data_relationships import DetachCaseRequestDataRelationships +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType +from datadog_api_client.v2.model.findings import Findings + +body = DetachCaseRequest( + data=DetachCaseRequestData( + relationships=DetachCaseRequestDataRelationships( + findings=Findings( + data=[ + FindingData( + id="YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=", + type=FindingDataType.FINDINGS, + ), + ], + ), + ), + type=CaseDataType.CASES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + api_instance.detach_case(body=body) diff --git a/src/datadog_api_client/v2/api/security_monitoring_api.py b/src/datadog_api_client/v2/api/security_monitoring_api.py index 30ca95c432..9d41c494e1 100644 --- a/src/datadog_api_client/v2/api/security_monitoring_api.py +++ b/src/datadog_api_client/v2/api/security_monitoring_api.py @@ -36,6 +36,13 @@ from datadog_api_client.v2.model.bulk_mute_findings_response import BulkMuteFindingsResponse from datadog_api_client.v2.model.bulk_mute_findings_request import BulkMuteFindingsRequest from datadog_api_client.v2.model.get_finding_response import GetFindingResponse +from datadog_api_client.v2.model.detach_case_request import DetachCaseRequest +from datadog_api_client.v2.model.finding_case_response_array import FindingCaseResponseArray +from datadog_api_client.v2.model.create_case_request_array import CreateCaseRequestArray +from datadog_api_client.v2.model.finding_case_response import FindingCaseResponse +from datadog_api_client.v2.model.attach_case_request import AttachCaseRequest +from datadog_api_client.v2.model.attach_jira_issue_request import AttachJiraIssueRequest +from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray from datadog_api_client.v2.model.list_assets_sbo_ms_response import ListAssetsSBOMsResponse from datadog_api_client.v2.model.asset_type import AssetType from datadog_api_client.v2.model.sbom_component_license_type import SBOMComponentLicenseType @@ -122,6 +129,52 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._attach_case_endpoint = _Endpoint( + settings={ + "response_type": (FindingCaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/findings/cases/{case_id}", + "operation_id": "attach_case", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (AttachCaseRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._attach_jira_issue_endpoint = _Endpoint( + settings={ + "response_type": (FindingCaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/findings/jira_issues", + "operation_id": "attach_jira_issue", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AttachJiraIssueRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._cancel_threat_hunting_job_endpoint = _Endpoint( settings={ "response_type": None, @@ -208,6 +261,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_cases_endpoint = _Endpoint( + settings={ + "response_type": (FindingCaseResponseArray,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/findings/cases", + "operation_id": "create_cases", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateCaseRequestArray,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_custom_framework_endpoint = _Endpoint( settings={ "response_type": (CreateCustomFrameworkResponse,), @@ -228,6 +301,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_jira_issues_endpoint = _Endpoint( + settings={ + "response_type": (FindingCaseResponseArray,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/findings/jira_issues", + "operation_id": "create_jira_issues", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateJiraIssueRequestArray,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_security_filter_endpoint = _Endpoint( settings={ "response_type": (SecurityFilterResponse,), @@ -495,6 +588,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._detach_case_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/findings/cases", + "operation_id": "detach_case", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (DetachCaseRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._edit_security_monitoring_signal_assignee_endpoint = _Endpoint( settings={ "response_type": (SecurityMonitoringSignalTriageUpdateResponse,), @@ -1850,7 +1963,7 @@ def __init__(self, api_client=None): self._mute_findings_endpoint = _Endpoint( settings={ "response_type": (BulkMuteFindingsResponse,), - "auth": ["apiKeyAuth", "appKeyAuth"], + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], "endpoint_path": "/api/v2/posture_management/findings", "operation_id": "mute_findings", "http_method": "PATCH", @@ -2193,6 +2306,43 @@ def __init__(self, api_client=None): api_client=api_client, ) + def attach_case( + self, + case_id: str, + body: AttachCaseRequest, + ) -> FindingCaseResponse: + """Attach security findings to a case. + + Attach security findings to a case. You can attach up to 50 security findings per case. Security findings that are already attached to another case will be detached from their previous case and attached to the specified case. + + :param case_id: The unique identifier of the case to attach security findings to + :type case_id: str + :type body: AttachCaseRequest + :rtype: FindingCaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["body"] = body + + return self._attach_case_endpoint.call_with_http_info(**kwargs) + + def attach_jira_issue( + self, + body: AttachJiraIssueRequest, + ) -> FindingCaseResponse: + """Attach security findings to a Jira issue. + + Attach security findings to a Jira issue by providing the Jira issue URL. You can attach up to 50 security findings per Jira issue. If the Jira issue is not linked to any case, this operation will create a case for the security findings and link the Jira issue to the newly created case. Security findings that are already attached to another Jira issue will be detached from their previous Jira issue and attached to the specified Jira issue. + + :type body: AttachJiraIssueRequest + :rtype: FindingCaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._attach_jira_issue_endpoint.call_with_http_info(**kwargs) + def cancel_threat_hunting_job( self, job_id: str, @@ -2277,6 +2427,22 @@ def convert_security_monitoring_rule_from_json_to_terraform( return self._convert_security_monitoring_rule_from_json_to_terraform_endpoint.call_with_http_info(**kwargs) + def create_cases( + self, + body: CreateCaseRequestArray, + ) -> FindingCaseResponseArray: + """Create cases for security findings. + + Create cases for security findings. You can create up to 50 cases per request and associate up to 50 security findings per case. Security findings that are already attached to another case will be detached from their previous case and attached to the newly created case. + + :type body: CreateCaseRequestArray + :rtype: FindingCaseResponseArray + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_cases_endpoint.call_with_http_info(**kwargs) + def create_custom_framework( self, body: CreateCustomFrameworkRequest, @@ -2293,6 +2459,22 @@ def create_custom_framework( return self._create_custom_framework_endpoint.call_with_http_info(**kwargs) + def create_jira_issues( + self, + body: CreateJiraIssueRequestArray, + ) -> FindingCaseResponseArray: + """Create Jira issues for security findings. + + Create Jira issues for security findings. This operation creates a case in Datadog and a Jira issue linked to that case for bidirectional sync between Datadog and Jira. You can create up to 50 Jira issues per request and associate up to 50 security findings per Jira issue. Security findings that are already attached to another Jira issue will be detached from their previous Jira issue and attached to the newly created Jira issue. + + :type body: CreateJiraIssueRequestArray + :rtype: FindingCaseResponseArray + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_jira_issues_endpoint.call_with_http_info(**kwargs) + def create_security_filter( self, body: SecurityFilterCreateRequest, @@ -2511,6 +2693,22 @@ def delete_vulnerability_notification_rule( return self._delete_vulnerability_notification_rule_endpoint.call_with_http_info(**kwargs) + def detach_case( + self, + body: DetachCaseRequest, + ) -> None: + """Detach security findings from their case. + + Detach security findings from their case. This operation dissociates security findings from their associated cases without deleting the cases themselves. You can detach security findings from multiple different cases in a single request, with a limit of 50 security findings per request. Security findings that are not currently attached to any case will be ignored. + + :type body: DetachCaseRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._detach_case_endpoint.call_with_http_info(**kwargs) + def edit_security_monitoring_signal_assignee( self, signal_id: str, diff --git a/src/datadog_api_client/v2/model/attach_case_request.py b/src/datadog_api_client/v2/model/attach_case_request.py new file mode 100644 index 0000000000..a678b5bb6a --- /dev/null +++ b/src/datadog_api_client/v2/model/attach_case_request.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.attach_case_request_data import AttachCaseRequestData + + +class AttachCaseRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attach_case_request_data import AttachCaseRequestData + + return { + "data": (AttachCaseRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AttachCaseRequestData, UnsetType] = unset, **kwargs): + """ + Request for attaching security findings to a case. + + :param data: Data of the case to attach security findings to. + :type data: AttachCaseRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/attach_case_request_data.py b/src/datadog_api_client/v2/model/attach_case_request_data.py new file mode 100644 index 0000000000..1446e902b9 --- /dev/null +++ b/src/datadog_api_client/v2/model/attach_case_request_data.py @@ -0,0 +1,65 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.attach_case_request_data_relationships import AttachCaseRequestDataRelationships + from datadog_api_client.v2.model.case_data_type import CaseDataType + + +class AttachCaseRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attach_case_request_data_relationships import ( + AttachCaseRequestDataRelationships, + ) + from datadog_api_client.v2.model.case_data_type import CaseDataType + + return { + "id": (str,), + "relationships": (AttachCaseRequestDataRelationships,), + "type": (CaseDataType,), + } + + attribute_map = { + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + id: str, + type: CaseDataType, + relationships: Union[AttachCaseRequestDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data of the case to attach security findings to. + + :param id: The unique identifier of the case. + :type id: str + + :param relationships: Relationships of the case to attach security findings to. + :type relationships: AttachCaseRequestDataRelationships, optional + + :param type: Cases resource type. + :type type: CaseDataType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/attach_case_request_data_relationships.py b/src/datadog_api_client/v2/model/attach_case_request_data_relationships.py new file mode 100644 index 0000000000..ba6d7fdf0a --- /dev/null +++ b/src/datadog_api_client/v2/model/attach_case_request_data_relationships.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.findings import Findings + + +class AttachCaseRequestDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.findings import Findings + + return { + "findings": (Findings,), + } + + attribute_map = { + "findings": "findings", + } + + def __init__(self_, findings: Findings, **kwargs): + """ + Relationships of the case to attach security findings to. + + :param findings: A list of security findings. + :type findings: Findings + """ + super().__init__(kwargs) + + self_.findings = findings diff --git a/src/datadog_api_client/v2/model/attach_jira_issue_request.py b/src/datadog_api_client/v2/model/attach_jira_issue_request.py new file mode 100644 index 0000000000..54dc5d7a3d --- /dev/null +++ b/src/datadog_api_client/v2/model/attach_jira_issue_request.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.attach_jira_issue_request_data import AttachJiraIssueRequestData + + +class AttachJiraIssueRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attach_jira_issue_request_data import AttachJiraIssueRequestData + + return { + "data": (AttachJiraIssueRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AttachJiraIssueRequestData, UnsetType] = unset, **kwargs): + """ + Request for attaching security findings to a Jira issue. + + :param data: Data of the Jira issue to attach security findings to. + :type data: AttachJiraIssueRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/attach_jira_issue_request_data.py b/src/datadog_api_client/v2/model/attach_jira_issue_request_data.py new file mode 100644 index 0000000000..ac6ff71046 --- /dev/null +++ b/src/datadog_api_client/v2/model/attach_jira_issue_request_data.py @@ -0,0 +1,82 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.attach_jira_issue_request_data_attributes import ( + AttachJiraIssueRequestDataAttributes, + ) + from datadog_api_client.v2.model.attach_jira_issue_request_data_relationships import ( + AttachJiraIssueRequestDataRelationships, + ) + from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + + +class AttachJiraIssueRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attach_jira_issue_request_data_attributes import ( + AttachJiraIssueRequestDataAttributes, + ) + from datadog_api_client.v2.model.attach_jira_issue_request_data_relationships import ( + AttachJiraIssueRequestDataRelationships, + ) + from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + + return { + "attributes": (AttachJiraIssueRequestDataAttributes,), + "id": (str,), + "relationships": (AttachJiraIssueRequestDataRelationships,), + "type": (JiraIssuesDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: JiraIssuesDataType, + attributes: Union[AttachJiraIssueRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[AttachJiraIssueRequestDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data of the Jira issue to attach security findings to. + + :param attributes: Attributes of the Jira issue to attach security findings to. + :type attributes: AttachJiraIssueRequestDataAttributes, optional + + :param id: The unique identifier of the Jira issue attachment request. + :type id: str, optional + + :param relationships: Relationships of the Jira issue to attach security findings to. + :type relationships: AttachJiraIssueRequestDataRelationships, optional + + :param type: Jira issues resource type. + :type type: JiraIssuesDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/attach_jira_issue_request_data_attributes.py b/src/datadog_api_client/v2/model/attach_jira_issue_request_data_attributes.py new file mode 100644 index 0000000000..44a1b72414 --- /dev/null +++ b/src/datadog_api_client/v2/model/attach_jira_issue_request_data_attributes.py @@ -0,0 +1,33 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AttachJiraIssueRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "jira_issue_url": (str,), + } + + attribute_map = { + "jira_issue_url": "jira_issue_url", + } + + def __init__(self_, jira_issue_url: str, **kwargs): + """ + Attributes of the Jira issue to attach security findings to. + + :param jira_issue_url: The URL of the Jira issue to attach security findings to. + :type jira_issue_url: str + """ + super().__init__(kwargs) + + self_.jira_issue_url = jira_issue_url diff --git a/src/datadog_api_client/v2/model/attach_jira_issue_request_data_relationships.py b/src/datadog_api_client/v2/model/attach_jira_issue_request_data_relationships.py new file mode 100644 index 0000000000..7cb6763632 --- /dev/null +++ b/src/datadog_api_client/v2/model/attach_jira_issue_request_data_relationships.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.findings import Findings + from datadog_api_client.v2.model.case_management_project import CaseManagementProject + + +class AttachJiraIssueRequestDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.findings import Findings + from datadog_api_client.v2.model.case_management_project import CaseManagementProject + + return { + "findings": (Findings,), + "project": (CaseManagementProject,), + } + + attribute_map = { + "findings": "findings", + "project": "project", + } + + def __init__(self_, findings: Findings, project: CaseManagementProject, **kwargs): + """ + Relationships of the Jira issue to attach security findings to. + + :param findings: A list of security findings. + :type findings: Findings + + :param project: Case management project. + :type project: CaseManagementProject + """ + super().__init__(kwargs) + + self_.findings = findings + self_.project = project diff --git a/src/datadog_api_client/v2/model/case_data_type.py b/src/datadog_api_client/v2/model/case_data_type.py new file mode 100644 index 0000000000..390841fc3b --- /dev/null +++ b/src/datadog_api_client/v2/model/case_data_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CaseDataType(ModelSimple): + """ + Cases resource type. + + :param value: If omitted defaults to "cases". Must be one of ["cases"]. + :type value: str + """ + + allowed_values = { + "cases", + } + CASES: ClassVar["CaseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CaseDataType.CASES = CaseDataType("cases") diff --git a/src/datadog_api_client/v2/model/case_insights_items.py b/src/datadog_api_client/v2/model/case_insights_items.py new file mode 100644 index 0000000000..efa61b85be --- /dev/null +++ b/src/datadog_api_client/v2/model/case_insights_items.py @@ -0,0 +1,56 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CaseInsightsItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "ref": (str,), + "resource_id": (str,), + "type": (str,), + } + + attribute_map = { + "ref": "ref", + "resource_id": "resource_id", + "type": "type", + } + + def __init__( + self_, + ref: Union[str, UnsetType] = unset, + resource_id: Union[str, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + An insight of the case. + + :param ref: The reference of the insight. + :type ref: str, optional + + :param resource_id: The unique identifier of the resource. For example, the unique identifier of a security finding. + :type resource_id: str, optional + + :param type: The type of the resource. For example, the type of a security finding is "SECURITY_FINDING". + :type type: str, optional + """ + if ref is not unset: + kwargs["ref"] = ref + if resource_id is not unset: + kwargs["resource_id"] = resource_id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_management_project.py b/src/datadog_api_client/v2/model/case_management_project.py new file mode 100644 index 0000000000..b8b789d301 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_management_project.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData + + +class CaseManagementProject(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData + + return { + "data": (CaseManagementProjectData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CaseManagementProjectData, **kwargs): + """ + Case management project. + + :param data: + :type data: CaseManagementProjectData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/case_management_project_data.py b/src/datadog_api_client/v2/model/case_management_project_data.py new file mode 100644 index 0000000000..b80ada112f --- /dev/null +++ b/src/datadog_api_client/v2/model/case_management_project_data.py @@ -0,0 +1,46 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType + + +class CaseManagementProjectData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType + + return { + "id": (str,), + "type": (CaseManagementProjectDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: CaseManagementProjectDataType, **kwargs): + """ + + + :param id: The unique identifier of the case management project. + :type id: str + + :param type: Projects resource type. + :type type: CaseManagementProjectDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_management_project_data_type.py b/src/datadog_api_client/v2/model/case_management_project_data_type.py new file mode 100644 index 0000000000..d66771791c --- /dev/null +++ b/src/datadog_api_client/v2/model/case_management_project_data_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CaseManagementProjectDataType(ModelSimple): + """ + Projects resource type. + + :param value: If omitted defaults to "projects". Must be one of ["projects"]. + :type value: str + """ + + allowed_values = { + "projects", + } + PROJECTS: ClassVar["CaseManagementProjectDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CaseManagementProjectDataType.PROJECTS = CaseManagementProjectDataType("projects") diff --git a/src/datadog_api_client/v2/model/create_case_request_array.py b/src/datadog_api_client/v2/model/create_case_request_array.py new file mode 100644 index 0000000000..82952edd26 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_case_request_array.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData + + +class CreateCaseRequestArray(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData + + return { + "data": ([CreateCaseRequestData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[CreateCaseRequestData], **kwargs): + """ + List of requests to create cases for security findings. + + :param data: + :type data: [CreateCaseRequestData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_case_request_data.py b/src/datadog_api_client/v2/model/create_case_request_data.py new file mode 100644 index 0000000000..cbf51ae126 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_case_request_data.py @@ -0,0 +1,76 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes + from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships + from datadog_api_client.v2.model.case_data_type import CaseDataType + + +class CreateCaseRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes + from datadog_api_client.v2.model.create_case_request_data_relationships import ( + CreateCaseRequestDataRelationships, + ) + from datadog_api_client.v2.model.case_data_type import CaseDataType + + return { + "attributes": (CreateCaseRequestDataAttributes,), + "id": (str,), + "relationships": (CreateCaseRequestDataRelationships,), + "type": (CaseDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: CaseDataType, + attributes: Union[CreateCaseRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[CreateCaseRequestDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data of the case to create. + + :param attributes: Attributes of the case to create. + :type attributes: CreateCaseRequestDataAttributes, optional + + :param id: The unique identifier of the case. + :type id: str, optional + + :param relationships: Relationships of the case to create. + :type relationships: CreateCaseRequestDataRelationships, optional + + :param type: Cases resource type. + :type type: CaseDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_case_request_data_attributes.py b/src/datadog_api_client/v2/model/create_case_request_data_attributes.py new file mode 100644 index 0000000000..5ffd1b9301 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_case_request_data_attributes.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_priority import CasePriority + + +class CreateCaseRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_priority import CasePriority + + return { + "assignee_id": (str,), + "description": (str,), + "priority": (CasePriority,), + "title": (str,), + } + + attribute_map = { + "assignee_id": "assignee_id", + "description": "description", + "priority": "priority", + "title": "title", + } + + def __init__( + self_, + assignee_id: Union[str, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + priority: Union[CasePriority, UnsetType] = unset, + title: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of the case to create. + + :param assignee_id: The unique identifier of the user assigned to the case. + :type assignee_id: str, optional + + :param description: The description of the case. If not provided, the description will be automatically generated. + :type description: str, optional + + :param priority: Case priority + :type priority: CasePriority, optional + + :param title: The title of the case. If not provided, the title will be automatically generated. + :type title: str, optional + """ + if assignee_id is not unset: + kwargs["assignee_id"] = assignee_id + if description is not unset: + kwargs["description"] = description + if priority is not unset: + kwargs["priority"] = priority + if title is not unset: + kwargs["title"] = title + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_case_request_data_relationships.py b/src/datadog_api_client/v2/model/create_case_request_data_relationships.py new file mode 100644 index 0000000000..cda45f7eca --- /dev/null +++ b/src/datadog_api_client/v2/model/create_case_request_data_relationships.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.findings import Findings + from datadog_api_client.v2.model.case_management_project import CaseManagementProject + + +class CreateCaseRequestDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.findings import Findings + from datadog_api_client.v2.model.case_management_project import CaseManagementProject + + return { + "findings": (Findings,), + "project": (CaseManagementProject,), + } + + attribute_map = { + "findings": "findings", + "project": "project", + } + + def __init__(self_, findings: Findings, project: CaseManagementProject, **kwargs): + """ + Relationships of the case to create. + + :param findings: A list of security findings. + :type findings: Findings + + :param project: Case management project. + :type project: CaseManagementProject + """ + super().__init__(kwargs) + + self_.findings = findings + self_.project = project diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_array.py b/src/datadog_api_client/v2/model/create_jira_issue_request_array.py new file mode 100644 index 0000000000..89cfabdeca --- /dev/null +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_array.py @@ -0,0 +1,68 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData + from datadog_api_client.v2.model.create_jira_issue_request_array_included import CreateJiraIssueRequestArrayIncluded + from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData + from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData + from datadog_api_client.v2.model.finding_data import FindingData + + +class CreateJiraIssueRequestArray(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData + from datadog_api_client.v2.model.create_jira_issue_request_array_included import ( + CreateJiraIssueRequestArrayIncluded, + ) + + return { + "data": ([CreateJiraIssueRequestData],), + "included": ([CreateJiraIssueRequestArrayIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: List[CreateJiraIssueRequestData], + included: Union[ + List[ + Union[ + CreateJiraIssueRequestArrayIncluded, CreateCaseRequestData, CaseManagementProjectData, FindingData + ] + ], + UnsetType, + ] = unset, + **kwargs, + ): + """ + List of requests to create Jira issues for security findings. + + :param data: + :type data: [CreateJiraIssueRequestData] + + :param included: + :type included: [CreateJiraIssueRequestArrayIncluded], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_array_included.py b/src/datadog_api_client/v2/model/create_jira_issue_request_array_included.py new file mode 100644 index 0000000000..12e06baeb6 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_array_included.py @@ -0,0 +1,51 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class CreateJiraIssueRequestArrayIncluded(ModelComposed): + def __init__(self, **kwargs): + """ + Attributes and relationships of the case linked to the Jira issue. Should contain all of the following: case, project, and security findings. + + :param attributes: Attributes of the case to create. + :type attributes: CreateCaseRequestDataAttributes, optional + + :param id: The unique identifier of the case. + :type id: str, optional + + :param relationships: Relationships of the case to create. + :type relationships: CreateCaseRequestDataRelationships, optional + + :param type: Cases resource type. + :type type: CaseDataType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData + from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData + from datadog_api_client.v2.model.finding_data import FindingData + + return { + "oneOf": [ + CreateCaseRequestData, + CaseManagementProjectData, + FindingData, + ], + } diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data.py new file mode 100644 index 0000000000..99584d8424 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data.py @@ -0,0 +1,82 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import ( + CreateJiraIssueRequestDataAttributes, + ) + from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( + CreateJiraIssueRequestDataRelationships, + ) + from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + + +class CreateJiraIssueRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import ( + CreateJiraIssueRequestDataAttributes, + ) + from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( + CreateJiraIssueRequestDataRelationships, + ) + from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType + + return { + "attributes": (CreateJiraIssueRequestDataAttributes,), + "id": (str,), + "relationships": (CreateJiraIssueRequestDataRelationships,), + "type": (JiraIssuesDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: JiraIssuesDataType, + attributes: Union[CreateJiraIssueRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[CreateJiraIssueRequestDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data of the Jira issue to create. + + :param attributes: Attributes of the Jira issue to create. + :type attributes: CreateJiraIssueRequestDataAttributes, optional + + :param id: The unique identifier of the Jira issue creation request. + :type id: str, optional + + :param relationships: Relationships of the Jira issue to create. + :type relationships: CreateJiraIssueRequestDataRelationships, optional + + :param type: Jira issues resource type. + :type type: JiraIssuesDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes.py new file mode 100644 index 0000000000..e97d8371b3 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes.py @@ -0,0 +1,46 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_jira_issue_request_data_attributes_fields import ( + CreateJiraIssueRequestDataAttributesFields, + ) + + +class CreateJiraIssueRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_jira_issue_request_data_attributes_fields import ( + CreateJiraIssueRequestDataAttributesFields, + ) + + return { + "fields": (CreateJiraIssueRequestDataAttributesFields,), + } + + attribute_map = { + "fields": "fields", + } + + def __init__(self_, fields: Union[CreateJiraIssueRequestDataAttributesFields, UnsetType] = unset, **kwargs): + """ + Attributes of the Jira issue to create. + + :param fields: Custom fields of the Jira issue to create. For the list of available fields, see `Jira documentation `_. + :type fields: CreateJiraIssueRequestDataAttributesFields, optional + """ + if fields is not unset: + kwargs["fields"] = fields + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes_fields.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes_fields.py new file mode 100644 index 0000000000..5a9b0f038e --- /dev/null +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes_fields.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CreateJiraIssueRequestDataAttributesFields(ModelNormal): + @cached_property + def openapi_types(_): + return { + "fields": (dict,), + } + + attribute_map = { + "fields": "fields", + } + + def __init__(self_, fields: Union[dict, UnsetType] = unset, **kwargs): + """ + Custom fields of the Jira issue to create. For the list of available fields, see `Jira documentation `_. + + :param fields: + :type fields: dict, optional + """ + if fields is not unset: + kwargs["fields"] = fields + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships.py new file mode 100644 index 0000000000..62dfb4b7ac --- /dev/null +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships.py @@ -0,0 +1,44 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( + CreateJiraIssueRequestDataRelationshipsCase, + ) + + +class CreateJiraIssueRequestDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( + CreateJiraIssueRequestDataRelationshipsCase, + ) + + return { + "case": (CreateJiraIssueRequestDataRelationshipsCase,), + } + + attribute_map = { + "case": "case", + } + + def __init__(self_, case: CreateJiraIssueRequestDataRelationshipsCase, **kwargs): + """ + Relationships of the Jira issue to create. + + :param case: Case linked to the Jira issue. + :type case: CreateJiraIssueRequestDataRelationshipsCase + """ + super().__init__(kwargs) + + self_.case = case diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case.py new file mode 100644 index 0000000000..9ebdf312df --- /dev/null +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case.py @@ -0,0 +1,44 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( + CreateJiraIssueRequestDataRelationshipsCaseData, + ) + + +class CreateJiraIssueRequestDataRelationshipsCase(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( + CreateJiraIssueRequestDataRelationshipsCaseData, + ) + + return { + "data": (CreateJiraIssueRequestDataRelationshipsCaseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CreateJiraIssueRequestDataRelationshipsCaseData, **kwargs): + """ + Case linked to the Jira issue. + + :param data: Case linked to the Jira issue. + :type data: CreateJiraIssueRequestDataRelationshipsCaseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case_data.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case_data.py new file mode 100644 index 0000000000..0c2dda89e1 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case_data.py @@ -0,0 +1,46 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_data_type import CaseDataType + + +class CreateJiraIssueRequestDataRelationshipsCaseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_data_type import CaseDataType + + return { + "id": (str,), + "type": (CaseDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: CaseDataType, **kwargs): + """ + Case linked to the Jira issue. + + :param id: + :type id: str + + :param type: Cases resource type. + :type type: CaseDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/detach_case_request.py b/src/datadog_api_client/v2/model/detach_case_request.py new file mode 100644 index 0000000000..8d6f1ef67f --- /dev/null +++ b/src/datadog_api_client/v2/model/detach_case_request.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.detach_case_request_data import DetachCaseRequestData + + +class DetachCaseRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.detach_case_request_data import DetachCaseRequestData + + return { + "data": (DetachCaseRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[DetachCaseRequestData, UnsetType] = unset, **kwargs): + """ + Request for detaching security findings from their case. + + :param data: Data for detaching security findings from their case. + :type data: DetachCaseRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/detach_case_request_data.py b/src/datadog_api_client/v2/model/detach_case_request_data.py new file mode 100644 index 0000000000..6db8f3111e --- /dev/null +++ b/src/datadog_api_client/v2/model/detach_case_request_data.py @@ -0,0 +1,66 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.detach_case_request_data_relationships import DetachCaseRequestDataRelationships + from datadog_api_client.v2.model.case_data_type import CaseDataType + + +class DetachCaseRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.detach_case_request_data_relationships import ( + DetachCaseRequestDataRelationships, + ) + from datadog_api_client.v2.model.case_data_type import CaseDataType + + return { + "id": (str,), + "relationships": (DetachCaseRequestDataRelationships,), + "type": (CaseDataType,), + } + + attribute_map = { + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: CaseDataType, + id: Union[str, UnsetType] = unset, + relationships: Union[DetachCaseRequestDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data for detaching security findings from their case. + + :param id: The unique identifier of the detachment request. + :type id: str, optional + + :param relationships: Relationships detaching security findings from their case. + :type relationships: DetachCaseRequestDataRelationships, optional + + :param type: Cases resource type. + :type type: CaseDataType + """ + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/detach_case_request_data_relationships.py b/src/datadog_api_client/v2/model/detach_case_request_data_relationships.py new file mode 100644 index 0000000000..a76df6df92 --- /dev/null +++ b/src/datadog_api_client/v2/model/detach_case_request_data_relationships.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.findings import Findings + + +class DetachCaseRequestDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.findings import Findings + + return { + "findings": (Findings,), + } + + attribute_map = { + "findings": "findings", + } + + def __init__(self_, findings: Findings, **kwargs): + """ + Relationships detaching security findings from their case. + + :param findings: A list of security findings. + :type findings: Findings + """ + super().__init__(kwargs) + + self_.findings = findings diff --git a/src/datadog_api_client/v2/model/finding_case_response.py b/src/datadog_api_client/v2/model/finding_case_response.py new file mode 100644 index 0000000000..cfab2e19bb --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_case_response.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.finding_case_response_data import FindingCaseResponseData + + +class FindingCaseResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.finding_case_response_data import FindingCaseResponseData + + return { + "data": (FindingCaseResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[FindingCaseResponseData, UnsetType] = unset, **kwargs): + """ + Case response. + + :param data: Data of the case. + :type data: FindingCaseResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/finding_case_response_array.py b/src/datadog_api_client/v2/model/finding_case_response_array.py new file mode 100644 index 0000000000..81b9d644a6 --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_case_response_array.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.finding_case_response_data import FindingCaseResponseData + + +class FindingCaseResponseArray(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.finding_case_response_data import FindingCaseResponseData + + return { + "data": ([FindingCaseResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[FindingCaseResponseData], **kwargs): + """ + List of case responses. + + :param data: + :type data: [FindingCaseResponseData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/finding_case_response_data.py b/src/datadog_api_client/v2/model/finding_case_response_data.py new file mode 100644 index 0000000000..63a25ed372 --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_case_response_data.py @@ -0,0 +1,78 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.finding_case_response_data_attributes import FindingCaseResponseDataAttributes + from datadog_api_client.v2.model.finding_case_response_data_relationships import ( + FindingCaseResponseDataRelationships, + ) + from datadog_api_client.v2.model.case_data_type import CaseDataType + + +class FindingCaseResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.finding_case_response_data_attributes import FindingCaseResponseDataAttributes + from datadog_api_client.v2.model.finding_case_response_data_relationships import ( + FindingCaseResponseDataRelationships, + ) + from datadog_api_client.v2.model.case_data_type import CaseDataType + + return { + "attributes": (FindingCaseResponseDataAttributes,), + "id": (str,), + "relationships": (FindingCaseResponseDataRelationships,), + "type": (CaseDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: CaseDataType, + attributes: Union[FindingCaseResponseDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[FindingCaseResponseDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data of the case. + + :param attributes: Attributes of the case. + :type attributes: FindingCaseResponseDataAttributes, optional + + :param id: The unique identifier of the case. + :type id: str, optional + + :param relationships: Relationships of the case. + :type relationships: FindingCaseResponseDataRelationships, optional + + :param type: Cases resource type. + :type type: CaseDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/finding_case_response_data_attributes.py b/src/datadog_api_client/v2/model/finding_case_response_data_attributes.py new file mode 100644 index 0000000000..1316817fa4 --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_case_response_data_attributes.py @@ -0,0 +1,187 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Dict, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + from datadog_api_client.v2.model.case_insights_items import CaseInsightsItems + from datadog_api_client.v2.model.finding_jira_issue import FindingJiraIssue + + +class FindingCaseResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + from datadog_api_client.v2.model.case_insights_items import CaseInsightsItems + from datadog_api_client.v2.model.finding_jira_issue import FindingJiraIssue + + return { + "archived_at": (datetime,), + "assigned_to": (RelationshipToUser,), + "attributes": ({str: ([str],)},), + "closed_at": (datetime,), + "created_at": (datetime,), + "creation_source": (str,), + "description": (str,), + "due_date": (str,), + "insights": ([CaseInsightsItems],), + "jira_issue": (FindingJiraIssue,), + "key": (str,), + "modified_at": (datetime,), + "priority": (str,), + "status": (str,), + "status_group": (str,), + "status_name": (str,), + "title": (str,), + "type": (str,), + } + + attribute_map = { + "archived_at": "archived_at", + "assigned_to": "assigned_to", + "attributes": "attributes", + "closed_at": "closed_at", + "created_at": "created_at", + "creation_source": "creation_source", + "description": "description", + "due_date": "due_date", + "insights": "insights", + "jira_issue": "jira_issue", + "key": "key", + "modified_at": "modified_at", + "priority": "priority", + "status": "status", + "status_group": "status_group", + "status_name": "status_name", + "title": "title", + "type": "type", + } + + def __init__( + self_, + archived_at: Union[datetime, UnsetType] = unset, + assigned_to: Union[RelationshipToUser, UnsetType] = unset, + attributes: Union[Dict[str, List[str]], UnsetType] = unset, + closed_at: Union[datetime, UnsetType] = unset, + created_at: Union[datetime, UnsetType] = unset, + creation_source: Union[str, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + due_date: Union[str, UnsetType] = unset, + insights: Union[List[CaseInsightsItems], UnsetType] = unset, + jira_issue: Union[FindingJiraIssue, UnsetType] = unset, + key: Union[str, UnsetType] = unset, + modified_at: Union[datetime, UnsetType] = unset, + priority: Union[str, UnsetType] = unset, + status: Union[str, UnsetType] = unset, + status_group: Union[str, UnsetType] = unset, + status_name: Union[str, UnsetType] = unset, + title: Union[str, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of the case. + + :param archived_at: Timestamp of when the case was archived. + :type archived_at: datetime, optional + + :param assigned_to: Relationship to user. + :type assigned_to: RelationshipToUser, optional + + :param attributes: + :type attributes: {str: ([str],)}, optional + + :param closed_at: Timestamp of when the case was closed. + :type closed_at: datetime, optional + + :param created_at: Timestamp of when the case was created. + :type created_at: datetime, optional + + :param creation_source: Source of the case creation. + :type creation_source: str, optional + + :param description: Description of the case. + :type description: str, optional + + :param due_date: Due date of the case. + :type due_date: str, optional + + :param insights: Insights of the case. + :type insights: [CaseInsightsItems], optional + + :param jira_issue: Jira issue associated with the case. + :type jira_issue: FindingJiraIssue, optional + + :param key: Key of the case. + :type key: str, optional + + :param modified_at: Timestamp of when the case was last modified. + :type modified_at: datetime, optional + + :param priority: Priority of the case. + :type priority: str, optional + + :param status: Status of the case. + :type status: str, optional + + :param status_group: Status group of the case. + :type status_group: str, optional + + :param status_name: Status name of the case. + :type status_name: str, optional + + :param title: Title of the case. + :type title: str, optional + + :param type: Type of the case. For security cases, this is always "SECURITY". + :type type: str, optional + """ + if archived_at is not unset: + kwargs["archived_at"] = archived_at + if assigned_to is not unset: + kwargs["assigned_to"] = assigned_to + if attributes is not unset: + kwargs["attributes"] = attributes + if closed_at is not unset: + kwargs["closed_at"] = closed_at + if created_at is not unset: + kwargs["created_at"] = created_at + if creation_source is not unset: + kwargs["creation_source"] = creation_source + if description is not unset: + kwargs["description"] = description + if due_date is not unset: + kwargs["due_date"] = due_date + if insights is not unset: + kwargs["insights"] = insights + if jira_issue is not unset: + kwargs["jira_issue"] = jira_issue + if key is not unset: + kwargs["key"] = key + if modified_at is not unset: + kwargs["modified_at"] = modified_at + if priority is not unset: + kwargs["priority"] = priority + if status is not unset: + kwargs["status"] = status + if status_group is not unset: + kwargs["status_group"] = status_group + if status_name is not unset: + kwargs["status_name"] = status_name + if title is not unset: + kwargs["title"] = title + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/finding_case_response_data_relationships.py b/src/datadog_api_client/v2/model/finding_case_response_data_relationships.py new file mode 100644 index 0000000000..8f0c750cd2 --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_case_response_data_relationships.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + from datadog_api_client.v2.model.case_management_project import CaseManagementProject + + +class FindingCaseResponseDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + from datadog_api_client.v2.model.case_management_project import CaseManagementProject + + return { + "created_by": (RelationshipToUser,), + "modified_by": (RelationshipToUser,), + "project": (CaseManagementProject,), + } + + attribute_map = { + "created_by": "created_by", + "modified_by": "modified_by", + "project": "project", + } + + def __init__( + self_, + created_by: Union[RelationshipToUser, UnsetType] = unset, + modified_by: Union[RelationshipToUser, UnsetType] = unset, + project: Union[CaseManagementProject, UnsetType] = unset, + **kwargs, + ): + """ + Relationships of the case. + + :param created_by: Relationship to user. + :type created_by: RelationshipToUser, optional + + :param modified_by: Relationship to user. + :type modified_by: RelationshipToUser, optional + + :param project: Case management project. + :type project: CaseManagementProject, optional + """ + if created_by is not unset: + kwargs["created_by"] = created_by + if modified_by is not unset: + kwargs["modified_by"] = modified_by + if project is not unset: + kwargs["project"] = project + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/finding_data.py b/src/datadog_api_client/v2/model/finding_data.py new file mode 100644 index 0000000000..67fa9785bd --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_data.py @@ -0,0 +1,46 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.finding_data_type import FindingDataType + + +class FindingData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.finding_data_type import FindingDataType + + return { + "id": (str,), + "type": (FindingDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: FindingDataType, **kwargs): + """ + + + :param id: The unique identifier of the security finding. + :type id: str + + :param type: Security findings resource type. + :type type: FindingDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/finding_data_type.py b/src/datadog_api_client/v2/model/finding_data_type.py new file mode 100644 index 0000000000..07a8ad19b5 --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_data_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FindingDataType(ModelSimple): + """ + Security findings resource type. + + :param value: If omitted defaults to "findings". Must be one of ["findings"]. + :type value: str + """ + + allowed_values = { + "findings", + } + FINDINGS: ClassVar["FindingDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FindingDataType.FINDINGS = FindingDataType("findings") diff --git a/src/datadog_api_client/v2/model/finding_jira_issue.py b/src/datadog_api_client/v2/model/finding_jira_issue.py new file mode 100644 index 0000000000..ad45387130 --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_jira_issue.py @@ -0,0 +1,62 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.finding_jira_issue_result import FindingJiraIssueResult + + +class FindingJiraIssue(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.finding_jira_issue_result import FindingJiraIssueResult + + return { + "error_message": (str,), + "result": (FindingJiraIssueResult,), + "status": (str,), + } + + attribute_map = { + "error_message": "error_message", + "result": "result", + "status": "status", + } + + def __init__( + self_, + error_message: Union[str, UnsetType] = unset, + result: Union[FindingJiraIssueResult, UnsetType] = unset, + status: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Jira issue associated with the case. + + :param error_message: The error message if the Jira issue creation failed. + :type error_message: str, optional + + :param result: Result of the Jira issue creation. + :type result: FindingJiraIssueResult, optional + + :param status: The status of the Jira issue creation. Can be "COMPLETED" if the Jira issue was created successfully, or "FAILED" if the Jira issue creation failed. + :type status: str, optional + """ + if error_message is not unset: + kwargs["error_message"] = error_message + if result is not unset: + kwargs["result"] = result + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/finding_jira_issue_result.py b/src/datadog_api_client/v2/model/finding_jira_issue_result.py new file mode 100644 index 0000000000..5863deceab --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_jira_issue_result.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class FindingJiraIssueResult(ModelNormal): + @cached_property + def openapi_types(_): + return { + "account_id": (str,), + "issue_id": (str,), + "issue_key": (str,), + "issue_url": (str,), + } + + attribute_map = { + "account_id": "account_id", + "issue_id": "issue_id", + "issue_key": "issue_key", + "issue_url": "issue_url", + } + + def __init__( + self_, + account_id: Union[str, UnsetType] = unset, + issue_id: Union[str, UnsetType] = unset, + issue_key: Union[str, UnsetType] = unset, + issue_url: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Result of the Jira issue creation. + + :param account_id: The account ID of the Jira issue. + :type account_id: str, optional + + :param issue_id: The unique identifier of the Jira issue. + :type issue_id: str, optional + + :param issue_key: The key of the Jira issue. + :type issue_key: str, optional + + :param issue_url: The URL of the Jira issue. + :type issue_url: str, optional + """ + if account_id is not unset: + kwargs["account_id"] = account_id + if issue_id is not unset: + kwargs["issue_id"] = issue_id + if issue_key is not unset: + kwargs["issue_key"] = issue_key + if issue_url is not unset: + kwargs["issue_url"] = issue_url + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/findings.py b/src/datadog_api_client/v2/model/findings.py new file mode 100644 index 0000000000..dadc91ca7d --- /dev/null +++ b/src/datadog_api_client/v2/model/findings.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.finding_data import FindingData + + +class Findings(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.finding_data import FindingData + + return { + "data": ([FindingData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[FindingData], UnsetType] = unset, **kwargs): + """ + A list of security findings. + + :param data: + :type data: [FindingData], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/jira_issues_data_type.py b/src/datadog_api_client/v2/model/jira_issues_data_type.py new file mode 100644 index 0000000000..94f767627c --- /dev/null +++ b/src/datadog_api_client/v2/model/jira_issues_data_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class JiraIssuesDataType(ModelSimple): + """ + Jira issues resource type. + + :param value: If omitted defaults to "jira_issues". Must be one of ["jira_issues"]. + :type value: str + """ + + allowed_values = { + "jira_issues", + } + JIRA_ISSUES: ClassVar["JiraIssuesDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +JiraIssuesDataType.JIRA_ISSUES = JiraIssuesDataType("jira_issues") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 9cece11cff..fc4c880499 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -362,6 +362,15 @@ from datadog_api_client.v2.model.asset_risks import AssetRisks from datadog_api_client.v2.model.asset_type import AssetType from datadog_api_client.v2.model.asset_version import AssetVersion +from datadog_api_client.v2.model.attach_case_request import AttachCaseRequest +from datadog_api_client.v2.model.attach_case_request_data import AttachCaseRequestData +from datadog_api_client.v2.model.attach_case_request_data_relationships import AttachCaseRequestDataRelationships +from datadog_api_client.v2.model.attach_jira_issue_request import AttachJiraIssueRequest +from datadog_api_client.v2.model.attach_jira_issue_request_data import AttachJiraIssueRequestData +from datadog_api_client.v2.model.attach_jira_issue_request_data_attributes import AttachJiraIssueRequestDataAttributes +from datadog_api_client.v2.model.attach_jira_issue_request_data_relationships import ( + AttachJiraIssueRequestDataRelationships, +) from datadog_api_client.v2.model.audit_logs_event import AuditLogsEvent from datadog_api_client.v2.model.audit_logs_event_attributes import AuditLogsEventAttributes from datadog_api_client.v2.model.audit_logs_event_type import AuditLogsEventType @@ -619,8 +628,13 @@ from datadog_api_client.v2.model.case_create_attributes import CaseCreateAttributes from datadog_api_client.v2.model.case_create_relationships import CaseCreateRelationships from datadog_api_client.v2.model.case_create_request import CaseCreateRequest +from datadog_api_client.v2.model.case_data_type import CaseDataType from datadog_api_client.v2.model.case_empty import CaseEmpty from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest +from datadog_api_client.v2.model.case_insights_items import CaseInsightsItems +from datadog_api_client.v2.model.case_management_project import CaseManagementProject +from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData +from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType from datadog_api_client.v2.model.case_object_attributes import CaseObjectAttributes from datadog_api_client.v2.model.case_priority import CasePriority from datadog_api_client.v2.model.case_relationships import CaseRelationships @@ -942,6 +956,10 @@ ) from datadog_api_client.v2.model.create_apps_datastore_response import CreateAppsDatastoreResponse from datadog_api_client.v2.model.create_apps_datastore_response_data import CreateAppsDatastoreResponseData +from datadog_api_client.v2.model.create_case_request_array import CreateCaseRequestArray +from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData +from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes +from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships from datadog_api_client.v2.model.create_connection_request import CreateConnectionRequest from datadog_api_client.v2.model.create_connection_request_data import CreateConnectionRequestData from datadog_api_client.v2.model.create_connection_request_data_attributes import CreateConnectionRequestDataAttributes @@ -973,6 +991,22 @@ from datadog_api_client.v2.model.create_incident_notification_template_request import ( CreateIncidentNotificationTemplateRequest, ) +from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray +from datadog_api_client.v2.model.create_jira_issue_request_array_included import CreateJiraIssueRequestArrayIncluded +from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData +from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import CreateJiraIssueRequestDataAttributes +from datadog_api_client.v2.model.create_jira_issue_request_data_attributes_fields import ( + CreateJiraIssueRequestDataAttributesFields, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( + CreateJiraIssueRequestDataRelationships, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( + CreateJiraIssueRequestDataRelationshipsCase, +) +from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( + CreateJiraIssueRequestDataRelationshipsCaseData, +) from datadog_api_client.v2.model.create_notification_rule_parameters import CreateNotificationRuleParameters from datadog_api_client.v2.model.create_notification_rule_parameters_data import CreateNotificationRuleParametersData from datadog_api_client.v2.model.create_notification_rule_parameters_data_attributes import ( @@ -1355,6 +1389,9 @@ DeploymentRuleResponseDataAttributesUpdatedBy, ) from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions +from datadog_api_client.v2.model.detach_case_request import DetachCaseRequest +from datadog_api_client.v2.model.detach_case_request_data import DetachCaseRequestData +from datadog_api_client.v2.model.detach_case_request_data_relationships import DetachCaseRequestDataRelationships from datadog_api_client.v2.model.detailed_finding import DetailedFinding from datadog_api_client.v2.model.detailed_finding_attributes import DetailedFindingAttributes from datadog_api_client.v2.model.detailed_finding_type import DetailedFindingType @@ -1705,13 +1742,23 @@ from datadog_api_client.v2.model.filters_per_product import FiltersPerProduct from datadog_api_client.v2.model.finding import Finding from datadog_api_client.v2.model.finding_attributes import FindingAttributes +from datadog_api_client.v2.model.finding_case_response import FindingCaseResponse +from datadog_api_client.v2.model.finding_case_response_array import FindingCaseResponseArray +from datadog_api_client.v2.model.finding_case_response_data import FindingCaseResponseData +from datadog_api_client.v2.model.finding_case_response_data_attributes import FindingCaseResponseDataAttributes +from datadog_api_client.v2.model.finding_case_response_data_relationships import FindingCaseResponseDataRelationships +from datadog_api_client.v2.model.finding_data import FindingData +from datadog_api_client.v2.model.finding_data_type import FindingDataType from datadog_api_client.v2.model.finding_evaluation import FindingEvaluation +from datadog_api_client.v2.model.finding_jira_issue import FindingJiraIssue +from datadog_api_client.v2.model.finding_jira_issue_result import FindingJiraIssueResult from datadog_api_client.v2.model.finding_mute import FindingMute from datadog_api_client.v2.model.finding_mute_reason import FindingMuteReason from datadog_api_client.v2.model.finding_rule import FindingRule from datadog_api_client.v2.model.finding_status import FindingStatus from datadog_api_client.v2.model.finding_type import FindingType from datadog_api_client.v2.model.finding_vulnerability_type import FindingVulnerabilityType +from datadog_api_client.v2.model.findings import Findings from datadog_api_client.v2.model.flaky_test import FlakyTest from datadog_api_client.v2.model.flaky_test_attributes import FlakyTestAttributes from datadog_api_client.v2.model.flaky_test_attributes_flaky_state import FlakyTestAttributesFlakyState @@ -2293,6 +2340,7 @@ from datadog_api_client.v2.model.jira_integration_metadata_issues_item import JiraIntegrationMetadataIssuesItem from datadog_api_client.v2.model.jira_issue import JiraIssue from datadog_api_client.v2.model.jira_issue_result import JiraIssueResult +from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType from datadog_api_client.v2.model.job_create_response import JobCreateResponse from datadog_api_client.v2.model.job_create_response_data import JobCreateResponseData from datadog_api_client.v2.model.job_definition import JobDefinition @@ -5194,6 +5242,13 @@ "AssetRisks", "AssetType", "AssetVersion", + "AttachCaseRequest", + "AttachCaseRequestData", + "AttachCaseRequestDataRelationships", + "AttachJiraIssueRequest", + "AttachJiraIssueRequestData", + "AttachJiraIssueRequestDataAttributes", + "AttachJiraIssueRequestDataRelationships", "AuditLogsEvent", "AuditLogsEventAttributes", "AuditLogsEventType", @@ -5417,8 +5472,13 @@ "CaseCreateAttributes", "CaseCreateRelationships", "CaseCreateRequest", + "CaseDataType", "CaseEmpty", "CaseEmptyRequest", + "CaseInsightsItems", + "CaseManagementProject", + "CaseManagementProjectData", + "CaseManagementProjectDataType", "CaseObjectAttributes", "CasePriority", "CaseRelationships", @@ -5658,6 +5718,10 @@ "CreateAppsDatastoreRequestDataAttributesOrgAccess", "CreateAppsDatastoreResponse", "CreateAppsDatastoreResponseData", + "CreateCaseRequestArray", + "CreateCaseRequestData", + "CreateCaseRequestDataAttributes", + "CreateCaseRequestDataRelationships", "CreateConnectionRequest", "CreateConnectionRequestData", "CreateConnectionRequestDataAttributes", @@ -5677,6 +5741,14 @@ "CreateDeploymentRuleParamsDataAttributes", "CreateIncidentNotificationRuleRequest", "CreateIncidentNotificationTemplateRequest", + "CreateJiraIssueRequestArray", + "CreateJiraIssueRequestArrayIncluded", + "CreateJiraIssueRequestData", + "CreateJiraIssueRequestDataAttributes", + "CreateJiraIssueRequestDataAttributesFields", + "CreateJiraIssueRequestDataRelationships", + "CreateJiraIssueRequestDataRelationshipsCase", + "CreateJiraIssueRequestDataRelationshipsCaseData", "CreateNotificationRuleParameters", "CreateNotificationRuleParametersData", "CreateNotificationRuleParametersDataAttributes", @@ -5929,6 +6001,9 @@ "DeploymentRuleResponseDataAttributesType", "DeploymentRuleResponseDataAttributesUpdatedBy", "DeploymentRulesOptions", + "DetachCaseRequest", + "DetachCaseRequestData", + "DetachCaseRequestDataRelationships", "DetailedFinding", "DetailedFindingAttributes", "DetailedFindingType", @@ -6191,13 +6266,23 @@ "FiltersPerProduct", "Finding", "FindingAttributes", + "FindingCaseResponse", + "FindingCaseResponseArray", + "FindingCaseResponseData", + "FindingCaseResponseDataAttributes", + "FindingCaseResponseDataRelationships", + "FindingData", + "FindingDataType", "FindingEvaluation", + "FindingJiraIssue", + "FindingJiraIssueResult", "FindingMute", "FindingMuteReason", "FindingRule", "FindingStatus", "FindingType", "FindingVulnerabilityType", + "Findings", "FlakyTest", "FlakyTestAttributes", "FlakyTestAttributesFlakyState", @@ -6679,6 +6764,7 @@ "JiraIntegrationMetadataIssuesItem", "JiraIssue", "JiraIssueResult", + "JiraIssuesDataType", "JobCreateResponse", "JobCreateResponseData", "JobDefinition", diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_case_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_case_returns_ok_response.frozen new file mode 100644 index 0000000000..24c38af62e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-19T16:20:46.726Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_case_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_case_returns_ok_response.yaml new file mode 100644 index 0000000000..02049bec36 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_case_returns_ok_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-459","modified_at":"2025-11-19T16:20:51.754979Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_jira_issue_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_jira_issue_returns_ok_response.frozen new file mode 100644 index 0000000000..e21d532e44 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_jira_issue_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-20T15:49:48.969Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_jira_issue_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_jira_issue_returns_ok_response.yaml new file mode 100644 index 0000000000..4cb28892ca --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_finding_to_a_jira_issue_returns_ok_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"data":{"id":"9efb1118-ed9c-4b02-b13b-f3acf8415f7c","type":"cases","attributes":{"created_at":"2025-11-20T15:22:44.644286Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404808","issue_key":"CSMSEC-105476","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-463","modified_at":"2025-11-20T15:49:53.272293Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_bad_request_response.frozen new file mode 100644 index 0000000000..1adeacaf47 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-19T16:16:38.781Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_bad_request_response.yaml new file mode 100644 index 0000000000..400ce73a6c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[]}},"type":"cases"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_not_found_response.frozen new file mode 100644 index 0000000000..ed7d98397f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-19T16:17:49.938Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_not_found_response.yaml new file mode 100644 index 0000000000..56e647f6cd --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"id":"wrong-case-id","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/wrong-case-id + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"failed to + get case: case not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_ok_response.frozen new file mode 100644 index 0000000000..376033b3d9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-19T16:23:42.957Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_ok_response.yaml new file mode 100644 index 0000000000..7d66614f2f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_case_returns_ok_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"},{"id":"MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/2e336d846a2745499849778d969b56f8?detection=static","resource_id":"MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ="}],"key":"CSMINV-459","modified_at":"2025-11-19T16:23:22.109092Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_bad_request_response.frozen new file mode 100644 index 0000000000..7b6703448a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-20T15:53:19.037Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_bad_request_response.yaml new file mode 100644 index 0000000000..fd8a81c8f3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_not_found_response.frozen new file mode 100644 index 0000000000..4495f3bf05 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-20T15:59:56.064Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_not_found_response.yaml new file mode 100644 index 0000000000..8818579862 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"wrong-finding-id","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"finding not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_ok_response.frozen new file mode 100644 index 0000000000..8a74e023fa --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-20T15:52:21.664Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_ok_response.yaml new file mode 100644 index 0000000000..6d3017a929 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_attach_security_findings_to_a_jira_issue_returns_ok_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"},{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"data":{"id":"9efb1118-ed9c-4b02-b13b-f3acf8415f7c","type":"cases","attributes":{"created_at":"2025-11-20T15:22:44.644286Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/13c7ffac3021be5d1bd4c5e07b575fca?detection=static","resource_id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404808","issue_key":"CSMSEC-105476","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-463","modified_at":"2025-11-20T15:52:25.368628Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.frozen new file mode 100644 index 0000000000..a6ccca66ab --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.frozen @@ -0,0 +1 @@ +2025-11-19T13:45:48.321Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.yaml new file mode 100644 index 0000000000..e842738d1d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '{"data":[{"id":"639c5df7-2352-4fc6-9d39-7dc8bdb8af14","type":"cases","attributes":{"created_at":"2025-11-19T13:45:50.295906Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-454","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"id":"639c5df7-2352-4fc6-9d39-7dc8bdb8af14","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.frozen new file mode 100644 index 0000000000..11d711428d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.frozen @@ -0,0 +1 @@ +2025-11-19T13:46:07.661Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.yaml new file mode 100644 index 0000000000..47f9ec9fcf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"},{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '{"data":[{"id":"2c1ac0c4-e8cf-4699-8781-09077b10d2a0","type":"cases","attributes":{"created_at":"2025-11-19T13:46:09.874194Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-455","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"id":"2c1ac0c4-e8cf-4699-8781-09077b10d2a0","relationships":{"findings":{"data":[{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_bad_request_response.frozen new file mode 100644 index 0000000000..03dcf16231 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-19T13:46:49.148Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_bad_request_response.yaml new file mode 100644 index 0000000000..8cda3de78e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":[{"attributes":{},"relationships":{"findings":{"data":[]},"project":{"data":{"id":"7f198869-c7ef-4afc-97cf-da5cdc13b5c3","type":"projects"}}},"type":"cases"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.frozen new file mode 100644 index 0000000000..d1e05ac25c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.frozen @@ -0,0 +1 @@ +2025-11-19T13:54:20.603Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.yaml new file mode 100644 index 0000000000..2f40126da2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"attributes":{"description":"A + description","title":"A title"},"relationships":{"findings":{"data":[{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '{"data":[{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-459","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}},{"id":"601cab78-ef04-4bdf-901a-55533afbde0b","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634552Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="}],"key":"CSMINV-458","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_not_found_response.frozen new file mode 100644 index 0000000000..331897b6e2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-19T13:47:19.797Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_not_found_response.yaml new file mode 100644 index 0000000000..8eae2a9ca1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":[{"attributes":{},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"projects"}}},"type":"cases"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"project not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.frozen new file mode 100644 index 0000000000..6c188712b9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.frozen @@ -0,0 +1 @@ +2025-11-19T17:01:11.179Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.yaml new file mode 100644 index 0000000000..181bef684e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.yaml @@ -0,0 +1,39 @@ +interactions: +- request: + body: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"6a773295-8729-4034-aada-53b64cbe02e7","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"6a773295-8729-4034-aada-53b64cbe02e7","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"data":[{"id":"6a773295-8729-4034-aada-53b64cbe02e7","type":"cases","attributes":{"created_at":"2025-11-19T17:01:15.21452Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2402037","issue_key":"CSMSEC-105473","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105473","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-461","modified_at":"2025-11-19T17:01:16.621974Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"id":"6a773295-8729-4034-aada-53b64cbe02e7","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.frozen new file mode 100644 index 0000000000..8bb7a59bf9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.frozen @@ -0,0 +1 @@ +2025-11-21T14:49:30.001Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.yaml new file mode 100644 index 0000000000..96e75527fd --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.yaml @@ -0,0 +1,39 @@ +interactions: +- request: + body: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"e469ceda-957a-4557-a607-9ff25032e9ca","relationships":{"findings":{"data":[{"id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"},{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"},{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"data":[{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","type":"cases","attributes":{"created_at":"2025-11-21T14:49:32.034826Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/f16db9b7fa42c8a047777b354d6ccfe7?detection=static","resource_id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/3510289f2aa284ab44f86b66e1f64cc7?detection=static","resource_id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2407744","issue_key":"CSMSEC-105481","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105481","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-468","modified_at":"2025-11-21T14:49:33.306003Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","relationships":{"findings":{"data":[{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.frozen new file mode 100644 index 0000000000..ff98ffb1a1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-20T12:01:47.295Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.yaml new file mode 100644 index 0000000000..ca89455f91 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"a7c38bab-ae98-4113-878c-c98799f914c2","type":"cases"}}},"type":"jira_issues"}],"included":[{"id":"a7c38bab-ae98-4113-878c-c98799f914c2","relationships":{"findings":{"data":[]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.frozen new file mode 100644 index 0000000000..e5b6d0d76b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.frozen @@ -0,0 +1 @@ +2025-11-20T15:32:21.828Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.yaml new file mode 100644 index 0000000000..4c55ad86cd --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","type":"cases"}}},"type":"jira_issues"},{"attributes":{},"relationships":{"case":{"data":{"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"attributes":{"description":"A + description","title":"A title"},"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","relationships":{"findings":{"data":[{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"},{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"data":[{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","type":"cases","attributes":{"created_at":"2025-11-20T15:32:23.777159Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404837","issue_key":"CSMSEC-105480","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105480","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-467","modified_at":"2025-11-20T15:32:25.088199Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}},{"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","type":"cases","attributes":{"created_at":"2025-11-20T15:32:23.776904Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/13c7ffac3021be5d1bd4c5e07b575fca?detection=static","resource_id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404836","issue_key":"CSMSEC-105479","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105479","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-466","modified_at":"2025-11-20T15:32:24.96456Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.frozen new file mode 100644 index 0000000000..f0ed0dd3f1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-20T15:42:51.100Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.yaml new file mode 100644 index 0000000000..48aa98ce11 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3","relationships":{"findings":{"data":[{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]},"project":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"projects"}}},"type":"cases"},{"id":"00000000-0000-0000-0000-000000000000","type":"projects"},{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"project not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_bad_request_response.frozen new file mode 100644 index 0000000000..48119112e5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-20T16:07:27.292Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_bad_request_response.yaml new file mode 100644 index 0000000000..52f7c6fd6b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"relationships":{"findings":{"data":[]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_no_content_response.frozen new file mode 100644 index 0000000000..3e388493c6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_no_content_response.frozen @@ -0,0 +1 @@ +2025-11-21T13:41:10.798Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_no_content_response.yaml new file mode 100644 index 0000000000..7dc9adc886 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_no_content_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: '{"data":{"relationships":{"findings":{"data":[{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_not_found_response.frozen new file mode 100644 index 0000000000..72e1b275ef --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-20T16:06:53.415Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_not_found_response.yaml new file mode 100644 index 0000000000..08b7d1f35f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_detach_security_findings_from_their_case_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"relationships":{"findings":{"data":[{"id":"wrong-finding-id","type":"findings"}]}},"type":"cases"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"finding not + found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/features/security_monitoring.feature b/tests/v2/features/security_monitoring.feature index 531c84c19c..99b3f52c8d 100644 --- a/tests/v2/features/security_monitoring.feature +++ b/tests/v2/features/security_monitoring.feature @@ -5,9 +5,83 @@ Feature: Security Monitoring information. Background: - Given an instance of "SecurityMonitoring" API - And a valid "apiKeyAuth" key in the system + Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system + And an instance of "SecurityMonitoring" API + + @team:DataDog/k9-findings-platform + Scenario: Attach security finding to a Jira issue returns "OK" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476" + + @team:DataDog/k9-findings-platform + Scenario: Attach security finding to a case returns "OK" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + + @team:DataDog/k9-findings-platform + Scenario: Attach security findings to a Jira issue returns "Bad Request" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-findings-platform + Scenario: Attach security findings to a Jira issue returns "Not Found" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-findings-platform + Scenario: Attach security findings to a Jira issue returns "OK" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}, {"id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data.attributes.insights" has item with field "resource_id" with value "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" + And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476" + + @team:DataDog/k9-findings-platform + Scenario: Attach security findings to a case returns "Bad Request" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": []}}, "type": "cases"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-findings-platform + Scenario: Attach security findings to a case returns "Not Found" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "wrong-case-id" + And body with value {"data": {"id": "wrong-case-id", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-findings-platform + Scenario: Attach security findings to a case returns "OK" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}, {"id": "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data.attributes.insights" has item with field "resource_id" with value "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=" @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "Bad Request" response @@ -184,6 +258,78 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n" + @team:DataDog/k9-findings-platform + Scenario: Create Jira issue for security finding returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6a773295-8729-4034-aada-53b64cbe02e7"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]}}, "id": "6a773295-8729-4034-aada-53b64cbe02e7"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-findings-platform + Scenario: Create Jira issue for security findings returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]}}, "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 2 + And the response "data[0].attributes.insights[1].resource_id" is equal to "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=" + And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-findings-platform + Scenario: Create Jira issues for security findings returns "Bad Request" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}}}}], "included": [{"type": "cases", "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": []}}, "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-findings-platform + Scenario: Create Jira issues for security findings returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes":{}, "relationships": {"case": {"data": {"type": "cases", "id":"53e242c6-a7d6-46ad-9680-b8d14753f716"}}}}, {"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}}}}], "included":[{"type":"cases", "attributes":{"title":"A title", "description":"A description"}, "relationships":{"project":{"data":{"type":"projects", "id":"959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}]}}, "id": "53e242c6-a7d6-46ad-9680-b8d14753f716"}, {"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data":[{"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]}}, "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}, {"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 2 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + And the response "data[1]" has field "id" + And the response "data[1].attributes.title" is equal to "A title" + And the response "data[1].attributes.description" is equal to "A description" + And the response "data[1].attributes.type" is equal to "SECURITY" + And the response "data[1].attributes.insights" has length 1 + And the response "data[1].attributes.insights[0].resource_id" is equal to "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" + And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-findings-platform + Scenario: Create Jira issues for security findings returns "Not Found" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}}, "findings": {"data": [{"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]}}, "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}, {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}, {"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]} + When the request is sent + Then the response status is 404 Not Found + @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a cloud_configuration rule returns "OK" response Given new "CreateSecurityMonitoringRule" request @@ -408,6 +554,74 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail" And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345" + @team:DataDog/k9-findings-platform + Scenario: Create case for security finding returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-findings-platform + Scenario: Create case for security findings returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}, {"id": "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 2 + And the response "data[0].attributes.insights[1].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.insights[0].resource_id" is equal to "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-findings-platform + Scenario: Create cases for security findings returns "Bad Request" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "7f198869-c7ef-4afc-97cf-da5cdc13b5c3", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-findings-platform + Scenario: Create cases for security findings returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}, {"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 2 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[1]" has field "id" + And the response "data[1].attributes.title" is equal to "A title" + And the response "data[1].attributes.description" is equal to "A description" + And the response "data[1].attributes.type" is equal to "SECURITY" + And the response "data[1].attributes.insights" has length 1 + And the response "data[1].attributes.insights[0].resource_id" is equal to "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=" + And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-findings-platform + Scenario: Create cases for security findings returns "Not Found" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/k9-cloud-security-platform Scenario: Delete a custom framework returns "Bad Request" response Given new "DeleteCustomFramework" request @@ -546,6 +760,27 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @team:DataDog/k9-findings-platform + Scenario: Detach security findings from their case returns "Bad Request" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": []}}, "type": "cases"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-findings-platform + Scenario: Detach security findings from their case returns "No Content" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": [{"id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/k9-findings-platform + Scenario: Detach security findings from their case returns "Not Found" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/asm-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetSBOM" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 3799e64e63..0ee3a47318 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3597,6 +3597,50 @@ "type": "safe" } }, + "DetachCase": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "CreateCases": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DetachCase", + "parameters": [ + { + "name": "body", + "template": "{\n \"data\": {\n \"type\": \"cases\",\n \"id\": \"{{data[0].id}}\",\n \"relationships\": {\n \"findings\": {\n \"data\": [\n {\n \"type\": \"findings\",\n \"id\": \"{{data[0].attributes.insights[0].resource_id}}\"\n }\n ]\n }\n }\n }\n}" + } + ], + "type": "unsafe" + } + }, + "AttachCase": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "AttachJiraIssue": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "CreateJiraIssues": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DetachCase", + "parameters": [ + { + "name": "body", + "template": "{\n \"data\": {\n \"type\": \"cases\",\n \"id\": \"{{data[0].id}}\",\n \"relationships\": {\n \"findings\": {\n \"data\": [\n {\n \"type\": \"findings\",\n \"id\": \"{{data[0].attributes.insights[0].resource_id}}\"\n }\n ]\n }\n }\n }\n}" + } + ], + "type": "unsafe" + } + }, "ListAssetsSBOMs": { "tag": "Security Monitoring", "undo": {