From d71b35f6a2350262976da4c1251a62bcf759a72e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 18 Jun 2026 10:34:44 +0000 Subject: [PATCH] Regenerate client from commit 61df48f of spec repo --- .generator/schemas/v2/openapi.yaml | 2150 +++++++++++++++++ docs/datadog_api_client.v2.model.rst | 350 +++ ...teSecurityFindingsAutomationDueDateRule.py | 49 + ...reateSecurityFindingsAutomationMuteRule.py | 41 + ...ityFindingsAutomationTicketCreationRule.py | 44 + ...teSecurityFindingsAutomationDueDateRule.py | 18 + ...eleteSecurityFindingsAutomationMuteRule.py | 18 + ...ityFindingsAutomationTicketCreationRule.py | 18 + ...etSecurityFindingsAutomationDueDateRule.py | 20 + .../GetSecurityFindingsAutomationMuteRule.py | 20 + ...ityFindingsAutomationTicketCreationRule.py | 20 + ...tSecurityFindingsAutomationDueDateRules.py | 14 + ...ListSecurityFindingsAutomationMuteRules.py | 14 + ...tyFindingsAutomationTicketCreationRules.py | 14 + ...rSecurityFindingsAutomationDueDateRules.py | 30 + ...rderSecurityFindingsAutomationMuteRules.py | 30 + ...tyFindingsAutomationTicketCreationRules.py | 30 + ...teSecurityFindingsAutomationDueDateRule.py | 55 + ...pdateSecurityFindingsAutomationMuteRule.py | 45 + ...ityFindingsAutomationTicketCreationRule.py | 50 + src/datadog_api_client/configuration.py | 18 + .../v2/api/security_monitoring_api.py | 814 ++++++- .../v2/model/automation_rule_actor_type.py | 38 + .../v2/model/automation_rule_created_by.py | 52 + .../v2/model/automation_rule_modified_by.py | 52 + .../v2/model/automation_rule_scope.py | 58 + .../v2/model/due_date_from.py | 38 + .../v2/model/due_date_per_severity_item.py | 53 + .../v2/model/due_date_rule_action.py | 69 + .../model/due_date_rule_attributes_create.py | 77 + .../due_date_rule_attributes_response.py | 106 + .../v2/model/due_date_rule_create_request.py | 40 + .../v2/model/due_date_rule_data_create.py | 48 + .../v2/model/due_date_rule_data_response.py | 55 + .../v2/model/due_date_rule_reorder_item.py | 47 + .../v2/model/due_date_rule_reorder_request.py | 40 + .../v2/model/due_date_rule_response.py | 40 + .../v2/model/due_date_rule_type.py | 35 + .../v2/model/due_date_rule_update_request.py | 40 + .../v2/model/due_date_rules_response.py | 62 + .../v2/model/due_date_severity.py | 53 + .../v2/model/mute_reason.py | 50 + .../v2/model/mute_rule_action.py | 68 + .../v2/model/mute_rule_attributes_create.py | 77 + .../v2/model/mute_rule_attributes_response.py | 106 + .../v2/model/mute_rule_create_request.py | 40 + .../v2/model/mute_rule_data_create.py | 48 + .../v2/model/mute_rule_data_response.py | 55 + .../v2/model/mute_rule_reorder_item.py | 47 + .../v2/model/mute_rule_reorder_request.py | 40 + .../v2/model/mute_rule_response.py | 40 + .../v2/model/mute_rule_type.py | 35 + .../v2/model/mute_rule_update_request.py | 40 + .../v2/model/mute_rules_response.py | 62 + .../model/security_automation_rules_links.py | 58 + .../model/security_automation_rules_meta.py | 40 + .../security_automation_rules_page_info.py | 33 + .../v2/model/security_finding_type.py | 65 + .../v2/model/ticket_creation_rule_action.py | 84 + .../ticket_creation_rule_action_response.py | 92 + .../ticket_creation_rule_attributes_create.py | 77 + ...icket_creation_rule_attributes_response.py | 106 + .../ticket_creation_rule_create_request.py | 40 + .../model/ticket_creation_rule_data_create.py | 50 + .../ticket_creation_rule_data_response.py | 61 + .../ticket_creation_rule_reorder_item.py | 47 + .../ticket_creation_rule_reorder_request.py | 40 + .../v2/model/ticket_creation_rule_response.py | 40 + .../v2/model/ticket_creation_rule_type.py | 35 + .../ticket_creation_rule_update_request.py | 40 + .../model/ticket_creation_rules_response.py | 62 + .../v2/model/ticket_creation_target.py | 38 + src/datadog_api_client/v2/models/__init__.py | 100 + ..._created_the_due_date_rule_response.frozen | 1 + ...ly_created_the_due_date_rule_response.yaml | 36 + ...ully_created_the_mute_rule_response.frozen | 1 + ...sfully_created_the_mute_rule_response.yaml | 36 + ...d_the_ticket_creation_rule_response.frozen | 1 + ...ted_the_ticket_creation_rule_response.yaml | 36 + ..._rule_successfully_deleted_response.frozen | 1 + ...ns_rule_successfully_deleted_response.yaml | 53 + ..._rule_successfully_deleted_response.frozen | 1 + ...ns_rule_successfully_deleted_response.yaml | 53 + ..._rule_successfully_deleted_response.frozen | 1 + ...ns_rule_successfully_deleted_response.yaml | 53 + ...etrieved_the_due_date_rule_response.frozen | 1 + ..._retrieved_the_due_date_rule_response.yaml | 54 + ...ly_retrieved_the_mute_rule_response.frozen | 1 + ...ully_retrieved_the_mute_rule_response.yaml | 54 + ...d_the_ticket_creation_rule_response.frozen | 1 + ...ved_the_ticket_creation_rule_response.yaml | 54 + ...the_list_of_due_date_rules_response.frozen | 1 + ...d_the_list_of_due_date_rules_response.yaml | 54 + ...ved_the_list_of_mute_rules_response.frozen | 1 + ...ieved_the_list_of_mute_rules_response.yaml | 54 + ...t_of_ticket_creation_rules_response.frozen | 1 + ...ist_of_ticket_creation_rules_response.yaml | 54 + ...ordered_the_due_date_rules_response.frozen | 1 + ...reordered_the_due_date_rules_response.yaml | 54 + ...y_reordered_the_mute_rules_response.frozen | 1 + ...lly_reordered_the_mute_rules_response.yaml | 54 + ..._the_ticket_creation_rules_response.frozen | 1 + ...ed_the_ticket_creation_rules_response.yaml | 54 + ..._updated_the_due_date_rule_response.frozen | 1 + ...ly_updated_the_due_date_rule_response.yaml | 56 + ...ully_updated_the_mute_rule_response.frozen | 1 + ...sfully_updated_the_mute_rule_response.yaml | 56 + ...d_the_ticket_creation_rule_response.frozen | 1 + ...ted_the_ticket_creation_rule_response.yaml | 56 + tests/v2/features/given.json | 36 + tests/v2/features/security_monitoring.feature | 408 ++++ tests/v2/features/undo.json | 129 + 112 files changed, 8181 insertions(+), 12 deletions(-) create mode 100644 examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.py create mode 100644 examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.py create mode 100644 examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.py create mode 100644 examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.py create mode 100644 examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.py create mode 100644 examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.py create mode 100644 examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.py create mode 100644 examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.py create mode 100644 examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.py create mode 100644 examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.py create mode 100644 examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.py create mode 100644 examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.py create mode 100644 examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.py create mode 100644 examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.py create mode 100644 examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.py create mode 100644 examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.py create mode 100644 examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.py create mode 100644 examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.py create mode 100644 src/datadog_api_client/v2/model/automation_rule_actor_type.py create mode 100644 src/datadog_api_client/v2/model/automation_rule_created_by.py create mode 100644 src/datadog_api_client/v2/model/automation_rule_modified_by.py create mode 100644 src/datadog_api_client/v2/model/automation_rule_scope.py create mode 100644 src/datadog_api_client/v2/model/due_date_from.py create mode 100644 src/datadog_api_client/v2/model/due_date_per_severity_item.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_action.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_attributes_create.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_attributes_response.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_create_request.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_data_create.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_data_response.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_reorder_item.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_reorder_request.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_response.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_type.py create mode 100644 src/datadog_api_client/v2/model/due_date_rule_update_request.py create mode 100644 src/datadog_api_client/v2/model/due_date_rules_response.py create mode 100644 src/datadog_api_client/v2/model/due_date_severity.py create mode 100644 src/datadog_api_client/v2/model/mute_reason.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_action.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_attributes_create.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_attributes_response.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_create_request.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_data_create.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_data_response.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_reorder_item.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_reorder_request.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_response.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_type.py create mode 100644 src/datadog_api_client/v2/model/mute_rule_update_request.py create mode 100644 src/datadog_api_client/v2/model/mute_rules_response.py create mode 100644 src/datadog_api_client/v2/model/security_automation_rules_links.py create mode 100644 src/datadog_api_client/v2/model/security_automation_rules_meta.py create mode 100644 src/datadog_api_client/v2/model/security_automation_rules_page_info.py create mode 100644 src/datadog_api_client/v2/model/security_finding_type.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_action.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_action_response.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_attributes_create.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_attributes_response.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_create_request.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_data_create.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_data_response.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_reorder_item.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_reorder_request.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_response.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_type.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rule_update_request.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_rules_response.py create mode 100644 src/datadog_api_client/v2/model/ticket_creation_target.py create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_due_date_rule_returns_successfully_created_the_due_date_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_due_date_rule_returns_successfully_created_the_due_date_rule_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_mute_rule_returns_successfully_created_the_mute_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_mute_rule_returns_successfully_created_the_mute_rule_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_ticket_creation_rule_returns_successfully_created_the_ticket_creation_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_ticket_creation_rule_returns_successfully_created_the_ticket_creation_rule_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_due_date_rule_returns_rule_successfully_deleted_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_due_date_rule_returns_rule_successfully_deleted_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_ticket_creation_rule_returns_rule_successfully_deleted_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_ticket_creation_rule_returns_rule_successfully_deleted_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_due_date_rule_returns_successfully_retrieved_the_due_date_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_due_date_rule_returns_successfully_retrieved_the_due_date_rule_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_mute_rule_returns_successfully_retrieved_the_mute_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_mute_rule_returns_successfully_retrieved_the_mute_rule_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_ticket_creation_rule_returns_successfully_retrieved_the_ticket_creation_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_ticket_creation_rule_returns_successfully_retrieved_the_ticket_creation_rule_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_due_date_rules_returns_successfully_retrieved_the_list_of_due_date_rules_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_due_date_rules_returns_successfully_retrieved_the_list_of_due_date_rules_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_mute_rules_returns_successfully_retrieved_the_list_of_mute_rules_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_mute_rules_returns_successfully_retrieved_the_list_of_mute_rules_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_ticket_creation_rules_returns_successfully_retrieved_the_list_of_ticket_creation_rules_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_ticket_creation_rules_returns_successfully_retrieved_the_list_of_ticket_creation_rules_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_reorder_due_date_rules_returns_successfully_reordered_the_due_date_rules_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_reorder_due_date_rules_returns_successfully_reordered_the_due_date_rules_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_reorder_mute_rules_returns_successfully_reordered_the_mute_rules_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_reorder_mute_rules_returns_successfully_reordered_the_mute_rules_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_reorder_ticket_creation_rules_returns_successfully_reordered_the_ticket_creation_rules_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_reorder_ticket_creation_rules_returns_successfully_reordered_the_ticket_creation_rules_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_due_date_rule_returns_successfully_updated_the_due_date_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_due_date_rule_returns_successfully_updated_the_due_date_rule_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_successfully_updated_the_mute_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_successfully_updated_the_mute_rule_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_ticket_creation_rule_returns_successfully_updated_the_ticket_creation_rule_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_ticket_creation_rule_returns_successfully_updated_the_ticket_creation_rule_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b17c8433bd..de1bbc1393 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11426,6 +11426,16 @@ components: x-enum-varnames: - EXECUTE_WORKFLOW - ASSIGN_AGENT + AutomationRuleActorType: + description: Whether the actor is a user or the Datadog system. + enum: + - user + - system + example: user + type: string + x-enum-varnames: + - USER + - SYSTEM AutomationRuleAttributes: description: Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state. properties: @@ -11494,6 +11504,42 @@ components: required: - data type: object + AutomationRuleCreatedBy: + description: The user or Datadog system who created the rule. + properties: + id: + description: The actor's identifier (a user UUID or a system identifier). + example: "00000000-0000-0000-0000-000000000000" + type: string + name: + description: The name of the actor. + example: "Jane Doe" + type: string + type: + $ref: "#/components/schemas/AutomationRuleActorType" + required: + - type + - id + - name + type: object + AutomationRuleModifiedBy: + description: The user or Datadog system who last modified the rule. + properties: + id: + description: The actor's identifier (a user UUID or a system identifier). + example: "00000000-0000-0000-0000-000000000000" + type: string + name: + description: The name of the actor. + example: "Jane Doe" + type: string + type: + $ref: "#/components/schemas/AutomationRuleActorType" + required: + - type + - id + - name + type: object AutomationRuleRelationships: description: Related resources for the automation rule, including the users who created and last modified it. properties: @@ -11510,6 +11556,19 @@ components: required: - data type: object + AutomationRuleScope: + description: Defines the scope of findings to which the automation rule applies. + properties: + finding_types: + $ref: "#/components/schemas/SecurityFindingTypes" + query: + description: A search query to further filter the findings matched by this rule. The `@workflow.*` namespace and `@status` fields are not permitted. For a reference of available fields, see the [Security Findings schema documentation](https://docs.datadoghq.com/security/guide/findings-schema/). + example: "env:prod team:platform" + maxLength: 30000 + type: string + required: + - finding_types + type: object AutomationRuleTrigger: description: Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires). properties: @@ -31697,6 +31756,242 @@ components: - type - attributes type: object + DueDateFrom: + description: The reference point from which the due date is calculated. When `fix_available` is selected but not applicable to the finding type, `first_seen` is used instead. + enum: + - first_seen + - fix_available + example: first_seen + type: string + x-enum-varnames: + - FIRST_SEEN + - FIX_AVAILABLE + DueDatePerSeverityItem: + description: A mapping of a severity level to the number of days until a finding is due. + properties: + due_in_days: + description: The number of days from the reference point until the finding is due. + example: 7 + format: int64 + maximum: 365 + minimum: 1 + type: integer + severity: + $ref: "#/components/schemas/DueDateSeverity" + required: + - severity + - due_in_days + type: object + DueDatePerSeverityList: + description: A list of severity-to-due-date mappings. Each severity may appear at most once. + items: + $ref: "#/components/schemas/DueDatePerSeverityItem" + type: array + DueDateRuleAction: + description: The action to take when the due date rule matches a finding. + properties: + due_days_per_severity: + $ref: "#/components/schemas/DueDatePerSeverityList" + due_from: + $ref: "#/components/schemas/DueDateFrom" + reason_description: + description: An optional description providing more context for the due date assignment. + example: "Applied for production findings only" + maxLength: 20000 + type: string + required: + - due_days_per_severity + - due_from + type: object + DueDateRuleAttributesCreate: + description: Attributes for creating or updating a due date rule. + properties: + action: + $ref: "#/components/schemas/DueDateRuleAction" + enabled: + description: Whether the due date rule is enabled. + example: true + type: boolean + name: + description: The name of the due date rule. + example: "Critical findings due in 7 days" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + DueDateRuleAttributesResponse: + description: Attributes of a due date rule returned by the API. + properties: + action: + $ref: "#/components/schemas/DueDateRuleAction" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the due date rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the due date rule. + example: "Critical findings due in 7 days" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + DueDateRuleCreateRequest: + description: The body of a due date rule create request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataCreate" + required: + - data + type: object + DueDateRuleDataCreate: + description: The data object for a due date rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/DueDateRuleAttributesCreate" + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - type + - attributes + type: object + DueDateRuleDataResponse: + description: The data object for a due date rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/DueDateRuleAttributesResponse" + id: + description: The ID of the due date rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - id + - type + - attributes + type: object + DueDateRuleReorderData: + description: The ordered list of all due date rules; every rule must be included. + items: + $ref: "#/components/schemas/DueDateRuleReorderItem" + type: array + DueDateRuleReorderItem: + description: A reference to a due date rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - type + - id + type: object + DueDateRuleReorderRequest: + description: The body of the due date rule reorder request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleReorderData" + required: + - data + type: object + DueDateRuleResponse: + description: A single due date rule response. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataResponse" + required: + - data + type: object + DueDateRuleType: + description: The JSON:API type for due date rules. + enum: + - due_date_rules + example: due_date_rules + type: string + x-enum-varnames: + - DUE_DATE_RULES + DueDateRuleUpdateRequest: + description: The body of a due date rule update request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataCreate" + required: + - data + type: object + DueDateRulesDataList: + description: A list of due date rule data objects. + items: + $ref: "#/components/schemas/DueDateRuleDataResponse" + type: array + DueDateRulesResponse: + description: A list of due date rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/DueDateRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object + DueDateSeverity: + description: A severity level used to configure due date thresholds. + enum: + - critical + - high + - medium + - low + - info + - none + - unknown + example: critical + type: string + x-enum-varnames: + - CRITICAL + - HIGH + - MEDIUM + - LOW + - INFO + - NONE + - UNKNOWN ELFSourcemapAttributes: description: Attributes of an ELF symbol file. properties: @@ -61121,6 +61416,211 @@ components: - type - id type: object + MuteReason: + description: The reason for muting a security finding. + enum: + - duplicate + - false_positive + - no_fix + - other + - pending_fix + - risk_accepted + example: risk_accepted + type: string + x-enum-varnames: + - DUPLICATE + - FALSE_POSITIVE + - NO_FIX + - OTHER + - PENDING_FIX + - RISK_ACCEPTED + MuteRuleAction: + description: The action to take when the mute rule matches a finding. + properties: + expire_at: + description: The Unix timestamp in milliseconds at which the mute expires. If omitted, the mute does not expire. + example: 4070908800000 + format: int64 + type: integer + reason: + $ref: "#/components/schemas/MuteReason" + reason_description: + description: An optional description providing more context for the mute reason. + example: "Accepted for dev environments only" + maxLength: 20000 + type: string + required: + - reason + type: object + MuteRuleAttributesCreate: + description: Attributes for creating or updating a mute rule. + properties: + action: + $ref: "#/components/schemas/MuteRuleAction" + enabled: + description: Whether the mute rule is enabled. + example: true + type: boolean + name: + description: The name of the mute rule. + example: "Mute accepted risks in dev" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + MuteRuleAttributesResponse: + description: Attributes of a mute rule returned by the API. + properties: + action: + $ref: "#/components/schemas/MuteRuleAction" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the mute rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the mute rule. + example: "Mute accepted risks in dev" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + MuteRuleCreateRequest: + description: The body of a mute rule create request. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataCreate" + required: + - data + type: object + MuteRuleDataCreate: + description: The data object for a mute rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/MuteRuleAttributesCreate" + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - type + - attributes + type: object + MuteRuleDataResponse: + description: The data object for a mute rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/MuteRuleAttributesResponse" + id: + description: The ID of the mute rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - id + - type + - attributes + type: object + MuteRuleReorderData: + description: The ordered list of all mute rules; every rule must be included. + items: + $ref: "#/components/schemas/MuteRuleReorderItem" + type: array + MuteRuleReorderItem: + description: A reference to a mute rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - type + - id + type: object + MuteRuleReorderRequest: + description: The body of the mute rule reorder request. + properties: + data: + $ref: "#/components/schemas/MuteRuleReorderData" + required: + - data + type: object + MuteRuleResponse: + description: A single mute rule response. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataResponse" + required: + - data + type: object + MuteRuleType: + description: The JSON:API type for mute rules. + enum: + - mute_rules + example: mute_rules + type: string + x-enum-varnames: + - MUTE_RULES + MuteRuleUpdateRequest: + description: The body of a mute rule update request. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataCreate" + required: + - data + type: object + MuteRulesDataList: + description: A list of mute rule data objects. + items: + $ref: "#/components/schemas/MuteRuleDataResponse" + type: array + MuteRulesResponse: + description: A list of mute rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/MuteRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object NDKSourcemapAttributes: description: Attributes of an Android NDK symbol file. properties: @@ -82773,6 +83273,48 @@ components: - SYSTEM - LIGHT - DARK + SecurityAutomationRulesLinks: + description: Pagination links for the list of automation rules. + properties: + first: + description: Link to the first page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=0" + type: string + last: + description: Link to the last page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=5" + type: string + next: + description: Link to the next page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=2" + type: string + prev: + description: Link to the previous page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=0" + type: string + required: + - first + - last + type: object + SecurityAutomationRulesMeta: + description: Metadata for the list of automation rules. + properties: + page: + $ref: "#/components/schemas/SecurityAutomationRulesPageInfo" + required: + - page + type: object + SecurityAutomationRulesPageInfo: + description: Pagination information for the list of automation rules. + properties: + total_filtered_count: + description: The total number of rules matching the current filter. + example: 42 + format: int64 + type: integer + required: + - total_filtered_count + type: object SecurityEntityConfigRisks: description: Configuration risks associated with the entity properties: @@ -83377,6 +83919,42 @@ components: meta: $ref: "#/components/schemas/SecurityFilterMeta" type: object + SecurityFindingType: + description: The type of security finding that the automation rule applies to. + enum: + - api_security + - attack_path + - host_and_container_vulnerability + - iac_misconfiguration + - identity_risk + - library_vulnerability + - misconfiguration + - runtime_code_vulnerability + - secret + - static_code_vulnerability + - workload_activity + example: misconfiguration + type: string + x-enum-varnames: + - API_SECURITY + - ATTACK_PATH + - HOST_AND_CONTAINER_VULNERABILITY + - IAC_MISCONFIGURATION + - IDENTITY_RISK + - LIBRARY_VULNERABILITY + - MISCONFIGURATION + - RUNTIME_CODE_VULNERABILITY + - SECRET + - STATIC_CODE_VULNERABILITY + - WORKLOAD_ACTIVITY + SecurityFindingTypes: + description: The list of security finding types that the automation rule applies to. + example: + - misconfiguration + items: + $ref: "#/components/schemas/SecurityFindingType" + minItems: 1 + type: array SecurityFindingsAttributes: description: The JSON object containing all attributes of the security finding. properties: @@ -101859,6 +102437,255 @@ components: type: string x-enum-varnames: - TEST_OPTIMIZATION_UPDATE_SERVICE_SETTINGS_REQUEST + TicketCreationRuleAction: + description: The action to take when the ticket creation rule matches a finding. + properties: + assignee_id: + description: The UUID of the default assignee for created tickets. + example: "22222222-2222-2222-2222-222222222222" + format: uuid + type: string + fields: + 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). + example: + labels: + - security + type: object + max_tickets_per_day: + description: The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + example: 100 + format: int64 + maximum: 500 + minimum: 1 + type: integer + project_id: + description: The UUID of the case management project. + example: "11111111-1111-1111-1111-111111111111" + format: uuid + type: string + target: + $ref: "#/components/schemas/TicketCreationTarget" + required: + - project_id + - target + - max_tickets_per_day + type: object + TicketCreationRuleActionResponse: + description: The action to take when the ticket creation rule matches a finding. + properties: + assignee_id: + description: The UUID of the default assignee for created tickets. + example: "22222222-2222-2222-2222-222222222222" + format: uuid + type: string + auto_disabled_reason: + description: The reason the rule was automatically disabled by the system due to a ticketing integration error. + example: "Daily ticket creation limit exceeded" + type: string + fields: + 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). + example: + labels: + - security + type: object + max_tickets_per_day: + description: The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + example: 100 + format: int64 + maximum: 500 + minimum: 1 + type: integer + project_id: + description: The UUID of the case management project. + example: "11111111-1111-1111-1111-111111111111" + format: uuid + type: string + target: + $ref: "#/components/schemas/TicketCreationTarget" + required: + - project_id + - target + - max_tickets_per_day + type: object + TicketCreationRuleAttributesCreate: + description: Attributes for creating or updating a ticket creation rule. + properties: + action: + $ref: "#/components/schemas/TicketCreationRuleAction" + enabled: + description: Whether the ticket creation rule is enabled. + example: true + type: boolean + name: + description: The name of the ticket creation rule. + example: "Auto-create Jira tickets for critical findings" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + TicketCreationRuleAttributesResponse: + description: Attributes of a ticket creation rule returned by the API. + properties: + action: + $ref: "#/components/schemas/TicketCreationRuleActionResponse" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the ticket creation rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the ticket creation rule. + example: "Auto-create Jira tickets for critical findings" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + TicketCreationRuleCreateRequest: + description: The body of a ticket creation rule create request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataCreate" + required: + - data + type: object + TicketCreationRuleDataCreate: + description: The data object for a ticket creation rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/TicketCreationRuleAttributesCreate" + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - type + - attributes + type: object + TicketCreationRuleDataResponse: + description: The data object for a ticket creation rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/TicketCreationRuleAttributesResponse" + id: + description: The ID of the ticket creation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - id + - type + - attributes + type: object + TicketCreationRuleReorderData: + description: The ordered list of all ticket creation rules; every rule must be included. + items: + $ref: "#/components/schemas/TicketCreationRuleReorderItem" + type: array + TicketCreationRuleReorderItem: + description: A reference to a ticket creation rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - type + - id + type: object + TicketCreationRuleReorderRequest: + description: The body of the ticket creation rule reorder request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleReorderData" + required: + - data + type: object + TicketCreationRuleResponse: + description: A single ticket creation rule response. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataResponse" + required: + - data + type: object + TicketCreationRuleType: + description: The JSON:API type for ticket creation rules. + enum: + - ticket_creation_rules + example: ticket_creation_rules + type: string + x-enum-varnames: + - TICKET_CREATION_RULES + TicketCreationRuleUpdateRequest: + description: The body of a ticket creation rule update request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataCreate" + required: + - data + type: object + TicketCreationRulesDataList: + description: A list of ticket creation rule data objects. + items: + $ref: "#/components/schemas/TicketCreationRuleDataResponse" + type: array + TicketCreationRulesResponse: + description: A list of ticket creation rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/TicketCreationRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object + TicketCreationTarget: + description: The ticketing system to create tickets in. + enum: + - jira + - case_management + example: jira + type: string + x-enum-varnames: + - JIRA + - CASE_MANAGEMENT TimeAggregation: description: |- Time aggregation period (in seconds) is used to aggregate the results of the notification rule evaluation. @@ -167038,6 +167865,1329 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules: + get: + description: Get all due date rules for the current organization. + operationId: ListSecurityFindingsAutomationDueDateRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + links: + first: "/api/v2/security/findings/automation/due_date_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/due_date_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/DueDateRulesResponse" + description: Successfully retrieved the list of due date rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all due date rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new due date rule for the current organization. + operationId: CreateSecurityFindingsAutomationDueDateRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + enabled: true + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully created the due date rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a due date rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules/reorder: + post: + description: Reorder the list of due date rules for the current organization. + operationId: ReorderSecurityFindingsAutomationDueDateRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + - id: "11111111-1111-1111-1111-111111111111" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + - id: "11111111-1111-1111-1111-111111111111" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleReorderRequest" + description: Successfully reordered the due date rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder due date rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules/{rule_id}: + delete: + description: Delete an existing due date rule by ID. + operationId: DeleteSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "204": + description: "Rule successfully deleted." + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a due date rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the details of a due date rule by ID. + operationId: GetSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully retrieved the due date rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a due date rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Update an existing due date rule by ID. + operationId: UpdateSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + - due_in_days: 90 + severity: medium + due_from: fix_available + enabled: true + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + - due_in_days: 90 + severity: medium + due_from: fix_available + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully updated the due date rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a due date rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules: + get: + description: Get all mute rules for the current organization. + operationId: ListSecurityFindingsAutomationMuteRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + links: + first: "/api/v2/security/findings/automation/mute_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/mute_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/MuteRulesResponse" + description: Successfully retrieved the list of mute rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all mute rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new mute rule for the current organization. + operationId: CreateSecurityFindingsAutomationMuteRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + enabled: true + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully created the mute rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules/reorder: + post: + description: Reorder the list of mute rules for the current organization. + operationId: ReorderSecurityFindingsAutomationMuteRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + - id: "11111111-1111-1111-1111-111111111111" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + - id: "11111111-1111-1111-1111-111111111111" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleReorderRequest" + description: Successfully reordered the mute rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder mute rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules/{rule_id}: + delete: + description: Delete an existing mute rule by ID. + operationId: DeleteSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "204": + description: "Rule successfully deleted." + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the details of a mute rule by ID. + operationId: GetSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully retrieved the mute rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Update an existing mute rule by ID. + operationId: UpdateSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + reason: risk_accepted + enabled: false + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + reason: risk_accepted + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: false + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully updated the mute rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules: + get: + description: Get all ticket creation rules for the current organization. + operationId: ListSecurityFindingsAutomationTicketCreationRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + links: + first: "/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/TicketCreationRulesResponse" + description: Successfully retrieved the list of ticket creation rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all ticket creation rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new ticket creation rule for the current organization. + operationId: CreateSecurityFindingsAutomationTicketCreationRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + enabled: true + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully created the ticket creation rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a ticket creation rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules/reorder: + post: + description: Reorder the list of ticket creation rules for the current organization. + operationId: ReorderSecurityFindingsAutomationTicketCreationRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + - id: "11111111-1111-1111-1111-111111111111" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + - id: "11111111-1111-1111-1111-111111111111" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleReorderRequest" + description: Successfully reordered the ticket creation rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder ticket creation rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules/{rule_id}: + delete: + description: Delete an existing ticket creation rule by ID. + operationId: DeleteSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "204": + description: "Rule successfully deleted." + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a ticket creation rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the details of a ticket creation rule by ID. + operationId: GetSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully retrieved the ticket creation rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a ticket creation rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Update an existing ticket creation rule by ID. + operationId: UpdateSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 50 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + enabled: true + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 50 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully updated the ticket creation rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a ticket creation rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security/findings/cases: delete: description: >- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 95baa66cec..aa19c0dfea 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -2979,6 +2979,13 @@ datadog\_api\_client.v2.model.automation\_rule\_action\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.automation\_rule\_actor\_type module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.automation_rule_actor_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.automation\_rule\_attributes module ----------------------------------------------------------------- @@ -3007,6 +3014,20 @@ datadog\_api\_client.v2.model.automation\_rule\_create\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.automation\_rule\_created\_by module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.automation_rule_created_by + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.automation\_rule\_modified\_by module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.automation_rule_modified_by + :members: + :show-inheritance: + datadog\_api\_client.v2.model.automation\_rule\_relationships module -------------------------------------------------------------------- @@ -3021,6 +3042,13 @@ datadog\_api\_client.v2.model.automation\_rule\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.automation\_rule\_scope module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.automation_rule_scope + :members: + :show-inheritance: + datadog\_api\_client.v2.model.automation\_rule\_trigger module -------------------------------------------------------------- @@ -12555,6 +12583,111 @@ datadog\_api\_client.v2.model.downtime\_update\_request\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.due\_date\_from module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_from + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_per\_severity\_item module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_per_severity_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_action module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.due_date_rule_action + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_attributes\_create module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.due_date_rule_attributes_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_attributes\_response module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rule_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_create\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rule_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_data\_create module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.due_date_rule_data_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_data\_response module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rule_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_reorder\_item module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rule_reorder_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_reorder\_request module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rule_reorder_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_response module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rule_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_type module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rule_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rule\_update\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rule_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_rules\_response module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_rules_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.due\_date\_severity module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.due_date_severity + :members: + :show-inheritance: + datadog\_api\_client.v2.model.elf\_sourcemap\_attributes module --------------------------------------------------------------- @@ -25463,6 +25596,97 @@ datadog\_api\_client.v2.model.mute\_findings\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.mute\_reason module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_reason + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_action module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_action + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_attributes\_create module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_attributes_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_attributes\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_create\_request module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_data\_create module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_data_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_data\_response module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_reorder\_item module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_reorder_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_reorder\_request module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_reorder_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_response module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_type module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_update\_request module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rules\_response module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rules_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.ndk\_sourcemap\_attributes module --------------------------------------------------------------- @@ -35396,6 +35620,27 @@ datadog\_api\_client.v2.model.secure\_embed\_viewing\_preferences\_theme module :members: :show-inheritance: +datadog\_api\_client.v2.model.security\_automation\_rules\_links module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_automation_rules_links + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_automation\_rules\_meta module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_automation_rules_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_automation\_rules\_page\_info module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_automation_rules_page_info + :members: + :show-inheritance: + datadog\_api\_client.v2.model.security\_entity\_config\_risks module -------------------------------------------------------------------- @@ -35592,6 +35837,13 @@ datadog\_api\_client.v2.model.security\_filters\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.security\_finding\_type module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.security_finding_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.security\_findings\_attributes module ------------------------------------------------------------------- @@ -43530,6 +43782,104 @@ datadog\_api\_client.v2.model.test\_optimization\_update\_service\_settings\_req :members: :show-inheritance: +datadog\_api\_client.v2.model.ticket\_creation\_rule\_action module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_action + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_action\_response module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_action_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_attributes\_create module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_attributes_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_attributes\_response module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_create\_request module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_data\_create module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_data_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_data\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_reorder\_item module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_reorder_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_reorder\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_reorder_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rule\_update\_request module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rule_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_rules\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_rules_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.ticket\_creation\_target module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.ticket_creation_target + :members: + :show-inheritance: + datadog\_api\_client.v2.model.time\_restriction module ------------------------------------------------------ diff --git a/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.py b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.py new file mode 100644 index 0000000000..d145bea3eb --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.py @@ -0,0 +1,49 @@ +""" +Create a due date rule returns "Successfully created the due date rule" 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.automation_rule_scope import AutomationRuleScope +from datadog_api_client.v2.model.due_date_from import DueDateFrom +from datadog_api_client.v2.model.due_date_per_severity_item import DueDatePerSeverityItem +from datadog_api_client.v2.model.due_date_rule_action import DueDateRuleAction +from datadog_api_client.v2.model.due_date_rule_attributes_create import DueDateRuleAttributesCreate +from datadog_api_client.v2.model.due_date_rule_create_request import DueDateRuleCreateRequest +from datadog_api_client.v2.model.due_date_rule_data_create import DueDateRuleDataCreate +from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType +from datadog_api_client.v2.model.due_date_severity import DueDateSeverity +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType + +body = DueDateRuleCreateRequest( + data=DueDateRuleDataCreate( + attributes=DueDateRuleAttributesCreate( + action=DueDateRuleAction( + due_days_per_severity=[ + DueDatePerSeverityItem( + due_in_days=7, + severity=DueDateSeverity.CRITICAL, + ), + ], + due_from=DueDateFrom.FIRST_SEEN, + ), + enabled=True, + name="Example-Security-Monitoring", + rule=AutomationRuleScope( + finding_types=[ + SecurityFindingType.MISCONFIGURATION, + ], + query="env:staging", + ), + ), + type=DueDateRuleType.DUE_DATE_RULES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_security_findings_automation_due_date_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_security_findings_automation_due_date_rule(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.py b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.py new file mode 100644 index 0000000000..0f3bfdc344 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.py @@ -0,0 +1,41 @@ +""" +Create a mute rule returns "Successfully created the mute rule" 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.automation_rule_scope import AutomationRuleScope +from datadog_api_client.v2.model.mute_reason import MuteReason +from datadog_api_client.v2.model.mute_rule_action import MuteRuleAction +from datadog_api_client.v2.model.mute_rule_attributes_create import MuteRuleAttributesCreate +from datadog_api_client.v2.model.mute_rule_create_request import MuteRuleCreateRequest +from datadog_api_client.v2.model.mute_rule_data_create import MuteRuleDataCreate +from datadog_api_client.v2.model.mute_rule_type import MuteRuleType +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType + +body = MuteRuleCreateRequest( + data=MuteRuleDataCreate( + attributes=MuteRuleAttributesCreate( + action=MuteRuleAction( + reason=MuteReason.RISK_ACCEPTED, + ), + enabled=True, + name="Example-Security-Monitoring", + rule=AutomationRuleScope( + finding_types=[ + SecurityFindingType.MISCONFIGURATION, + ], + query="env:staging", + ), + ), + type=MuteRuleType.MUTE_RULES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_security_findings_automation_mute_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_security_findings_automation_mute_rule(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.py b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.py new file mode 100644 index 0000000000..d55e73feac --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.py @@ -0,0 +1,44 @@ +""" +Create a ticket creation rule returns "Successfully created the ticket creation rule" 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.automation_rule_scope import AutomationRuleScope +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType +from datadog_api_client.v2.model.ticket_creation_rule_action import TicketCreationRuleAction +from datadog_api_client.v2.model.ticket_creation_rule_attributes_create import TicketCreationRuleAttributesCreate +from datadog_api_client.v2.model.ticket_creation_rule_create_request import TicketCreationRuleCreateRequest +from datadog_api_client.v2.model.ticket_creation_rule_data_create import TicketCreationRuleDataCreate +from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType +from datadog_api_client.v2.model.ticket_creation_target import TicketCreationTarget +from uuid import UUID + +body = TicketCreationRuleCreateRequest( + data=TicketCreationRuleDataCreate( + attributes=TicketCreationRuleAttributesCreate( + action=TicketCreationRuleAction( + max_tickets_per_day=10, + project_id=UUID("11111111-1111-1111-1111-111111111111"), + target=TicketCreationTarget.JIRA, + ), + enabled=True, + name="Example-Security-Monitoring", + rule=AutomationRuleScope( + finding_types=[ + SecurityFindingType.MISCONFIGURATION, + ], + query="env:staging", + ), + ), + type=TicketCreationRuleType.TICKET_CREATION_RULES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_security_findings_automation_ticket_creation_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_security_findings_automation_ticket_creation_rule(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.py new file mode 100644 index 0000000000..fdb3ea3e69 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.py @@ -0,0 +1,18 @@ +""" +Delete a due date rule returns "Rule successfully deleted." response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +# there is a valid "valid_due_date_rule" in the system +VALID_DUE_DATE_RULE_DATA_ID = environ["VALID_DUE_DATE_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["delete_security_findings_automation_due_date_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + api_instance.delete_security_findings_automation_due_date_rule( + rule_id=VALID_DUE_DATE_RULE_DATA_ID, + ) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.py new file mode 100644 index 0000000000..96a1e96722 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.py @@ -0,0 +1,18 @@ +""" +Delete a mute rule returns "Rule successfully deleted." response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = environ["VALID_MUTE_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["delete_security_findings_automation_mute_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + api_instance.delete_security_findings_automation_mute_rule( + rule_id=VALID_MUTE_RULE_DATA_ID, + ) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.py new file mode 100644 index 0000000000..a5acc99d65 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.py @@ -0,0 +1,18 @@ +""" +Delete a ticket creation rule returns "Rule successfully deleted." response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +# there is a valid "valid_ticket_creation_rule" in the system +VALID_TICKET_CREATION_RULE_DATA_ID = environ["VALID_TICKET_CREATION_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["delete_security_findings_automation_ticket_creation_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + api_instance.delete_security_findings_automation_ticket_creation_rule( + rule_id=VALID_TICKET_CREATION_RULE_DATA_ID, + ) diff --git a/examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.py b/examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.py new file mode 100644 index 0000000000..f6bf552d44 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.py @@ -0,0 +1,20 @@ +""" +Get a due date rule returns "Successfully retrieved the due date rule" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +# there is a valid "valid_due_date_rule" in the system +VALID_DUE_DATE_RULE_DATA_ID = environ["VALID_DUE_DATE_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_security_findings_automation_due_date_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_security_findings_automation_due_date_rule( + rule_id=VALID_DUE_DATE_RULE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.py b/examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.py new file mode 100644 index 0000000000..88c247fea4 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.py @@ -0,0 +1,20 @@ +""" +Get a mute rule returns "Successfully retrieved the mute rule" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = environ["VALID_MUTE_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_security_findings_automation_mute_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_security_findings_automation_mute_rule( + rule_id=VALID_MUTE_RULE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.py b/examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.py new file mode 100644 index 0000000000..7c520a017b --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.py @@ -0,0 +1,20 @@ +""" +Get a ticket creation rule returns "Successfully retrieved the ticket creation rule" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +# there is a valid "valid_ticket_creation_rule" in the system +VALID_TICKET_CREATION_RULE_DATA_ID = environ["VALID_TICKET_CREATION_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_security_findings_automation_ticket_creation_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_security_findings_automation_ticket_creation_rule( + rule_id=VALID_TICKET_CREATION_RULE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.py b/examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.py new file mode 100644 index 0000000000..e13cd4356f --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.py @@ -0,0 +1,14 @@ +""" +Get all due date rules returns "Successfully retrieved the list of due date rules" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +configuration.unstable_operations["list_security_findings_automation_due_date_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.list_security_findings_automation_due_date_rules() + + print(response) diff --git a/examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.py b/examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.py new file mode 100644 index 0000000000..17a19e28dd --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.py @@ -0,0 +1,14 @@ +""" +Get all mute rules returns "Successfully retrieved the list of mute rules" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +configuration.unstable_operations["list_security_findings_automation_mute_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.list_security_findings_automation_mute_rules() + + print(response) diff --git a/examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.py b/examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.py new file mode 100644 index 0000000000..6ecd83c5d7 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.py @@ -0,0 +1,14 @@ +""" +Get all ticket creation rules returns "Successfully retrieved the list of ticket creation rules" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +configuration.unstable_operations["list_security_findings_automation_ticket_creation_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.list_security_findings_automation_ticket_creation_rules() + + print(response) diff --git a/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.py b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.py new file mode 100644 index 0000000000..e2daa44eb2 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.py @@ -0,0 +1,30 @@ +""" +Reorder due date rules returns "Successfully reordered the due date rules" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.due_date_rule_reorder_item import DueDateRuleReorderItem +from datadog_api_client.v2.model.due_date_rule_reorder_request import DueDateRuleReorderRequest +from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType + +# there is a valid "valid_due_date_rule" in the system +VALID_DUE_DATE_RULE_DATA_ID = environ["VALID_DUE_DATE_RULE_DATA_ID"] + +body = DueDateRuleReorderRequest( + data=[ + DueDateRuleReorderItem( + id=VALID_DUE_DATE_RULE_DATA_ID, + type=DueDateRuleType.DUE_DATE_RULES, + ), + ], +) + +configuration = Configuration() +configuration.unstable_operations["reorder_security_findings_automation_due_date_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.reorder_security_findings_automation_due_date_rules(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.py b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.py new file mode 100644 index 0000000000..7d3f8e8ebd --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.py @@ -0,0 +1,30 @@ +""" +Reorder mute rules returns "Successfully reordered the mute rules" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.mute_rule_reorder_item import MuteRuleReorderItem +from datadog_api_client.v2.model.mute_rule_reorder_request import MuteRuleReorderRequest +from datadog_api_client.v2.model.mute_rule_type import MuteRuleType + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = environ["VALID_MUTE_RULE_DATA_ID"] + +body = MuteRuleReorderRequest( + data=[ + MuteRuleReorderItem( + id=VALID_MUTE_RULE_DATA_ID, + type=MuteRuleType.MUTE_RULES, + ), + ], +) + +configuration = Configuration() +configuration.unstable_operations["reorder_security_findings_automation_mute_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.reorder_security_findings_automation_mute_rules(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.py b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.py new file mode 100644 index 0000000000..44687c72f0 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.py @@ -0,0 +1,30 @@ +""" +Reorder ticket creation rules returns "Successfully reordered the ticket creation rules" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.ticket_creation_rule_reorder_item import TicketCreationRuleReorderItem +from datadog_api_client.v2.model.ticket_creation_rule_reorder_request import TicketCreationRuleReorderRequest +from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType + +# there is a valid "valid_ticket_creation_rule" in the system +VALID_TICKET_CREATION_RULE_DATA_ID = environ["VALID_TICKET_CREATION_RULE_DATA_ID"] + +body = TicketCreationRuleReorderRequest( + data=[ + TicketCreationRuleReorderItem( + id=VALID_TICKET_CREATION_RULE_DATA_ID, + type=TicketCreationRuleType.TICKET_CREATION_RULES, + ), + ], +) + +configuration = Configuration() +configuration.unstable_operations["reorder_security_findings_automation_ticket_creation_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.reorder_security_findings_automation_ticket_creation_rules(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.py b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.py new file mode 100644 index 0000000000..8f0e4db13e --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.py @@ -0,0 +1,55 @@ +""" +Update a due date rule returns "Successfully updated the due date rule" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope +from datadog_api_client.v2.model.due_date_from import DueDateFrom +from datadog_api_client.v2.model.due_date_per_severity_item import DueDatePerSeverityItem +from datadog_api_client.v2.model.due_date_rule_action import DueDateRuleAction +from datadog_api_client.v2.model.due_date_rule_attributes_create import DueDateRuleAttributesCreate +from datadog_api_client.v2.model.due_date_rule_data_create import DueDateRuleDataCreate +from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType +from datadog_api_client.v2.model.due_date_rule_update_request import DueDateRuleUpdateRequest +from datadog_api_client.v2.model.due_date_severity import DueDateSeverity +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType + +# there is a valid "valid_due_date_rule" in the system +VALID_DUE_DATE_RULE_DATA_ID = environ["VALID_DUE_DATE_RULE_DATA_ID"] + +body = DueDateRuleUpdateRequest( + data=DueDateRuleDataCreate( + attributes=DueDateRuleAttributesCreate( + action=DueDateRuleAction( + due_days_per_severity=[ + DueDatePerSeverityItem( + due_in_days=14, + severity=DueDateSeverity.CRITICAL, + ), + ], + due_from=DueDateFrom.FIRST_SEEN, + ), + enabled=False, + name="Example-Security-Monitoring", + rule=AutomationRuleScope( + finding_types=[ + SecurityFindingType.MISCONFIGURATION, + ], + query="env:staging", + ), + ), + type=DueDateRuleType.DUE_DATE_RULES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_security_findings_automation_due_date_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.update_security_findings_automation_due_date_rule( + rule_id=VALID_DUE_DATE_RULE_DATA_ID, body=body + ) + + print(response) diff --git a/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.py b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.py new file mode 100644 index 0000000000..e522af16a7 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.py @@ -0,0 +1,45 @@ +""" +Update a mute rule returns "Successfully updated the mute rule" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope +from datadog_api_client.v2.model.mute_reason import MuteReason +from datadog_api_client.v2.model.mute_rule_action import MuteRuleAction +from datadog_api_client.v2.model.mute_rule_attributes_create import MuteRuleAttributesCreate +from datadog_api_client.v2.model.mute_rule_data_create import MuteRuleDataCreate +from datadog_api_client.v2.model.mute_rule_type import MuteRuleType +from datadog_api_client.v2.model.mute_rule_update_request import MuteRuleUpdateRequest +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = environ["VALID_MUTE_RULE_DATA_ID"] + +body = MuteRuleUpdateRequest( + data=MuteRuleDataCreate( + attributes=MuteRuleAttributesCreate( + action=MuteRuleAction( + reason=MuteReason.FALSE_POSITIVE, + ), + enabled=False, + name="Example-Security-Monitoring", + rule=AutomationRuleScope( + finding_types=[ + SecurityFindingType.MISCONFIGURATION, + ], + query="env:staging", + ), + ), + type=MuteRuleType.MUTE_RULES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_security_findings_automation_mute_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.update_security_findings_automation_mute_rule(rule_id=VALID_MUTE_RULE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.py b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.py new file mode 100644 index 0000000000..d2cdb47658 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.py @@ -0,0 +1,50 @@ +""" +Update a ticket creation rule returns "Successfully updated the ticket creation rule" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType +from datadog_api_client.v2.model.ticket_creation_rule_action import TicketCreationRuleAction +from datadog_api_client.v2.model.ticket_creation_rule_attributes_create import TicketCreationRuleAttributesCreate +from datadog_api_client.v2.model.ticket_creation_rule_data_create import TicketCreationRuleDataCreate +from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType +from datadog_api_client.v2.model.ticket_creation_rule_update_request import TicketCreationRuleUpdateRequest +from datadog_api_client.v2.model.ticket_creation_target import TicketCreationTarget +from uuid import UUID + +# there is a valid "valid_ticket_creation_rule" in the system +VALID_TICKET_CREATION_RULE_DATA_ID = environ["VALID_TICKET_CREATION_RULE_DATA_ID"] + +body = TicketCreationRuleUpdateRequest( + data=TicketCreationRuleDataCreate( + attributes=TicketCreationRuleAttributesCreate( + action=TicketCreationRuleAction( + max_tickets_per_day=5, + project_id=UUID("11111111-1111-1111-1111-111111111111"), + target=TicketCreationTarget.JIRA, + ), + enabled=False, + name="Example-Security-Monitoring", + rule=AutomationRuleScope( + finding_types=[ + SecurityFindingType.MISCONFIGURATION, + ], + query="env:staging", + ), + ), + type=TicketCreationRuleType.TICKET_CREATION_RULES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_security_findings_automation_ticket_creation_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.update_security_findings_automation_ticket_creation_rule( + rule_id=VALID_TICKET_CREATION_RULE_DATA_ID, body=body + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 65de7b7f8c..8a2a543e07 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -404,6 +404,9 @@ def __init__( "v2.convert_security_monitoring_terraform_resource": False, "v2.create_io_c_triage_state": False, "v2.create_sample_log_generation_subscription": False, + "v2.create_security_findings_automation_due_date_rule": False, + "v2.create_security_findings_automation_mute_rule": False, + "v2.create_security_findings_automation_ticket_creation_rule": False, "v2.create_security_monitoring_dataset": False, "v2.create_security_monitoring_integration_config": False, "v2.create_service_now_tickets": False, @@ -412,6 +415,9 @@ def __init__( "v2.deactivate_content_pack": False, "v2.delete_historical_job": False, "v2.delete_sample_log_generation_subscription": False, + "v2.delete_security_findings_automation_due_date_rule": False, + "v2.delete_security_findings_automation_mute_rule": False, + "v2.delete_security_findings_automation_ticket_creation_rule": False, "v2.delete_security_monitoring_dataset": False, "v2.delete_security_monitoring_integration_config": False, "v2.export_security_monitoring_terraform_resource": False, @@ -422,6 +428,9 @@ def __init__( "v2.get_indicator_of_compromise": False, "v2.get_rule_version_history": False, "v2.get_secrets_rules": False, + "v2.get_security_findings_automation_due_date_rule": False, + "v2.get_security_findings_automation_mute_rule": False, + "v2.get_security_findings_automation_ticket_creation_rule": False, "v2.get_security_monitoring_dataset": False, "v2.get_security_monitoring_dataset_by_version": False, "v2.get_security_monitoring_dataset_version_history": False, @@ -440,16 +449,25 @@ def __init__( "v2.list_multiple_rulesets": False, "v2.list_sample_log_generation_subscriptions": False, "v2.list_scanned_assets_metadata": False, + "v2.list_security_findings_automation_due_date_rules": False, + "v2.list_security_findings_automation_mute_rules": False, + "v2.list_security_findings_automation_ticket_creation_rules": False, "v2.list_security_monitoring_datasets": False, "v2.list_security_monitoring_histsignals": False, "v2.list_security_monitoring_integration_configs": False, "v2.list_static_analysis_codegen_rulesets": False, "v2.list_vulnerabilities": False, "v2.list_vulnerable_assets": False, + "v2.reorder_security_findings_automation_due_date_rules": False, + "v2.reorder_security_findings_automation_mute_rules": False, + "v2.reorder_security_findings_automation_ticket_creation_rules": False, "v2.restore_security_monitoring_rule": False, "v2.run_historical_job": False, "v2.search_security_monitoring_histsignals": False, "v2.update_findings_assignee": False, + "v2.update_security_findings_automation_due_date_rule": False, + "v2.update_security_findings_automation_mute_rule": False, + "v2.update_security_findings_automation_ticket_creation_rule": False, "v2.update_security_monitoring_dataset": False, "v2.update_security_monitoring_integration_config": False, "v2.validate_security_monitoring_integration_config": False, 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 80b2175a5e..513301a1ad 100644 --- a/src/datadog_api_client/v2/api/security_monitoring_api.py +++ b/src/datadog_api_client/v2/api/security_monitoring_api.py @@ -16,6 +16,7 @@ file_type, UnsetType, unset, + UUID, ) from datadog_api_client.v2.model.create_custom_framework_response import CreateCustomFrameworkResponse from datadog_api_client.v2.model.create_custom_framework_request import CreateCustomFrameworkRequest @@ -41,6 +42,21 @@ from datadog_api_client.v2.model.security_findings_data import SecurityFindingsData from datadog_api_client.v2.model.assignee_response import AssigneeResponse from datadog_api_client.v2.model.assignee_request import AssigneeRequest +from datadog_api_client.v2.model.due_date_rules_response import DueDateRulesResponse +from datadog_api_client.v2.model.due_date_rule_response import DueDateRuleResponse +from datadog_api_client.v2.model.due_date_rule_create_request import DueDateRuleCreateRequest +from datadog_api_client.v2.model.due_date_rule_reorder_request import DueDateRuleReorderRequest +from datadog_api_client.v2.model.due_date_rule_update_request import DueDateRuleUpdateRequest +from datadog_api_client.v2.model.mute_rules_response import MuteRulesResponse +from datadog_api_client.v2.model.mute_rule_response import MuteRuleResponse +from datadog_api_client.v2.model.mute_rule_create_request import MuteRuleCreateRequest +from datadog_api_client.v2.model.mute_rule_reorder_request import MuteRuleReorderRequest +from datadog_api_client.v2.model.mute_rule_update_request import MuteRuleUpdateRequest +from datadog_api_client.v2.model.ticket_creation_rules_response import TicketCreationRulesResponse +from datadog_api_client.v2.model.ticket_creation_rule_response import TicketCreationRuleResponse +from datadog_api_client.v2.model.ticket_creation_rule_create_request import TicketCreationRuleCreateRequest +from datadog_api_client.v2.model.ticket_creation_rule_reorder_request import TicketCreationRuleReorderRequest +from datadog_api_client.v2.model.ticket_creation_rule_update_request import TicketCreationRuleUpdateRequest 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 @@ -782,6 +798,66 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_security_findings_automation_due_date_rule_endpoint = _Endpoint( + settings={ + "response_type": (DueDateRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/due_date_rules", + "operation_id": "create_security_findings_automation_due_date_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (DueDateRuleCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_security_findings_automation_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": (MuteRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/mute_rules", + "operation_id": "create_security_findings_automation_mute_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (MuteRuleCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_security_findings_automation_ticket_creation_rule_endpoint = _Endpoint( + settings={ + "response_type": (TicketCreationRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/ticket_creation_rules", + "operation_id": "create_security_findings_automation_ticket_creation_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (TicketCreationRuleCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_security_monitoring_critical_asset_endpoint = _Endpoint( settings={ "response_type": (SecurityMonitoringCriticalAssetResponse,), @@ -1103,6 +1179,75 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_security_findings_automation_due_date_rule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/due_date_rules/{rule_id}", + "operation_id": "delete_security_findings_automation_due_date_rule", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_security_findings_automation_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/mute_rules/{rule_id}", + "operation_id": "delete_security_findings_automation_mute_rule", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_security_findings_automation_ticket_creation_rule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}", + "operation_id": "delete_security_findings_automation_ticket_creation_rule", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_security_monitoring_critical_asset_endpoint = _Endpoint( settings={ "response_type": None, @@ -1802,6 +1947,75 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_security_findings_automation_due_date_rule_endpoint = _Endpoint( + settings={ + "response_type": (DueDateRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/due_date_rules/{rule_id}", + "operation_id": "get_security_findings_automation_due_date_rule", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_security_findings_automation_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": (MuteRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/mute_rules/{rule_id}", + "operation_id": "get_security_findings_automation_mute_rule", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_security_findings_automation_ticket_creation_rule_endpoint = _Endpoint( + settings={ + "response_type": (TicketCreationRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}", + "operation_id": "get_security_findings_automation_ticket_creation_rule", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_security_monitoring_critical_asset_endpoint = _Endpoint( settings={ "response_type": (SecurityMonitoringCriticalAssetResponse,), @@ -2864,6 +3078,108 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_security_findings_automation_due_date_rules_endpoint = _Endpoint( + settings={ + "response_type": (DueDateRulesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/due_date_rules", + "operation_id": "list_security_findings_automation_due_date_rules", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "validation": { + "inclusive_maximum": 1000, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "validation": { + "inclusive_minimum": 0, + }, + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_security_findings_automation_mute_rules_endpoint = _Endpoint( + settings={ + "response_type": (MuteRulesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/mute_rules", + "operation_id": "list_security_findings_automation_mute_rules", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "validation": { + "inclusive_maximum": 1000, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "validation": { + "inclusive_minimum": 0, + }, + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_security_findings_automation_ticket_creation_rules_endpoint = _Endpoint( + settings={ + "response_type": (TicketCreationRulesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/ticket_creation_rules", + "operation_id": "list_security_findings_automation_ticket_creation_rules", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "validation": { + "inclusive_maximum": 1000, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "validation": { + "inclusive_minimum": 0, + }, + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_security_monitoring_critical_assets_endpoint = _Endpoint( settings={ "response_type": (SecurityMonitoringCriticalAssetsResponse,), @@ -3527,25 +3843,85 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._patch_vulnerability_notification_rule_endpoint = _Endpoint( + self._patch_vulnerability_notification_rule_endpoint = _Endpoint( + settings={ + "response_type": (NotificationRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/vulnerabilities/notification_rules/{id}", + "operation_id": "patch_vulnerability_notification_rule", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (PatchNotificationRuleParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._reorder_security_findings_automation_due_date_rules_endpoint = _Endpoint( + settings={ + "response_type": (DueDateRuleReorderRequest,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/due_date_rules/reorder", + "operation_id": "reorder_security_findings_automation_due_date_rules", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (DueDateRuleReorderRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._reorder_security_findings_automation_mute_rules_endpoint = _Endpoint( + settings={ + "response_type": (MuteRuleReorderRequest,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/mute_rules/reorder", + "operation_id": "reorder_security_findings_automation_mute_rules", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (MuteRuleReorderRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._reorder_security_findings_automation_ticket_creation_rules_endpoint = _Endpoint( settings={ - "response_type": (NotificationRuleResponse,), + "response_type": (TicketCreationRuleReorderRequest,), "auth": ["apiKeyAuth", "appKeyAuth"], - "endpoint_path": "/api/v2/security/vulnerabilities/notification_rules/{id}", - "operation_id": "patch_vulnerability_notification_rule", - "http_method": "PATCH", + "endpoint_path": "/api/v2/security/findings/automation/ticket_creation_rules/reorder", + "operation_id": "reorder_security_findings_automation_ticket_creation_rules", + "http_method": "POST", "version": "v2", }, params_map={ - "id": { - "required": True, - "openapi_types": (str,), - "attribute": "id", - "location": "path", - }, "body": { "required": True, - "openapi_types": (PatchNotificationRuleParameters,), + "openapi_types": (TicketCreationRuleReorderRequest,), "location": "body", }, }, @@ -3824,6 +4200,84 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_security_findings_automation_due_date_rule_endpoint = _Endpoint( + settings={ + "response_type": (DueDateRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/due_date_rules/{rule_id}", + "operation_id": "update_security_findings_automation_due_date_rule", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (DueDateRuleUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_security_findings_automation_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": (MuteRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/mute_rules/{rule_id}", + "operation_id": "update_security_findings_automation_mute_rule", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (MuteRuleUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_security_findings_automation_ticket_creation_rule_endpoint = _Endpoint( + settings={ + "response_type": (TicketCreationRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}", + "operation_id": "update_security_findings_automation_ticket_creation_rule", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "rule_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (TicketCreationRuleUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_security_monitoring_critical_asset_endpoint = _Endpoint( settings={ "response_type": (SecurityMonitoringCriticalAssetResponse,), @@ -4506,6 +4960,54 @@ def create_security_filter( return self._create_security_filter_endpoint.call_with_http_info(**kwargs) + def create_security_findings_automation_due_date_rule( + self, + body: DueDateRuleCreateRequest, + ) -> DueDateRuleResponse: + """Create a due date rule. + + Create a new due date rule for the current organization. + + :type body: DueDateRuleCreateRequest + :rtype: DueDateRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_security_findings_automation_due_date_rule_endpoint.call_with_http_info(**kwargs) + + def create_security_findings_automation_mute_rule( + self, + body: MuteRuleCreateRequest, + ) -> MuteRuleResponse: + """Create a mute rule. + + Create a new mute rule for the current organization. + + :type body: MuteRuleCreateRequest + :rtype: MuteRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_security_findings_automation_mute_rule_endpoint.call_with_http_info(**kwargs) + + def create_security_findings_automation_ticket_creation_rule( + self, + body: TicketCreationRuleCreateRequest, + ) -> TicketCreationRuleResponse: + """Create a ticket creation rule. + + Create a new ticket creation rule for the current organization. + + :type body: TicketCreationRuleCreateRequest + :rtype: TicketCreationRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_security_findings_automation_ticket_creation_rule_endpoint.call_with_http_info(**kwargs) + def create_security_monitoring_critical_asset( self, body: SecurityMonitoringCriticalAssetCreateRequest, @@ -4778,6 +5280,57 @@ def delete_security_filter( return self._delete_security_filter_endpoint.call_with_http_info(**kwargs) + def delete_security_findings_automation_due_date_rule( + self, + rule_id: UUID, + ) -> None: + """Delete a due date rule. + + Delete an existing due date rule by ID. + + :param rule_id: The ID of the due date rule. + :type rule_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._delete_security_findings_automation_due_date_rule_endpoint.call_with_http_info(**kwargs) + + def delete_security_findings_automation_mute_rule( + self, + rule_id: UUID, + ) -> None: + """Delete a mute rule. + + Delete an existing mute rule by ID. + + :param rule_id: The ID of the mute rule. + :type rule_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._delete_security_findings_automation_mute_rule_endpoint.call_with_http_info(**kwargs) + + def delete_security_findings_automation_ticket_creation_rule( + self, + rule_id: UUID, + ) -> None: + """Delete a ticket creation rule. + + Delete an existing ticket creation rule by ID. + + :param rule_id: The ID of the ticket creation rule. + :type rule_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._delete_security_findings_automation_ticket_creation_rule_endpoint.call_with_http_info(**kwargs) + def delete_security_monitoring_critical_asset( self, critical_asset_id: str, @@ -5364,6 +5917,57 @@ def get_security_filter( return self._get_security_filter_endpoint.call_with_http_info(**kwargs) + def get_security_findings_automation_due_date_rule( + self, + rule_id: UUID, + ) -> DueDateRuleResponse: + """Get a due date rule. + + Get the details of a due date rule by ID. + + :param rule_id: The ID of the due date rule. + :type rule_id: UUID + :rtype: DueDateRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._get_security_findings_automation_due_date_rule_endpoint.call_with_http_info(**kwargs) + + def get_security_findings_automation_mute_rule( + self, + rule_id: UUID, + ) -> MuteRuleResponse: + """Get a mute rule. + + Get the details of a mute rule by ID. + + :param rule_id: The ID of the mute rule. + :type rule_id: UUID + :rtype: MuteRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._get_security_findings_automation_mute_rule_endpoint.call_with_http_info(**kwargs) + + def get_security_findings_automation_ticket_creation_rule( + self, + rule_id: UUID, + ) -> TicketCreationRuleResponse: + """Get a ticket creation rule. + + Get the details of a ticket creation rule by ID. + + :param rule_id: The ID of the ticket creation rule. + :type rule_id: UUID + :rtype: TicketCreationRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._get_security_findings_automation_ticket_creation_rule_endpoint.call_with_http_info(**kwargs) + def get_security_monitoring_critical_asset( self, critical_asset_id: str, @@ -6608,6 +7212,81 @@ def list_security_findings_with_pagination( } return endpoint.call_with_http_info_paginated(pagination) + def list_security_findings_automation_due_date_rules( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + ) -> DueDateRulesResponse: + """Get all due date rules. + + Get all due date rules for the current organization. + + :param page_size: The number of rules per page. Maximum is 1000. + :type page_size: int, optional + :param page_number: The page number to return. + :type page_number: int, optional + :rtype: DueDateRulesResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + return self._list_security_findings_automation_due_date_rules_endpoint.call_with_http_info(**kwargs) + + def list_security_findings_automation_mute_rules( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + ) -> MuteRulesResponse: + """Get all mute rules. + + Get all mute rules for the current organization. + + :param page_size: The number of rules per page. Maximum is 1000. + :type page_size: int, optional + :param page_number: The page number to return. + :type page_number: int, optional + :rtype: MuteRulesResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + return self._list_security_findings_automation_mute_rules_endpoint.call_with_http_info(**kwargs) + + def list_security_findings_automation_ticket_creation_rules( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + ) -> TicketCreationRulesResponse: + """Get all ticket creation rules. + + Get all ticket creation rules for the current organization. + + :param page_size: The number of rules per page. Maximum is 1000. + :type page_size: int, optional + :param page_number: The page number to return. + :type page_number: int, optional + :rtype: TicketCreationRulesResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + return self._list_security_findings_automation_ticket_creation_rules_endpoint.call_with_http_info(**kwargs) + def list_security_monitoring_critical_assets( self, ) -> SecurityMonitoringCriticalAssetsResponse: @@ -7476,6 +8155,54 @@ def patch_vulnerability_notification_rule( return self._patch_vulnerability_notification_rule_endpoint.call_with_http_info(**kwargs) + def reorder_security_findings_automation_due_date_rules( + self, + body: DueDateRuleReorderRequest, + ) -> DueDateRuleReorderRequest: + """Reorder due date rules. + + Reorder the list of due date rules for the current organization. + + :type body: DueDateRuleReorderRequest + :rtype: DueDateRuleReorderRequest + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._reorder_security_findings_automation_due_date_rules_endpoint.call_with_http_info(**kwargs) + + def reorder_security_findings_automation_mute_rules( + self, + body: MuteRuleReorderRequest, + ) -> MuteRuleReorderRequest: + """Reorder mute rules. + + Reorder the list of mute rules for the current organization. + + :type body: MuteRuleReorderRequest + :rtype: MuteRuleReorderRequest + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._reorder_security_findings_automation_mute_rules_endpoint.call_with_http_info(**kwargs) + + def reorder_security_findings_automation_ticket_creation_rules( + self, + body: TicketCreationRuleReorderRequest, + ) -> TicketCreationRuleReorderRequest: + """Reorder ticket creation rules. + + Reorder the list of ticket creation rules for the current organization. + + :type body: TicketCreationRuleReorderRequest + :rtype: TicketCreationRuleReorderRequest + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._reorder_security_findings_automation_ticket_creation_rules_endpoint.call_with_http_info(**kwargs) + def restore_security_monitoring_rule( self, rule_id: str, @@ -7771,6 +8498,69 @@ def update_security_filter( return self._update_security_filter_endpoint.call_with_http_info(**kwargs) + def update_security_findings_automation_due_date_rule( + self, + rule_id: UUID, + body: DueDateRuleUpdateRequest, + ) -> DueDateRuleResponse: + """Update a due date rule. + + Update an existing due date rule by ID. + + :param rule_id: The ID of the due date rule. + :type rule_id: UUID + :type body: DueDateRuleUpdateRequest + :rtype: DueDateRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + kwargs["body"] = body + + return self._update_security_findings_automation_due_date_rule_endpoint.call_with_http_info(**kwargs) + + def update_security_findings_automation_mute_rule( + self, + rule_id: UUID, + body: MuteRuleUpdateRequest, + ) -> MuteRuleResponse: + """Update a mute rule. + + Update an existing mute rule by ID. + + :param rule_id: The ID of the mute rule. + :type rule_id: UUID + :type body: MuteRuleUpdateRequest + :rtype: MuteRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + kwargs["body"] = body + + return self._update_security_findings_automation_mute_rule_endpoint.call_with_http_info(**kwargs) + + def update_security_findings_automation_ticket_creation_rule( + self, + rule_id: UUID, + body: TicketCreationRuleUpdateRequest, + ) -> TicketCreationRuleResponse: + """Update a ticket creation rule. + + Update an existing ticket creation rule by ID. + + :param rule_id: The ID of the ticket creation rule. + :type rule_id: UUID + :type body: TicketCreationRuleUpdateRequest + :rtype: TicketCreationRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + kwargs["body"] = body + + return self._update_security_findings_automation_ticket_creation_rule_endpoint.call_with_http_info(**kwargs) + def update_security_monitoring_critical_asset( self, critical_asset_id: str, diff --git a/src/datadog_api_client/v2/model/automation_rule_actor_type.py b/src/datadog_api_client/v2/model/automation_rule_actor_type.py new file mode 100644 index 0000000000..f6e1b25e58 --- /dev/null +++ b/src/datadog_api_client/v2/model/automation_rule_actor_type.py @@ -0,0 +1,38 @@ +# 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 AutomationRuleActorType(ModelSimple): + """ + Whether the actor is a user or the Datadog system. + + :param value: Must be one of ["user", "system"]. + :type value: str + """ + + allowed_values = { + "user", + "system", + } + USER: ClassVar["AutomationRuleActorType"] + SYSTEM: ClassVar["AutomationRuleActorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AutomationRuleActorType.USER = AutomationRuleActorType("user") +AutomationRuleActorType.SYSTEM = AutomationRuleActorType("system") diff --git a/src/datadog_api_client/v2/model/automation_rule_created_by.py b/src/datadog_api_client/v2/model/automation_rule_created_by.py new file mode 100644 index 0000000000..ff87f0acf5 --- /dev/null +++ b/src/datadog_api_client/v2/model/automation_rule_created_by.py @@ -0,0 +1,52 @@ +# 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.automation_rule_actor_type import AutomationRuleActorType + + +class AutomationRuleCreatedBy(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.automation_rule_actor_type import AutomationRuleActorType + + return { + "id": (str,), + "name": (str,), + "type": (AutomationRuleActorType,), + } + + attribute_map = { + "id": "id", + "name": "name", + "type": "type", + } + + def __init__(self_, id: str, name: str, type: AutomationRuleActorType, **kwargs): + """ + The user or Datadog system who created the rule. + + :param id: The actor's identifier (a user UUID or a system identifier). + :type id: str + + :param name: The name of the actor. + :type name: str + + :param type: Whether the actor is a user or the Datadog system. + :type type: AutomationRuleActorType + """ + super().__init__(kwargs) + + self_.id = id + self_.name = name + self_.type = type diff --git a/src/datadog_api_client/v2/model/automation_rule_modified_by.py b/src/datadog_api_client/v2/model/automation_rule_modified_by.py new file mode 100644 index 0000000000..cdb0b3b593 --- /dev/null +++ b/src/datadog_api_client/v2/model/automation_rule_modified_by.py @@ -0,0 +1,52 @@ +# 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.automation_rule_actor_type import AutomationRuleActorType + + +class AutomationRuleModifiedBy(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.automation_rule_actor_type import AutomationRuleActorType + + return { + "id": (str,), + "name": (str,), + "type": (AutomationRuleActorType,), + } + + attribute_map = { + "id": "id", + "name": "name", + "type": "type", + } + + def __init__(self_, id: str, name: str, type: AutomationRuleActorType, **kwargs): + """ + The user or Datadog system who last modified the rule. + + :param id: The actor's identifier (a user UUID or a system identifier). + :type id: str + + :param name: The name of the actor. + :type name: str + + :param type: Whether the actor is a user or the Datadog system. + :type type: AutomationRuleActorType + """ + super().__init__(kwargs) + + self_.id = id + self_.name = name + self_.type = type diff --git a/src/datadog_api_client/v2/model/automation_rule_scope.py b/src/datadog_api_client/v2/model/automation_rule_scope.py new file mode 100644 index 0000000000..10edb14b4c --- /dev/null +++ b/src/datadog_api_client/v2/model/automation_rule_scope.py @@ -0,0 +1,58 @@ +# 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.security_finding_type import SecurityFindingType + + +class AutomationRuleScope(ModelNormal): + validations = { + "finding_types": { + "min_items": 1, + }, + "query": { + "max_length": 30000, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_finding_type import SecurityFindingType + + return { + "finding_types": ([SecurityFindingType],), + "query": (str,), + } + + attribute_map = { + "finding_types": "finding_types", + "query": "query", + } + + def __init__(self_, finding_types: List[SecurityFindingType], query: Union[str, UnsetType] = unset, **kwargs): + """ + Defines the scope of findings to which the automation rule applies. + + :param finding_types: The list of security finding types that the automation rule applies to. + :type finding_types: [SecurityFindingType] + + :param query: A search query to further filter the findings matched by this rule. The ``@workflow.*`` namespace and ``@status`` fields are not permitted. For a reference of available fields, see the `Security Findings schema documentation `_. + :type query: str, optional + """ + if query is not unset: + kwargs["query"] = query + super().__init__(kwargs) + + self_.finding_types = finding_types diff --git a/src/datadog_api_client/v2/model/due_date_from.py b/src/datadog_api_client/v2/model/due_date_from.py new file mode 100644 index 0000000000..7d27dc9f2d --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_from.py @@ -0,0 +1,38 @@ +# 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 DueDateFrom(ModelSimple): + """ + The reference point from which the due date is calculated. When `fix_available` is selected but not applicable to the finding type, `first_seen` is used instead. + + :param value: Must be one of ["first_seen", "fix_available"]. + :type value: str + """ + + allowed_values = { + "first_seen", + "fix_available", + } + FIRST_SEEN: ClassVar["DueDateFrom"] + FIX_AVAILABLE: ClassVar["DueDateFrom"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DueDateFrom.FIRST_SEEN = DueDateFrom("first_seen") +DueDateFrom.FIX_AVAILABLE = DueDateFrom("fix_available") diff --git a/src/datadog_api_client/v2/model/due_date_per_severity_item.py b/src/datadog_api_client/v2/model/due_date_per_severity_item.py new file mode 100644 index 0000000000..a02fcd9c29 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_per_severity_item.py @@ -0,0 +1,53 @@ +# 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.due_date_severity import DueDateSeverity + + +class DueDatePerSeverityItem(ModelNormal): + validations = { + "due_in_days": { + "inclusive_maximum": 365, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_severity import DueDateSeverity + + return { + "due_in_days": (int,), + "severity": (DueDateSeverity,), + } + + attribute_map = { + "due_in_days": "due_in_days", + "severity": "severity", + } + + def __init__(self_, due_in_days: int, severity: DueDateSeverity, **kwargs): + """ + A mapping of a severity level to the number of days until a finding is due. + + :param due_in_days: The number of days from the reference point until the finding is due. + :type due_in_days: int + + :param severity: A severity level used to configure due date thresholds. + :type severity: DueDateSeverity + """ + super().__init__(kwargs) + + self_.due_in_days = due_in_days + self_.severity = severity diff --git a/src/datadog_api_client/v2/model/due_date_rule_action.py b/src/datadog_api_client/v2/model/due_date_rule_action.py new file mode 100644 index 0000000000..e0b58fc734 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_action.py @@ -0,0 +1,69 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 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.due_date_per_severity_item import DueDatePerSeverityItem + from datadog_api_client.v2.model.due_date_from import DueDateFrom + + +class DueDateRuleAction(ModelNormal): + validations = { + "reason_description": { + "max_length": 20000, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_per_severity_item import DueDatePerSeverityItem + from datadog_api_client.v2.model.due_date_from import DueDateFrom + + return { + "due_days_per_severity": ([DueDatePerSeverityItem],), + "due_from": (DueDateFrom,), + "reason_description": (str,), + } + + attribute_map = { + "due_days_per_severity": "due_days_per_severity", + "due_from": "due_from", + "reason_description": "reason_description", + } + + def __init__( + self_, + due_days_per_severity: List[DueDatePerSeverityItem], + due_from: DueDateFrom, + reason_description: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The action to take when the due date rule matches a finding. + + :param due_days_per_severity: A list of severity-to-due-date mappings. Each severity may appear at most once. + :type due_days_per_severity: [DueDatePerSeverityItem] + + :param due_from: The reference point from which the due date is calculated. When ``fix_available`` is selected but not applicable to the finding type, ``first_seen`` is used instead. + :type due_from: DueDateFrom + + :param reason_description: An optional description providing more context for the due date assignment. + :type reason_description: str, optional + """ + if reason_description is not unset: + kwargs["reason_description"] = reason_description + super().__init__(kwargs) + + self_.due_days_per_severity = due_days_per_severity + self_.due_from = due_from diff --git a/src/datadog_api_client/v2/model/due_date_rule_attributes_create.py b/src/datadog_api_client/v2/model/due_date_rule_attributes_create.py new file mode 100644 index 0000000000..46207bf57b --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_attributes_create.py @@ -0,0 +1,77 @@ +# 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.due_date_rule_action import DueDateRuleAction + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + +class DueDateRuleAttributesCreate(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_action import DueDateRuleAction + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + return { + "action": (DueDateRuleAction,), + "enabled": (bool,), + "name": (str,), + "rule": (AutomationRuleScope,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: DueDateRuleAction, + name: str, + rule: AutomationRuleScope, + enabled: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating or updating a due date rule. + + :param action: The action to take when the due date rule matches a finding. + :type action: DueDateRuleAction + + :param enabled: Whether the due date rule is enabled. + :type enabled: bool, optional + + :param name: The name of the due date rule. + :type name: str + + :param rule: Defines the scope of findings to which the automation rule applies. + :type rule: AutomationRuleScope + """ + if enabled is not unset: + kwargs["enabled"] = enabled + super().__init__(kwargs) + + self_.action = action + self_.name = name + self_.rule = rule diff --git a/src/datadog_api_client/v2/model/due_date_rule_attributes_response.py b/src/datadog_api_client/v2/model/due_date_rule_attributes_response.py new file mode 100644 index 0000000000..9de8acb735 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_attributes_response.py @@ -0,0 +1,106 @@ +# 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.due_date_rule_action import DueDateRuleAction + from datadog_api_client.v2.model.automation_rule_created_by import AutomationRuleCreatedBy + from datadog_api_client.v2.model.automation_rule_modified_by import AutomationRuleModifiedBy + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + +class DueDateRuleAttributesResponse(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_action import DueDateRuleAction + from datadog_api_client.v2.model.automation_rule_created_by import AutomationRuleCreatedBy + from datadog_api_client.v2.model.automation_rule_modified_by import AutomationRuleModifiedBy + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + return { + "action": (DueDateRuleAction,), + "created_at": (int,), + "created_by": (AutomationRuleCreatedBy,), + "enabled": (bool,), + "modified_at": (int,), + "modified_by": (AutomationRuleModifiedBy,), + "name": (str,), + "rule": (AutomationRuleScope,), + } + + attribute_map = { + "action": "action", + "created_at": "created_at", + "created_by": "created_by", + "enabled": "enabled", + "modified_at": "modified_at", + "modified_by": "modified_by", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: DueDateRuleAction, + created_at: int, + created_by: AutomationRuleCreatedBy, + enabled: bool, + modified_at: int, + modified_by: AutomationRuleModifiedBy, + name: str, + rule: AutomationRuleScope, + **kwargs, + ): + """ + Attributes of a due date rule returned by the API. + + :param action: The action to take when the due date rule matches a finding. + :type action: DueDateRuleAction + + :param created_at: The Unix timestamp in milliseconds when the rule was created. + :type created_at: int + + :param created_by: The user or Datadog system who created the rule. + :type created_by: AutomationRuleCreatedBy + + :param enabled: Whether the due date rule is enabled. + :type enabled: bool + + :param modified_at: The Unix timestamp in milliseconds when the rule was last modified. + :type modified_at: int + + :param modified_by: The user or Datadog system who last modified the rule. + :type modified_by: AutomationRuleModifiedBy + + :param name: The name of the due date rule. + :type name: str + + :param rule: Defines the scope of findings to which the automation rule applies. + :type rule: AutomationRuleScope + """ + super().__init__(kwargs) + + self_.action = action + self_.created_at = created_at + self_.created_by = created_by + self_.enabled = enabled + self_.modified_at = modified_at + self_.modified_by = modified_by + self_.name = name + self_.rule = rule diff --git a/src/datadog_api_client/v2/model/due_date_rule_create_request.py b/src/datadog_api_client/v2/model/due_date_rule_create_request.py new file mode 100644 index 0000000000..9444456204 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_create_request.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.due_date_rule_data_create import DueDateRuleDataCreate + + +class DueDateRuleCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_data_create import DueDateRuleDataCreate + + return { + "data": (DueDateRuleDataCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DueDateRuleDataCreate, **kwargs): + """ + The body of a due date rule create request. + + :param data: The data object for a due date rule create or update request. + :type data: DueDateRuleDataCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/due_date_rule_data_create.py b/src/datadog_api_client/v2/model/due_date_rule_data_create.py new file mode 100644 index 0000000000..cd45da2d2c --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_data_create.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.due_date_rule_attributes_create import DueDateRuleAttributesCreate + from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType + + +class DueDateRuleDataCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_attributes_create import DueDateRuleAttributesCreate + from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType + + return { + "attributes": (DueDateRuleAttributesCreate,), + "type": (DueDateRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: DueDateRuleAttributesCreate, type: DueDateRuleType, **kwargs): + """ + The data object for a due date rule create or update request. + + :param attributes: Attributes for creating or updating a due date rule. + :type attributes: DueDateRuleAttributesCreate + + :param type: The JSON:API type for due date rules. + :type type: DueDateRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/due_date_rule_data_response.py b/src/datadog_api_client/v2/model/due_date_rule_data_response.py new file mode 100644 index 0000000000..29a40c6967 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_data_response.py @@ -0,0 +1,55 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.due_date_rule_attributes_response import DueDateRuleAttributesResponse + from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType + + +class DueDateRuleDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_attributes_response import DueDateRuleAttributesResponse + from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType + + return { + "attributes": (DueDateRuleAttributesResponse,), + "id": (UUID,), + "type": (DueDateRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: DueDateRuleAttributesResponse, id: UUID, type: DueDateRuleType, **kwargs): + """ + The data object for a due date rule returned by the API. + + :param attributes: Attributes of a due date rule returned by the API. + :type attributes: DueDateRuleAttributesResponse + + :param id: The ID of the due date rule. + :type id: UUID + + :param type: The JSON:API type for due date rules. + :type type: DueDateRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/due_date_rule_reorder_item.py b/src/datadog_api_client/v2/model/due_date_rule_reorder_item.py new file mode 100644 index 0000000000..4c18997111 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_reorder_item.py @@ -0,0 +1,47 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType + + +class DueDateRuleReorderItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType + + return { + "id": (UUID,), + "type": (DueDateRuleType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: DueDateRuleType, **kwargs): + """ + A reference to a due date rule used for reordering. + + :param id: The ID of the automation rule. + :type id: UUID + + :param type: The JSON:API type for due date rules. + :type type: DueDateRuleType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/due_date_rule_reorder_request.py b/src/datadog_api_client/v2/model/due_date_rule_reorder_request.py new file mode 100644 index 0000000000..168c476409 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_reorder_request.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.due_date_rule_reorder_item import DueDateRuleReorderItem + + +class DueDateRuleReorderRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_reorder_item import DueDateRuleReorderItem + + return { + "data": ([DueDateRuleReorderItem],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[DueDateRuleReorderItem], **kwargs): + """ + The body of the due date rule reorder request. + + :param data: The ordered list of all due date rules; every rule must be included. + :type data: [DueDateRuleReorderItem] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/due_date_rule_response.py b/src/datadog_api_client/v2/model/due_date_rule_response.py new file mode 100644 index 0000000000..d635103808 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_response.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.due_date_rule_data_response import DueDateRuleDataResponse + + +class DueDateRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_data_response import DueDateRuleDataResponse + + return { + "data": (DueDateRuleDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DueDateRuleDataResponse, **kwargs): + """ + A single due date rule response. + + :param data: The data object for a due date rule returned by the API. + :type data: DueDateRuleDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/due_date_rule_type.py b/src/datadog_api_client/v2/model/due_date_rule_type.py new file mode 100644 index 0000000000..ae01bb3ffa --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_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 DueDateRuleType(ModelSimple): + """ + The JSON:API type for due date rules. + + :param value: If omitted defaults to "due_date_rules". Must be one of ["due_date_rules"]. + :type value: str + """ + + allowed_values = { + "due_date_rules", + } + DUE_DATE_RULES: ClassVar["DueDateRuleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DueDateRuleType.DUE_DATE_RULES = DueDateRuleType("due_date_rules") diff --git a/src/datadog_api_client/v2/model/due_date_rule_update_request.py b/src/datadog_api_client/v2/model/due_date_rule_update_request.py new file mode 100644 index 0000000000..3c0e66f1bc --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rule_update_request.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.due_date_rule_data_create import DueDateRuleDataCreate + + +class DueDateRuleUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_data_create import DueDateRuleDataCreate + + return { + "data": (DueDateRuleDataCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DueDateRuleDataCreate, **kwargs): + """ + The body of a due date rule update request. + + :param data: The data object for a due date rule create or update request. + :type data: DueDateRuleDataCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/due_date_rules_response.py b/src/datadog_api_client/v2/model/due_date_rules_response.py new file mode 100644 index 0000000000..7a7c474626 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_rules_response.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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.due_date_rule_data_response import DueDateRuleDataResponse + from datadog_api_client.v2.model.security_automation_rules_links import SecurityAutomationRulesLinks + from datadog_api_client.v2.model.security_automation_rules_meta import SecurityAutomationRulesMeta + + +class DueDateRulesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.due_date_rule_data_response import DueDateRuleDataResponse + from datadog_api_client.v2.model.security_automation_rules_links import SecurityAutomationRulesLinks + from datadog_api_client.v2.model.security_automation_rules_meta import SecurityAutomationRulesMeta + + return { + "data": ([DueDateRuleDataResponse],), + "links": (SecurityAutomationRulesLinks,), + "meta": (SecurityAutomationRulesMeta,), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: List[DueDateRuleDataResponse], + links: SecurityAutomationRulesLinks, + meta: SecurityAutomationRulesMeta, + **kwargs, + ): + """ + A list of due date rules with pagination metadata. + + :param data: A list of due date rule data objects. + :type data: [DueDateRuleDataResponse] + + :param links: Pagination links for the list of automation rules. + :type links: SecurityAutomationRulesLinks + + :param meta: Metadata for the list of automation rules. + :type meta: SecurityAutomationRulesMeta + """ + super().__init__(kwargs) + + self_.data = data + self_.links = links + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/due_date_severity.py b/src/datadog_api_client/v2/model/due_date_severity.py new file mode 100644 index 0000000000..3d0534a513 --- /dev/null +++ b/src/datadog_api_client/v2/model/due_date_severity.py @@ -0,0 +1,53 @@ +# 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 DueDateSeverity(ModelSimple): + """ + A severity level used to configure due date thresholds. + + :param value: Must be one of ["critical", "high", "medium", "low", "info", "none", "unknown"]. + :type value: str + """ + + allowed_values = { + "critical", + "high", + "medium", + "low", + "info", + "none", + "unknown", + } + CRITICAL: ClassVar["DueDateSeverity"] + HIGH: ClassVar["DueDateSeverity"] + MEDIUM: ClassVar["DueDateSeverity"] + LOW: ClassVar["DueDateSeverity"] + INFO: ClassVar["DueDateSeverity"] + NONE: ClassVar["DueDateSeverity"] + UNKNOWN: ClassVar["DueDateSeverity"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DueDateSeverity.CRITICAL = DueDateSeverity("critical") +DueDateSeverity.HIGH = DueDateSeverity("high") +DueDateSeverity.MEDIUM = DueDateSeverity("medium") +DueDateSeverity.LOW = DueDateSeverity("low") +DueDateSeverity.INFO = DueDateSeverity("info") +DueDateSeverity.NONE = DueDateSeverity("none") +DueDateSeverity.UNKNOWN = DueDateSeverity("unknown") diff --git a/src/datadog_api_client/v2/model/mute_reason.py b/src/datadog_api_client/v2/model/mute_reason.py new file mode 100644 index 0000000000..2ba208bef3 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_reason.py @@ -0,0 +1,50 @@ +# 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 MuteReason(ModelSimple): + """ + The reason for muting a security finding. + + :param value: Must be one of ["duplicate", "false_positive", "no_fix", "other", "pending_fix", "risk_accepted"]. + :type value: str + """ + + allowed_values = { + "duplicate", + "false_positive", + "no_fix", + "other", + "pending_fix", + "risk_accepted", + } + DUPLICATE: ClassVar["MuteReason"] + FALSE_POSITIVE: ClassVar["MuteReason"] + NO_FIX: ClassVar["MuteReason"] + OTHER: ClassVar["MuteReason"] + PENDING_FIX: ClassVar["MuteReason"] + RISK_ACCEPTED: ClassVar["MuteReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +MuteReason.DUPLICATE = MuteReason("duplicate") +MuteReason.FALSE_POSITIVE = MuteReason("false_positive") +MuteReason.NO_FIX = MuteReason("no_fix") +MuteReason.OTHER = MuteReason("other") +MuteReason.PENDING_FIX = MuteReason("pending_fix") +MuteReason.RISK_ACCEPTED = MuteReason("risk_accepted") diff --git a/src/datadog_api_client/v2/model/mute_rule_action.py b/src/datadog_api_client/v2/model/mute_rule_action.py new file mode 100644 index 0000000000..d74769e69d --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_action.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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mute_reason import MuteReason + + +class MuteRuleAction(ModelNormal): + validations = { + "reason_description": { + "max_length": 20000, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_reason import MuteReason + + return { + "expire_at": (int,), + "reason": (MuteReason,), + "reason_description": (str,), + } + + attribute_map = { + "expire_at": "expire_at", + "reason": "reason", + "reason_description": "reason_description", + } + + def __init__( + self_, + reason: MuteReason, + expire_at: Union[int, UnsetType] = unset, + reason_description: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The action to take when the mute rule matches a finding. + + :param expire_at: The Unix timestamp in milliseconds at which the mute expires. If omitted, the mute does not expire. + :type expire_at: int, optional + + :param reason: The reason for muting a security finding. + :type reason: MuteReason + + :param reason_description: An optional description providing more context for the mute reason. + :type reason_description: str, optional + """ + if expire_at is not unset: + kwargs["expire_at"] = expire_at + if reason_description is not unset: + kwargs["reason_description"] = reason_description + super().__init__(kwargs) + + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/mute_rule_attributes_create.py b/src/datadog_api_client/v2/model/mute_rule_attributes_create.py new file mode 100644 index 0000000000..70a3803cf8 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_attributes_create.py @@ -0,0 +1,77 @@ +# 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.mute_rule_action import MuteRuleAction + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + +class MuteRuleAttributesCreate(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_action import MuteRuleAction + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + return { + "action": (MuteRuleAction,), + "enabled": (bool,), + "name": (str,), + "rule": (AutomationRuleScope,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: MuteRuleAction, + name: str, + rule: AutomationRuleScope, + enabled: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating or updating a mute rule. + + :param action: The action to take when the mute rule matches a finding. + :type action: MuteRuleAction + + :param enabled: Whether the mute rule is enabled. + :type enabled: bool, optional + + :param name: The name of the mute rule. + :type name: str + + :param rule: Defines the scope of findings to which the automation rule applies. + :type rule: AutomationRuleScope + """ + if enabled is not unset: + kwargs["enabled"] = enabled + super().__init__(kwargs) + + self_.action = action + self_.name = name + self_.rule = rule diff --git a/src/datadog_api_client/v2/model/mute_rule_attributes_response.py b/src/datadog_api_client/v2/model/mute_rule_attributes_response.py new file mode 100644 index 0000000000..b1ec00307b --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_attributes_response.py @@ -0,0 +1,106 @@ +# 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.mute_rule_action import MuteRuleAction + from datadog_api_client.v2.model.automation_rule_created_by import AutomationRuleCreatedBy + from datadog_api_client.v2.model.automation_rule_modified_by import AutomationRuleModifiedBy + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + +class MuteRuleAttributesResponse(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_action import MuteRuleAction + from datadog_api_client.v2.model.automation_rule_created_by import AutomationRuleCreatedBy + from datadog_api_client.v2.model.automation_rule_modified_by import AutomationRuleModifiedBy + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + return { + "action": (MuteRuleAction,), + "created_at": (int,), + "created_by": (AutomationRuleCreatedBy,), + "enabled": (bool,), + "modified_at": (int,), + "modified_by": (AutomationRuleModifiedBy,), + "name": (str,), + "rule": (AutomationRuleScope,), + } + + attribute_map = { + "action": "action", + "created_at": "created_at", + "created_by": "created_by", + "enabled": "enabled", + "modified_at": "modified_at", + "modified_by": "modified_by", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: MuteRuleAction, + created_at: int, + created_by: AutomationRuleCreatedBy, + enabled: bool, + modified_at: int, + modified_by: AutomationRuleModifiedBy, + name: str, + rule: AutomationRuleScope, + **kwargs, + ): + """ + Attributes of a mute rule returned by the API. + + :param action: The action to take when the mute rule matches a finding. + :type action: MuteRuleAction + + :param created_at: The Unix timestamp in milliseconds when the rule was created. + :type created_at: int + + :param created_by: The user or Datadog system who created the rule. + :type created_by: AutomationRuleCreatedBy + + :param enabled: Whether the mute rule is enabled. + :type enabled: bool + + :param modified_at: The Unix timestamp in milliseconds when the rule was last modified. + :type modified_at: int + + :param modified_by: The user or Datadog system who last modified the rule. + :type modified_by: AutomationRuleModifiedBy + + :param name: The name of the mute rule. + :type name: str + + :param rule: Defines the scope of findings to which the automation rule applies. + :type rule: AutomationRuleScope + """ + super().__init__(kwargs) + + self_.action = action + self_.created_at = created_at + self_.created_by = created_by + self_.enabled = enabled + self_.modified_at = modified_at + self_.modified_by = modified_by + self_.name = name + self_.rule = rule diff --git a/src/datadog_api_client/v2/model/mute_rule_create_request.py b/src/datadog_api_client/v2/model/mute_rule_create_request.py new file mode 100644 index 0000000000..4618733af9 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_create_request.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.mute_rule_data_create import MuteRuleDataCreate + + +class MuteRuleCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_data_create import MuteRuleDataCreate + + return { + "data": (MuteRuleDataCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: MuteRuleDataCreate, **kwargs): + """ + The body of a mute rule create request. + + :param data: The data object for a mute rule create or update request. + :type data: MuteRuleDataCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/mute_rule_data_create.py b/src/datadog_api_client/v2/model/mute_rule_data_create.py new file mode 100644 index 0000000000..e4375546c2 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_data_create.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.mute_rule_attributes_create import MuteRuleAttributesCreate + from datadog_api_client.v2.model.mute_rule_type import MuteRuleType + + +class MuteRuleDataCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_attributes_create import MuteRuleAttributesCreate + from datadog_api_client.v2.model.mute_rule_type import MuteRuleType + + return { + "attributes": (MuteRuleAttributesCreate,), + "type": (MuteRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: MuteRuleAttributesCreate, type: MuteRuleType, **kwargs): + """ + The data object for a mute rule create or update request. + + :param attributes: Attributes for creating or updating a mute rule. + :type attributes: MuteRuleAttributesCreate + + :param type: The JSON:API type for mute rules. + :type type: MuteRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/mute_rule_data_response.py b/src/datadog_api_client/v2/model/mute_rule_data_response.py new file mode 100644 index 0000000000..4dd198cc77 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_data_response.py @@ -0,0 +1,55 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mute_rule_attributes_response import MuteRuleAttributesResponse + from datadog_api_client.v2.model.mute_rule_type import MuteRuleType + + +class MuteRuleDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_attributes_response import MuteRuleAttributesResponse + from datadog_api_client.v2.model.mute_rule_type import MuteRuleType + + return { + "attributes": (MuteRuleAttributesResponse,), + "id": (UUID,), + "type": (MuteRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: MuteRuleAttributesResponse, id: UUID, type: MuteRuleType, **kwargs): + """ + The data object for a mute rule returned by the API. + + :param attributes: Attributes of a mute rule returned by the API. + :type attributes: MuteRuleAttributesResponse + + :param id: The ID of the mute rule. + :type id: UUID + + :param type: The JSON:API type for mute rules. + :type type: MuteRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/mute_rule_reorder_item.py b/src/datadog_api_client/v2/model/mute_rule_reorder_item.py new file mode 100644 index 0000000000..7564d2dd1d --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_reorder_item.py @@ -0,0 +1,47 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mute_rule_type import MuteRuleType + + +class MuteRuleReorderItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_type import MuteRuleType + + return { + "id": (UUID,), + "type": (MuteRuleType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: MuteRuleType, **kwargs): + """ + A reference to a mute rule used for reordering. + + :param id: The ID of the automation rule. + :type id: UUID + + :param type: The JSON:API type for mute rules. + :type type: MuteRuleType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/mute_rule_reorder_request.py b/src/datadog_api_client/v2/model/mute_rule_reorder_request.py new file mode 100644 index 0000000000..009e87b736 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_reorder_request.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.mute_rule_reorder_item import MuteRuleReorderItem + + +class MuteRuleReorderRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_reorder_item import MuteRuleReorderItem + + return { + "data": ([MuteRuleReorderItem],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[MuteRuleReorderItem], **kwargs): + """ + The body of the mute rule reorder request. + + :param data: The ordered list of all mute rules; every rule must be included. + :type data: [MuteRuleReorderItem] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/mute_rule_response.py b/src/datadog_api_client/v2/model/mute_rule_response.py new file mode 100644 index 0000000000..03a1963224 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_response.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.mute_rule_data_response import MuteRuleDataResponse + + +class MuteRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_data_response import MuteRuleDataResponse + + return { + "data": (MuteRuleDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: MuteRuleDataResponse, **kwargs): + """ + A single mute rule response. + + :param data: The data object for a mute rule returned by the API. + :type data: MuteRuleDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/mute_rule_type.py b/src/datadog_api_client/v2/model/mute_rule_type.py new file mode 100644 index 0000000000..f397a7d8a3 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_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 MuteRuleType(ModelSimple): + """ + The JSON:API type for mute rules. + + :param value: If omitted defaults to "mute_rules". Must be one of ["mute_rules"]. + :type value: str + """ + + allowed_values = { + "mute_rules", + } + MUTE_RULES: ClassVar["MuteRuleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +MuteRuleType.MUTE_RULES = MuteRuleType("mute_rules") diff --git a/src/datadog_api_client/v2/model/mute_rule_update_request.py b/src/datadog_api_client/v2/model/mute_rule_update_request.py new file mode 100644 index 0000000000..caf7d4619d --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_update_request.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.mute_rule_data_create import MuteRuleDataCreate + + +class MuteRuleUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_data_create import MuteRuleDataCreate + + return { + "data": (MuteRuleDataCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: MuteRuleDataCreate, **kwargs): + """ + The body of a mute rule update request. + + :param data: The data object for a mute rule create or update request. + :type data: MuteRuleDataCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/mute_rules_response.py b/src/datadog_api_client/v2/model/mute_rules_response.py new file mode 100644 index 0000000000..a14c68a431 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rules_response.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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mute_rule_data_response import MuteRuleDataResponse + from datadog_api_client.v2.model.security_automation_rules_links import SecurityAutomationRulesLinks + from datadog_api_client.v2.model.security_automation_rules_meta import SecurityAutomationRulesMeta + + +class MuteRulesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_data_response import MuteRuleDataResponse + from datadog_api_client.v2.model.security_automation_rules_links import SecurityAutomationRulesLinks + from datadog_api_client.v2.model.security_automation_rules_meta import SecurityAutomationRulesMeta + + return { + "data": ([MuteRuleDataResponse],), + "links": (SecurityAutomationRulesLinks,), + "meta": (SecurityAutomationRulesMeta,), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: List[MuteRuleDataResponse], + links: SecurityAutomationRulesLinks, + meta: SecurityAutomationRulesMeta, + **kwargs, + ): + """ + A list of mute rules with pagination metadata. + + :param data: A list of mute rule data objects. + :type data: [MuteRuleDataResponse] + + :param links: Pagination links for the list of automation rules. + :type links: SecurityAutomationRulesLinks + + :param meta: Metadata for the list of automation rules. + :type meta: SecurityAutomationRulesMeta + """ + super().__init__(kwargs) + + self_.data = data + self_.links = links + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/security_automation_rules_links.py b/src/datadog_api_client/v2/model/security_automation_rules_links.py new file mode 100644 index 0000000000..cc414bf335 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_automation_rules_links.py @@ -0,0 +1,58 @@ +# 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 SecurityAutomationRulesLinks(ModelNormal): + @cached_property + def openapi_types(_): + return { + "first": (str,), + "last": (str,), + "next": (str,), + "prev": (str,), + } + + attribute_map = { + "first": "first", + "last": "last", + "next": "next", + "prev": "prev", + } + + def __init__( + self_, first: str, last: str, next: Union[str, UnsetType] = unset, prev: Union[str, UnsetType] = unset, **kwargs + ): + """ + Pagination links for the list of automation rules. + + :param first: Link to the first page of results. + :type first: str + + :param last: Link to the last page of results. + :type last: str + + :param next: Link to the next page of results. + :type next: str, optional + + :param prev: Link to the previous page of results. + :type prev: str, optional + """ + if next is not unset: + kwargs["next"] = next + if prev is not unset: + kwargs["prev"] = prev + super().__init__(kwargs) + + self_.first = first + self_.last = last diff --git a/src/datadog_api_client/v2/model/security_automation_rules_meta.py b/src/datadog_api_client/v2/model/security_automation_rules_meta.py new file mode 100644 index 0000000000..bb5c97cc82 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_automation_rules_meta.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.security_automation_rules_page_info import SecurityAutomationRulesPageInfo + + +class SecurityAutomationRulesMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_automation_rules_page_info import SecurityAutomationRulesPageInfo + + return { + "page": (SecurityAutomationRulesPageInfo,), + } + + attribute_map = { + "page": "page", + } + + def __init__(self_, page: SecurityAutomationRulesPageInfo, **kwargs): + """ + Metadata for the list of automation rules. + + :param page: Pagination information for the list of automation rules. + :type page: SecurityAutomationRulesPageInfo + """ + super().__init__(kwargs) + + self_.page = page diff --git a/src/datadog_api_client/v2/model/security_automation_rules_page_info.py b/src/datadog_api_client/v2/model/security_automation_rules_page_info.py new file mode 100644 index 0000000000..b5570e020c --- /dev/null +++ b/src/datadog_api_client/v2/model/security_automation_rules_page_info.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 SecurityAutomationRulesPageInfo(ModelNormal): + @cached_property + def openapi_types(_): + return { + "total_filtered_count": (int,), + } + + attribute_map = { + "total_filtered_count": "total_filtered_count", + } + + def __init__(self_, total_filtered_count: int, **kwargs): + """ + Pagination information for the list of automation rules. + + :param total_filtered_count: The total number of rules matching the current filter. + :type total_filtered_count: int + """ + super().__init__(kwargs) + + self_.total_filtered_count = total_filtered_count diff --git a/src/datadog_api_client/v2/model/security_finding_type.py b/src/datadog_api_client/v2/model/security_finding_type.py new file mode 100644 index 0000000000..c76616370a --- /dev/null +++ b/src/datadog_api_client/v2/model/security_finding_type.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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SecurityFindingType(ModelSimple): + """ + The type of security finding that the automation rule applies to. + + :param value: Must be one of ["api_security", "attack_path", "host_and_container_vulnerability", "iac_misconfiguration", "identity_risk", "library_vulnerability", "misconfiguration", "runtime_code_vulnerability", "secret", "static_code_vulnerability", "workload_activity"]. + :type value: str + """ + + allowed_values = { + "api_security", + "attack_path", + "host_and_container_vulnerability", + "iac_misconfiguration", + "identity_risk", + "library_vulnerability", + "misconfiguration", + "runtime_code_vulnerability", + "secret", + "static_code_vulnerability", + "workload_activity", + } + API_SECURITY: ClassVar["SecurityFindingType"] + ATTACK_PATH: ClassVar["SecurityFindingType"] + HOST_AND_CONTAINER_VULNERABILITY: ClassVar["SecurityFindingType"] + IAC_MISCONFIGURATION: ClassVar["SecurityFindingType"] + IDENTITY_RISK: ClassVar["SecurityFindingType"] + LIBRARY_VULNERABILITY: ClassVar["SecurityFindingType"] + MISCONFIGURATION: ClassVar["SecurityFindingType"] + RUNTIME_CODE_VULNERABILITY: ClassVar["SecurityFindingType"] + SECRET: ClassVar["SecurityFindingType"] + STATIC_CODE_VULNERABILITY: ClassVar["SecurityFindingType"] + WORKLOAD_ACTIVITY: ClassVar["SecurityFindingType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SecurityFindingType.API_SECURITY = SecurityFindingType("api_security") +SecurityFindingType.ATTACK_PATH = SecurityFindingType("attack_path") +SecurityFindingType.HOST_AND_CONTAINER_VULNERABILITY = SecurityFindingType("host_and_container_vulnerability") +SecurityFindingType.IAC_MISCONFIGURATION = SecurityFindingType("iac_misconfiguration") +SecurityFindingType.IDENTITY_RISK = SecurityFindingType("identity_risk") +SecurityFindingType.LIBRARY_VULNERABILITY = SecurityFindingType("library_vulnerability") +SecurityFindingType.MISCONFIGURATION = SecurityFindingType("misconfiguration") +SecurityFindingType.RUNTIME_CODE_VULNERABILITY = SecurityFindingType("runtime_code_vulnerability") +SecurityFindingType.SECRET = SecurityFindingType("secret") +SecurityFindingType.STATIC_CODE_VULNERABILITY = SecurityFindingType("static_code_vulnerability") +SecurityFindingType.WORKLOAD_ACTIVITY = SecurityFindingType("workload_activity") diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_action.py b/src/datadog_api_client/v2/model/ticket_creation_rule_action.py new file mode 100644 index 0000000000..73d4f18f8a --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_action.py @@ -0,0 +1,84 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ticket_creation_target import TicketCreationTarget + + +class TicketCreationRuleAction(ModelNormal): + validations = { + "max_tickets_per_day": { + "inclusive_maximum": 500, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_target import TicketCreationTarget + + return { + "assignee_id": (UUID,), + "fields": (dict,), + "max_tickets_per_day": (int,), + "project_id": (UUID,), + "target": (TicketCreationTarget,), + } + + attribute_map = { + "assignee_id": "assignee_id", + "fields": "fields", + "max_tickets_per_day": "max_tickets_per_day", + "project_id": "project_id", + "target": "target", + } + + def __init__( + self_, + max_tickets_per_day: int, + project_id: UUID, + target: TicketCreationTarget, + assignee_id: Union[UUID, UnsetType] = unset, + fields: Union[dict, UnsetType] = unset, + **kwargs, + ): + """ + The action to take when the ticket creation rule matches a finding. + + :param assignee_id: The UUID of the default assignee for created tickets. + :type assignee_id: UUID, optional + + :param fields: Custom fields of the Jira issue to create. For the list of available fields, see `Jira documentation `_. + :type fields: dict, optional + + :param max_tickets_per_day: The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + :type max_tickets_per_day: int + + :param project_id: The UUID of the case management project. + :type project_id: UUID + + :param target: The ticketing system to create tickets in. + :type target: TicketCreationTarget + """ + if assignee_id is not unset: + kwargs["assignee_id"] = assignee_id + if fields is not unset: + kwargs["fields"] = fields + super().__init__(kwargs) + + self_.max_tickets_per_day = max_tickets_per_day + self_.project_id = project_id + self_.target = target diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_action_response.py b/src/datadog_api_client/v2/model/ticket_creation_rule_action_response.py new file mode 100644 index 0000000000..6b1f32f64c --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_action_response.py @@ -0,0 +1,92 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ticket_creation_target import TicketCreationTarget + + +class TicketCreationRuleActionResponse(ModelNormal): + validations = { + "max_tickets_per_day": { + "inclusive_maximum": 500, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_target import TicketCreationTarget + + return { + "assignee_id": (UUID,), + "auto_disabled_reason": (str,), + "fields": (dict,), + "max_tickets_per_day": (int,), + "project_id": (UUID,), + "target": (TicketCreationTarget,), + } + + attribute_map = { + "assignee_id": "assignee_id", + "auto_disabled_reason": "auto_disabled_reason", + "fields": "fields", + "max_tickets_per_day": "max_tickets_per_day", + "project_id": "project_id", + "target": "target", + } + + def __init__( + self_, + max_tickets_per_day: int, + project_id: UUID, + target: TicketCreationTarget, + assignee_id: Union[UUID, UnsetType] = unset, + auto_disabled_reason: Union[str, UnsetType] = unset, + fields: Union[dict, UnsetType] = unset, + **kwargs, + ): + """ + The action to take when the ticket creation rule matches a finding. + + :param assignee_id: The UUID of the default assignee for created tickets. + :type assignee_id: UUID, optional + + :param auto_disabled_reason: The reason the rule was automatically disabled by the system due to a ticketing integration error. + :type auto_disabled_reason: str, optional + + :param fields: Custom fields of the Jira issue to create. For the list of available fields, see `Jira documentation `_. + :type fields: dict, optional + + :param max_tickets_per_day: The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + :type max_tickets_per_day: int + + :param project_id: The UUID of the case management project. + :type project_id: UUID + + :param target: The ticketing system to create tickets in. + :type target: TicketCreationTarget + """ + if assignee_id is not unset: + kwargs["assignee_id"] = assignee_id + if auto_disabled_reason is not unset: + kwargs["auto_disabled_reason"] = auto_disabled_reason + if fields is not unset: + kwargs["fields"] = fields + super().__init__(kwargs) + + self_.max_tickets_per_day = max_tickets_per_day + self_.project_id = project_id + self_.target = target diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_attributes_create.py b/src/datadog_api_client/v2/model/ticket_creation_rule_attributes_create.py new file mode 100644 index 0000000000..56ce3efb72 --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_attributes_create.py @@ -0,0 +1,77 @@ +# 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.ticket_creation_rule_action import TicketCreationRuleAction + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + +class TicketCreationRuleAttributesCreate(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_action import TicketCreationRuleAction + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + return { + "action": (TicketCreationRuleAction,), + "enabled": (bool,), + "name": (str,), + "rule": (AutomationRuleScope,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: TicketCreationRuleAction, + name: str, + rule: AutomationRuleScope, + enabled: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating or updating a ticket creation rule. + + :param action: The action to take when the ticket creation rule matches a finding. + :type action: TicketCreationRuleAction + + :param enabled: Whether the ticket creation rule is enabled. + :type enabled: bool, optional + + :param name: The name of the ticket creation rule. + :type name: str + + :param rule: Defines the scope of findings to which the automation rule applies. + :type rule: AutomationRuleScope + """ + if enabled is not unset: + kwargs["enabled"] = enabled + super().__init__(kwargs) + + self_.action = action + self_.name = name + self_.rule = rule diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_attributes_response.py b/src/datadog_api_client/v2/model/ticket_creation_rule_attributes_response.py new file mode 100644 index 0000000000..2bd6b537b3 --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_attributes_response.py @@ -0,0 +1,106 @@ +# 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.ticket_creation_rule_action_response import TicketCreationRuleActionResponse + from datadog_api_client.v2.model.automation_rule_created_by import AutomationRuleCreatedBy + from datadog_api_client.v2.model.automation_rule_modified_by import AutomationRuleModifiedBy + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + +class TicketCreationRuleAttributesResponse(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_action_response import TicketCreationRuleActionResponse + from datadog_api_client.v2.model.automation_rule_created_by import AutomationRuleCreatedBy + from datadog_api_client.v2.model.automation_rule_modified_by import AutomationRuleModifiedBy + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + return { + "action": (TicketCreationRuleActionResponse,), + "created_at": (int,), + "created_by": (AutomationRuleCreatedBy,), + "enabled": (bool,), + "modified_at": (int,), + "modified_by": (AutomationRuleModifiedBy,), + "name": (str,), + "rule": (AutomationRuleScope,), + } + + attribute_map = { + "action": "action", + "created_at": "created_at", + "created_by": "created_by", + "enabled": "enabled", + "modified_at": "modified_at", + "modified_by": "modified_by", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: TicketCreationRuleActionResponse, + created_at: int, + created_by: AutomationRuleCreatedBy, + enabled: bool, + modified_at: int, + modified_by: AutomationRuleModifiedBy, + name: str, + rule: AutomationRuleScope, + **kwargs, + ): + """ + Attributes of a ticket creation rule returned by the API. + + :param action: The action to take when the ticket creation rule matches a finding. + :type action: TicketCreationRuleActionResponse + + :param created_at: The Unix timestamp in milliseconds when the rule was created. + :type created_at: int + + :param created_by: The user or Datadog system who created the rule. + :type created_by: AutomationRuleCreatedBy + + :param enabled: Whether the ticket creation rule is enabled. + :type enabled: bool + + :param modified_at: The Unix timestamp in milliseconds when the rule was last modified. + :type modified_at: int + + :param modified_by: The user or Datadog system who last modified the rule. + :type modified_by: AutomationRuleModifiedBy + + :param name: The name of the ticket creation rule. + :type name: str + + :param rule: Defines the scope of findings to which the automation rule applies. + :type rule: AutomationRuleScope + """ + super().__init__(kwargs) + + self_.action = action + self_.created_at = created_at + self_.created_by = created_by + self_.enabled = enabled + self_.modified_at = modified_at + self_.modified_by = modified_by + self_.name = name + self_.rule = rule diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_create_request.py b/src/datadog_api_client/v2/model/ticket_creation_rule_create_request.py new file mode 100644 index 0000000000..14ce09e396 --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_create_request.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.ticket_creation_rule_data_create import TicketCreationRuleDataCreate + + +class TicketCreationRuleCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_data_create import TicketCreationRuleDataCreate + + return { + "data": (TicketCreationRuleDataCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TicketCreationRuleDataCreate, **kwargs): + """ + The body of a ticket creation rule create request. + + :param data: The data object for a ticket creation rule create or update request. + :type data: TicketCreationRuleDataCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_data_create.py b/src/datadog_api_client/v2/model/ticket_creation_rule_data_create.py new file mode 100644 index 0000000000..5768ffbfcd --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_data_create.py @@ -0,0 +1,50 @@ +# 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.ticket_creation_rule_attributes_create import TicketCreationRuleAttributesCreate + from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType + + +class TicketCreationRuleDataCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_attributes_create import ( + TicketCreationRuleAttributesCreate, + ) + from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType + + return { + "attributes": (TicketCreationRuleAttributesCreate,), + "type": (TicketCreationRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: TicketCreationRuleAttributesCreate, type: TicketCreationRuleType, **kwargs): + """ + The data object for a ticket creation rule create or update request. + + :param attributes: Attributes for creating or updating a ticket creation rule. + :type attributes: TicketCreationRuleAttributesCreate + + :param type: The JSON:API type for ticket creation rules. + :type type: TicketCreationRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_data_response.py b/src/datadog_api_client/v2/model/ticket_creation_rule_data_response.py new file mode 100644 index 0000000000..976dd97e57 --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_data_response.py @@ -0,0 +1,61 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ticket_creation_rule_attributes_response import ( + TicketCreationRuleAttributesResponse, + ) + from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType + + +class TicketCreationRuleDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_attributes_response import ( + TicketCreationRuleAttributesResponse, + ) + from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType + + return { + "attributes": (TicketCreationRuleAttributesResponse,), + "id": (UUID,), + "type": (TicketCreationRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: TicketCreationRuleAttributesResponse, id: UUID, type: TicketCreationRuleType, **kwargs + ): + """ + The data object for a ticket creation rule returned by the API. + + :param attributes: Attributes of a ticket creation rule returned by the API. + :type attributes: TicketCreationRuleAttributesResponse + + :param id: The ID of the ticket creation rule. + :type id: UUID + + :param type: The JSON:API type for ticket creation rules. + :type type: TicketCreationRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_reorder_item.py b/src/datadog_api_client/v2/model/ticket_creation_rule_reorder_item.py new file mode 100644 index 0000000000..b9d7b6b28b --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_reorder_item.py @@ -0,0 +1,47 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType + + +class TicketCreationRuleReorderItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType + + return { + "id": (UUID,), + "type": (TicketCreationRuleType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: TicketCreationRuleType, **kwargs): + """ + A reference to a ticket creation rule used for reordering. + + :param id: The ID of the automation rule. + :type id: UUID + + :param type: The JSON:API type for ticket creation rules. + :type type: TicketCreationRuleType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_reorder_request.py b/src/datadog_api_client/v2/model/ticket_creation_rule_reorder_request.py new file mode 100644 index 0000000000..cda27e887a --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_reorder_request.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.ticket_creation_rule_reorder_item import TicketCreationRuleReorderItem + + +class TicketCreationRuleReorderRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_reorder_item import TicketCreationRuleReorderItem + + return { + "data": ([TicketCreationRuleReorderItem],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[TicketCreationRuleReorderItem], **kwargs): + """ + The body of the ticket creation rule reorder request. + + :param data: The ordered list of all ticket creation rules; every rule must be included. + :type data: [TicketCreationRuleReorderItem] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_response.py b/src/datadog_api_client/v2/model/ticket_creation_rule_response.py new file mode 100644 index 0000000000..bd8607275b --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_response.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.ticket_creation_rule_data_response import TicketCreationRuleDataResponse + + +class TicketCreationRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_data_response import TicketCreationRuleDataResponse + + return { + "data": (TicketCreationRuleDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TicketCreationRuleDataResponse, **kwargs): + """ + A single ticket creation rule response. + + :param data: The data object for a ticket creation rule returned by the API. + :type data: TicketCreationRuleDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_type.py b/src/datadog_api_client/v2/model/ticket_creation_rule_type.py new file mode 100644 index 0000000000..c7736103d5 --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_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 TicketCreationRuleType(ModelSimple): + """ + The JSON:API type for ticket creation rules. + + :param value: If omitted defaults to "ticket_creation_rules". Must be one of ["ticket_creation_rules"]. + :type value: str + """ + + allowed_values = { + "ticket_creation_rules", + } + TICKET_CREATION_RULES: ClassVar["TicketCreationRuleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TicketCreationRuleType.TICKET_CREATION_RULES = TicketCreationRuleType("ticket_creation_rules") diff --git a/src/datadog_api_client/v2/model/ticket_creation_rule_update_request.py b/src/datadog_api_client/v2/model/ticket_creation_rule_update_request.py new file mode 100644 index 0000000000..af9845da0d --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rule_update_request.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.ticket_creation_rule_data_create import TicketCreationRuleDataCreate + + +class TicketCreationRuleUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_data_create import TicketCreationRuleDataCreate + + return { + "data": (TicketCreationRuleDataCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TicketCreationRuleDataCreate, **kwargs): + """ + The body of a ticket creation rule update request. + + :param data: The data object for a ticket creation rule create or update request. + :type data: TicketCreationRuleDataCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/ticket_creation_rules_response.py b/src/datadog_api_client/v2/model/ticket_creation_rules_response.py new file mode 100644 index 0000000000..80a0733abc --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_rules_response.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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.ticket_creation_rule_data_response import TicketCreationRuleDataResponse + from datadog_api_client.v2.model.security_automation_rules_links import SecurityAutomationRulesLinks + from datadog_api_client.v2.model.security_automation_rules_meta import SecurityAutomationRulesMeta + + +class TicketCreationRulesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.ticket_creation_rule_data_response import TicketCreationRuleDataResponse + from datadog_api_client.v2.model.security_automation_rules_links import SecurityAutomationRulesLinks + from datadog_api_client.v2.model.security_automation_rules_meta import SecurityAutomationRulesMeta + + return { + "data": ([TicketCreationRuleDataResponse],), + "links": (SecurityAutomationRulesLinks,), + "meta": (SecurityAutomationRulesMeta,), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: List[TicketCreationRuleDataResponse], + links: SecurityAutomationRulesLinks, + meta: SecurityAutomationRulesMeta, + **kwargs, + ): + """ + A list of ticket creation rules with pagination metadata. + + :param data: A list of ticket creation rule data objects. + :type data: [TicketCreationRuleDataResponse] + + :param links: Pagination links for the list of automation rules. + :type links: SecurityAutomationRulesLinks + + :param meta: Metadata for the list of automation rules. + :type meta: SecurityAutomationRulesMeta + """ + super().__init__(kwargs) + + self_.data = data + self_.links = links + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/ticket_creation_target.py b/src/datadog_api_client/v2/model/ticket_creation_target.py new file mode 100644 index 0000000000..cccffe441a --- /dev/null +++ b/src/datadog_api_client/v2/model/ticket_creation_target.py @@ -0,0 +1,38 @@ +# 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 TicketCreationTarget(ModelSimple): + """ + The ticketing system to create tickets in. + + :param value: Must be one of ["jira", "case_management"]. + :type value: str + """ + + allowed_values = { + "jira", + "case_management", + } + JIRA: ClassVar["TicketCreationTarget"] + CASE_MANAGEMENT: ClassVar["TicketCreationTarget"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TicketCreationTarget.JIRA = TicketCreationTarget("jira") +TicketCreationTarget.CASE_MANAGEMENT = TicketCreationTarget("case_management") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 0910910737..63f7f0c551 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -685,12 +685,16 @@ from datadog_api_client.v2.model.automation_rule_action import AutomationRuleAction from datadog_api_client.v2.model.automation_rule_action_data import AutomationRuleActionData from datadog_api_client.v2.model.automation_rule_action_type import AutomationRuleActionType +from datadog_api_client.v2.model.automation_rule_actor_type import AutomationRuleActorType from datadog_api_client.v2.model.automation_rule_attributes import AutomationRuleAttributes from datadog_api_client.v2.model.automation_rule_create import AutomationRuleCreate from datadog_api_client.v2.model.automation_rule_create_attributes import AutomationRuleCreateAttributes from datadog_api_client.v2.model.automation_rule_create_request import AutomationRuleCreateRequest +from datadog_api_client.v2.model.automation_rule_created_by import AutomationRuleCreatedBy +from datadog_api_client.v2.model.automation_rule_modified_by import AutomationRuleModifiedBy from datadog_api_client.v2.model.automation_rule_relationships import AutomationRuleRelationships from datadog_api_client.v2.model.automation_rule_response import AutomationRuleResponse +from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope from datadog_api_client.v2.model.automation_rule_trigger import AutomationRuleTrigger from datadog_api_client.v2.model.automation_rule_trigger_data import AutomationRuleTriggerData from datadog_api_client.v2.model.automation_rule_trigger_type import AutomationRuleTriggerType @@ -2369,6 +2373,21 @@ from datadog_api_client.v2.model.downtime_update_request import DowntimeUpdateRequest from datadog_api_client.v2.model.downtime_update_request_attributes import DowntimeUpdateRequestAttributes from datadog_api_client.v2.model.downtime_update_request_data import DowntimeUpdateRequestData +from datadog_api_client.v2.model.due_date_from import DueDateFrom +from datadog_api_client.v2.model.due_date_per_severity_item import DueDatePerSeverityItem +from datadog_api_client.v2.model.due_date_rule_action import DueDateRuleAction +from datadog_api_client.v2.model.due_date_rule_attributes_create import DueDateRuleAttributesCreate +from datadog_api_client.v2.model.due_date_rule_attributes_response import DueDateRuleAttributesResponse +from datadog_api_client.v2.model.due_date_rule_create_request import DueDateRuleCreateRequest +from datadog_api_client.v2.model.due_date_rule_data_create import DueDateRuleDataCreate +from datadog_api_client.v2.model.due_date_rule_data_response import DueDateRuleDataResponse +from datadog_api_client.v2.model.due_date_rule_reorder_item import DueDateRuleReorderItem +from datadog_api_client.v2.model.due_date_rule_reorder_request import DueDateRuleReorderRequest +from datadog_api_client.v2.model.due_date_rule_response import DueDateRuleResponse +from datadog_api_client.v2.model.due_date_rule_type import DueDateRuleType +from datadog_api_client.v2.model.due_date_rule_update_request import DueDateRuleUpdateRequest +from datadog_api_client.v2.model.due_date_rules_response import DueDateRulesResponse +from datadog_api_client.v2.model.due_date_severity import DueDateSeverity from datadog_api_client.v2.model.elf_sourcemap_attributes import ELFSourcemapAttributes from datadog_api_client.v2.model.elf_sourcemap_data import ELFSourcemapData from datadog_api_client.v2.model.epss import EPSS @@ -4771,6 +4790,19 @@ from datadog_api_client.v2.model.mute_findings_request_data_relationships import MuteFindingsRequestDataRelationships from datadog_api_client.v2.model.mute_findings_response import MuteFindingsResponse from datadog_api_client.v2.model.mute_findings_response_data import MuteFindingsResponseData +from datadog_api_client.v2.model.mute_reason import MuteReason +from datadog_api_client.v2.model.mute_rule_action import MuteRuleAction +from datadog_api_client.v2.model.mute_rule_attributes_create import MuteRuleAttributesCreate +from datadog_api_client.v2.model.mute_rule_attributes_response import MuteRuleAttributesResponse +from datadog_api_client.v2.model.mute_rule_create_request import MuteRuleCreateRequest +from datadog_api_client.v2.model.mute_rule_data_create import MuteRuleDataCreate +from datadog_api_client.v2.model.mute_rule_data_response import MuteRuleDataResponse +from datadog_api_client.v2.model.mute_rule_reorder_item import MuteRuleReorderItem +from datadog_api_client.v2.model.mute_rule_reorder_request import MuteRuleReorderRequest +from datadog_api_client.v2.model.mute_rule_response import MuteRuleResponse +from datadog_api_client.v2.model.mute_rule_type import MuteRuleType +from datadog_api_client.v2.model.mute_rule_update_request import MuteRuleUpdateRequest +from datadog_api_client.v2.model.mute_rules_response import MuteRulesResponse from datadog_api_client.v2.model.ndk_sourcemap_attributes import NDKSourcemapAttributes from datadog_api_client.v2.model.ndk_sourcemap_data import NDKSourcemapData from datadog_api_client.v2.model.network_health_insight import NetworkHealthInsight @@ -6997,6 +7029,9 @@ from datadog_api_client.v2.model.secure_embed_update_response_type import SecureEmbedUpdateResponseType from datadog_api_client.v2.model.secure_embed_viewing_preferences import SecureEmbedViewingPreferences from datadog_api_client.v2.model.secure_embed_viewing_preferences_theme import SecureEmbedViewingPreferencesTheme +from datadog_api_client.v2.model.security_automation_rules_links import SecurityAutomationRulesLinks +from datadog_api_client.v2.model.security_automation_rules_meta import SecurityAutomationRulesMeta +from datadog_api_client.v2.model.security_automation_rules_page_info import SecurityAutomationRulesPageInfo from datadog_api_client.v2.model.security_entity_config_risks import SecurityEntityConfigRisks from datadog_api_client.v2.model.security_entity_metadata import SecurityEntityMetadata from datadog_api_client.v2.model.security_entity_risk_score import SecurityEntityRiskScore @@ -7028,6 +7063,7 @@ from datadog_api_client.v2.model.security_filter_version_type import SecurityFilterVersionType from datadog_api_client.v2.model.security_filter_versions_response import SecurityFilterVersionsResponse from datadog_api_client.v2.model.security_filters_response import SecurityFiltersResponse +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType from datadog_api_client.v2.model.security_findings_attributes import SecurityFindingsAttributes from datadog_api_client.v2.model.security_findings_data import SecurityFindingsData from datadog_api_client.v2.model.security_findings_data_type import SecurityFindingsDataType @@ -8784,6 +8820,20 @@ from datadog_api_client.v2.model.test_optimization_update_service_settings_request_data_type import ( TestOptimizationUpdateServiceSettingsRequestDataType, ) +from datadog_api_client.v2.model.ticket_creation_rule_action import TicketCreationRuleAction +from datadog_api_client.v2.model.ticket_creation_rule_action_response import TicketCreationRuleActionResponse +from datadog_api_client.v2.model.ticket_creation_rule_attributes_create import TicketCreationRuleAttributesCreate +from datadog_api_client.v2.model.ticket_creation_rule_attributes_response import TicketCreationRuleAttributesResponse +from datadog_api_client.v2.model.ticket_creation_rule_create_request import TicketCreationRuleCreateRequest +from datadog_api_client.v2.model.ticket_creation_rule_data_create import TicketCreationRuleDataCreate +from datadog_api_client.v2.model.ticket_creation_rule_data_response import TicketCreationRuleDataResponse +from datadog_api_client.v2.model.ticket_creation_rule_reorder_item import TicketCreationRuleReorderItem +from datadog_api_client.v2.model.ticket_creation_rule_reorder_request import TicketCreationRuleReorderRequest +from datadog_api_client.v2.model.ticket_creation_rule_response import TicketCreationRuleResponse +from datadog_api_client.v2.model.ticket_creation_rule_type import TicketCreationRuleType +from datadog_api_client.v2.model.ticket_creation_rule_update_request import TicketCreationRuleUpdateRequest +from datadog_api_client.v2.model.ticket_creation_rules_response import TicketCreationRulesResponse +from datadog_api_client.v2.model.ticket_creation_target import TicketCreationTarget from datadog_api_client.v2.model.time_restriction import TimeRestriction from datadog_api_client.v2.model.time_restrictions import TimeRestrictions from datadog_api_client.v2.model.timeline_cell import TimelineCell @@ -9802,12 +9852,16 @@ "AutomationRuleAction", "AutomationRuleActionData", "AutomationRuleActionType", + "AutomationRuleActorType", "AutomationRuleAttributes", "AutomationRuleCreate", "AutomationRuleCreateAttributes", "AutomationRuleCreateRequest", + "AutomationRuleCreatedBy", + "AutomationRuleModifiedBy", "AutomationRuleRelationships", "AutomationRuleResponse", + "AutomationRuleScope", "AutomationRuleTrigger", "AutomationRuleTriggerData", "AutomationRuleTriggerType", @@ -11074,6 +11128,21 @@ "DowntimeUpdateRequest", "DowntimeUpdateRequestAttributes", "DowntimeUpdateRequestData", + "DueDateFrom", + "DueDatePerSeverityItem", + "DueDateRuleAction", + "DueDateRuleAttributesCreate", + "DueDateRuleAttributesResponse", + "DueDateRuleCreateRequest", + "DueDateRuleDataCreate", + "DueDateRuleDataResponse", + "DueDateRuleReorderItem", + "DueDateRuleReorderRequest", + "DueDateRuleResponse", + "DueDateRuleType", + "DueDateRuleUpdateRequest", + "DueDateRulesResponse", + "DueDateSeverity", "ELFSourcemapAttributes", "ELFSourcemapData", "EPSS", @@ -12920,6 +12989,19 @@ "MuteFindingsRequestDataRelationships", "MuteFindingsResponse", "MuteFindingsResponseData", + "MuteReason", + "MuteRuleAction", + "MuteRuleAttributesCreate", + "MuteRuleAttributesResponse", + "MuteRuleCreateRequest", + "MuteRuleDataCreate", + "MuteRuleDataResponse", + "MuteRuleReorderItem", + "MuteRuleReorderRequest", + "MuteRuleResponse", + "MuteRuleType", + "MuteRuleUpdateRequest", + "MuteRulesResponse", "NDKSourcemapAttributes", "NDKSourcemapData", "NetworkHealthInsight", @@ -14348,6 +14430,9 @@ "SecureEmbedUpdateResponseType", "SecureEmbedViewingPreferences", "SecureEmbedViewingPreferencesTheme", + "SecurityAutomationRulesLinks", + "SecurityAutomationRulesMeta", + "SecurityAutomationRulesPageInfo", "SecurityEntityConfigRisks", "SecurityEntityMetadata", "SecurityEntityRiskScore", @@ -14377,6 +14462,7 @@ "SecurityFilterVersionType", "SecurityFilterVersionsResponse", "SecurityFiltersResponse", + "SecurityFindingType", "SecurityFindingsAttributes", "SecurityFindingsData", "SecurityFindingsDataType", @@ -15509,6 +15595,20 @@ "TestOptimizationUpdateServiceSettingsRequestAttributes", "TestOptimizationUpdateServiceSettingsRequestData", "TestOptimizationUpdateServiceSettingsRequestDataType", + "TicketCreationRuleAction", + "TicketCreationRuleActionResponse", + "TicketCreationRuleAttributesCreate", + "TicketCreationRuleAttributesResponse", + "TicketCreationRuleCreateRequest", + "TicketCreationRuleDataCreate", + "TicketCreationRuleDataResponse", + "TicketCreationRuleReorderItem", + "TicketCreationRuleReorderRequest", + "TicketCreationRuleResponse", + "TicketCreationRuleType", + "TicketCreationRuleUpdateRequest", + "TicketCreationRulesResponse", + "TicketCreationTarget", "TimeRestriction", "TimeRestrictions", "TimelineCell", diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_due_date_rule_returns_successfully_created_the_due_date_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_due_date_rule_returns_successfully_created_the_due_date_rule_response.frozen new file mode 100644 index 0000000000..f80d953763 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_due_date_rule_returns_successfully_created_the_due_date_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:00.178Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_due_date_rule_returns_successfully_created_the_due_date_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_due_date_rule_returns_successfully_created_the_due_date_rule_response.yaml new file mode 100644 index 0000000000..80ee4df64f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_due_date_rule_returns_successfully_created_the_due_date_rule_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response-1781624460","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + string: '{"data":{"id":"51eb64b5-a519-408a-961a-137e4fe31d3c","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624462372,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624462372,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response-1781624460","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/51eb64b5-a519-408a-961a-137e4fe31d3c + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_mute_rule_returns_successfully_created_the_mute_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_mute_rule_returns_successfully_created_the_mute_rule_response.frozen new file mode 100644 index 0000000000..43ceab1103 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_mute_rule_returns_successfully_created_the_mute_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:02.989Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_mute_rule_returns_successfully_created_the_mute_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_mute_rule_returns_successfully_created_the_mute_rule_response.yaml new file mode 100644 index 0000000000..b775db08e9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_mute_rule_returns_successfully_created_the_mute_rule_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response-1781624462","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + string: '{"data":{"id":"a23423e0-da14-4698-9c01-7897eb56b76c","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624463227,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624463227,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response-1781624462","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/a23423e0-da14-4698-9c01-7897eb56b76c + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_ticket_creation_rule_returns_successfully_created_the_ticket_creation_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_ticket_creation_rule_returns_successfully_created_the_ticket_creation_rule_response.frozen new file mode 100644 index 0000000000..65bc80d9bd --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_ticket_creation_rule_returns_successfully_created_the_ticket_creation_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:03.837Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_ticket_creation_rule_returns_successfully_created_the_ticket_creation_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_ticket_creation_rule_returns_successfully_created_the_ticket_creation_rule_response.yaml new file mode 100644 index 0000000000..7a2f94a051 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_ticket_creation_rule_returns_successfully_created_the_ticket_creation_rule_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response-1781624463","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + string: '{"data":{"id":"c24fb7cb-e877-491e-ae6e-2e8676b20dcb","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624464096,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624464096,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response-1781624463","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/c24fb7cb-e877-491e-ae6e-2e8676b20dcb + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_due_date_rule_returns_rule_successfully_deleted_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_due_date_rule_returns_rule_successfully_deleted_response.frozen new file mode 100644 index 0000000000..a1ce401859 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_due_date_rule_returns_rule_successfully_deleted_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:04.669Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_due_date_rule_returns_rule_successfully_deleted_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_due_date_rule_returns_rule_successfully_deleted_response.yaml new file mode 100644 index 0000000000..dc3fecc08e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_due_date_rule_returns_rule_successfully_deleted_response.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Delete_a_due_date_rule_returns_Rule_successfully_deleted_response-1781624464","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + string: '{"data":{"id":"139c64ad-97f6-4b26-8579-05a2e2792b6c","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624464907,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624464907,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Delete_a_due_date_rule_returns_Rule_successfully_deleted_response-1781624464","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/139c64ad-97f6-4b26-8579-05a2e2792b6c + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/139c64ad-97f6-4b26-8579-05a2e2792b6c + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.frozen new file mode 100644 index 0000000000..09f9f0ac51 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:05.734Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.yaml new file mode 100644 index 0000000000..beab5405b7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1781624465","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + string: '{"data":{"id":"03c9e010-5a46-40b2-af26-5ff613828897","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624465962,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624465962,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1781624465","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/03c9e010-5a46-40b2-af26-5ff613828897 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/03c9e010-5a46-40b2-af26-5ff613828897 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_ticket_creation_rule_returns_rule_successfully_deleted_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_ticket_creation_rule_returns_rule_successfully_deleted_response.frozen new file mode 100644 index 0000000000..6ce75cad4a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_ticket_creation_rule_returns_rule_successfully_deleted_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:06.806Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_ticket_creation_rule_returns_rule_successfully_deleted_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_ticket_creation_rule_returns_rule_successfully_deleted_response.yaml new file mode 100644 index 0000000000..4395197268 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_ticket_creation_rule_returns_rule_successfully_deleted_response.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response-1781624466","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + string: '{"data":{"id":"6b2c813c-cd92-4531-b4aa-f79e1194bcb2","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624467064,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624467064,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response-1781624466","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/6b2c813c-cd92-4531-b4aa-f79e1194bcb2 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/6b2c813c-cd92-4531-b4aa-f79e1194bcb2 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_due_date_rule_returns_successfully_retrieved_the_due_date_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_due_date_rule_returns_successfully_retrieved_the_due_date_rule_response.frozen new file mode 100644 index 0000000000..55413b6c7b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_due_date_rule_returns_successfully_retrieved_the_due_date_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:07.946Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_due_date_rule_returns_successfully_retrieved_the_due_date_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_due_date_rule_returns_successfully_retrieved_the_due_date_rule_response.yaml new file mode 100644 index 0000000000..927f777ee4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_due_date_rule_returns_successfully_retrieved_the_due_date_rule_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + string: '{"data":{"id":"7842abcf-795f-47cd-b6ba-6e05790668d5","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624468200,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624468200,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/7842abcf-795f-47cd-b6ba-6e05790668d5 + response: + body: + string: '{"data":{"id":"7842abcf-795f-47cd-b6ba-6e05790668d5","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624468200,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624468200,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/7842abcf-795f-47cd-b6ba-6e05790668d5 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_mute_rule_returns_successfully_retrieved_the_mute_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_mute_rule_returns_successfully_retrieved_the_mute_rule_response.frozen new file mode 100644 index 0000000000..865b604abf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_mute_rule_returns_successfully_retrieved_the_mute_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:09.039Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_mute_rule_returns_successfully_retrieved_the_mute_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_mute_rule_returns_successfully_retrieved_the_mute_rule_response.yaml new file mode 100644 index 0000000000..3062118168 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_mute_rule_returns_successfully_retrieved_the_mute_rule_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + string: '{"data":{"id":"66330741-04f8-43cc-8cd0-a4840a593658","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624469277,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624469277,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/66330741-04f8-43cc-8cd0-a4840a593658 + response: + body: + string: '{"data":{"id":"66330741-04f8-43cc-8cd0-a4840a593658","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624469277,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624469277,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/66330741-04f8-43cc-8cd0-a4840a593658 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_ticket_creation_rule_returns_successfully_retrieved_the_ticket_creation_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_ticket_creation_rule_returns_successfully_retrieved_the_ticket_creation_rule_response.frozen new file mode 100644 index 0000000000..392abe6d03 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_ticket_creation_rule_returns_successfully_retrieved_the_ticket_creation_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:10.163Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_ticket_creation_rule_returns_successfully_retrieved_the_ticket_creation_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_ticket_creation_rule_returns_successfully_retrieved_the_ticket_creation_rule_response.yaml new file mode 100644 index 0000000000..0e2acbc6d8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_ticket_creation_rule_returns_successfully_retrieved_the_ticket_creation_rule_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + string: '{"data":{"id":"065f00af-171c-4ecc-853d-ddb4c8e30c7b","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624470412,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624470412,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/065f00af-171c-4ecc-853d-ddb4c8e30c7b + response: + body: + string: '{"data":{"id":"065f00af-171c-4ecc-853d-ddb4c8e30c7b","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624470412,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624470412,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/065f00af-171c-4ecc-853d-ddb4c8e30c7b + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_due_date_rules_returns_successfully_retrieved_the_list_of_due_date_rules_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_due_date_rules_returns_successfully_retrieved_the_list_of_due_date_rules_response.frozen new file mode 100644 index 0000000000..2f74959337 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_due_date_rules_returns_successfully_retrieved_the_list_of_due_date_rules_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:11.482Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_due_date_rules_returns_successfully_retrieved_the_list_of_due_date_rules_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_due_date_rules_returns_successfully_retrieved_the_list_of_due_date_rules_response.yaml new file mode 100644 index 0000000000..2504fa5f13 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_due_date_rules_returns_successfully_retrieved_the_list_of_due_date_rules_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + string: '{"data":{"id":"1c8622b9-591f-472c-97ff-cac4c5a7cfe5","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624471720,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624471720,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + string: '{"data":[{"id":"1c8622b9-591f-472c-97ff-cac4c5a7cfe5","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624471720,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624471720,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}],"meta":{"page":{"total_filtered_count":1}},"links":{"first":"/api/v2/security/findings/automation/due_date_rules?page[size]=1000\u0026page[number]=0","last":"/api/v2/security/findings/automation/due_date_rules?page[size]=1000\u0026page[number]=0"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/1c8622b9-591f-472c-97ff-cac4c5a7cfe5 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_mute_rules_returns_successfully_retrieved_the_list_of_mute_rules_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_mute_rules_returns_successfully_retrieved_the_list_of_mute_rules_response.frozen new file mode 100644 index 0000000000..89c620816b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_mute_rules_returns_successfully_retrieved_the_list_of_mute_rules_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:12.599Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_mute_rules_returns_successfully_retrieved_the_list_of_mute_rules_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_mute_rules_returns_successfully_retrieved_the_list_of_mute_rules_response.yaml new file mode 100644 index 0000000000..c5e1e1a695 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_mute_rules_returns_successfully_retrieved_the_list_of_mute_rules_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + string: '{"data":{"id":"4c72a302-c7c8-42bc-986a-f196580240c3","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624472865,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624472865,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + string: '{"data":[{"id":"4c72a302-c7c8-42bc-986a-f196580240c3","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624472865,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624472865,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}],"meta":{"page":{"total_filtered_count":1}},"links":{"first":"/api/v2/security/findings/automation/mute_rules?page[size]=1000\u0026page[number]=0","last":"/api/v2/security/findings/automation/mute_rules?page[size]=1000\u0026page[number]=0"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/4c72a302-c7c8-42bc-986a-f196580240c3 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_ticket_creation_rules_returns_successfully_retrieved_the_list_of_ticket_creation_rules_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_ticket_creation_rules_returns_successfully_retrieved_the_list_of_ticket_creation_rules_response.frozen new file mode 100644 index 0000000000..f3b009f910 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_ticket_creation_rules_returns_successfully_retrieved_the_list_of_ticket_creation_rules_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:13.714Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_ticket_creation_rules_returns_successfully_retrieved_the_list_of_ticket_creation_rules_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_ticket_creation_rules_returns_successfully_retrieved_the_list_of_ticket_creation_rules_response.yaml new file mode 100644 index 0000000000..63ccb630b7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_ticket_creation_rules_returns_successfully_retrieved_the_list_of_ticket_creation_rules_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + string: '{"data":{"id":"399d69c3-6fcd-4538-b0cc-05e6db5aac38","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624473944,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624473944,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + string: '{"data":[{"id":"399d69c3-6fcd-4538-b0cc-05e6db5aac38","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624473944,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624473944,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}],"meta":{"page":{"total_filtered_count":1}},"links":{"first":"/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000\u0026page[number]=0","last":"/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000\u0026page[number]=0"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/399d69c3-6fcd-4538-b0cc-05e6db5aac38 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_reorder_due_date_rules_returns_successfully_reordered_the_due_date_rules_response.frozen b/tests/v2/cassettes/test_scenarios/test_reorder_due_date_rules_returns_successfully_reordered_the_due_date_rules_response.frozen new file mode 100644 index 0000000000..c7ce8f75a4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_reorder_due_date_rules_returns_successfully_reordered_the_due_date_rules_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:14.824Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_reorder_due_date_rules_returns_successfully_reordered_the_due_date_rules_response.yaml b/tests/v2/cassettes/test_scenarios/test_reorder_due_date_rules_returns_successfully_reordered_the_due_date_rules_response.yaml new file mode 100644 index 0000000000..42af330841 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_reorder_due_date_rules_returns_successfully_reordered_the_due_date_rules_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response-1781624474","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + string: '{"data":{"id":"64e53941-8eba-42f9-946b-6422bead1eea","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624475039,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624475039,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response-1781624474","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":[{"id":"64e53941-8eba-42f9-946b-6422bead1eea","type":"due_date_rules"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/reorder + response: + body: + string: '{"data":[{"type":"due_date_rules","id":"64e53941-8eba-42f9-946b-6422bead1eea"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/64e53941-8eba-42f9-946b-6422bead1eea + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_reorder_mute_rules_returns_successfully_reordered_the_mute_rules_response.frozen b/tests/v2/cassettes/test_scenarios/test_reorder_mute_rules_returns_successfully_reordered_the_mute_rules_response.frozen new file mode 100644 index 0000000000..a7c62ff975 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_reorder_mute_rules_returns_successfully_reordered_the_mute_rules_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:16.028Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_reorder_mute_rules_returns_successfully_reordered_the_mute_rules_response.yaml b/tests/v2/cassettes/test_scenarios/test_reorder_mute_rules_returns_successfully_reordered_the_mute_rules_response.yaml new file mode 100644 index 0000000000..accd373f8c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_reorder_mute_rules_returns_successfully_reordered_the_mute_rules_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response-1781624476","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + string: '{"data":{"id":"707a25e7-57ae-4d8f-9ce8-4840b52c7349","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624476249,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624476249,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response-1781624476","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":[{"id":"707a25e7-57ae-4d8f-9ce8-4840b52c7349","type":"mute_rules"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/reorder + response: + body: + string: '{"data":[{"type":"mute_rules","id":"707a25e7-57ae-4d8f-9ce8-4840b52c7349"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/707a25e7-57ae-4d8f-9ce8-4840b52c7349 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_reorder_ticket_creation_rules_returns_successfully_reordered_the_ticket_creation_rules_response.frozen b/tests/v2/cassettes/test_scenarios/test_reorder_ticket_creation_rules_returns_successfully_reordered_the_ticket_creation_rules_response.frozen new file mode 100644 index 0000000000..f5acdf623f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_reorder_ticket_creation_rules_returns_successfully_reordered_the_ticket_creation_rules_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:17.183Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_reorder_ticket_creation_rules_returns_successfully_reordered_the_ticket_creation_rules_response.yaml b/tests/v2/cassettes/test_scenarios/test_reorder_ticket_creation_rules_returns_successfully_reordered_the_ticket_creation_rules_response.yaml new file mode 100644 index 0000000000..976b62b332 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_reorder_ticket_creation_rules_returns_successfully_reordered_the_ticket_creation_rules_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response-1781624477","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + string: '{"data":{"id":"b34dcd68-976a-49af-915b-83488a3d9f74","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624477424,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624477424,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response-1781624477","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":[{"id":"b34dcd68-976a-49af-915b-83488a3d9f74","type":"ticket_creation_rules"}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/reorder + response: + body: + string: '{"data":[{"type":"ticket_creation_rules","id":"b34dcd68-976a-49af-915b-83488a3d9f74"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/b34dcd68-976a-49af-915b-83488a3d9f74 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_due_date_rule_returns_successfully_updated_the_due_date_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_due_date_rule_returns_successfully_updated_the_due_date_rule_response.frozen new file mode 100644 index 0000000000..c0e1f30ef5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_due_date_rule_returns_successfully_updated_the_due_date_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:18.417Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_due_date_rule_returns_successfully_updated_the_due_date_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_due_date_rule_returns_successfully_updated_the_due_date_rule_response.yaml new file mode 100644 index 0000000000..6103c591bb --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_due_date_rule_returns_successfully_updated_the_due_date_rule_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + string: '{"data":{"id":"22df6980-9710-496d-bf46-85e0ac181dc0","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624478629,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624478629,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":14,"severity":"critical"}],"due_from":"first_seen"},"enabled":false,"name":"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/22df6980-9710-496d-bf46-85e0ac181dc0 + response: + body: + string: '{"data":{"id":"22df6980-9710-496d-bf46-85e0ac181dc0","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":14}],"due_from":"first_seen"},"created_at":1781624478629,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":false,"modified_at":1781624479036,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/22df6980-9710-496d-bf46-85e0ac181dc0 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_successfully_updated_the_mute_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_successfully_updated_the_mute_rule_response.frozen new file mode 100644 index 0000000000..9c2202dcbf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_successfully_updated_the_mute_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:19.612Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_successfully_updated_the_mute_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_successfully_updated_the_mute_rule_response.yaml new file mode 100644 index 0000000000..032bdfff3f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_successfully_updated_the_mute_rule_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + string: '{"data":{"id":"9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624479894,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624479894,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"reason":"false_positive"},"enabled":false,"name":"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9 + response: + body: + string: '{"data":{"id":"9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9","type":"mute_rules","attributes":{"action":{"reason":"false_positive"},"created_at":1781624479894,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":false,"modified_at":1781624480318,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_ticket_creation_rule_returns_successfully_updated_the_ticket_creation_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_ticket_creation_rule_returns_successfully_updated_the_ticket_creation_rule_response.frozen new file mode 100644 index 0000000000..1bf1e4fadb --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_ticket_creation_rule_returns_successfully_updated_the_ticket_creation_rule_response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:20.880Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_ticket_creation_rule_returns_successfully_updated_the_ticket_creation_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_ticket_creation_rule_returns_successfully_updated_the_ticket_creation_rule_response.yaml new file mode 100644 index 0000000000..a29326ab06 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_ticket_creation_rule_returns_successfully_updated_the_ticket_creation_rule_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + string: '{"data":{"id":"d3fcec39-567f-4450-967e-ca83bb29dbe4","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624481109,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624481109,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"max_tickets_per_day":5,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":false,"name":"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/d3fcec39-567f-4450-967e-ca83bb29dbe4 + response: + body: + string: '{"data":{"id":"d3fcec39-567f-4450-967e-ca83bb29dbe4","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":5},"created_at":1781624481109,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":false,"modified_at":1781624481511,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/d3fcec39-567f-4450-967e-ca83bb29dbe4 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index f5ce3365da..0f9de6d48a 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1290,6 +1290,42 @@ "tag": "Scorecards", "operationId": "CreateScorecardRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"due_date_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"due_days_per_severity\": [\n {\"severity\": \"critical\", \"due_in_days\": 7}\n ],\n \"due_from\": \"first_seen\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_due_date_rule\" in the system", + "key": "valid_due_date_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationDueDateRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"mute_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"reason\": \"risk_accepted\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_mute_rule\" in the system", + "key": "valid_mute_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationMuteRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"ticket_creation_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"project_id\": \"11111111-1111-1111-1111-111111111111\",\n \"target\": \"jira\",\n \"max_tickets_per_day\": 10\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_ticket_creation_rule\" in the system", + "key": "valid_ticket_creation_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationTicketCreationRule" + }, { "parameters": [ { diff --git a/tests/v2/features/security_monitoring.feature b/tests/v2/features/security_monitoring.feature index dd064c2a4a..0c14124aae 100644 --- a/tests/v2/features/security_monitoring.feature +++ b/tests/v2/features/security_monitoring.feature @@ -756,6 +756,60 @@ Feature: Security Monitoring And the response "message" is equal to "Test rule" And the response "isEnabled" is equal to true + @generated @skip @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Successfully created the due date rule" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 201 Successfully created the due date rule + And the response "data.type" is equal to "due_date_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Successfully created the mute rule" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"reason": "risk_accepted"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 201 Successfully created the mute rule + And the response "data.type" is equal to "mute_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Create a new signal-based notification rule returns "Bad Request" response Given new "CreateSignalNotificationRule" request @@ -870,6 +924,33 @@ 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" + @generated @skip @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Successfully created the ticket creation rule" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"max_tickets_per_day": 10, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 201 Successfully created the ticket creation rule + And the response "data.type" is equal to "ticket_creation_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Create an entity context sync configuration returns "Bad Request" response Given operation "CreateSecurityMonitoringIntegrationConfig" enabled @@ -1042,6 +1123,40 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a due date rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationDueDateRule" enabled + And new "DeleteSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a due date rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "DeleteSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted. + + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a mute rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationMuteRule" enabled + And new "DeleteSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a mute rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "DeleteSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted. + @skip @team:DataDog/k9-cloud-siem Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -1101,6 +1216,23 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a ticket creation rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationTicketCreationRule" enabled + And new "DeleteSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a ticket creation rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "DeleteSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted. + @team:DataDog/cloud-security-posture-management Scenario: Delete a vulnerability-based notification rule returns "Not Found" response Given new "DeleteVulnerabilityNotificationRule" request @@ -1408,6 +1540,25 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Get a due date rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationDueDateRule" enabled + And new "GetSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a due date rule returns "Successfully retrieved the due date rule" response + Given operation "GetSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "GetSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the due date rule + And the response "data.id" is equal to "{{ valid_due_date_rule.data.id }}" + And the response "data.type" is equal to "due_date_rules" + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get a finding returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetFinding" enabled @@ -1529,6 +1680,25 @@ Feature: Security Monitoring Then the response status is 200 OK And the response has 3 items + @generated @skip @team:DataDog/k9-automation + Scenario: Get a mute rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationMuteRule" enabled + And new "GetSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a mute rule returns "Successfully retrieved the mute rule" response + Given operation "GetSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "GetSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the mute rule + And the response "data.id" is equal to "{{ valid_mute_rule.data.id }}" + And the response "data.type" is equal to "mute_rules" + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get a quick list of security signals returns "Bad Request" response Given new "ListSecurityMonitoringSignals" request @@ -1680,12 +1850,49 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Get a ticket creation rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationTicketCreationRule" enabled + And new "GetSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a ticket creation rule returns "Successfully retrieved the ticket creation rule" response + Given operation "GetSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "GetSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the ticket creation rule + And the response "data.id" is equal to "{{ valid_ticket_creation_rule.data.id }}" + And the response "data.type" is equal to "ticket_creation_rules" + @team:DataDog/k9-cloud-siem Scenario: Get all critical assets returns "OK" response Given new "ListSecurityMonitoringCriticalAssets" request When the request is sent Then the response status is 200 OK + @team:DataDog/k9-automation + Scenario: Get all due date rules returns "Successfully retrieved the list of due date rules" response + Given operation "ListSecurityFindingsAutomationDueDateRules" enabled + And there is a valid "valid_due_date_rule" in the system + And new "ListSecurityFindingsAutomationDueDateRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of due date rules + And the response "data" has item with field "id" with value "{{ valid_due_date_rule.data.id }}" + + @team:DataDog/k9-automation + Scenario: Get all mute rules returns "Successfully retrieved the list of mute rules" response + Given operation "ListSecurityFindingsAutomationMuteRules" enabled + And there is a valid "valid_mute_rule" in the system + And new "ListSecurityFindingsAutomationMuteRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of mute rules + And the response "data" has item with field "id" with value "{{ valid_mute_rule.data.id }}" + @team:DataDog/k9-cloud-siem Scenario: Get all security filters returns "OK" response Given new "ListSecurityFilters" request @@ -1734,6 +1941,15 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "suppression2 {{ unique_hash }}" + @team:DataDog/k9-automation + Scenario: Get all ticket creation rules returns "Successfully retrieved the list of ticket creation rules" response + Given operation "ListSecurityFindingsAutomationTicketCreationRules" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "ListSecurityFindingsAutomationTicketCreationRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of ticket creation rules + And the response "data" has item with field "id" with value "{{ valid_ticket_creation_rule.data.id }}" + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get an entity context sync configuration returns "Not Found" response Given operation "GetSecurityMonitoringIntegrationConfig" enabled @@ -2517,6 +2733,81 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Successfully reordered the due date rules" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And there is a valid "valid_due_date_rule" in the system + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "{{ valid_due_date_rule.data.id }}", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the due date rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Successfully reordered the mute rules" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And there is a valid "valid_mute_rule" in the system + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the mute rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Successfully reordered the ticket creation rules" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "{{ valid_ticket_creation_rule.data.id }}", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the ticket creation rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Restore a rule to a historical version returns "Bad Request" response Given operation "RestoreSecurityMonitoringRule" enabled @@ -2862,6 +3153,84 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Successfully updated the due date rule" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 14, "severity": "critical"}], "due_from": "first_seen"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the due date rule + And the response "data.id" is equal to "{{ valid_due_date_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Successfully updated the mute rule" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason": "false_positive"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the mute rule + And the response "data.id" is equal to "{{ valid_mute_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Update a security filter returns "Bad Request" response Given new "UpdateSecurityFilter" request @@ -2934,6 +3303,45 @@ Feature: Security Monitoring And the response "data.attributes.suppression_query" is equal to "env:staging status:low" And the response "data.attributes.version" is equal to 2 + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Successfully updated the ticket creation rule" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + And body with value {"data": {"attributes": {"action": {"max_tickets_per_day": 5, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the ticket creation rule + And the response "data.id" is equal to "{{ valid_ticket_creation_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Update an entity context sync configuration returns "Bad Request" response Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 049cc12522..896b23d3d8 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -6913,6 +6913,135 @@ "type": "idempotent" } }, + "ListSecurityFindingsAutomationDueDateRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationDueDateRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationDueDateRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ListSecurityFindingsAutomationMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationMuteRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ListSecurityFindingsAutomationTicketCreationRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationTicketCreationRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationTicketCreationRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "DetachCase": { "tag": "Security Monitoring", "undo": {