From 501dfb201db6716a9bf9d1b2311a46d5032fde0c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 11 Sep 2026 13:48:33 +0000 Subject: [PATCH] Regenerate client from commit 08d108d of spec repo --- .generator/schemas/v2/openapi.yaml | 1175 +++++++++++++++-- ...eateSecurityFindingsAutomationInboxRule.py | 40 + ...teSecurityFindingsAutomationDueDateRule.py | 9 +- ...indingsAutomationDueDateRule_1294276849.py | 18 + ...leteSecurityFindingsAutomationInboxRule.py | 18 + ...eleteSecurityFindingsAutomationMuteRule.py | 9 +- ...tyFindingsAutomationMuteRule_4166916016.py | 18 + ...yFindingsAutomationSeverityModifierRule.py | 9 +- ...tomationSeverityModifierRule_1187257521.py | 18 + ...ityFindingsAutomationTicketCreationRule.py | 9 +- ...sAutomationTicketCreationRule_476126190.py | 18 + ...urityFindingsAutomationDefaultInboxRule.py | 16 + ...urityFindingsAutomationDefaultInboxRule.py | 16 + ...urityFindingsAutomationDefaultInboxRule.py | 16 + .../GetSecurityFindingsAutomationInboxRule.py | 20 + ...rityFindingsAutomationDefaultInboxRules.py | 14 + ...istSecurityFindingsAutomationInboxRules.py | 14 + ...derSecurityFindingsAutomationInboxRules.py | 30 + ...dateSecurityFindingsAutomationInboxRule.py | 45 + src/datadog_api_client/configuration.py | 10 + .../v2/api/security_monitoring_api.py | 460 ++++++- .../default_inbox_rule_attributes_response.py | 106 ++ .../model/default_inbox_rule_data_response.py | 62 + .../v2/model/default_inbox_rule_response.py | 40 + .../v2/model/default_inbox_rule_type.py | 35 + .../v2/model/default_inbox_rules_response.py | 40 + .../v2/model/due_date_rule_reorder_item.py | 2 +- .../v2/model/due_date_rule_reorder_request.py | 2 +- .../v2/model/inbox_rule_action.py | 42 + .../v2/model/inbox_rule_attributes_create.py | 77 ++ .../model/inbox_rule_attributes_response.py | 106 ++ .../v2/model/inbox_rule_create_request.py | 40 + .../v2/model/inbox_rule_data_create.py | 48 + .../v2/model/inbox_rule_data_response.py | 55 + .../v2/model/inbox_rule_data_update.py | 55 + .../v2/model/inbox_rule_reorder_item.py | 47 + .../v2/model/inbox_rule_reorder_request.py | 40 + .../v2/model/inbox_rule_reorder_response.py | 40 + .../v2/model/inbox_rule_response.py | 40 + .../v2/model/inbox_rule_type.py | 35 + .../v2/model/inbox_rule_update_request.py | 40 + .../v2/model/inbox_rules_response.py | 62 + .../v2/model/mute_rule_reorder_item.py | 2 +- .../v2/model/mute_rule_reorder_request.py | 2 +- .../severity_modifier_rule_reorder_item.py | 2 +- .../severity_modifier_rule_reorder_request.py | 2 +- ...severity_modifier_rule_reorder_response.py | 2 +- .../ticket_creation_rule_reorder_item.py | 2 +- .../ticket_creation_rule_reorder_request.py | 2 +- src/datadog_api_client/v2/models/__init__.py | 38 + tests/v2/features/given.json | 12 + tests/v2/features/security_monitoring.feature | 232 ++++ tests/v2/features/undo.json | 67 + 53 files changed, 3231 insertions(+), 128 deletions(-) create mode 100644 examples/v2/security-monitoring/CreateSecurityFindingsAutomationInboxRule.py create mode 100644 examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule_1294276849.py create mode 100644 examples/v2/security-monitoring/DeleteSecurityFindingsAutomationInboxRule.py create mode 100644 examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule_4166916016.py create mode 100644 examples/v2/security-monitoring/DeleteSecurityFindingsAutomationSeverityModifierRule_1187257521.py create mode 100644 examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule_476126190.py create mode 100644 examples/v2/security-monitoring/DisableSecurityFindingsAutomationDefaultInboxRule.py create mode 100644 examples/v2/security-monitoring/EnableSecurityFindingsAutomationDefaultInboxRule.py create mode 100644 examples/v2/security-monitoring/GetSecurityFindingsAutomationDefaultInboxRule.py create mode 100644 examples/v2/security-monitoring/GetSecurityFindingsAutomationInboxRule.py create mode 100644 examples/v2/security-monitoring/ListSecurityFindingsAutomationDefaultInboxRules.py create mode 100644 examples/v2/security-monitoring/ListSecurityFindingsAutomationInboxRules.py create mode 100644 examples/v2/security-monitoring/ReorderSecurityFindingsAutomationInboxRules.py create mode 100644 examples/v2/security-monitoring/UpdateSecurityFindingsAutomationInboxRule.py create mode 100644 src/datadog_api_client/v2/model/default_inbox_rule_attributes_response.py create mode 100644 src/datadog_api_client/v2/model/default_inbox_rule_data_response.py create mode 100644 src/datadog_api_client/v2/model/default_inbox_rule_response.py create mode 100644 src/datadog_api_client/v2/model/default_inbox_rule_type.py create mode 100644 src/datadog_api_client/v2/model/default_inbox_rules_response.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_action.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_attributes_create.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_attributes_response.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_create_request.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_data_create.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_data_response.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_data_update.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_reorder_item.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_reorder_request.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_reorder_response.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_response.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_type.py create mode 100644 src/datadog_api_client/v2/model/inbox_rule_update_request.py create mode 100644 src/datadog_api_client/v2/model/inbox_rules_response.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 10b435d883..c2a236c053 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -32687,6 +32687,99 @@ components: example: "Query result was truncated at the configured row_limit." type: string type: array + DefaultInboxRuleAttributesResponse: + description: Attributes of a default inbox rule returned by the API. + properties: + action: + $ref: "#/components/schemas/InboxRuleAction" + created_at: + description: The Unix timestamp in milliseconds when the rule definition was created. The definition is authored by Datadog. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the default inbox rule is enabled for the organization. + 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 default inbox rule. + example: "Secrets" + 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 + DefaultInboxRuleDataResponse: + description: The data object for a default inbox rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/DefaultInboxRuleAttributesResponse" + id: + description: |- + The ID of the default inbox rule. + Known default rule IDs include: `identity_risk_default_rule`, + `secret_default_rule`, `library_vulnerability_default_rule`, + `attack_path_default_rule`, `host_and_container_vulnerability_default_rule`, + `runtime_code_vulnerability_default_rule`, `iac_misconfiguration_default_rule`, + and `misconfiguration_default_rule`. Datadog can add new default rules + over time. + example: "secret_default_rule" + type: string + type: + $ref: "#/components/schemas/DefaultInboxRuleType" + required: + - id + - type + - attributes + type: object + DefaultInboxRuleResponse: + description: A single default inbox rule response. + properties: + data: + $ref: "#/components/schemas/DefaultInboxRuleDataResponse" + required: + - data + type: object + DefaultInboxRuleType: + description: The JSON:API type for default inbox rules. + enum: + - default_inbox_rules + example: default_inbox_rules + type: string + x-enum-varnames: + - DEFAULT_INBOX_RULES + DefaultInboxRulesDataList: + description: A list of default inbox rule data objects. + items: + $ref: "#/components/schemas/DefaultInboxRuleDataResponse" + type: array + DefaultInboxRulesResponse: + description: A list of default inbox rules. + properties: + data: + $ref: "#/components/schemas/DefaultInboxRulesDataList" + required: + - data + type: object DefaultRulesetsPerLanguageData: description: The primary data object in the default rulesets per language response. properties: @@ -36252,7 +36345,7 @@ components: - attributes type: object DueDateRuleReorderData: - description: The ordered list of all due date rules; every rule must be included. + description: The ordered list of all due date rules. Every rule must be included. items: $ref: "#/components/schemas/DueDateRuleReorderItem" type: array @@ -36260,7 +36353,7 @@ components: description: A reference to a due date rule used for reordering. properties: id: - description: The ID of the automation rule. + description: The ID of the due date rule. example: "00000000-0000-0000-0000-000000000000" format: uuid type: string @@ -49551,6 +49644,209 @@ components: required: - data type: object + InboxRuleAction: + description: The action to take when the inbox rule matches a finding. + properties: + description: + description: An optional description providing more context for the rule. + example: "Needs triage" + maxLength: 20000 + type: string + type: object + InboxRuleAttributesCreate: + description: Attributes for creating or updating an inbox rule. + properties: + action: + $ref: "#/components/schemas/InboxRuleAction" + enabled: + description: Whether the inbox rule is enabled. + example: true + type: boolean + name: + description: The name of the inbox rule. + example: "Triage production misconfigurations" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + InboxRuleAttributesResponse: + description: Attributes of an inbox rule returned by the API. + properties: + action: + $ref: "#/components/schemas/InboxRuleAction" + 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 inbox 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 inbox rule. + example: "Triage production misconfigurations" + 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 + InboxRuleCreateRequest: + description: The body of an inbox rule create request. + properties: + data: + $ref: "#/components/schemas/InboxRuleDataCreate" + required: + - data + type: object + InboxRuleDataCreate: + description: The data object for an inbox rule create request. + properties: + attributes: + $ref: "#/components/schemas/InboxRuleAttributesCreate" + type: + $ref: "#/components/schemas/InboxRuleType" + required: + - type + - attributes + type: object + InboxRuleDataResponse: + description: The data object for an inbox rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/InboxRuleAttributesResponse" + id: + description: The ID of the inbox rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/InboxRuleType" + required: + - id + - type + - attributes + type: object + InboxRuleDataUpdate: + description: The data object for an inbox rule update request. The `id` must match the `rule_id` path parameter. + properties: + attributes: + $ref: "#/components/schemas/InboxRuleAttributesCreate" + id: + description: The ID of the inbox rule to update. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/InboxRuleType" + required: + - id + - type + - attributes + type: object + InboxRuleReorderData: + description: The ordered list of all inbox rules. Every rule must be included. + items: + $ref: "#/components/schemas/InboxRuleReorderItem" + type: array + InboxRuleReorderItem: + description: A reference to an inbox rule used for reordering. + properties: + id: + description: The ID of the inbox rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/InboxRuleType" + required: + - type + - id + type: object + InboxRuleReorderRequest: + description: The body of an inbox rule reorder request. + properties: + data: + $ref: "#/components/schemas/InboxRuleReorderData" + required: + - data + type: object + InboxRuleReorderResponse: + description: The response of an inbox rule reorder request. + properties: + data: + $ref: "#/components/schemas/InboxRuleReorderData" + required: + - data + type: object + InboxRuleResponse: + description: A single inbox rule response. + properties: + data: + $ref: "#/components/schemas/InboxRuleDataResponse" + required: + - data + type: object + InboxRuleType: + description: The JSON:API type for inbox rules. + enum: + - inbox_rules + example: inbox_rules + type: string + x-enum-varnames: + - INBOX_RULES + InboxRuleUpdateRequest: + description: The body of an inbox rule update request. + properties: + data: + $ref: "#/components/schemas/InboxRuleDataUpdate" + required: + - data + type: object + InboxRulesDataList: + description: A list of inbox rule data objects. + items: + $ref: "#/components/schemas/InboxRuleDataResponse" + type: array + InboxRulesResponse: + description: A list of inbox rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/InboxRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object IncidentAIPostmortemDataAttributesResponse: description: Attributes of an AI-generated incident postmortem. properties: @@ -71998,7 +72294,7 @@ components: - attributes type: object MuteRuleReorderData: - description: The ordered list of all mute rules; every rule must be included. + description: The ordered list of all mute rules. Every rule must be included. items: $ref: "#/components/schemas/MuteRuleReorderItem" type: array @@ -72006,7 +72302,7 @@ components: description: A reference to a mute rule used for reordering. properties: id: - description: The ID of the automation rule. + description: The ID of the mute rule. example: "00000000-0000-0000-0000-000000000000" format: uuid type: string @@ -108611,7 +108907,7 @@ components: - attributes type: object SeverityModifierRuleReorderData: - description: The ordered list of severity modifier rules; every rule must be included. + description: The ordered list of all severity modifier rules. Every rule must be included. items: $ref: "#/components/schemas/SeverityModifierRuleReorderItem" type: array @@ -108619,7 +108915,7 @@ components: description: A reference to a severity modifier rule used for reordering. properties: id: - description: The ID of the automation rule. + description: The ID of the severity modifier rule. example: "00000000-0000-0000-0000-000000000000" format: uuid type: string @@ -121066,7 +121362,7 @@ components: - attributes type: object TicketCreationRuleReorderData: - description: The ordered list of all ticket creation rules; every rule must be included. + description: The ordered list of all ticket creation rules. Every rule must be included. items: $ref: "#/components/schemas/TicketCreationRuleReorderItem" type: array @@ -121074,7 +121370,7 @@ components: description: A reference to a ticket creation rule used for reordering. properties: id: - description: The ID of the automation rule. + description: The ID of the ticket creation rule. example: "00000000-0000-0000-0000-000000000000" format: uuid type: string @@ -200765,6 +201061,295 @@ 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/default_inbox_rules: + get: + description: |- + Get all default inbox rules for the current organization. + Datadog manages default inbox rules. Their name, rule, and action are + read-only, and each organization can change only whether they are enabled. + operationId: ListSecurityFindingsAutomationDefaultInboxRules + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + description: "Maintained by Datadog Security Research. Customize your inbox by adding your own rules, cloning this rule, or disabling it." + created_at: 1787064734329 + created_by: + id: "datadog.security_research" + name: "Datadog Security Research" + type: system + enabled: true + modified_at: 1787064734329 + modified_by: + id: "datadog.security_research" + name: "Datadog Security Research" + type: system + name: "Secrets" + rule: + finding_types: + - secret + query: "@git.repository_visibility:public OR @secret.validation_status:valid" + id: secret_default_rule + type: default_inbox_rules + - attributes: + action: + description: "Detects misconfigurations in your environment." + created_at: 1722439510282 + created_by: + id: "datadog.security_research" + name: "Datadog Security Research" + type: system + enabled: false + modified_at: 1722439510282 + modified_by: + id: "datadog.security_research" + name: "Datadog Security Research" + type: system + name: "Misconfigurations" + rule: + finding_types: + - misconfiguration + id: misconfiguration_default_rule + type: default_inbox_rules + schema: + $ref: "#/components/schemas/DefaultInboxRulesResponse" + description: Successfully retrieved the list of default inbox rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all default inbox 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/). + /api/v2/security/findings/automation/default_inbox_rules/{rule_id}: + get: + description: |- + Get the details of a default inbox rule by ID. + Datadog manages default inbox rules. Their name, rule, and action are + read-only, and each organization can change only whether they are enabled. + operationId: GetSecurityFindingsAutomationDefaultInboxRule + parameters: + - description: |- + The ID of the default inbox rule. + Known default rule IDs include: `identity_risk_default_rule`, + `secret_default_rule`, `library_vulnerability_default_rule`, + `attack_path_default_rule`, `host_and_container_vulnerability_default_rule`, + `runtime_code_vulnerability_default_rule`, `iac_misconfiguration_default_rule`, + and `misconfiguration_default_rule`. Datadog can add new default rules + over time. + in: path + name: rule_id + required: true + schema: + example: "secret_default_rule" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + description: "Maintained by Datadog Security Research. Customize your inbox by adding your own rules, cloning this rule, or disabling it." + created_at: 1787064734329 + created_by: + id: "datadog.security_research" + name: "Datadog Security Research" + type: system + enabled: true + modified_at: 1787064734329 + modified_by: + id: "datadog.security_research" + name: "Datadog Security Research" + type: system + name: "Secrets" + rule: + finding_types: + - secret + query: "@git.repository_visibility:public OR @secret.validation_status:valid" + id: secret_default_rule + type: default_inbox_rules + schema: + $ref: "#/components/schemas/DefaultInboxRuleResponse" + description: Successfully retrieved the default inbox rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a default inbox 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/). + /api/v2/security/findings/automation/default_inbox_rules/{rule_id}/disable: + post: + description: Disable a default inbox rule for the current organization. + operationId: DisableSecurityFindingsAutomationDefaultInboxRule + parameters: + - description: |- + The ID of the default inbox rule. + Known default rule IDs include: `identity_risk_default_rule`, + `secret_default_rule`, `library_vulnerability_default_rule`, + `attack_path_default_rule`, `host_and_container_vulnerability_default_rule`, + `runtime_code_vulnerability_default_rule`, `iac_misconfiguration_default_rule`, + and `misconfiguration_default_rule`. Datadog can add new default rules + over time. + in: path + name: rule_id + required: true + schema: + example: "secret_default_rule" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + description: "Maintained by Datadog Security Research. Customize your inbox by adding your own rules, cloning this rule, or disabling it." + created_at: 1787064734329 + created_by: + id: "datadog.security_research" + name: "Datadog Security Research" + type: system + enabled: false + modified_at: 1788255000000 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Secrets" + rule: + finding_types: + - secret + query: "@git.repository_visibility:public OR @secret.validation_status:valid" + id: secret_default_rule + type: default_inbox_rules + schema: + $ref: "#/components/schemas/DefaultInboxRuleResponse" + description: Successfully disabled the default inbox rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Disable a default inbox 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/). + /api/v2/security/findings/automation/default_inbox_rules/{rule_id}/enable: + post: + description: Enable a default inbox rule for the current organization. + operationId: EnableSecurityFindingsAutomationDefaultInboxRule + parameters: + - description: |- + The ID of the default inbox rule. + Known default rule IDs include: `identity_risk_default_rule`, + `secret_default_rule`, `library_vulnerability_default_rule`, + `attack_path_default_rule`, `host_and_container_vulnerability_default_rule`, + `runtime_code_vulnerability_default_rule`, `iac_misconfiguration_default_rule`, + and `misconfiguration_default_rule`. Datadog can add new default rules + over time. + in: path + name: rule_id + required: true + schema: + example: "secret_default_rule" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + description: "Maintained by Datadog Security Research. Customize your inbox by adding your own rules, cloning this rule, or disabling it." + created_at: 1787064734329 + created_by: + id: "datadog.security_research" + name: "Datadog Security Research" + type: system + enabled: true + modified_at: 1788255000000 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Secrets" + rule: + finding_types: + - secret + query: "@git.repository_visibility:public OR @secret.validation_status:valid" + id: secret_default_rule + type: default_inbox_rules + schema: + $ref: "#/components/schemas/DefaultInboxRuleResponse" + description: Successfully enabled the default inbox rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Enable a default inbox 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/). /api/v2/security/findings/automation/due_date_rules: get: description: Get all due date rules for the current organization. @@ -200852,7 +201437,7 @@ paths: **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. + description: Create a due date rule for the current organization. operationId: CreateSecurityFindingsAutomationDueDateRule requestBody: content: @@ -200915,7 +201500,281 @@ paths: type: due_date_rules schema: $ref: "#/components/schemas/DueDateRuleResponse" - description: Successfully created the due date rule + 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 a 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: Successfully deleted the due date rule + "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 a 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: @@ -200924,6 +201783,8 @@ paths: description: Bad Request "403": $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" "422": content: application/json: @@ -200935,7 +201796,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Create a due date rule + summary: Update a due date rule tags: - Security Monitoring x-codegen-request-body-name: body @@ -200946,10 +201807,176 @@ 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/reorder: + /api/v2/security/findings/automation/inbox_rules: + get: + description: Get all inbox rules for the current organization. + operationId: ListSecurityFindingsAutomationInboxRules + 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: + description: "Needs triage" + 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: "Triage production misconfigurations" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: inbox_rules + links: + first: "/api/v2/security/findings/automation/inbox_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/inbox_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/InboxRulesResponse" + description: Successfully retrieved the list of inbox rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all inbox 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: Reorder the list of due date rules for the current organization. - operationId: ReorderSecurityFindingsAutomationDueDateRules + description: Create an inbox rule for the current organization. + operationId: CreateSecurityFindingsAutomationInboxRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + description: "Needs triage" + enabled: true + name: "Triage production misconfigurations" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: inbox_rules + schema: + $ref: "#/components/schemas/InboxRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + description: "Needs triage" + 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: "Triage production misconfigurations" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: inbox_rules + schema: + $ref: "#/components/schemas/InboxRuleResponse" + description: Successfully created the inbox 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 an inbox 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/inbox_rules/reorder: + post: + description: Reorder the list of inbox rules for the current organization. + operationId: ReorderSecurityFindingsAutomationInboxRules requestBody: content: application/json: @@ -200958,11 +201985,11 @@ paths: value: data: - id: "00000000-0000-0000-0000-000000000000" - type: due_date_rules + type: inbox_rules - id: "11111111-1111-1111-1111-111111111111" - type: due_date_rules + type: inbox_rules schema: - $ref: "#/components/schemas/DueDateRuleReorderRequest" + $ref: "#/components/schemas/InboxRuleReorderRequest" required: true responses: "200": @@ -200973,12 +202000,12 @@ paths: value: data: - id: "00000000-0000-0000-0000-000000000000" - type: due_date_rules + type: inbox_rules - id: "11111111-1111-1111-1111-111111111111" - type: due_date_rules + type: inbox_rules schema: - $ref: "#/components/schemas/DueDateRuleReorderRequest" - description: Successfully reordered the due date rules + $ref: "#/components/schemas/InboxRuleReorderResponse" + description: Successfully reordered the inbox rules "400": content: application/json: @@ -200998,7 +202025,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Reorder due date rules + summary: Reorder inbox rules tags: - Security Monitoring x-codegen-request-body-name: body @@ -201009,12 +202036,12 @@ 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/{rule_id}: + /api/v2/security/findings/automation/inbox_rules/{rule_id}: delete: - description: Delete an existing due date rule by ID. - operationId: DeleteSecurityFindingsAutomationDueDateRule + description: Delete an inbox rule by ID. + operationId: DeleteSecurityFindingsAutomationInboxRule parameters: - - description: The ID of the due date rule. + - description: The ID of the inbox rule. in: path name: rule_id required: true @@ -201024,7 +202051,7 @@ paths: type: string responses: "204": - description: "Rule successfully deleted." + description: Successfully deleted the inbox rule "403": $ref: "#/components/responses/ForbiddenResponse" "404": @@ -201034,7 +202061,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Delete a due date rule + summary: Delete an inbox rule tags: - Security Monitoring x-permission: @@ -201045,10 +202072,10 @@ paths: **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 + description: Get the details of an inbox rule by ID. + operationId: GetSecurityFindingsAutomationInboxRule parameters: - - description: The ID of the due date rule. + - description: The ID of the inbox rule. in: path name: rule_id required: true @@ -201066,12 +202093,7 @@ paths: data: attributes: action: - due_days_per_severity: - - due_in_days: 7 - severity: critical - - due_in_days: 30 - severity: high - due_from: first_seen + description: "Needs triage" created_at: 1722439510282 created_by: id: "00000000-0000-0000-0000-000000000000" @@ -201083,16 +202105,16 @@ paths: id: "00000000-0000-0000-0000-000000000000" name: "Jane Doe" type: user - name: "Critical findings due in 7 days" + name: "Triage production misconfigurations" rule: finding_types: - misconfiguration query: "env:prod" id: "00000000-0000-0000-0000-000000000000" - type: due_date_rules + type: inbox_rules schema: - $ref: "#/components/schemas/DueDateRuleResponse" - description: Successfully retrieved the due date rule + $ref: "#/components/schemas/InboxRuleResponse" + description: Successfully retrieved the inbox rule "403": $ref: "#/components/responses/ForbiddenResponse" "404": @@ -201102,7 +202124,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get a due date rule + summary: Get an inbox rule tags: - Security Monitoring x-permission: @@ -201113,10 +202135,10 @@ paths: **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 + description: Update an inbox rule by ID. + operationId: UpdateSecurityFindingsAutomationInboxRule parameters: - - description: The ID of the due date rule. + - description: The ID of the inbox rule. in: path name: rule_id required: true @@ -201133,23 +202155,17 @@ paths: 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" + description: "Needs triage" + enabled: false + name: "Triage production misconfigurations" rule: finding_types: - misconfiguration query: "env:prod" - type: due_date_rules + id: "00000000-0000-0000-0000-000000000000" + type: inbox_rules schema: - $ref: "#/components/schemas/DueDateRuleUpdateRequest" + $ref: "#/components/schemas/InboxRuleUpdateRequest" required: true responses: "200": @@ -201161,35 +202177,28 @@ paths: 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 + description: "Needs triage" created_at: 1722439510282 created_by: id: "00000000-0000-0000-0000-000000000000" name: "Jane Doe" type: user - enabled: true + enabled: false modified_at: 1722439510999 modified_by: id: "00000000-0000-0000-0000-000000000000" name: "Jane Doe" type: user - name: "Critical findings due in 7 days" + name: "Triage production misconfigurations" rule: finding_types: - misconfiguration query: "env:prod" id: "00000000-0000-0000-0000-000000000000" - type: due_date_rules + type: inbox_rules schema: - $ref: "#/components/schemas/DueDateRuleResponse" - description: Successfully updated the due date rule + $ref: "#/components/schemas/InboxRuleResponse" + description: Successfully updated the inbox rule "400": content: application/json: @@ -201211,7 +202220,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Update a due date rule + summary: Update an inbox rule tags: - Security Monitoring x-codegen-request-body-name: body @@ -201306,7 +202315,7 @@ paths: **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. + description: Create a mute rule for the current organization. operationId: CreateSecurityFindingsAutomationMuteRule requestBody: content: @@ -201459,7 +202468,7 @@ paths: 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. + description: Delete a mute rule by ID. operationId: DeleteSecurityFindingsAutomationMuteRule parameters: - description: The ID of the mute rule. @@ -201472,7 +202481,7 @@ paths: type: string responses: "204": - description: "Rule successfully deleted." + description: Successfully deleted the mute rule "403": $ref: "#/components/responses/ForbiddenResponse" "404": @@ -201558,7 +202567,7 @@ paths: **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. + description: Update a mute rule by ID. operationId: UpdateSecurityFindingsAutomationMuteRule parameters: - description: The ID of the mute rule. @@ -201739,7 +202748,7 @@ paths: **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 severity modifier rule for the current organization. + description: Create a severity modifier rule for the current organization. operationId: CreateSecurityFindingsAutomationSeverityModifierRule requestBody: content: @@ -201892,7 +202901,7 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security/findings/automation/severity_modifier_rules/{rule_id}: delete: - description: Delete an existing severity modifier rule by ID. + description: Delete a severity modifier rule by ID. operationId: DeleteSecurityFindingsAutomationSeverityModifierRule parameters: - description: The ID of the severity modifier rule. @@ -201905,7 +202914,7 @@ paths: type: string responses: "204": - description: "Rule successfully deleted" + description: Successfully deleted the severity modifier rule "403": $ref: "#/components/responses/ForbiddenResponse" "404": @@ -202003,7 +203012,7 @@ paths: **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 severity modifier rule by ID. + description: Update a severity modifier rule by ID. operationId: UpdateSecurityFindingsAutomationSeverityModifierRule parameters: - description: The ID of the severity modifier rule. @@ -202184,7 +203193,7 @@ paths: **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. + description: Create a ticket creation rule for the current organization. operationId: CreateSecurityFindingsAutomationTicketCreationRule requestBody: content: @@ -202337,7 +203346,7 @@ paths: 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. + description: Delete a ticket creation rule by ID. operationId: DeleteSecurityFindingsAutomationTicketCreationRule parameters: - description: The ID of the ticket creation rule. @@ -202350,7 +203359,7 @@ paths: type: string responses: "204": - description: "Rule successfully deleted." + description: Successfully deleted the ticket creation rule "403": $ref: "#/components/responses/ForbiddenResponse" "404": @@ -202436,7 +203445,7 @@ paths: **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. + description: Update a ticket creation rule by ID. operationId: UpdateSecurityFindingsAutomationTicketCreationRule parameters: - description: The ID of the ticket creation rule. diff --git a/examples/v2/security-monitoring/CreateSecurityFindingsAutomationInboxRule.py b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationInboxRule.py new file mode 100644 index 0000000000..3c75e355cb --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationInboxRule.py @@ -0,0 +1,40 @@ +""" +Create an inbox rule returns "Successfully created the inbox 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.inbox_rule_action import InboxRuleAction +from datadog_api_client.v2.model.inbox_rule_attributes_create import InboxRuleAttributesCreate +from datadog_api_client.v2.model.inbox_rule_create_request import InboxRuleCreateRequest +from datadog_api_client.v2.model.inbox_rule_data_create import InboxRuleDataCreate +from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType + +body = InboxRuleCreateRequest( + data=InboxRuleDataCreate( + attributes=InboxRuleAttributesCreate( + action=InboxRuleAction( + description="Needs triage", + ), + enabled=True, + name="Example-Security-Monitoring", + rule=AutomationRuleScope( + finding_types=[ + SecurityFindingType.MISCONFIGURATION, + ], + query="env:staging", + ), + ), + type=InboxRuleType.INBOX_RULES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_security_findings_automation_inbox_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_security_findings_automation_inbox_rule(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.py index fdb3ea3e69..982d5417bb 100644 --- a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.py +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.py @@ -1,18 +1,15 @@ """ -Delete a due date rule returns "Rule successfully deleted." response +Delete a due date rule returns "Successfully deleted 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"] +from uuid import UUID 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, + rule_id=UUID("00000000-0000-0000-0000-000000000000"), ) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule_1294276849.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule_1294276849.py new file mode 100644 index 0000000000..fdb3ea3e69 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule_1294276849.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/DeleteSecurityFindingsAutomationInboxRule.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationInboxRule.py new file mode 100644 index 0000000000..5faad1e2ac --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationInboxRule.py @@ -0,0 +1,18 @@ +""" +Delete an inbox rule returns "Successfully deleted the inbox 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_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = environ["VALID_INBOX_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["delete_security_findings_automation_inbox_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + api_instance.delete_security_findings_automation_inbox_rule( + rule_id=VALID_INBOX_RULE_DATA_ID, + ) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.py index 96a1e96722..ca2b1aff83 100644 --- a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.py +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.py @@ -1,18 +1,15 @@ """ -Delete a mute rule returns "Rule successfully deleted." response +Delete a mute rule returns "Successfully deleted 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"] +from uuid import UUID 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, + rule_id=UUID("00000000-0000-0000-0000-000000000000"), ) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule_4166916016.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule_4166916016.py new file mode 100644 index 0000000000..96a1e96722 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule_4166916016.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/DeleteSecurityFindingsAutomationSeverityModifierRule.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationSeverityModifierRule.py index db09a0356f..54556d7a7a 100644 --- a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationSeverityModifierRule.py +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationSeverityModifierRule.py @@ -1,18 +1,15 @@ """ -Delete a severity modifier rule returns "Rule successfully deleted" response +Delete a severity modifier rule returns "Successfully deleted the severity modifier 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_severity_modifier_rule" in the system -VALID_SEVERITY_MODIFIER_RULE_DATA_ID = environ["VALID_SEVERITY_MODIFIER_RULE_DATA_ID"] +from uuid import UUID configuration = Configuration() configuration.unstable_operations["delete_security_findings_automation_severity_modifier_rule"] = True with ApiClient(configuration) as api_client: api_instance = SecurityMonitoringApi(api_client) api_instance.delete_security_findings_automation_severity_modifier_rule( - rule_id=VALID_SEVERITY_MODIFIER_RULE_DATA_ID, + rule_id=UUID("00000000-0000-0000-0000-000000000000"), ) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationSeverityModifierRule_1187257521.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationSeverityModifierRule_1187257521.py new file mode 100644 index 0000000000..db09a0356f --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationSeverityModifierRule_1187257521.py @@ -0,0 +1,18 @@ +""" +Delete a severity modifier 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_severity_modifier_rule" in the system +VALID_SEVERITY_MODIFIER_RULE_DATA_ID = environ["VALID_SEVERITY_MODIFIER_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["delete_security_findings_automation_severity_modifier_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + api_instance.delete_security_findings_automation_severity_modifier_rule( + rule_id=VALID_SEVERITY_MODIFIER_RULE_DATA_ID, + ) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.py index a5acc99d65..77b33a337c 100644 --- a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.py +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.py @@ -1,18 +1,15 @@ """ -Delete a ticket creation rule returns "Rule successfully deleted." response +Delete a ticket creation rule returns "Successfully deleted 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"] +from uuid import UUID 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, + rule_id=UUID("00000000-0000-0000-0000-000000000000"), ) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule_476126190.py b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule_476126190.py new file mode 100644 index 0000000000..a5acc99d65 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule_476126190.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/DisableSecurityFindingsAutomationDefaultInboxRule.py b/examples/v2/security-monitoring/DisableSecurityFindingsAutomationDefaultInboxRule.py new file mode 100644 index 0000000000..893cd3569e --- /dev/null +++ b/examples/v2/security-monitoring/DisableSecurityFindingsAutomationDefaultInboxRule.py @@ -0,0 +1,16 @@ +""" +Disable a default inbox rule returns "Successfully disabled the default inbox rule" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +configuration.unstable_operations["disable_security_findings_automation_default_inbox_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.disable_security_findings_automation_default_inbox_rule( + rule_id="secret_default_rule", + ) + + print(response) diff --git a/examples/v2/security-monitoring/EnableSecurityFindingsAutomationDefaultInboxRule.py b/examples/v2/security-monitoring/EnableSecurityFindingsAutomationDefaultInboxRule.py new file mode 100644 index 0000000000..f646df6cfa --- /dev/null +++ b/examples/v2/security-monitoring/EnableSecurityFindingsAutomationDefaultInboxRule.py @@ -0,0 +1,16 @@ +""" +Enable a default inbox rule returns "Successfully enabled the default inbox rule" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +configuration.unstable_operations["enable_security_findings_automation_default_inbox_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.enable_security_findings_automation_default_inbox_rule( + rule_id="secret_default_rule", + ) + + print(response) diff --git a/examples/v2/security-monitoring/GetSecurityFindingsAutomationDefaultInboxRule.py b/examples/v2/security-monitoring/GetSecurityFindingsAutomationDefaultInboxRule.py new file mode 100644 index 0000000000..1004be406f --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationDefaultInboxRule.py @@ -0,0 +1,16 @@ +""" +Get a default inbox rule returns "Successfully retrieved the default inbox rule" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +configuration.unstable_operations["get_security_findings_automation_default_inbox_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_security_findings_automation_default_inbox_rule( + rule_id="secret_default_rule", + ) + + print(response) diff --git a/examples/v2/security-monitoring/GetSecurityFindingsAutomationInboxRule.py b/examples/v2/security-monitoring/GetSecurityFindingsAutomationInboxRule.py new file mode 100644 index 0000000000..2bb4cebd78 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationInboxRule.py @@ -0,0 +1,20 @@ +""" +Get an inbox rule returns "Successfully retrieved the inbox 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_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = environ["VALID_INBOX_RULE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_security_findings_automation_inbox_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_security_findings_automation_inbox_rule( + rule_id=VALID_INBOX_RULE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/security-monitoring/ListSecurityFindingsAutomationDefaultInboxRules.py b/examples/v2/security-monitoring/ListSecurityFindingsAutomationDefaultInboxRules.py new file mode 100644 index 0000000000..3e1c1329f3 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationDefaultInboxRules.py @@ -0,0 +1,14 @@ +""" +Get all default inbox rules returns "Successfully retrieved the list of default inbox 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_default_inbox_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.list_security_findings_automation_default_inbox_rules() + + print(response) diff --git a/examples/v2/security-monitoring/ListSecurityFindingsAutomationInboxRules.py b/examples/v2/security-monitoring/ListSecurityFindingsAutomationInboxRules.py new file mode 100644 index 0000000000..84130d8e89 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationInboxRules.py @@ -0,0 +1,14 @@ +""" +Get all inbox rules returns "Successfully retrieved the list of inbox 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_inbox_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.list_security_findings_automation_inbox_rules() + + print(response) diff --git a/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationInboxRules.py b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationInboxRules.py new file mode 100644 index 0000000000..e361dc9a01 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationInboxRules.py @@ -0,0 +1,30 @@ +""" +Reorder inbox rules returns "Successfully reordered the inbox 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.inbox_rule_reorder_item import InboxRuleReorderItem +from datadog_api_client.v2.model.inbox_rule_reorder_request import InboxRuleReorderRequest +from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType + +# there is a valid "valid_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = environ["VALID_INBOX_RULE_DATA_ID"] + +body = InboxRuleReorderRequest( + data=[ + InboxRuleReorderItem( + id=VALID_INBOX_RULE_DATA_ID, + type=InboxRuleType.INBOX_RULES, + ), + ], +) + +configuration = Configuration() +configuration.unstable_operations["reorder_security_findings_automation_inbox_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.reorder_security_findings_automation_inbox_rules(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationInboxRule.py b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationInboxRule.py new file mode 100644 index 0000000000..96af4d9213 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationInboxRule.py @@ -0,0 +1,45 @@ +""" +Update an inbox rule returns "Successfully updated the inbox 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.inbox_rule_action import InboxRuleAction +from datadog_api_client.v2.model.inbox_rule_attributes_create import InboxRuleAttributesCreate +from datadog_api_client.v2.model.inbox_rule_data_update import InboxRuleDataUpdate +from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType +from datadog_api_client.v2.model.inbox_rule_update_request import InboxRuleUpdateRequest +from datadog_api_client.v2.model.security_finding_type import SecurityFindingType + +# there is a valid "valid_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = environ["VALID_INBOX_RULE_DATA_ID"] + +body = InboxRuleUpdateRequest( + data=InboxRuleDataUpdate( + attributes=InboxRuleAttributesCreate( + action=InboxRuleAction( + description="Needs triage", + ), + enabled=False, + name="Example-Security-Monitoring", + rule=AutomationRuleScope( + finding_types=[ + SecurityFindingType.MISCONFIGURATION, + ], + query="env:staging", + ), + ), + id=VALID_INBOX_RULE_DATA_ID, + type=InboxRuleType.INBOX_RULES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_security_findings_automation_inbox_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.update_security_findings_automation_inbox_rule(rule_id=VALID_INBOX_RULE_DATA_ID, body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 9fc508c929..a6b191e760 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -376,6 +376,7 @@ def __init__( "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_inbox_rule": False, "v2.create_security_findings_automation_mute_rule": False, "v2.create_security_findings_automation_severity_modifier_rule": False, "v2.create_security_findings_automation_ticket_creation_rule": False, @@ -388,11 +389,14 @@ def __init__( "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_inbox_rule": False, "v2.delete_security_findings_automation_mute_rule": False, "v2.delete_security_findings_automation_severity_modifier_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.disable_security_findings_automation_default_inbox_rule": False, + "v2.enable_security_findings_automation_default_inbox_rule": False, "v2.export_security_monitoring_terraform_resource": False, "v2.get_content_packs_states": False, "v2.get_entity_context": False, @@ -402,7 +406,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_default_inbox_rule": False, "v2.get_security_findings_automation_due_date_rule": False, + "v2.get_security_findings_automation_inbox_rule": False, "v2.get_security_findings_automation_mute_rule": False, "v2.get_security_findings_automation_severity_modifier_rule": False, "v2.get_security_findings_automation_ticket_creation_rule": False, @@ -425,7 +431,9 @@ 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_default_inbox_rules": False, "v2.list_security_findings_automation_due_date_rules": False, + "v2.list_security_findings_automation_inbox_rules": False, "v2.list_security_findings_automation_mute_rules": False, "v2.list_security_findings_automation_severity_modifier_rules": False, "v2.list_security_findings_automation_ticket_creation_rules": False, @@ -436,6 +444,7 @@ def __init__( "v2.list_vulnerabilities": False, "v2.list_vulnerable_assets": False, "v2.reorder_security_findings_automation_due_date_rules": False, + "v2.reorder_security_findings_automation_inbox_rules": False, "v2.reorder_security_findings_automation_mute_rules": False, "v2.reorder_security_findings_automation_severity_modifier_rules": False, "v2.reorder_security_findings_automation_ticket_creation_rules": False, @@ -444,6 +453,7 @@ def __init__( "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_inbox_rule": False, "v2.update_security_findings_automation_mute_rule": False, "v2.update_security_findings_automation_severity_modifier_rule": False, "v2.update_security_findings_automation_ticket_creation_rule": 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 c17dbfdbd9..6bea42ee69 100644 --- a/src/datadog_api_client/v2/api/security_monitoring_api.py +++ b/src/datadog_api_client/v2/api/security_monitoring_api.py @@ -42,11 +42,19 @@ 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.default_inbox_rules_response import DefaultInboxRulesResponse +from datadog_api_client.v2.model.default_inbox_rule_response import DefaultInboxRuleResponse 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.inbox_rules_response import InboxRulesResponse +from datadog_api_client.v2.model.inbox_rule_response import InboxRuleResponse +from datadog_api_client.v2.model.inbox_rule_create_request import InboxRuleCreateRequest +from datadog_api_client.v2.model.inbox_rule_reorder_response import InboxRuleReorderResponse +from datadog_api_client.v2.model.inbox_rule_reorder_request import InboxRuleReorderRequest +from datadog_api_client.v2.model.inbox_rule_update_request import InboxRuleUpdateRequest 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 @@ -898,6 +906,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_security_findings_automation_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (InboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/inbox_rules", + "operation_id": "create_security_findings_automation_inbox_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (InboxRuleCreateRequest,), + "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,), @@ -1325,6 +1353,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_security_findings_automation_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/inbox_rules/{rule_id}", + "operation_id": "delete_security_findings_automation_inbox_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, @@ -1575,6 +1626,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._disable_security_findings_automation_default_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (DefaultInboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/default_inbox_rules/{rule_id}/disable", + "operation_id": "disable_security_findings_automation_default_inbox_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (str,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._edit_security_monitoring_signal_endpoint = _Endpoint( settings={ "response_type": (SecurityMonitoringSignalTriageUpdateResponse,), @@ -1679,6 +1753,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._enable_security_findings_automation_default_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (DefaultInboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/default_inbox_rules/{rule_id}/enable", + "operation_id": "enable_security_findings_automation_default_inbox_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (str,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._export_security_monitoring_terraform_resource_endpoint = _Endpoint( settings={ "response_type": (SecurityMonitoringTerraformExportResponse,), @@ -2109,6 +2206,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_security_findings_automation_default_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (DefaultInboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/default_inbox_rules/{rule_id}", + "operation_id": "get_security_findings_automation_default_inbox_rule", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (str,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_security_findings_automation_due_date_rule_endpoint = _Endpoint( settings={ "response_type": (DueDateRuleResponse,), @@ -2132,6 +2252,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_security_findings_automation_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (InboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/inbox_rules/{rule_id}", + "operation_id": "get_security_findings_automation_inbox_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,), @@ -3283,6 +3426,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_security_findings_automation_default_inbox_rules_endpoint = _Endpoint( + settings={ + "response_type": (DefaultInboxRulesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/default_inbox_rules", + "operation_id": "list_security_findings_automation_default_inbox_rules", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_security_findings_automation_due_date_rules_endpoint = _Endpoint( settings={ "response_type": (DueDateRulesResponse,), @@ -3317,6 +3476,40 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_security_findings_automation_inbox_rules_endpoint = _Endpoint( + settings={ + "response_type": (InboxRulesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/inbox_rules", + "operation_id": "list_security_findings_automation_inbox_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,), @@ -4128,6 +4321,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._reorder_security_findings_automation_inbox_rules_endpoint = _Endpoint( + settings={ + "response_type": (InboxRuleReorderResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/inbox_rules/reorder", + "operation_id": "reorder_security_findings_automation_inbox_rules", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (InboxRuleReorderRequest,), + "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,), @@ -4485,6 +4698,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_security_findings_automation_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (InboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/security/findings/automation/inbox_rules/{rule_id}", + "operation_id": "update_security_findings_automation_inbox_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": (InboxRuleUpdateRequest,), + "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,), @@ -5312,7 +5551,7 @@ def create_security_findings_automation_due_date_rule( ) -> DueDateRuleResponse: """Create a due date rule. - Create a new due date rule for the current organization. + Create a due date rule for the current organization. :type body: DueDateRuleCreateRequest :rtype: DueDateRuleResponse @@ -5322,13 +5561,29 @@ def create_security_findings_automation_due_date_rule( return self._create_security_findings_automation_due_date_rule_endpoint.call_with_http_info(**kwargs) + def create_security_findings_automation_inbox_rule( + self, + body: InboxRuleCreateRequest, + ) -> InboxRuleResponse: + """Create an inbox rule. + + Create an inbox rule for the current organization. + + :type body: InboxRuleCreateRequest + :rtype: InboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_security_findings_automation_inbox_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. + Create a mute rule for the current organization. :type body: MuteRuleCreateRequest :rtype: MuteRuleResponse @@ -5344,7 +5599,7 @@ def create_security_findings_automation_severity_modifier_rule( ) -> SeverityModifierRuleResponse: """Create a severity modifier rule. - Create a new severity modifier rule for the current organization. + Create a severity modifier rule for the current organization. :type body: SeverityModifierRuleCreateRequest :rtype: SeverityModifierRuleResponse @@ -5360,7 +5615,7 @@ def create_security_findings_automation_ticket_creation_rule( ) -> TicketCreationRuleResponse: """Create a ticket creation rule. - Create a new ticket creation rule for the current organization. + Create a ticket creation rule for the current organization. :type body: TicketCreationRuleCreateRequest :rtype: TicketCreationRuleResponse @@ -5665,7 +5920,7 @@ def delete_security_findings_automation_due_date_rule( ) -> None: """Delete a due date rule. - Delete an existing due date rule by ID. + Delete a due date rule by ID. :param rule_id: The ID of the due date rule. :type rule_id: UUID @@ -5676,13 +5931,30 @@ def delete_security_findings_automation_due_date_rule( return self._delete_security_findings_automation_due_date_rule_endpoint.call_with_http_info(**kwargs) + def delete_security_findings_automation_inbox_rule( + self, + rule_id: UUID, + ) -> None: + """Delete an inbox rule. + + Delete an inbox rule by ID. + + :param rule_id: The ID of the inbox rule. + :type rule_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._delete_security_findings_automation_inbox_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. + Delete a mute rule by ID. :param rule_id: The ID of the mute rule. :type rule_id: UUID @@ -5699,7 +5971,7 @@ def delete_security_findings_automation_severity_modifier_rule( ) -> None: """Delete a severity modifier rule. - Delete an existing severity modifier rule by ID. + Delete a severity modifier rule by ID. :param rule_id: The ID of the severity modifier rule. :type rule_id: UUID @@ -5716,7 +5988,7 @@ def delete_security_findings_automation_ticket_creation_rule( ) -> None: """Delete a ticket creation rule. - Delete an existing ticket creation rule by ID. + Delete a ticket creation rule by ID. :param rule_id: The ID of the ticket creation rule. :type rule_id: UUID @@ -5865,6 +6137,29 @@ def detach_case( return self._detach_case_endpoint.call_with_http_info(**kwargs) + def disable_security_findings_automation_default_inbox_rule( + self, + rule_id: str, + ) -> DefaultInboxRuleResponse: + """Disable a default inbox rule. + + Disable a default inbox rule for the current organization. + + :param rule_id: The ID of the default inbox rule. + Known default rule IDs include: ``identity_risk_default_rule`` , + ``secret_default_rule`` , ``library_vulnerability_default_rule`` , + ``attack_path_default_rule`` , ``host_and_container_vulnerability_default_rule`` , + ``runtime_code_vulnerability_default_rule`` , ``iac_misconfiguration_default_rule`` , + and ``misconfiguration_default_rule``. Datadog can add new default rules + over time. + :type rule_id: str + :rtype: DefaultInboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._disable_security_findings_automation_default_inbox_rule_endpoint.call_with_http_info(**kwargs) + def edit_security_monitoring_signal( self, signal_id: str, @@ -5953,6 +6248,29 @@ def edit_security_monitoring_signal_state( return self._edit_security_monitoring_signal_state_endpoint.call_with_http_info(**kwargs) + def enable_security_findings_automation_default_inbox_rule( + self, + rule_id: str, + ) -> DefaultInboxRuleResponse: + """Enable a default inbox rule. + + Enable a default inbox rule for the current organization. + + :param rule_id: The ID of the default inbox rule. + Known default rule IDs include: ``identity_risk_default_rule`` , + ``secret_default_rule`` , ``library_vulnerability_default_rule`` , + ``attack_path_default_rule`` , ``host_and_container_vulnerability_default_rule`` , + ``runtime_code_vulnerability_default_rule`` , ``iac_misconfiguration_default_rule`` , + and ``misconfiguration_default_rule``. Datadog can add new default rules + over time. + :type rule_id: str + :rtype: DefaultInboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._enable_security_findings_automation_default_inbox_rule_endpoint.call_with_http_info(**kwargs) + def export_security_monitoring_terraform_resource( self, resource_type: SecurityMonitoringTerraformResourceType, @@ -6327,6 +6645,31 @@ def get_security_filter( return self._get_security_filter_endpoint.call_with_http_info(**kwargs) + def get_security_findings_automation_default_inbox_rule( + self, + rule_id: str, + ) -> DefaultInboxRuleResponse: + """Get a default inbox rule. + + Get the details of a default inbox rule by ID. + Datadog manages default inbox rules. Their name, rule, and action are + read-only, and each organization can change only whether they are enabled. + + :param rule_id: The ID of the default inbox rule. + Known default rule IDs include: ``identity_risk_default_rule`` , + ``secret_default_rule`` , ``library_vulnerability_default_rule`` , + ``attack_path_default_rule`` , ``host_and_container_vulnerability_default_rule`` , + ``runtime_code_vulnerability_default_rule`` , ``iac_misconfiguration_default_rule`` , + and ``misconfiguration_default_rule``. Datadog can add new default rules + over time. + :type rule_id: str + :rtype: DefaultInboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._get_security_findings_automation_default_inbox_rule_endpoint.call_with_http_info(**kwargs) + def get_security_findings_automation_due_date_rule( self, rule_id: UUID, @@ -6344,6 +6687,23 @@ def get_security_findings_automation_due_date_rule( return self._get_security_findings_automation_due_date_rule_endpoint.call_with_http_info(**kwargs) + def get_security_findings_automation_inbox_rule( + self, + rule_id: UUID, + ) -> InboxRuleResponse: + """Get an inbox rule. + + Get the details of an inbox rule by ID. + + :param rule_id: The ID of the inbox rule. + :type rule_id: UUID + :rtype: InboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._get_security_findings_automation_inbox_rule_endpoint.call_with_http_info(**kwargs) + def get_security_findings_automation_mute_rule( self, rule_id: UUID, @@ -7675,6 +8035,20 @@ def list_security_findings_with_pagination( } return endpoint.call_with_http_info_paginated(pagination) + def list_security_findings_automation_default_inbox_rules( + self, + ) -> DefaultInboxRulesResponse: + """Get all default inbox rules. + + Get all default inbox rules for the current organization. + Datadog manages default inbox rules. Their name, rule, and action are + read-only, and each organization can change only whether they are enabled. + + :rtype: DefaultInboxRulesResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_security_findings_automation_default_inbox_rules_endpoint.call_with_http_info(**kwargs) + def list_security_findings_automation_due_date_rules( self, *, @@ -7700,6 +8074,31 @@ def list_security_findings_automation_due_date_rules( return self._list_security_findings_automation_due_date_rules_endpoint.call_with_http_info(**kwargs) + def list_security_findings_automation_inbox_rules( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + ) -> InboxRulesResponse: + """Get all inbox rules. + + Get all inbox 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: InboxRulesResponse + """ + 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_inbox_rules_endpoint.call_with_http_info(**kwargs) + def list_security_findings_automation_mute_rules( self, *, @@ -8659,6 +9058,22 @@ def reorder_security_findings_automation_due_date_rules( return self._reorder_security_findings_automation_due_date_rules_endpoint.call_with_http_info(**kwargs) + def reorder_security_findings_automation_inbox_rules( + self, + body: InboxRuleReorderRequest, + ) -> InboxRuleReorderResponse: + """Reorder inbox rules. + + Reorder the list of inbox rules for the current organization. + + :type body: InboxRuleReorderRequest + :rtype: InboxRuleReorderResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._reorder_security_findings_automation_inbox_rules_endpoint.call_with_http_info(**kwargs) + def reorder_security_findings_automation_mute_rules( self, body: MuteRuleReorderRequest, @@ -9009,7 +9424,7 @@ def update_security_findings_automation_due_date_rule( ) -> DueDateRuleResponse: """Update a due date rule. - Update an existing due date rule by ID. + Update a due date rule by ID. :param rule_id: The ID of the due date rule. :type rule_id: UUID @@ -9023,6 +9438,27 @@ def update_security_findings_automation_due_date_rule( return self._update_security_findings_automation_due_date_rule_endpoint.call_with_http_info(**kwargs) + def update_security_findings_automation_inbox_rule( + self, + rule_id: UUID, + body: InboxRuleUpdateRequest, + ) -> InboxRuleResponse: + """Update an inbox rule. + + Update an inbox rule by ID. + + :param rule_id: The ID of the inbox rule. + :type rule_id: UUID + :type body: InboxRuleUpdateRequest + :rtype: InboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + kwargs["body"] = body + + return self._update_security_findings_automation_inbox_rule_endpoint.call_with_http_info(**kwargs) + def update_security_findings_automation_mute_rule( self, rule_id: UUID, @@ -9030,7 +9466,7 @@ def update_security_findings_automation_mute_rule( ) -> MuteRuleResponse: """Update a mute rule. - Update an existing mute rule by ID. + Update a mute rule by ID. :param rule_id: The ID of the mute rule. :type rule_id: UUID @@ -9051,7 +9487,7 @@ def update_security_findings_automation_severity_modifier_rule( ) -> SeverityModifierRuleResponse: """Update a severity modifier rule. - Update an existing severity modifier rule by ID. + Update a severity modifier rule by ID. :param rule_id: The ID of the severity modifier rule. :type rule_id: UUID @@ -9072,7 +9508,7 @@ def update_security_findings_automation_ticket_creation_rule( ) -> TicketCreationRuleResponse: """Update a ticket creation rule. - Update an existing ticket creation rule by ID. + Update a ticket creation rule by ID. :param rule_id: The ID of the ticket creation rule. :type rule_id: UUID diff --git a/src/datadog_api_client/v2/model/default_inbox_rule_attributes_response.py b/src/datadog_api_client/v2/model/default_inbox_rule_attributes_response.py new file mode 100644 index 0000000000..787ec5db8f --- /dev/null +++ b/src/datadog_api_client/v2/model/default_inbox_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.inbox_rule_action import InboxRuleAction + 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 DefaultInboxRuleAttributesResponse(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_action import InboxRuleAction + 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": (InboxRuleAction,), + "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: InboxRuleAction, + created_at: int, + created_by: AutomationRuleCreatedBy, + enabled: bool, + modified_at: int, + modified_by: AutomationRuleModifiedBy, + name: str, + rule: AutomationRuleScope, + **kwargs, + ): + """ + Attributes of a default inbox rule returned by the API. + + :param action: The action to take when the inbox rule matches a finding. + :type action: InboxRuleAction + + :param created_at: The Unix timestamp in milliseconds when the rule definition was created. The definition is authored by Datadog. + :type created_at: int + + :param created_by: The user or Datadog system who created the rule. + :type created_by: AutomationRuleCreatedBy + + :param enabled: Whether the default inbox rule is enabled for the organization. + :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 default inbox 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/default_inbox_rule_data_response.py b/src/datadog_api_client/v2/model/default_inbox_rule_data_response.py new file mode 100644 index 0000000000..ec7969ab64 --- /dev/null +++ b/src/datadog_api_client/v2/model/default_inbox_rule_data_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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.default_inbox_rule_attributes_response import DefaultInboxRuleAttributesResponse + from datadog_api_client.v2.model.default_inbox_rule_type import DefaultInboxRuleType + + +class DefaultInboxRuleDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.default_inbox_rule_attributes_response import ( + DefaultInboxRuleAttributesResponse, + ) + from datadog_api_client.v2.model.default_inbox_rule_type import DefaultInboxRuleType + + return { + "attributes": (DefaultInboxRuleAttributesResponse,), + "id": (str,), + "type": (DefaultInboxRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: DefaultInboxRuleAttributesResponse, id: str, type: DefaultInboxRuleType, **kwargs): + """ + The data object for a default inbox rule returned by the API. + + :param attributes: Attributes of a default inbox rule returned by the API. + :type attributes: DefaultInboxRuleAttributesResponse + + :param id: The ID of the default inbox rule. + Known default rule IDs include: ``identity_risk_default_rule`` , + ``secret_default_rule`` , ``library_vulnerability_default_rule`` , + ``attack_path_default_rule`` , ``host_and_container_vulnerability_default_rule`` , + ``runtime_code_vulnerability_default_rule`` , ``iac_misconfiguration_default_rule`` , + and ``misconfiguration_default_rule``. Datadog can add new default rules + over time. + :type id: str + + :param type: The JSON:API type for default inbox rules. + :type type: DefaultInboxRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/default_inbox_rule_response.py b/src/datadog_api_client/v2/model/default_inbox_rule_response.py new file mode 100644 index 0000000000..6c085775e9 --- /dev/null +++ b/src/datadog_api_client/v2/model/default_inbox_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.default_inbox_rule_data_response import DefaultInboxRuleDataResponse + + +class DefaultInboxRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.default_inbox_rule_data_response import DefaultInboxRuleDataResponse + + return { + "data": (DefaultInboxRuleDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DefaultInboxRuleDataResponse, **kwargs): + """ + A single default inbox rule response. + + :param data: The data object for a default inbox rule returned by the API. + :type data: DefaultInboxRuleDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/default_inbox_rule_type.py b/src/datadog_api_client/v2/model/default_inbox_rule_type.py new file mode 100644 index 0000000000..eab7d785ee --- /dev/null +++ b/src/datadog_api_client/v2/model/default_inbox_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 DefaultInboxRuleType(ModelSimple): + """ + The JSON:API type for default inbox rules. + + :param value: If omitted defaults to "default_inbox_rules". Must be one of ["default_inbox_rules"]. + :type value: str + """ + + allowed_values = { + "default_inbox_rules", + } + DEFAULT_INBOX_RULES: ClassVar["DefaultInboxRuleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DefaultInboxRuleType.DEFAULT_INBOX_RULES = DefaultInboxRuleType("default_inbox_rules") diff --git a/src/datadog_api_client/v2/model/default_inbox_rules_response.py b/src/datadog_api_client/v2/model/default_inbox_rules_response.py new file mode 100644 index 0000000000..1743057e5c --- /dev/null +++ b/src/datadog_api_client/v2/model/default_inbox_rules_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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.default_inbox_rule_data_response import DefaultInboxRuleDataResponse + + +class DefaultInboxRulesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.default_inbox_rule_data_response import DefaultInboxRuleDataResponse + + return { + "data": ([DefaultInboxRuleDataResponse],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[DefaultInboxRuleDataResponse], **kwargs): + """ + A list of default inbox rules. + + :param data: A list of default inbox rule data objects. + :type data: [DefaultInboxRuleDataResponse] + """ + super().__init__(kwargs) + + self_.data = data 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 index 4c18997111..2090276d1a 100644 --- 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 @@ -35,7 +35,7 @@ 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. + :param id: The ID of the due date rule. :type id: UUID :param type: The JSON:API type for due date rules. 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 index 168c476409..3574fe5b6d 100644 --- 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 @@ -32,7 +32,7 @@ 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. + :param data: The ordered list of all due date rules. Every rule must be included. :type data: [DueDateRuleReorderItem] """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/inbox_rule_action.py b/src/datadog_api_client/v2/model/inbox_rule_action.py new file mode 100644 index 0000000000..c08e26391d --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_rule_action.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class InboxRuleAction(ModelNormal): + validations = { + "description": { + "max_length": 20000, + }, + } + + @cached_property + def openapi_types(_): + return { + "description": (str,), + } + + attribute_map = { + "description": "description", + } + + def __init__(self_, description: Union[str, UnsetType] = unset, **kwargs): + """ + The action to take when the inbox rule matches a finding. + + :param description: An optional description providing more context for the rule. + :type description: str, optional + """ + if description is not unset: + kwargs["description"] = description + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/inbox_rule_attributes_create.py b/src/datadog_api_client/v2/model/inbox_rule_attributes_create.py new file mode 100644 index 0000000000..b569a82ce1 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_action import InboxRuleAction + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + +class InboxRuleAttributesCreate(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_action import InboxRuleAction + from datadog_api_client.v2.model.automation_rule_scope import AutomationRuleScope + + return { + "action": (InboxRuleAction,), + "enabled": (bool,), + "name": (str,), + "rule": (AutomationRuleScope,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: InboxRuleAction, + name: str, + rule: AutomationRuleScope, + enabled: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating or updating an inbox rule. + + :param action: The action to take when the inbox rule matches a finding. + :type action: InboxRuleAction + + :param enabled: Whether the inbox rule is enabled. + :type enabled: bool, optional + + :param name: The name of the inbox 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/inbox_rule_attributes_response.py b/src/datadog_api_client/v2/model/inbox_rule_attributes_response.py new file mode 100644 index 0000000000..f08f2e5c58 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_action import InboxRuleAction + 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 InboxRuleAttributesResponse(ModelNormal): + validations = { + "name": { + "max_length": 255, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_action import InboxRuleAction + 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": (InboxRuleAction,), + "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: InboxRuleAction, + created_at: int, + created_by: AutomationRuleCreatedBy, + enabled: bool, + modified_at: int, + modified_by: AutomationRuleModifiedBy, + name: str, + rule: AutomationRuleScope, + **kwargs, + ): + """ + Attributes of an inbox rule returned by the API. + + :param action: The action to take when the inbox rule matches a finding. + :type action: InboxRuleAction + + :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 inbox 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 inbox 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/inbox_rule_create_request.py b/src/datadog_api_client/v2/model/inbox_rule_create_request.py new file mode 100644 index 0000000000..18ef7e1df7 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_data_create import InboxRuleDataCreate + + +class InboxRuleCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_data_create import InboxRuleDataCreate + + return { + "data": (InboxRuleDataCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: InboxRuleDataCreate, **kwargs): + """ + The body of an inbox rule create request. + + :param data: The data object for an inbox rule create request. + :type data: InboxRuleDataCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/inbox_rule_data_create.py b/src/datadog_api_client/v2/model/inbox_rule_data_create.py new file mode 100644 index 0000000000..7b8889bbe0 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_attributes_create import InboxRuleAttributesCreate + from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType + + +class InboxRuleDataCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_attributes_create import InboxRuleAttributesCreate + from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType + + return { + "attributes": (InboxRuleAttributesCreate,), + "type": (InboxRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: InboxRuleAttributesCreate, type: InboxRuleType, **kwargs): + """ + The data object for an inbox rule create request. + + :param attributes: Attributes for creating or updating an inbox rule. + :type attributes: InboxRuleAttributesCreate + + :param type: The JSON:API type for inbox rules. + :type type: InboxRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/inbox_rule_data_response.py b/src/datadog_api_client/v2/model/inbox_rule_data_response.py new file mode 100644 index 0000000000..61d93c3283 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_attributes_response import InboxRuleAttributesResponse + from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType + + +class InboxRuleDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_attributes_response import InboxRuleAttributesResponse + from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType + + return { + "attributes": (InboxRuleAttributesResponse,), + "id": (UUID,), + "type": (InboxRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: InboxRuleAttributesResponse, id: UUID, type: InboxRuleType, **kwargs): + """ + The data object for an inbox rule returned by the API. + + :param attributes: Attributes of an inbox rule returned by the API. + :type attributes: InboxRuleAttributesResponse + + :param id: The ID of the inbox rule. + :type id: UUID + + :param type: The JSON:API type for inbox rules. + :type type: InboxRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/inbox_rule_data_update.py b/src/datadog_api_client/v2/model/inbox_rule_data_update.py new file mode 100644 index 0000000000..33e8d1cca9 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_rule_data_update.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.inbox_rule_attributes_create import InboxRuleAttributesCreate + from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType + + +class InboxRuleDataUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_attributes_create import InboxRuleAttributesCreate + from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType + + return { + "attributes": (InboxRuleAttributesCreate,), + "id": (UUID,), + "type": (InboxRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: InboxRuleAttributesCreate, id: UUID, type: InboxRuleType, **kwargs): + """ + The data object for an inbox rule update request. The ``id`` must match the ``rule_id`` path parameter. + + :param attributes: Attributes for creating or updating an inbox rule. + :type attributes: InboxRuleAttributesCreate + + :param id: The ID of the inbox rule to update. + :type id: UUID + + :param type: The JSON:API type for inbox rules. + :type type: InboxRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/inbox_rule_reorder_item.py b/src/datadog_api_client/v2/model/inbox_rule_reorder_item.py new file mode 100644 index 0000000000..7ca904e809 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_type import InboxRuleType + + +class InboxRuleReorderItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType + + return { + "id": (UUID,), + "type": (InboxRuleType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: InboxRuleType, **kwargs): + """ + A reference to an inbox rule used for reordering. + + :param id: The ID of the inbox rule. + :type id: UUID + + :param type: The JSON:API type for inbox rules. + :type type: InboxRuleType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/inbox_rule_reorder_request.py b/src/datadog_api_client/v2/model/inbox_rule_reorder_request.py new file mode 100644 index 0000000000..49205d48f2 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_reorder_item import InboxRuleReorderItem + + +class InboxRuleReorderRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_reorder_item import InboxRuleReorderItem + + return { + "data": ([InboxRuleReorderItem],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[InboxRuleReorderItem], **kwargs): + """ + The body of an inbox rule reorder request. + + :param data: The ordered list of all inbox rules. Every rule must be included. + :type data: [InboxRuleReorderItem] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/inbox_rule_reorder_response.py b/src/datadog_api_client/v2/model/inbox_rule_reorder_response.py new file mode 100644 index 0000000000..7b2c797a18 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_rule_reorder_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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.inbox_rule_reorder_item import InboxRuleReorderItem + + +class InboxRuleReorderResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_reorder_item import InboxRuleReorderItem + + return { + "data": ([InboxRuleReorderItem],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[InboxRuleReorderItem], **kwargs): + """ + The response of an inbox rule reorder request. + + :param data: The ordered list of all inbox rules. Every rule must be included. + :type data: [InboxRuleReorderItem] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/inbox_rule_response.py b/src/datadog_api_client/v2/model/inbox_rule_response.py new file mode 100644 index 0000000000..670d406445 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_data_response import InboxRuleDataResponse + + +class InboxRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_data_response import InboxRuleDataResponse + + return { + "data": (InboxRuleDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: InboxRuleDataResponse, **kwargs): + """ + A single inbox rule response. + + :param data: The data object for an inbox rule returned by the API. + :type data: InboxRuleDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/inbox_rule_type.py b/src/datadog_api_client/v2/model/inbox_rule_type.py new file mode 100644 index 0000000000..1f187d3f80 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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 InboxRuleType(ModelSimple): + """ + The JSON:API type for inbox rules. + + :param value: If omitted defaults to "inbox_rules". Must be one of ["inbox_rules"]. + :type value: str + """ + + allowed_values = { + "inbox_rules", + } + INBOX_RULES: ClassVar["InboxRuleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +InboxRuleType.INBOX_RULES = InboxRuleType("inbox_rules") diff --git a/src/datadog_api_client/v2/model/inbox_rule_update_request.py b/src/datadog_api_client/v2/model/inbox_rule_update_request.py new file mode 100644 index 0000000000..353e1a7a74 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_data_update import InboxRuleDataUpdate + + +class InboxRuleUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_data_update import InboxRuleDataUpdate + + return { + "data": (InboxRuleDataUpdate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: InboxRuleDataUpdate, **kwargs): + """ + The body of an inbox rule update request. + + :param data: The data object for an inbox rule update request. The ``id`` must match the ``rule_id`` path parameter. + :type data: InboxRuleDataUpdate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/inbox_rules_response.py b/src/datadog_api_client/v2/model/inbox_rules_response.py new file mode 100644 index 0000000000..0a44970266 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_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.inbox_rule_data_response import InboxRuleDataResponse + 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 InboxRulesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_data_response import InboxRuleDataResponse + 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": ([InboxRuleDataResponse],), + "links": (SecurityAutomationRulesLinks,), + "meta": (SecurityAutomationRulesMeta,), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: List[InboxRuleDataResponse], + links: SecurityAutomationRulesLinks, + meta: SecurityAutomationRulesMeta, + **kwargs, + ): + """ + A list of inbox rules with pagination metadata. + + :param data: A list of inbox rule data objects. + :type data: [InboxRuleDataResponse] + + :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/mute_rule_reorder_item.py b/src/datadog_api_client/v2/model/mute_rule_reorder_item.py index 7564d2dd1d..e9ee374911 100644 --- a/src/datadog_api_client/v2/model/mute_rule_reorder_item.py +++ b/src/datadog_api_client/v2/model/mute_rule_reorder_item.py @@ -35,7 +35,7 @@ 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. + :param id: The ID of the mute rule. :type id: UUID :param type: The JSON:API type for mute rules. 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 index 009e87b736..b826c59fd3 100644 --- a/src/datadog_api_client/v2/model/mute_rule_reorder_request.py +++ b/src/datadog_api_client/v2/model/mute_rule_reorder_request.py @@ -32,7 +32,7 @@ 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. + :param data: The ordered list of all mute rules. Every rule must be included. :type data: [MuteRuleReorderItem] """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_item.py b/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_item.py index 4d702372b5..6dc947ed05 100644 --- a/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_item.py +++ b/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_item.py @@ -35,7 +35,7 @@ def __init__(self_, id: UUID, type: SeverityModifierRuleType, **kwargs): """ A reference to a severity modifier rule used for reordering. - :param id: The ID of the automation rule. + :param id: The ID of the severity modifier rule. :type id: UUID :param type: The JSON:API type for severity modifier rules. diff --git a/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_request.py b/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_request.py index 4ec55c2141..ecac45f951 100644 --- a/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_request.py +++ b/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_request.py @@ -32,7 +32,7 @@ def __init__(self_, data: List[SeverityModifierRuleReorderItem], **kwargs): """ The body of a severity modifier rule reorder request. - :param data: The ordered list of severity modifier rules; every rule must be included. + :param data: The ordered list of all severity modifier rules. Every rule must be included. :type data: [SeverityModifierRuleReorderItem] """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_response.py b/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_response.py index bcbd914d43..3824e7e112 100644 --- a/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_response.py +++ b/src/datadog_api_client/v2/model/severity_modifier_rule_reorder_response.py @@ -32,7 +32,7 @@ def __init__(self_, data: List[SeverityModifierRuleReorderItem], **kwargs): """ The response of a severity modifier rule reorder request. - :param data: The ordered list of severity modifier rules; every rule must be included. + :param data: The ordered list of all severity modifier rules. Every rule must be included. :type data: [SeverityModifierRuleReorderItem] """ super().__init__(kwargs) 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 index b9d7b6b28b..d1647625fa 100644 --- 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 @@ -35,7 +35,7 @@ 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. + :param id: The ID of the ticket creation rule. :type id: UUID :param type: The JSON:API type for ticket creation rules. 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 index cda27e887a..d03843bdc1 100644 --- 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 @@ -32,7 +32,7 @@ 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. + :param data: The ordered list of all ticket creation rules. Every rule must be included. :type data: [TicketCreationRuleReorderItem] """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 512922069c..5998801952 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2389,6 +2389,11 @@ from datadog_api_client.v2.model.ddsql_tabular_query_response_type import DdsqlTabularQueryResponseType from datadog_api_client.v2.model.ddsql_tabular_query_state import DdsqlTabularQueryState from datadog_api_client.v2.model.ddsql_tabular_query_time_window import DdsqlTabularQueryTimeWindow +from datadog_api_client.v2.model.default_inbox_rule_attributes_response import DefaultInboxRuleAttributesResponse +from datadog_api_client.v2.model.default_inbox_rule_data_response import DefaultInboxRuleDataResponse +from datadog_api_client.v2.model.default_inbox_rule_response import DefaultInboxRuleResponse +from datadog_api_client.v2.model.default_inbox_rule_type import DefaultInboxRuleType +from datadog_api_client.v2.model.default_inbox_rules_response import DefaultInboxRulesResponse from datadog_api_client.v2.model.default_rulesets_per_language_data import DefaultRulesetsPerLanguageData from datadog_api_client.v2.model.default_rulesets_per_language_data_attributes import ( DefaultRulesetsPerLanguageDataAttributes, @@ -3807,6 +3812,20 @@ from datadog_api_client.v2.model.identity_provider_update_data import IdentityProviderUpdateData from datadog_api_client.v2.model.identity_provider_update_request import IdentityProviderUpdateRequest from datadog_api_client.v2.model.identity_providers_response import IdentityProvidersResponse +from datadog_api_client.v2.model.inbox_rule_action import InboxRuleAction +from datadog_api_client.v2.model.inbox_rule_attributes_create import InboxRuleAttributesCreate +from datadog_api_client.v2.model.inbox_rule_attributes_response import InboxRuleAttributesResponse +from datadog_api_client.v2.model.inbox_rule_create_request import InboxRuleCreateRequest +from datadog_api_client.v2.model.inbox_rule_data_create import InboxRuleDataCreate +from datadog_api_client.v2.model.inbox_rule_data_response import InboxRuleDataResponse +from datadog_api_client.v2.model.inbox_rule_data_update import InboxRuleDataUpdate +from datadog_api_client.v2.model.inbox_rule_reorder_item import InboxRuleReorderItem +from datadog_api_client.v2.model.inbox_rule_reorder_request import InboxRuleReorderRequest +from datadog_api_client.v2.model.inbox_rule_reorder_response import InboxRuleReorderResponse +from datadog_api_client.v2.model.inbox_rule_response import InboxRuleResponse +from datadog_api_client.v2.model.inbox_rule_type import InboxRuleType +from datadog_api_client.v2.model.inbox_rule_update_request import InboxRuleUpdateRequest +from datadog_api_client.v2.model.inbox_rules_response import InboxRulesResponse from datadog_api_client.v2.model.incident_ai_postmortem_data_attributes_response import ( IncidentAIPostmortemDataAttributesResponse, ) @@ -13296,6 +13315,11 @@ "DdsqlTabularQueryResponseType", "DdsqlTabularQueryState", "DdsqlTabularQueryTimeWindow", + "DefaultInboxRuleAttributesResponse", + "DefaultInboxRuleDataResponse", + "DefaultInboxRuleResponse", + "DefaultInboxRuleType", + "DefaultInboxRulesResponse", "DefaultRulesetsPerLanguageData", "DefaultRulesetsPerLanguageDataAttributes", "DefaultRulesetsPerLanguageDataType", @@ -14360,6 +14384,20 @@ "IdentityProviderUpdateData", "IdentityProviderUpdateRequest", "IdentityProvidersResponse", + "InboxRuleAction", + "InboxRuleAttributesCreate", + "InboxRuleAttributesResponse", + "InboxRuleCreateRequest", + "InboxRuleDataCreate", + "InboxRuleDataResponse", + "InboxRuleDataUpdate", + "InboxRuleReorderItem", + "InboxRuleReorderRequest", + "InboxRuleReorderResponse", + "InboxRuleResponse", + "InboxRuleType", + "InboxRuleUpdateRequest", + "InboxRulesResponse", "IncidentAIPostmortemDataAttributesResponse", "IncidentAIPostmortemDataResponse", "IncidentAIPostmortemResponse", diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 89abdd8c36..22701a6b11 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1366,6 +1366,18 @@ "tag": "Security Monitoring", "operationId": "CreateSecurityFindingsAutomationDueDateRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"inbox_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"description\": \"Needs triage\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_inbox_rule\" in the system", + "key": "valid_inbox_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationInboxRule" + }, { "parameters": [ { diff --git a/tests/v2/features/security_monitoring.feature b/tests/v2/features/security_monitoring.feature index 761c3321a0..a72d703edd 100644 --- a/tests/v2/features/security_monitoring.feature +++ b/tests/v2/features/security_monitoring.feature @@ -1041,6 +1041,33 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Create an inbox rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationInboxRule" enabled + And new "CreateSecurityFindingsAutomationInboxRule" request + And body with value {"data": {"attributes": {"action": {"description": "Needs triage"}, "enabled": true, "name": "Triage production misconfigurations", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/k9-automation + Scenario: Create an inbox rule returns "Successfully created the inbox rule" response + Given operation "CreateSecurityFindingsAutomationInboxRule" enabled + And new "CreateSecurityFindingsAutomationInboxRule" request + And body with value {"data": {"attributes": {"action": {"description": "Needs triage"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "inbox_rules"}} + When the request is sent + Then the response status is 201 Successfully created the inbox rule + And the response "data.type" is equal to "inbox_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 an inbox rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationInboxRule" enabled + And new "CreateSecurityFindingsAutomationInboxRule" request + And body with value {"data": {"attributes": {"action": {"description": "Needs triage"}, "enabled": true, "name": "Triage production misconfigurations", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "inbox_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @team:DataDog/k9-investigation Scenario: Create case for security finding returns "Created" response Given new "CreateCases" request @@ -1230,6 +1257,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 Rule successfully deleted. + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a due date rule returns "Successfully deleted the due date rule" 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 204 Successfully deleted the due date rule + @generated @skip @team:DataDog/k9-automation Scenario: Delete a mute rule returns "Not Found" response Given operation "DeleteSecurityFindingsAutomationMuteRule" enabled @@ -1247,6 +1282,14 @@ Feature: Security Monitoring 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 "Successfully deleted the mute rule" 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 204 Successfully deleted the mute rule + @skip @team:DataDog/cloud-siem Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -1293,6 +1336,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 Rule successfully deleted + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a severity modifier rule returns "Successfully deleted the severity modifier rule" response + Given operation "DeleteSecurityFindingsAutomationSeverityModifierRule" enabled + And new "DeleteSecurityFindingsAutomationSeverityModifierRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 Successfully deleted the severity modifier rule + @generated @skip @team:DataDog/k9-automation Scenario: Delete a severity modifier rule returns "Unprocessable Entity" response Given operation "DeleteSecurityFindingsAutomationSeverityModifierRule" enabled @@ -1348,6 +1399,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 Rule successfully deleted. + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a ticket creation rule returns "Successfully deleted the ticket creation rule" 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 204 Successfully deleted the ticket creation rule + @team:DataDog/cloud-security-posture-management Scenario: Delete a vulnerability-based notification rule returns "Not Found" response Given new "DeleteVulnerabilityNotificationRule" request @@ -1426,6 +1485,23 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Delete an inbox rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationInboxRule" enabled + And new "DeleteSecurityFindingsAutomationInboxRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/k9-automation + Scenario: Delete an inbox rule returns "Successfully deleted the inbox rule" response + Given operation "DeleteSecurityFindingsAutomationInboxRule" enabled + And there is a valid "valid_inbox_rule" in the system + And new "DeleteSecurityFindingsAutomationInboxRule" request + And request contains "rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 204 Successfully deleted the inbox rule + @team:DataDog/k9-investigation Scenario: Detach security findings from their case returns "Bad Request" response Given new "DetachCase" request @@ -1447,6 +1523,44 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-automation + Scenario: Disable a default inbox rule returns "Not Found" response + Given operation "DisableSecurityFindingsAutomationDefaultInboxRule" enabled + And new "DisableSecurityFindingsAutomationDefaultInboxRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/k9-automation + Scenario: Disable a default inbox rule returns "Successfully disabled the default inbox rule" response + Given operation "DisableSecurityFindingsAutomationDefaultInboxRule" enabled + And new "DisableSecurityFindingsAutomationDefaultInboxRule" request + And request contains "rule_id" parameter with value "secret_default_rule" + When the request is sent + Then the response status is 200 Successfully disabled the default inbox rule + And the response "data.id" is equal to "secret_default_rule" + And the response "data.type" is equal to "default_inbox_rules" + And the response "data.attributes.enabled" is equal to false + + @generated @skip @team:DataDog/k9-automation + Scenario: Enable a default inbox rule returns "Not Found" response + Given operation "EnableSecurityFindingsAutomationDefaultInboxRule" enabled + And new "EnableSecurityFindingsAutomationDefaultInboxRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/k9-automation + Scenario: Enable a default inbox rule returns "Successfully enabled the default inbox rule" response + Given operation "EnableSecurityFindingsAutomationDefaultInboxRule" enabled + And new "EnableSecurityFindingsAutomationDefaultInboxRule" request + And request contains "rule_id" parameter with value "secret_default_rule" + When the request is sent + Then the response status is 200 Successfully enabled the default inbox rule + And the response "data.id" is equal to "secret_default_rule" + And the response "data.type" is equal to "default_inbox_rules" + And the response "data.attributes.enabled" is equal to true + @generated @skip @team:DataDog/cloud-siem Scenario: Export security monitoring resource to Terraform returns "Not Found" response Given operation "ExportSecurityMonitoringTerraformResource" enabled @@ -1662,6 +1776,24 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Get a default inbox rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationDefaultInboxRule" enabled + And new "GetSecurityFindingsAutomationDefaultInboxRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/k9-automation + Scenario: Get a default inbox rule returns "Successfully retrieved the default inbox rule" response + Given operation "GetSecurityFindingsAutomationDefaultInboxRule" enabled + And new "GetSecurityFindingsAutomationDefaultInboxRule" request + And request contains "rule_id" parameter with value "secret_default_rule" + When the request is sent + Then the response status is 200 Successfully retrieved the default inbox rule + And the response "data.id" is equal to "secret_default_rule" + And the response "data.type" is equal to "default_inbox_rules" + @generated @skip @team:DataDog/k9-automation Scenario: Get a due date rule returns "Not Found" response Given operation "GetSecurityFindingsAutomationDueDateRule" enabled @@ -2027,6 +2159,14 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/k9-automation + Scenario: Get all default inbox rules returns "Successfully retrieved the list of default inbox rules" response + Given operation "ListSecurityFindingsAutomationDefaultInboxRules" enabled + And new "ListSecurityFindingsAutomationDefaultInboxRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of default inbox rules + And the response "data" has item with field "id" with value "secret_default_rule" + @team:DataDog/k9-automation Scenario: Get all due date rules returns "Successfully retrieved the list of due date rules" response Given operation "ListSecurityFindingsAutomationDueDateRules" enabled @@ -2036,6 +2176,15 @@ Feature: Security Monitoring 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 }}" + @skip @team:DataDog/k9-automation + Scenario: Get all inbox rules returns "Successfully retrieved the list of inbox rules" response + Given operation "ListSecurityFindingsAutomationInboxRules" enabled + And there is a valid "valid_inbox_rule" in the system + And new "ListSecurityFindingsAutomationInboxRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of inbox rules + And the response "data" has item with field "id" with value "{{ valid_inbox_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 @@ -2134,6 +2283,25 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Get an inbox rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationInboxRule" enabled + And new "GetSecurityFindingsAutomationInboxRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/k9-automation + Scenario: Get an inbox rule returns "Successfully retrieved the inbox rule" response + Given operation "GetSecurityFindingsAutomationInboxRule" enabled + And there is a valid "valid_inbox_rule" in the system + And new "GetSecurityFindingsAutomationInboxRule" request + And request contains "rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the inbox rule + And the response "data.id" is equal to "{{ valid_inbox_rule.data.id }}" + And the response "data.type" is equal to "inbox_rules" + @generated @skip @team:DataDog/cloud-siem Scenario: Get an indicator of compromise returns "Bad Request" response Given operation "GetIndicatorOfCompromise" enabled @@ -2963,6 +3131,31 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder inbox rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationInboxRules" enabled + And new "ReorderSecurityFindingsAutomationInboxRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "inbox_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/k9-automation + Scenario: Reorder inbox rules returns "Successfully reordered the inbox rules" response + Given operation "ReorderSecurityFindingsAutomationInboxRules" enabled + And there is a valid "valid_inbox_rule" in the system + And new "ReorderSecurityFindingsAutomationInboxRules" request + And body with value {"data": [{"id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the inbox rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder inbox rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationInboxRules" enabled + And new "ReorderSecurityFindingsAutomationInboxRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "inbox_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 @@ -3664,6 +3857,45 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}-Updated" And the response "id" has the same value as "security_rule.id" + @generated @skip @team:DataDog/k9-automation + Scenario: Update an inbox rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationInboxRule" enabled + And new "UpdateSecurityFindingsAutomationInboxRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"description": "Needs triage"}, "enabled": true, "name": "Triage production misconfigurations", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "id": "00000000-0000-0000-0000-000000000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update an inbox rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationInboxRule" enabled + And new "UpdateSecurityFindingsAutomationInboxRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"description": "Needs triage"}, "enabled": true, "name": "Triage production misconfigurations", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "id": "00000000-0000-0000-0000-000000000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/k9-automation + Scenario: Update an inbox rule returns "Successfully updated the inbox rule" response + Given operation "UpdateSecurityFindingsAutomationInboxRule" enabled + And there is a valid "valid_inbox_rule" in the system + And new "UpdateSecurityFindingsAutomationInboxRule" request + And request contains "rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"description": "Needs triage"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the inbox rule + And the response "data.id" is equal to "{{ valid_inbox_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update an inbox rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationInboxRule" enabled + And new "UpdateSecurityFindingsAutomationInboxRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"description": "Needs triage"}, "enabled": true, "name": "Triage production misconfigurations", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "id": "00000000-0000-0000-0000-000000000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @team:DataDog/cloud-siem Scenario: Update resource filters returns "Bad Request" response Given new "UpdateResourceEvaluationFilters" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index d96a572b6a..edb05f3dac 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -7899,6 +7899,30 @@ "type": "idempotent" } }, + "ListSecurityFindingsAutomationDefaultInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "GetSecurityFindingsAutomationDefaultInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "DisableSecurityFindingsAutomationDefaultInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "EnableSecurityFindingsAutomationDefaultInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListSecurityFindingsAutomationDueDateRules": { "tag": "Security Monitoring", "undo": { @@ -7942,6 +7966,49 @@ "type": "idempotent" } }, + "ListSecurityFindingsAutomationInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationInboxRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationInboxRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListSecurityFindingsAutomationMuteRules": { "tag": "Security Monitoring", "undo": {