diff --git a/.apigentools-info b/.apigentools-info index 6416aa99a0..9863b8009f 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-28 14:57:16.722951", - "spec_repo_commit": "f832f43e" + "regenerated": "2025-01-28 16:23:41.368586", + "spec_repo_commit": "590dadb7" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-28 14:57:16.737270", - "spec_repo_commit": "f832f43e" + "regenerated": "2025-01-28 16:23:41.383418", + "spec_repo_commit": "590dadb7" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ec0661fe20..28344b419e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -733,6 +733,13 @@ components: type: string requestBodies: {} responses: + AutomationRuleUnprocessableEntityResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: The server cannot process the request because it contains invalid + data. BadRequestResponse: content: application/json: @@ -782,6 +789,28 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden + InboxRulesList: + content: + application/json: + schema: + properties: + data: + items: + $ref: '#/components/schemas/InboxRule' + type: array + type: object + description: The list of inbox rules + MuteRulesList: + content: + application/json: + schema: + properties: + data: + items: + $ref: '#/components/schemas/MuteRule' + type: array + type: object + description: The list of mute rules NotAuthorizedResponse: content: application/json: @@ -1748,6 +1777,31 @@ components: oneOf: - $ref: '#/components/schemas/AWSIntegrationUpdate' - $ref: '#/components/schemas/HTTPIntegrationUpdate' + ActionInbox: + description: Action of the inbox rule + properties: + reason_description: + description: Free text to add a reason description. + example: We want to focus on these items. + type: string + type: object + ActionMute: + description: Action of the mute rule + properties: + expire_at: + description: End date of the mute rule (null means mute forever) + example: 1893452400000 + format: int64 + type: integer + reason: + $ref: '#/components/schemas/MuteReason' + reason_description: + description: Free text to add a reason description. + example: Muting for a while + type: string + required: + - reason + type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -2757,6 +2811,49 @@ components: type: string x-enum-varnames: - AUTHN_MAPPINGS + AutomationRule: + description: 'The definition of an automation pipeline rule scope. + + A rule can act on specific issue types, security rule types, security rule + IDs, rule severities, or a query. + + The query can be used to filter resources on tags and attributes. + + The issue type and rule types fields are required.' + properties: + issue_type: + $ref: '#/components/schemas/IssueType' + query: + $ref: '#/components/schemas/RuleQuery' + rule_ids: + $ref: '#/components/schemas/RuleIds' + rule_types: + $ref: '#/components/schemas/SecurityRuleTypes' + severities: + description: The security rules severities to consider + items: + $ref: '#/components/schemas/SecurityRuleSeverity' + type: array + required: + - issue_type + - rule_types + type: object + AutomationRuleName: + description: Name of the pipeline rule + example: Rule 1 + type: string + AutomationRuleUser: + description: User creating or modifying a rule + properties: + handle: + description: The user handle. + example: john.doe@domain.com + type: string + name: + description: The user name. + example: John Doe + type: string + type: object AwsCURConfig: description: AWS CUR config. properties: @@ -7451,6 +7548,76 @@ components: meta: $ref: '#/components/schemas/DataDeletionResponseMeta' type: object + CreateInboxRuleParameters: + description: Body of the inbox rule create request + properties: + data: + $ref: '#/components/schemas/CreateInboxRuleParametersData' + type: object + CreateInboxRuleParametersData: + description: 'Data of the inbox rule create request: the rule type and the rule + attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateInboxRuleParametersDataAttributes' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - type + type: object + CreateInboxRuleParametersDataAttributes: + description: 'Attributes of the inbox rule create request: the rule name, the + rule details, the associated action, and the optional enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionInbox' + enabled: + $ref: '#/components/schemas/RuleEnabled' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + required: + - action + - name + - rule + type: object + CreateMuteRuleParameters: + description: Body of the mute rule create request + properties: + data: + $ref: '#/components/schemas/CreateMuteRuleParametersData' + type: object + CreateMuteRuleParametersData: + description: 'Data of the mute rule create request: the rule type and the rule + attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateMuteRuleParametersDataAttributes' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - type + type: object + CreateMuteRuleParametersDataAttributes: + description: 'Attributes of the mute rule create request: the rule name, the + rule details, the associated action, and the optional enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionMute' + enabled: + $ref: '#/components/schemas/RuleEnabled' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + required: + - action + - name + - rule + type: object CreateNotificationRuleParameters: description: Body of the notification rule create request. properties: @@ -13271,6 +13438,67 @@ components: type: string x-mimetype: application/xml type: object + InboxRule: + description: 'Inbox rules are used to prioritize and add relevant vulnerabilities + to your Security Inbox. + + An inbox rule is composed of a rule UUID, a rule type, and the rule attributes. + All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/InboxRuleAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - id + - type + type: object + InboxRuleAttributes: + description: Attributes of the inbox rule + properties: + action: + $ref: '#/components/schemas/ActionInbox' + created_at: + $ref: '#/components/schemas/RuleModificationDate' + created_by: + $ref: '#/components/schemas/AutomationRuleUser' + enabled: + $ref: '#/components/schemas/RuleEnabled' + modified_at: + $ref: '#/components/schemas/RuleModificationDate' + modified_by: + $ref: '#/components/schemas/AutomationRuleUser' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + required: + - action + - created_at + - created_by + - enabled + - modified_at + - modified_by + - name + - rule + type: object + InboxRuleResponse: + description: Response object which includes an inbox rule. + properties: + data: + $ref: '#/components/schemas/InboxRule' + type: object + InboxRulesType: + description: The pipeline rule type associated to inbox rules + enum: + - inbox_rules + example: inbox_rules + type: string + x-enum-varnames: + - INBOX_RULES IncidentAttachmentAttachmentType: description: The type of the incident attachment attributes. enum: @@ -15405,6 +15633,14 @@ components: - DOWN - WARNING - 'OFF' + IssueType: + description: The type of issues on which the rule applies + enum: + - vulnerability + example: vulnerability + type: string + x-enum-varnames: + - VULNERABILITY JSONAPIErrorItem: description: API error response body properties: @@ -19255,6 +19491,91 @@ components: meta: $ref: '#/components/schemas/MonthlyCostAttributionMeta' type: object + MuteReason: + description: Reason for muting a vulnerability + enum: + - duplicate + - external_solution + - false_positive + - internal_solution + - no_fix_available + - other + - pending_fix + - risk_accepted + example: duplicate + type: string + x-enum-varnames: + - DUPLICATE + - EXTERNAL_SOLUTION + - FALSE_POSITIVE + - INTERNAL_SOLUTION + - NO_FIX_AVAILABLE + - OTHER + - PENDING_FIX + - RISK_ACCEPTED + MuteRule: + description: 'Mute rules are used to proactively filter out known false positives + or accepted risks. + + A mute rule is composed of a rule UUID, a rule type, and the rule attributes. + All fields are required. + + ' + properties: + attributes: + $ref: '#/components/schemas/MuteRuleAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - id + - type + type: object + MuteRuleAttributes: + description: Attributes of the mute rule + properties: + action: + $ref: '#/components/schemas/ActionMute' + created_at: + $ref: '#/components/schemas/RuleModificationDate' + created_by: + $ref: '#/components/schemas/AutomationRuleUser' + enabled: + $ref: '#/components/schemas/RuleEnabled' + modified_at: + $ref: '#/components/schemas/RuleModificationDate' + modified_by: + $ref: '#/components/schemas/AutomationRuleUser' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + required: + - action + - created_at + - created_by + - enabled + - modified_at + - modified_by + - name + - rule + type: object + MuteRuleResponse: + description: Response object which includes a mute rule. + properties: + data: + $ref: '#/components/schemas/MuteRule' + type: object + MuteRulesType: + description: The pipeline rule type associated to mute rules + enum: + - mute_rules + example: mute_rules + type: string + x-enum-varnames: + - MUTE_RULES NotificationRule: description: 'Notification rules allow full control over notifications generated by the various Datadog security products. @@ -20186,6 +20507,74 @@ components: $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' type: array type: object + PatchInboxRulesParameters: + description: Body of the inbox rule patch request + properties: + data: + $ref: '#/components/schemas/PatchInboxRulesParametersData' + type: object + PatchInboxRulesParametersData: + description: 'Data of the inbox rule patch request: the rule UUID, the rule + type, and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/PatchInboxRulesParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - id + - type + type: object + PatchInboxRulesParametersDataAttributes: + description: 'Attributes of the inbox rule patch request: the rule name, the + rule details, the associated action, and the enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionInbox' + enabled: + $ref: '#/components/schemas/RuleEnabled' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + type: object + PatchMuteRuleParameters: + description: Body of the mute rule patch request + properties: + data: + $ref: '#/components/schemas/PatchMuteRuleParametersData' + type: object + PatchMuteRuleParametersData: + description: 'Data of the mute rule patch request: the rule UUID, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/PatchMuteRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - id + - type + type: object + PatchMuteRuleParametersDataAttributes: + description: 'Attributes of the mute rule patch request: the rule name, the + rule details, the associated action, and the enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionMute' + enabled: + $ref: '#/components/schemas/RuleEnabled' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + type: object PatchNotificationRuleParameters: description: Body of the notification rule patch request. properties: @@ -22227,6 +22616,50 @@ components: - new_advisories - avoided_advisories type: object + ReorderInboxRulesParameters: + description: 'Body of the inbox rule reorder request: the full list of inbox + rules, which must be provided in the new order.' + properties: + data: + description: The `ReorderInboxRulesParameters` `data`. + items: + $ref: '#/components/schemas/ReorderInboxRulesParametersData' + type: array + type: object + ReorderInboxRulesParametersData: + description: 'Data of the inbox rule reorder request: the rule UUID, the rule + type, and the rule attributes. All fields are required.' + properties: + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - id + - type + type: object + ReorderMuteRulesParameters: + description: 'Body of the mute rule reorder request: the full list of mute rules, + which must be provided in the new order.' + properties: + data: + description: The `ReorderMuteRulesParameters` `data`. + items: + $ref: '#/components/schemas/ReorderMuteRulesParametersData' + type: array + type: object + ReorderMuteRulesParametersData: + description: 'Data of the mute rule reorder request: a rule UUID and its type. + All fields are required.' + properties: + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - id + - type + type: object ReorderRetentionFiltersRequest: description: A list of retention filters to reorder. properties: @@ -22911,10 +23344,26 @@ components: example: Deployments automated via Deployment Trains type: string type: object + RuleEnabled: + description: Field used to enable or disable the rule. + example: true + type: boolean RuleId: description: The unique ID for a scorecard rule. example: q8MQxk8TCqrHnWkx type: string + RuleIds: + description: Security rule ids + items: + description: Id of a rule + example: rule-id-1 + type: string + type: array + RuleModificationDate: + description: Date as Unix timestamp in milliseconds + example: 1722439510282 + format: int64 + type: integer RuleName: description: Name of the notification rule. example: Rule 1 @@ -22925,6 +23374,11 @@ components: rule: $ref: '#/components/schemas/RelationshipToOutcome' type: object + RuleQuery: + description: The query is composed of one or several key:value pairs, which + can be used to filter resources on tags and attributes. + example: key:val + type: string RuleSeverity: description: Severity of a security rule. enum: @@ -25894,6 +26348,52 @@ components: nullable: true type: string type: object + SecurityRuleSeverity: + description: Severity of a security rule + enum: + - critical + - high + - medium + - low + - unknown + - info + example: critical + type: string + x-enum-varnames: + - CRITICAL + - HIGH + - MEDIUM + - LOW + - UNKNOWN + - INFO + SecurityRuleTypes: + description: Security rule types + example: + - application_code_vulnerability + items: + $ref: '#/components/schemas/SecurityRuleTypesItems' + type: array + SecurityRuleTypesItems: + description: Security rule type + enum: + - application_code_vulnerability + - application_library_vulnerability + - attack_path + - container_image_vulnerability + - host_vulnerability + - identity_risk + - misconfiguration + - api_security + type: string + x-enum-varnames: + - APPLICATION_CODE_VULNERABILITY + - APPLICATION_LIBRARY_VULNERABILITY + - ATTACK_PATH + - CONTAINER_IMAGE_VULNERABILITY + - HOST_VULNERABILITY + - IDENTITY_RISK + - MISCONFIGURATION + - API_SECURITY Selectors: description: 'Selectors are used to filter security issues for which notifications should be generated. @@ -29421,6 +29921,11 @@ components: x-enum-varnames: - SECURITY_FINDINGS - SECURITY_SIGNALS + UUID: + description: The ID of a pipeline rule + example: 123e4567-e89b-12d3-a456-426655440000 + format: uuid + type: string Unit: description: Object containing the metric unit family, scale factor, name, and short name. @@ -29641,6 +30146,48 @@ components: type: string type: array type: object + UpdateInboxRuleParameters: + description: Body of the inbox rule update request + properties: + data: + $ref: '#/components/schemas/UpdateInboxRuleParametersData' + type: object + UpdateInboxRuleParametersData: + description: 'Data of the inbox rule update request: the rule id, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateInboxRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - id + - attributes + - type + type: object + UpdateMuteRuleParameters: + description: Body of the mute rule update request + properties: + data: + $ref: '#/components/schemas/UpdateMuteRuleParametersData' + type: object + UpdateMuteRuleParametersData: + description: 'Data of the mute rule update request: the rule id, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateMuteRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - id + - attributes + - type + type: object UpdateOpenAPIResponse: description: Response for `UpdateOpenAPI`. properties: @@ -44442,6 +44989,559 @@ paths: operator: OR permissions: - security_monitoring_notification_profiles_write + /api/v2/security/vulnerabilities/pipelines/inbox_rules: + get: + description: Returns the ordered list of inbox rules in the pipeline (first + match applies) + operationId: GetInboxRules + responses: + '200': + $ref: '#/components/responses/InboxRulesList' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get the ordered list of inbox rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + post: + description: Create a new inbox rule and return the created rule. + operationId: CreateInboxRule + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateInboxRuleParameters' + description: 'Mandatory fields are the rule type and the required attributes: + rule name, rule details, and action. + + The rule details are composed of issue types and security rule types on + which the rule applies. Optional security rule IDs, severities, and a tag + or attribute query can be provided. + + The action is composed of the optional reason description. + + ' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Successfully created the inbox rule + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Create a new inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder: + post: + description: 'Reorder the list of inbox rules in the pipeline and return the + reordered list of rules. + + To reorder fields, you must provide the full list of pipeline rules in the + new order.' + operationId: ReorderInboxRules + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReorderInboxRulesParameters' + description: 'The list of rules to reorder. The order of the rules in the + list becomes the new order in the pipeline. + + ' + required: true + responses: + '200': + $ref: '#/components/responses/InboxRulesList' + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Reorder the list of inbox rules in the pipeline + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}: + delete: + description: Delete an inbox rule + operationId: DeleteInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: Rule successfully deleted + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Delete an inbox rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + get: + description: Get the details of an inbox rule. + operationId: GetInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule details + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get details of an inbox rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + patch: + description: Partially update the inbox rule. All fields are optional; if a + field is not provided, it is not updated. + operationId: PatchInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchInboxRulesParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule successfully patched + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/AutomationRuleUnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Patch an inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + put: + description: Update the whole inbox rule. If an optional field is not provided, + it is set to its default value. + operationId: UpdateInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateInboxRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule successfully updated + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/AutomationRuleUnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Update an inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules: + get: + description: Returns the ordered list of mute rules in the pipeline (first match + applies) + operationId: GetMuteRules + responses: + '200': + $ref: '#/components/responses/MuteRulesList' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get the ordered list of mute rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + post: + description: Create a new mute rule and return the created rule. + operationId: CreateMuteRule + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateMuteRuleParameters' + description: 'Mandatory fields are the rule type and the required attributes: + rule name, rule details, and action. + + The rule details are composed of issue types and security rule types on + which the rule applies. Optional security rule IDs, severities, and a tag + or attribute query can be provided. + + The action is composed of the reason for muting and the rule expiration + date, and optionally a description of the rule. + + ' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Successfully created the mute rule + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Create a new mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules/reorder: + post: + description: 'Reorder the list of mute rules in the pipeline and return the + reordered list of rules. + + To reorder fields, you must provide the full list of pipeline rules in the + new order.' + operationId: ReorderMuteRules + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReorderMuteRulesParameters' + description: 'The list of rules to reorder. The order of the rules in the + list becomes the new order in the pipeline. + + ' + required: true + responses: + '200': + $ref: '#/components/responses/MuteRulesList' + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Reorder the list of mute rules in the pipeline + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}: + delete: + description: Delete a mute rule + operationId: DeleteMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: Rule successfully deleted + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Delete a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + get: + description: Get the details of a mute rule. + operationId: GetMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule details + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get details of a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + patch: + description: Partially update the mute rule. All fields are optional; if a field + is not provided, it is not updated. + operationId: PatchMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchMuteRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule successfully patched + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/AutomationRuleUnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Patch a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + put: + description: Update the whole mute rule. If an optional field is not provided, + it is set to its default value. + operationId: UpdateMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMuteRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule successfully updated + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/AutomationRuleUnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Update a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write /api/v2/security_monitoring/cloud_workload_security/agent_rules: get: description: Get the list of Agent rules. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 054c45be57..f59e1d09f0 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -53,6 +53,20 @@ datadog\_api\_client.v2.model.action\_connection\_integration\_update module :members: :show-inheritance: +datadog\_api\_client.v2.model.action\_inbox module +-------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_inbox + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.action\_mute module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.action_mute + :members: + :show-inheritance: + datadog\_api\_client.v2.model.active\_billing\_dimensions\_attributes module ---------------------------------------------------------------------------- @@ -634,6 +648,20 @@ datadog\_api\_client.v2.model.authn\_mappings\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.automation\_rule module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.automation_rule + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.automation\_rule\_user module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.automation_rule_user + :members: + :show-inheritance: + datadog\_api\_client.v2.model.aws\_account\_create\_request module ------------------------------------------------------------------ @@ -2888,6 +2916,48 @@ datadog\_api\_client.v2.model.create\_data\_deletion\_response\_body module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_inbox\_rule\_parameters module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_inbox_rule_parameters + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_inbox\_rule\_parameters\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_inbox_rule_parameters_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_inbox\_rule\_parameters\_data\_attributes module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_inbox_rule_parameters_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_mute\_rule\_parameters module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_mute_rule_parameters + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_mute\_rule\_parameters\_data module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_mute_rule_parameters_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_mute\_rule\_parameters\_data\_attributes module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_mute_rule_parameters_data_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_notification\_rule\_parameters module --------------------------------------------------------------------------- @@ -5408,6 +5478,34 @@ datadog\_api\_client.v2.model.idp\_metadata\_form\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.inbox\_rule module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.inbox_rule + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.inbox\_rule\_attributes module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.inbox_rule_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.inbox\_rule\_response module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.inbox_rule_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.inbox\_rules\_type module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.inbox_rules_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.incident\_attachment\_attachment\_type module --------------------------------------------------------------------------- @@ -6409,6 +6507,13 @@ datadog\_api\_client.v2.model.ip\_allowlist\_update\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.issue\_type module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.issue_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.jira\_integration\_metadata module ---------------------------------------------------------------- @@ -8264,6 +8369,41 @@ datadog\_api\_client.v2.model.ms\_teams\_integration\_metadata\_teams\_item modu :members: :show-inheritance: +datadog\_api\_client.v2.model.mute\_reason module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_reason + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_attributes module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rule\_response module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.mute_rule_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.mute\_rules\_type module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.mute_rules_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.notification\_rule module ------------------------------------------------------- @@ -8740,6 +8880,48 @@ datadog\_api\_client.v2.model.partial\_application\_key\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.patch\_inbox\_rules\_parameters module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_inbox_rules_parameters + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_inbox\_rules\_parameters\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_inbox_rules_parameters_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_inbox\_rules\_parameters\_data\_attributes module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_inbox_rules_parameters_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_mute\_rule\_parameters module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.patch_mute_rule_parameters + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_mute\_rule\_parameters\_data module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.patch_mute_rule_parameters_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_mute\_rule\_parameters\_data\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.patch_mute_rule_parameters_data_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.patch\_notification\_rule\_parameters module -------------------------------------------------------------------------- @@ -9377,6 +9559,34 @@ datadog\_api\_client.v2.model.remediation module :members: :show-inheritance: +datadog\_api\_client.v2.model.reorder\_inbox\_rules\_parameters module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.reorder_inbox_rules_parameters + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.reorder\_inbox\_rules\_parameters\_data module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.reorder_inbox_rules_parameters_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.reorder\_mute\_rules\_parameters module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.reorder_mute_rules_parameters + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.reorder\_mute\_rules\_parameters\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.reorder_mute_rules_parameters_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.reorder\_retention\_filters\_request module ------------------------------------------------------------------------- @@ -11169,6 +11379,20 @@ datadog\_api\_client.v2.model.security\_monitoring\_user module :members: :show-inheritance: +datadog\_api\_client.v2.model.security\_rule\_severity module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_rule_severity + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_rule\_types\_items module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_rule_types_items + :members: + :show-inheritance: + datadog\_api\_client.v2.model.selectors module ---------------------------------------------- @@ -12961,6 +13185,34 @@ datadog\_api\_client.v2.model.update\_app\_response\_data\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.update\_inbox\_rule\_parameters module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_inbox_rule_parameters + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_inbox\_rule\_parameters\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_inbox_rule_parameters_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_mute\_rule\_parameters module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_mute_rule_parameters + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_mute\_rule\_parameters\_data module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_mute_rule_parameters_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.update\_open\_api\_response module ---------------------------------------------------------------- diff --git a/examples/v2/security-monitoring/CreateInboxRule.py b/examples/v2/security-monitoring/CreateInboxRule.py new file mode 100644 index 0000000000..e74973c1ad --- /dev/null +++ b/examples/v2/security-monitoring/CreateInboxRule.py @@ -0,0 +1,50 @@ +""" +Create a new 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.action_inbox import ActionInbox +from datadog_api_client.v2.model.automation_rule import AutomationRule +from datadog_api_client.v2.model.create_inbox_rule_parameters import CreateInboxRuleParameters +from datadog_api_client.v2.model.create_inbox_rule_parameters_data import CreateInboxRuleParametersData +from datadog_api_client.v2.model.create_inbox_rule_parameters_data_attributes import ( + CreateInboxRuleParametersDataAttributes, +) +from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType +from datadog_api_client.v2.model.issue_type import IssueType +from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity +from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems + +body = CreateInboxRuleParameters( + data=CreateInboxRuleParametersData( + attributes=CreateInboxRuleParametersDataAttributes( + action=ActionInbox( + reason_description="We want to focus on these items.", + ), + enabled=True, + name="Rule 1", + rule=AutomationRule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + SecurityRuleSeverity.CRITICAL, + ], + ), + ), + type=InboxRulesType.INBOX_RULES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_inbox_rule(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/CreateMuteRule.py b/examples/v2/security-monitoring/CreateMuteRule.py new file mode 100644 index 0000000000..40703597e7 --- /dev/null +++ b/examples/v2/security-monitoring/CreateMuteRule.py @@ -0,0 +1,53 @@ +""" +Create a new mute rule returns "Successfully created the mute rule" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.action_mute import ActionMute +from datadog_api_client.v2.model.automation_rule import AutomationRule +from datadog_api_client.v2.model.create_mute_rule_parameters import CreateMuteRuleParameters +from datadog_api_client.v2.model.create_mute_rule_parameters_data import CreateMuteRuleParametersData +from datadog_api_client.v2.model.create_mute_rule_parameters_data_attributes import ( + CreateMuteRuleParametersDataAttributes, +) +from datadog_api_client.v2.model.issue_type import IssueType +from datadog_api_client.v2.model.mute_reason import MuteReason +from datadog_api_client.v2.model.mute_rules_type import MuteRulesType +from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity +from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems + +body = CreateMuteRuleParameters( + data=CreateMuteRuleParametersData( + attributes=CreateMuteRuleParametersDataAttributes( + action=ActionMute( + expire_at=1893452400000, + reason=MuteReason.DUPLICATE, + reason_description="Muting for a while", + ), + enabled=True, + name="Rule 1", + rule=AutomationRule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + SecurityRuleSeverity.CRITICAL, + ], + ), + ), + type=MuteRulesType.MUTE_RULES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.create_mute_rule(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/DeleteInboxRule.py b/examples/v2/security-monitoring/DeleteInboxRule.py new file mode 100644 index 0000000000..bce6d923b8 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteInboxRule.py @@ -0,0 +1,17 @@ +""" +Delete an inbox 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_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = environ["VALID_INBOX_RULE_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + api_instance.delete_inbox_rule( + inbox_rule_id=VALID_INBOX_RULE_DATA_ID, + ) diff --git a/examples/v2/security-monitoring/DeleteMuteRule.py b/examples/v2/security-monitoring/DeleteMuteRule.py new file mode 100644 index 0000000000..777b951432 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteMuteRule.py @@ -0,0 +1,17 @@ +""" +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() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + api_instance.delete_mute_rule( + mute_rule_id=VALID_MUTE_RULE_DATA_ID, + ) diff --git a/examples/v2/security-monitoring/GetInboxRule.py b/examples/v2/security-monitoring/GetInboxRule.py new file mode 100644 index 0000000000..d943840a1b --- /dev/null +++ b/examples/v2/security-monitoring/GetInboxRule.py @@ -0,0 +1,19 @@ +""" +Get details of an inbox rule returns "Inbox rule details" 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() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_inbox_rule( + inbox_rule_id=VALID_INBOX_RULE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/security-monitoring/GetInboxRules.py b/examples/v2/security-monitoring/GetInboxRules.py new file mode 100644 index 0000000000..5c54b61998 --- /dev/null +++ b/examples/v2/security-monitoring/GetInboxRules.py @@ -0,0 +1,13 @@ +""" +Get the ordered list of inbox rules returns "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() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_inbox_rules() + + print(response) diff --git a/examples/v2/security-monitoring/GetMuteRule.py b/examples/v2/security-monitoring/GetMuteRule.py new file mode 100644 index 0000000000..2bd7953d4f --- /dev/null +++ b/examples/v2/security-monitoring/GetMuteRule.py @@ -0,0 +1,19 @@ +""" +Get details of a mute rule returns "Mute rule details" 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() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_mute_rule( + mute_rule_id=VALID_MUTE_RULE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/security-monitoring/GetMuteRules.py b/examples/v2/security-monitoring/GetMuteRules.py new file mode 100644 index 0000000000..54fe7b4edf --- /dev/null +++ b/examples/v2/security-monitoring/GetMuteRules.py @@ -0,0 +1,13 @@ +""" +Get the ordered list of mute rules returns "The list of mute rules" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_mute_rules() + + print(response) diff --git a/examples/v2/security-monitoring/PatchInboxRule.py b/examples/v2/security-monitoring/PatchInboxRule.py new file mode 100644 index 0000000000..e912c55d59 --- /dev/null +++ b/examples/v2/security-monitoring/PatchInboxRule.py @@ -0,0 +1,55 @@ +""" +Patch an inbox rule returns "Inbox rule successfully patched" 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.action_inbox import ActionInbox +from datadog_api_client.v2.model.automation_rule import AutomationRule +from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType +from datadog_api_client.v2.model.issue_type import IssueType +from datadog_api_client.v2.model.patch_inbox_rules_parameters import PatchInboxRulesParameters +from datadog_api_client.v2.model.patch_inbox_rules_parameters_data import PatchInboxRulesParametersData +from datadog_api_client.v2.model.patch_inbox_rules_parameters_data_attributes import ( + PatchInboxRulesParametersDataAttributes, +) +from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity +from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems + +# there is a valid "valid_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = environ["VALID_INBOX_RULE_DATA_ID"] + +body = PatchInboxRulesParameters( + data=PatchInboxRulesParametersData( + attributes=PatchInboxRulesParametersDataAttributes( + action=ActionInbox( + reason_description="We want to focus on these items.", + ), + enabled=True, + name="Rule 1", + rule=AutomationRule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + SecurityRuleSeverity.CRITICAL, + ], + ), + ), + id=VALID_INBOX_RULE_DATA_ID, + type=InboxRulesType.INBOX_RULES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.patch_inbox_rule(inbox_rule_id=VALID_INBOX_RULE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/security-monitoring/PatchMuteRule.py b/examples/v2/security-monitoring/PatchMuteRule.py new file mode 100644 index 0000000000..372621b5fe --- /dev/null +++ b/examples/v2/security-monitoring/PatchMuteRule.py @@ -0,0 +1,56 @@ +""" +Patch a mute rule returns "Mute rule successfully patched" 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.action_mute import ActionMute +from datadog_api_client.v2.model.automation_rule import AutomationRule +from datadog_api_client.v2.model.issue_type import IssueType +from datadog_api_client.v2.model.mute_reason import MuteReason +from datadog_api_client.v2.model.mute_rules_type import MuteRulesType +from datadog_api_client.v2.model.patch_mute_rule_parameters import PatchMuteRuleParameters +from datadog_api_client.v2.model.patch_mute_rule_parameters_data import PatchMuteRuleParametersData +from datadog_api_client.v2.model.patch_mute_rule_parameters_data_attributes import PatchMuteRuleParametersDataAttributes +from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity +from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = environ["VALID_MUTE_RULE_DATA_ID"] + +body = PatchMuteRuleParameters( + data=PatchMuteRuleParametersData( + attributes=PatchMuteRuleParametersDataAttributes( + action=ActionMute( + expire_at=1893452400000, + reason=MuteReason.DUPLICATE, + reason_description="Muting for a while", + ), + enabled=True, + name="Rule 1", + rule=AutomationRule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + SecurityRuleSeverity.CRITICAL, + ], + ), + ), + id=VALID_MUTE_RULE_DATA_ID, + type=MuteRulesType.MUTE_RULES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.patch_mute_rule(mute_rule_id=VALID_MUTE_RULE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/security-monitoring/ReorderInboxRules.py b/examples/v2/security-monitoring/ReorderInboxRules.py new file mode 100644 index 0000000000..a0f8a0269f --- /dev/null +++ b/examples/v2/security-monitoring/ReorderInboxRules.py @@ -0,0 +1,26 @@ +""" +Reorder the list of inbox rules in the pipeline returns "The list of inbox rules" 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.inbox_rules_type import InboxRulesType +from datadog_api_client.v2.model.reorder_inbox_rules_parameters import ReorderInboxRulesParameters +from datadog_api_client.v2.model.reorder_inbox_rules_parameters_data import ReorderInboxRulesParametersData +from uuid import UUID + +body = ReorderInboxRulesParameters( + data=[ + ReorderInboxRulesParametersData( + id=UUID("123e4567-e89b-12d3-a456-426655440000"), + type=InboxRulesType.INBOX_RULES, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.reorder_inbox_rules(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/ReorderMuteRules.py b/examples/v2/security-monitoring/ReorderMuteRules.py new file mode 100644 index 0000000000..7c31429bd7 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderMuteRules.py @@ -0,0 +1,26 @@ +""" +Reorder the list of mute rules in the pipeline returns "The list of mute rules" 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.mute_rules_type import MuteRulesType +from datadog_api_client.v2.model.reorder_mute_rules_parameters import ReorderMuteRulesParameters +from datadog_api_client.v2.model.reorder_mute_rules_parameters_data import ReorderMuteRulesParametersData +from uuid import UUID + +body = ReorderMuteRulesParameters( + data=[ + ReorderMuteRulesParametersData( + id=UUID("123e4567-e89b-12d3-a456-426655440000"), + type=MuteRulesType.MUTE_RULES, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.reorder_mute_rules(body=body) + + print(response) diff --git a/examples/v2/security-monitoring/UpdateInboxRule.py b/examples/v2/security-monitoring/UpdateInboxRule.py new file mode 100644 index 0000000000..e99011f949 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateInboxRule.py @@ -0,0 +1,55 @@ +""" +Update an inbox rule returns "Inbox rule successfully updated" 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.action_inbox import ActionInbox +from datadog_api_client.v2.model.automation_rule import AutomationRule +from datadog_api_client.v2.model.create_inbox_rule_parameters_data_attributes import ( + CreateInboxRuleParametersDataAttributes, +) +from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType +from datadog_api_client.v2.model.issue_type import IssueType +from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity +from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems +from datadog_api_client.v2.model.update_inbox_rule_parameters import UpdateInboxRuleParameters +from datadog_api_client.v2.model.update_inbox_rule_parameters_data import UpdateInboxRuleParametersData + +# there is a valid "valid_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = environ["VALID_INBOX_RULE_DATA_ID"] + +body = UpdateInboxRuleParameters( + data=UpdateInboxRuleParametersData( + attributes=CreateInboxRuleParametersDataAttributes( + action=ActionInbox( + reason_description="We want to focus on these items.", + ), + enabled=True, + name="Rule 1", + rule=AutomationRule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + SecurityRuleSeverity.CRITICAL, + ], + ), + ), + id=VALID_INBOX_RULE_DATA_ID, + type=InboxRulesType.INBOX_RULES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.update_inbox_rule(inbox_rule_id=VALID_INBOX_RULE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/security-monitoring/UpdateMuteRule.py b/examples/v2/security-monitoring/UpdateMuteRule.py new file mode 100644 index 0000000000..6c11e9dcac --- /dev/null +++ b/examples/v2/security-monitoring/UpdateMuteRule.py @@ -0,0 +1,58 @@ +""" +Update a mute rule returns "Mute rule successfully updated" 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.action_mute import ActionMute +from datadog_api_client.v2.model.automation_rule import AutomationRule +from datadog_api_client.v2.model.create_mute_rule_parameters_data_attributes import ( + CreateMuteRuleParametersDataAttributes, +) +from datadog_api_client.v2.model.issue_type import IssueType +from datadog_api_client.v2.model.mute_reason import MuteReason +from datadog_api_client.v2.model.mute_rules_type import MuteRulesType +from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity +from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems +from datadog_api_client.v2.model.update_mute_rule_parameters import UpdateMuteRuleParameters +from datadog_api_client.v2.model.update_mute_rule_parameters_data import UpdateMuteRuleParametersData + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = environ["VALID_MUTE_RULE_DATA_ID"] + +body = UpdateMuteRuleParameters( + data=UpdateMuteRuleParametersData( + attributes=CreateMuteRuleParametersDataAttributes( + action=ActionMute( + expire_at=1893452400000, + reason=MuteReason.DUPLICATE, + reason_description="Muting for a while", + ), + enabled=True, + name="Rule 1", + rule=AutomationRule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + SecurityRuleSeverity.CRITICAL, + ], + ), + ), + id=VALID_MUTE_RULE_DATA_ID, + type=MuteRulesType.MUTE_RULES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.update_mute_rule(mute_rule_id=VALID_MUTE_RULE_DATA_ID, body=body) + + print(response) 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 9eae3d68cb..2f25e5d9b7 100644 --- a/src/datadog_api_client/v2/api/security_monitoring_api.py +++ b/src/datadog_api_client/v2/api/security_monitoring_api.py @@ -14,6 +14,7 @@ get_attribute_from_path, UnsetType, unset, + UUID, ) from datadog_api_client.v2.model.list_findings_response import ListFindingsResponse from datadog_api_client.v2.model.finding_evaluation import FindingEvaluation @@ -35,6 +36,16 @@ from datadog_api_client.v2.model.vulnerability_status import VulnerabilityStatus from datadog_api_client.v2.model.vulnerability_tool import VulnerabilityTool from datadog_api_client.v2.model.vulnerability_ecosystem import VulnerabilityEcosystem +from datadog_api_client.v2.model.inbox_rule_response import InboxRuleResponse +from datadog_api_client.v2.model.create_inbox_rule_parameters import CreateInboxRuleParameters +from datadog_api_client.v2.model.reorder_inbox_rules_parameters import ReorderInboxRulesParameters +from datadog_api_client.v2.model.patch_inbox_rules_parameters import PatchInboxRulesParameters +from datadog_api_client.v2.model.update_inbox_rule_parameters import UpdateInboxRuleParameters +from datadog_api_client.v2.model.mute_rule_response import MuteRuleResponse +from datadog_api_client.v2.model.create_mute_rule_parameters import CreateMuteRuleParameters +from datadog_api_client.v2.model.reorder_mute_rules_parameters import ReorderMuteRulesParameters +from datadog_api_client.v2.model.patch_mute_rule_parameters import PatchMuteRuleParameters +from datadog_api_client.v2.model.update_mute_rule_parameters import UpdateMuteRuleParameters from datadog_api_client.v2.model.security_filters_response import SecurityFiltersResponse from datadog_api_client.v2.model.security_filter_response import SecurityFilterResponse from datadog_api_client.v2.model.security_filter_create_request import SecurityFilterCreateRequest @@ -186,6 +197,46 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (InboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "operation_id": "create_inbox_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateInboxRuleParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": (MuteRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "operation_id": "create_mute_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateMuteRuleParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_security_filter_endpoint = _Endpoint( settings={ "response_type": (SecurityFilterResponse,), @@ -309,6 +360,52 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}", + "operation_id": "delete_inbox_rule", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "inbox_rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "inbox_rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}", + "operation_id": "delete_mute_rule", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "mute_rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "mute_rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_security_filter_endpoint = _Endpoint( settings={ "response_type": None, @@ -556,6 +653,84 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (InboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}", + "operation_id": "get_inbox_rule", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "inbox_rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "inbox_rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_inbox_rules_endpoint = _Endpoint( + settings={ + "response_type": (dict,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "operation_id": "get_inbox_rules", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": (MuteRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}", + "operation_id": "get_mute_rule", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "mute_rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "mute_rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_mute_rules_endpoint = _Endpoint( + settings={ + "response_type": (dict,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "operation_id": "get_mute_rules", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_sbom_endpoint = _Endpoint( settings={ "response_type": (GetSBOMResponse,), @@ -1348,6 +1523,58 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._patch_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (InboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}", + "operation_id": "patch_inbox_rule", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "inbox_rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "inbox_rule_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (PatchInboxRulesParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._patch_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": (MuteRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}", + "operation_id": "patch_mute_rule", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "mute_rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "mute_rule_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (PatchMuteRuleParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._patch_signal_notification_rule_endpoint = _Endpoint( settings={ "response_type": (NotificationRuleResponse,), @@ -1400,6 +1627,46 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._reorder_inbox_rules_endpoint = _Endpoint( + settings={ + "response_type": (dict,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder", + "operation_id": "reorder_inbox_rules", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ReorderInboxRulesParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._reorder_mute_rules_endpoint = _Endpoint( + settings={ + "response_type": (dict,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/reorder", + "operation_id": "reorder_mute_rules", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ReorderMuteRulesParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._run_historical_job_endpoint = _Endpoint( settings={ "response_type": (JobCreateResponse,), @@ -1485,6 +1752,58 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_inbox_rule_endpoint = _Endpoint( + settings={ + "response_type": (InboxRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}", + "operation_id": "update_inbox_rule", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "inbox_rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "inbox_rule_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateInboxRuleParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_mute_rule_endpoint = _Endpoint( + settings={ + "response_type": (MuteRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}", + "operation_id": "update_mute_rule", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "mute_rule_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "mute_rule_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateMuteRuleParameters,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_security_filter_endpoint = _Endpoint( settings={ "response_type": (SecurityFilterResponse,), @@ -1655,6 +1974,44 @@ def convert_security_monitoring_rule_from_json_to_terraform( return self._convert_security_monitoring_rule_from_json_to_terraform_endpoint.call_with_http_info(**kwargs) + def create_inbox_rule( + self, + body: CreateInboxRuleParameters, + ) -> InboxRuleResponse: + """Create a new inbox rule. + + Create a new inbox rule and return the created rule. + + :param body: Mandatory fields are the rule type and the required attributes: rule name, rule details, and action. + The rule details are composed of issue types and security rule types on which the rule applies. Optional security rule IDs, severities, and a tag or attribute query can be provided. + The action is composed of the optional reason description. + :type body: CreateInboxRuleParameters + :rtype: InboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_inbox_rule_endpoint.call_with_http_info(**kwargs) + + def create_mute_rule( + self, + body: CreateMuteRuleParameters, + ) -> MuteRuleResponse: + """Create a new mute rule. + + Create a new mute rule and return the created rule. + + :param body: Mandatory fields are the rule type and the required attributes: rule name, rule details, and action. + The rule details are composed of issue types and security rule types on which the rule applies. Optional security rule IDs, severities, and a tag or attribute query can be provided. + The action is composed of the reason for muting and the rule expiration date, and optionally a description of the rule. + :type body: CreateMuteRuleParameters + :rtype: MuteRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_mute_rule_endpoint.call_with_http_info(**kwargs) + def create_security_filter( self, body: SecurityFilterCreateRequest, @@ -1766,6 +2123,40 @@ def delete_historical_job( return self._delete_historical_job_endpoint.call_with_http_info(**kwargs) + def delete_inbox_rule( + self, + inbox_rule_id: UUID, + ) -> None: + """Delete an inbox rule. + + Delete an inbox rule + + :param inbox_rule_id: ID of the inbox rule + :type inbox_rule_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["inbox_rule_id"] = inbox_rule_id + + return self._delete_inbox_rule_endpoint.call_with_http_info(**kwargs) + + def delete_mute_rule( + self, + mute_rule_id: UUID, + ) -> None: + """Delete a mute rule. + + Delete a mute rule + + :param mute_rule_id: ID of the mute rule + :type mute_rule_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["mute_rule_id"] = mute_rule_id + + return self._delete_mute_rule_endpoint.call_with_http_info(**kwargs) + def delete_security_filter( self, security_filter_id: str, @@ -1958,6 +2349,64 @@ def get_historical_job( return self._get_historical_job_endpoint.call_with_http_info(**kwargs) + def get_inbox_rule( + self, + inbox_rule_id: UUID, + ) -> InboxRuleResponse: + """Get details of an inbox rule. + + Get the details of an inbox rule. + + :param inbox_rule_id: ID of the inbox rule + :type inbox_rule_id: UUID + :rtype: InboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["inbox_rule_id"] = inbox_rule_id + + return self._get_inbox_rule_endpoint.call_with_http_info(**kwargs) + + def get_inbox_rules( + self, + ) -> dict: + """Get the ordered list of inbox rules. + + Returns the ordered list of inbox rules in the pipeline (first match applies) + + :rtype: dict + """ + kwargs: Dict[str, Any] = {} + return self._get_inbox_rules_endpoint.call_with_http_info(**kwargs) + + def get_mute_rule( + self, + mute_rule_id: UUID, + ) -> MuteRuleResponse: + """Get details of a mute rule. + + Get the details of a mute rule. + + :param mute_rule_id: ID of the mute rule + :type mute_rule_id: UUID + :rtype: MuteRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["mute_rule_id"] = mute_rule_id + + return self._get_mute_rule_endpoint.call_with_http_info(**kwargs) + + def get_mute_rules( + self, + ) -> dict: + """Get the ordered list of mute rules. + + Returns the ordered list of mute rules in the pipeline (first match applies) + + :rtype: dict + """ + kwargs: Dict[str, Any] = {} + return self._get_mute_rules_endpoint.call_with_http_info(**kwargs) + def get_sbom( self, asset_type: AssetType, @@ -3020,6 +3469,48 @@ def mute_findings( return self._mute_findings_endpoint.call_with_http_info(**kwargs) + def patch_inbox_rule( + self, + inbox_rule_id: UUID, + body: PatchInboxRulesParameters, + ) -> InboxRuleResponse: + """Patch an inbox rule. + + Partially update the inbox rule. All fields are optional; if a field is not provided, it is not updated. + + :param inbox_rule_id: ID of the inbox rule + :type inbox_rule_id: UUID + :type body: PatchInboxRulesParameters + :rtype: InboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["inbox_rule_id"] = inbox_rule_id + + kwargs["body"] = body + + return self._patch_inbox_rule_endpoint.call_with_http_info(**kwargs) + + def patch_mute_rule( + self, + mute_rule_id: UUID, + body: PatchMuteRuleParameters, + ) -> MuteRuleResponse: + """Patch a mute rule. + + Partially update the mute rule. All fields are optional; if a field is not provided, it is not updated. + + :param mute_rule_id: ID of the mute rule + :type mute_rule_id: UUID + :type body: PatchMuteRuleParameters + :rtype: MuteRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["mute_rule_id"] = mute_rule_id + + kwargs["body"] = body + + return self._patch_mute_rule_endpoint.call_with_http_info(**kwargs) + def patch_signal_notification_rule( self, id: str, @@ -3062,6 +3553,42 @@ def patch_vulnerability_notification_rule( return self._patch_vulnerability_notification_rule_endpoint.call_with_http_info(**kwargs) + def reorder_inbox_rules( + self, + body: ReorderInboxRulesParameters, + ) -> dict: + """Reorder the list of inbox rules in the pipeline. + + Reorder the list of inbox rules in the pipeline and return the reordered list of rules. + To reorder fields, you must provide the full list of pipeline rules in the new order. + + :param body: The list of rules to reorder. The order of the rules in the list becomes the new order in the pipeline. + :type body: ReorderInboxRulesParameters + :rtype: dict + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._reorder_inbox_rules_endpoint.call_with_http_info(**kwargs) + + def reorder_mute_rules( + self, + body: ReorderMuteRulesParameters, + ) -> dict: + """Reorder the list of mute rules in the pipeline. + + Reorder the list of mute rules in the pipeline and return the reordered list of rules. + To reorder fields, you must provide the full list of pipeline rules in the new order. + + :param body: The list of rules to reorder. The order of the rules in the list becomes the new order in the pipeline. + :type body: ReorderMuteRulesParameters + :rtype: dict + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._reorder_mute_rules_endpoint.call_with_http_info(**kwargs) + def run_historical_job( self, body: RunHistoricalJobRequest, @@ -3166,6 +3693,48 @@ def test_security_monitoring_rule( return self._test_security_monitoring_rule_endpoint.call_with_http_info(**kwargs) + def update_inbox_rule( + self, + inbox_rule_id: UUID, + body: UpdateInboxRuleParameters, + ) -> InboxRuleResponse: + """Update an inbox rule. + + Update the whole inbox rule. If an optional field is not provided, it is set to its default value. + + :param inbox_rule_id: ID of the inbox rule + :type inbox_rule_id: UUID + :type body: UpdateInboxRuleParameters + :rtype: InboxRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["inbox_rule_id"] = inbox_rule_id + + kwargs["body"] = body + + return self._update_inbox_rule_endpoint.call_with_http_info(**kwargs) + + def update_mute_rule( + self, + mute_rule_id: UUID, + body: UpdateMuteRuleParameters, + ) -> MuteRuleResponse: + """Update a mute rule. + + Update the whole mute rule. If an optional field is not provided, it is set to its default value. + + :param mute_rule_id: ID of the mute rule + :type mute_rule_id: UUID + :type body: UpdateMuteRuleParameters + :rtype: MuteRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["mute_rule_id"] = mute_rule_id + + kwargs["body"] = body + + return self._update_mute_rule_endpoint.call_with_http_info(**kwargs) + def update_security_filter( self, security_filter_id: str, diff --git a/src/datadog_api_client/v2/model/action_inbox.py b/src/datadog_api_client/v2/model/action_inbox.py new file mode 100644 index 0000000000..f7c7296e87 --- /dev/null +++ b/src/datadog_api_client/v2/model/action_inbox.py @@ -0,0 +1,36 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ActionInbox(ModelNormal): + @cached_property + def openapi_types(_): + return { + "reason_description": (str,), + } + + attribute_map = { + "reason_description": "reason_description", + } + + def __init__(self_, reason_description: Union[str, UnsetType] = unset, **kwargs): + """ + Action of the inbox rule + + :param reason_description: Free text to add a reason description. + :type reason_description: str, optional + """ + if reason_description is not unset: + kwargs["reason_description"] = reason_description + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/action_mute.py b/src/datadog_api_client/v2/model/action_mute.py new file mode 100644 index 0000000000..693f547477 --- /dev/null +++ b/src/datadog_api_client/v2/model/action_mute.py @@ -0,0 +1,62 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mute_reason import MuteReason + + +class ActionMute(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_reason import MuteReason + + return { + "expire_at": (int,), + "reason": (MuteReason,), + "reason_description": (str,), + } + + attribute_map = { + "expire_at": "expire_at", + "reason": "reason", + "reason_description": "reason_description", + } + + def __init__( + self_, + reason: MuteReason, + expire_at: Union[int, UnsetType] = unset, + reason_description: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Action of the mute rule + + :param expire_at: End date of the mute rule (null means mute forever) + :type expire_at: int, optional + + :param reason: Reason for muting a vulnerability + :type reason: MuteReason + + :param reason_description: Free text to add a reason description. + :type reason_description: str, optional + """ + if expire_at is not unset: + kwargs["expire_at"] = expire_at + if reason_description is not unset: + kwargs["reason_description"] = reason_description + super().__init__(kwargs) + + self_.reason = reason diff --git a/src/datadog_api_client/v2/model/automation_rule.py b/src/datadog_api_client/v2/model/automation_rule.py new file mode 100644 index 0000000000..37cfed3b29 --- /dev/null +++ b/src/datadog_api_client/v2/model/automation_rule.py @@ -0,0 +1,84 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.issue_type import IssueType + from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems + from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity + + +class AutomationRule(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_type import IssueType + from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems + from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity + + return { + "issue_type": (IssueType,), + "query": (str,), + "rule_ids": ([str],), + "rule_types": ([SecurityRuleTypesItems],), + "severities": ([SecurityRuleSeverity],), + } + + attribute_map = { + "issue_type": "issue_type", + "query": "query", + "rule_ids": "rule_ids", + "rule_types": "rule_types", + "severities": "severities", + } + + def __init__( + self_, + issue_type: IssueType, + rule_types: List[SecurityRuleTypesItems], + query: Union[str, UnsetType] = unset, + rule_ids: Union[List[str], UnsetType] = unset, + severities: Union[List[SecurityRuleSeverity], UnsetType] = unset, + **kwargs, + ): + """ + The definition of an automation pipeline rule scope. + A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + The query can be used to filter resources on tags and attributes. + The issue type and rule types fields are required. + + :param issue_type: The type of issues on which the rule applies + :type issue_type: IssueType + + :param query: The query is composed of one or several key:value pairs, which can be used to filter resources on tags and attributes. + :type query: str, optional + + :param rule_ids: Security rule ids + :type rule_ids: [str], optional + + :param rule_types: Security rule types + :type rule_types: [SecurityRuleTypesItems] + + :param severities: The security rules severities to consider + :type severities: [SecurityRuleSeverity], optional + """ + if query is not unset: + kwargs["query"] = query + if rule_ids is not unset: + kwargs["rule_ids"] = rule_ids + if severities is not unset: + kwargs["severities"] = severities + super().__init__(kwargs) + + self_.issue_type = issue_type + self_.rule_types = rule_types diff --git a/src/datadog_api_client/v2/model/automation_rule_user.py b/src/datadog_api_client/v2/model/automation_rule_user.py new file mode 100644 index 0000000000..e3f105bf6e --- /dev/null +++ b/src/datadog_api_client/v2/model/automation_rule_user.py @@ -0,0 +1,43 @@ +# 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 AutomationRuleUser(ModelNormal): + @cached_property + def openapi_types(_): + return { + "handle": (str,), + "name": (str,), + } + + attribute_map = { + "handle": "handle", + "name": "name", + } + + def __init__(self_, handle: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): + """ + User creating or modifying a rule + + :param handle: The user handle. + :type handle: str, optional + + :param name: The user name. + :type name: str, optional + """ + if handle is not unset: + kwargs["handle"] = handle + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_inbox_rule_parameters.py b/src/datadog_api_client/v2/model/create_inbox_rule_parameters.py new file mode 100644 index 0000000000..1701838911 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_inbox_rule_parameters.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_inbox_rule_parameters_data import CreateInboxRuleParametersData + + +class CreateInboxRuleParameters(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_inbox_rule_parameters_data import CreateInboxRuleParametersData + + return { + "data": (CreateInboxRuleParametersData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateInboxRuleParametersData, UnsetType] = unset, **kwargs): + """ + Body of the inbox rule create request + + :param data: Data of the inbox rule create request: the rule type and the rule attributes. All fields are required. + :type data: CreateInboxRuleParametersData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_inbox_rule_parameters_data.py b/src/datadog_api_client/v2/model/create_inbox_rule_parameters_data.py new file mode 100644 index 0000000000..fc9819f541 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_inbox_rule_parameters_data.py @@ -0,0 +1,52 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_inbox_rule_parameters_data_attributes import ( + CreateInboxRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + +class CreateInboxRuleParametersData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_inbox_rule_parameters_data_attributes import ( + CreateInboxRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + return { + "attributes": (CreateInboxRuleParametersDataAttributes,), + "type": (InboxRulesType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: CreateInboxRuleParametersDataAttributes, type: InboxRulesType, **kwargs): + """ + Data of the inbox rule create request: the rule type and the rule attributes. All fields are required. + + :param attributes: Attributes of the inbox rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + :type attributes: CreateInboxRuleParametersDataAttributes + + :param type: The pipeline rule type associated to inbox rules + :type type: InboxRulesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_inbox_rule_parameters_data_attributes.py b/src/datadog_api_client/v2/model/create_inbox_rule_parameters_data_attributes.py new file mode 100644 index 0000000000..480d5d9941 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_inbox_rule_parameters_data_attributes.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_inbox import ActionInbox + from datadog_api_client.v2.model.automation_rule import AutomationRule + + +class CreateInboxRuleParametersDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_inbox import ActionInbox + from datadog_api_client.v2.model.automation_rule import AutomationRule + + return { + "action": (ActionInbox,), + "enabled": (bool,), + "name": (str,), + "rule": (AutomationRule,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, action: ActionInbox, name: str, rule: AutomationRule, enabled: Union[bool, UnsetType] = unset, **kwargs + ): + """ + Attributes of the inbox rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + + :param action: Action of the inbox rule + :type action: ActionInbox + + :param enabled: Field used to enable or disable the rule. + :type enabled: bool, optional + + :param name: Name of the pipeline rule + :type name: str + + :param rule: The definition of an automation pipeline rule scope. + A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + The query can be used to filter resources on tags and attributes. + The issue type and rule types fields are required. + :type rule: AutomationRule + """ + 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/create_mute_rule_parameters.py b/src/datadog_api_client/v2/model/create_mute_rule_parameters.py new file mode 100644 index 0000000000..7607c6c306 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_mute_rule_parameters.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_mute_rule_parameters_data import CreateMuteRuleParametersData + + +class CreateMuteRuleParameters(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_mute_rule_parameters_data import CreateMuteRuleParametersData + + return { + "data": (CreateMuteRuleParametersData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateMuteRuleParametersData, UnsetType] = unset, **kwargs): + """ + Body of the mute rule create request + + :param data: Data of the mute rule create request: the rule type and the rule attributes. All fields are required. + :type data: CreateMuteRuleParametersData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_mute_rule_parameters_data.py b/src/datadog_api_client/v2/model/create_mute_rule_parameters_data.py new file mode 100644 index 0000000000..d506e5f7cb --- /dev/null +++ b/src/datadog_api_client/v2/model/create_mute_rule_parameters_data.py @@ -0,0 +1,52 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_mute_rule_parameters_data_attributes import ( + CreateMuteRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + +class CreateMuteRuleParametersData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_mute_rule_parameters_data_attributes import ( + CreateMuteRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + return { + "attributes": (CreateMuteRuleParametersDataAttributes,), + "type": (MuteRulesType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: CreateMuteRuleParametersDataAttributes, type: MuteRulesType, **kwargs): + """ + Data of the mute rule create request: the rule type and the rule attributes. All fields are required. + + :param attributes: Attributes of the mute rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + :type attributes: CreateMuteRuleParametersDataAttributes + + :param type: The pipeline rule type associated to mute rules + :type type: MuteRulesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_mute_rule_parameters_data_attributes.py b/src/datadog_api_client/v2/model/create_mute_rule_parameters_data_attributes.py new file mode 100644 index 0000000000..41003ed21a --- /dev/null +++ b/src/datadog_api_client/v2/model/create_mute_rule_parameters_data_attributes.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_mute import ActionMute + from datadog_api_client.v2.model.automation_rule import AutomationRule + + +class CreateMuteRuleParametersDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_mute import ActionMute + from datadog_api_client.v2.model.automation_rule import AutomationRule + + return { + "action": (ActionMute,), + "enabled": (bool,), + "name": (str,), + "rule": (AutomationRule,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, action: ActionMute, name: str, rule: AutomationRule, enabled: Union[bool, UnsetType] = unset, **kwargs + ): + """ + Attributes of the mute rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + + :param action: Action of the mute rule + :type action: ActionMute + + :param enabled: Field used to enable or disable the rule. + :type enabled: bool, optional + + :param name: Name of the pipeline rule + :type name: str + + :param rule: The definition of an automation pipeline rule scope. + A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + The query can be used to filter resources on tags and attributes. + The issue type and rule types fields are required. + :type rule: AutomationRule + """ + 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.py b/src/datadog_api_client/v2/model/inbox_rule.py new file mode 100644 index 0000000000..fa818c5940 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_rule.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import 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 import InboxRuleAttributes + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + +class InboxRule(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule_attributes import InboxRuleAttributes + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + return { + "attributes": (InboxRuleAttributes,), + "id": (UUID,), + "type": (InboxRulesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: InboxRuleAttributes, id: UUID, type: InboxRulesType, **kwargs): + """ + Inbox rules are used to prioritize and add relevant vulnerabilities to your Security Inbox. + An inbox rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + + :param attributes: Attributes of the inbox rule + :type attributes: InboxRuleAttributes + + :param id: The ID of a pipeline rule + :type id: UUID + + :param type: The pipeline rule type associated to inbox rules + :type type: InboxRulesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/inbox_rule_attributes.py b/src/datadog_api_client/v2/model/inbox_rule_attributes.py new file mode 100644 index 0000000000..e2d8a64752 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_rule_attributes.py @@ -0,0 +1,100 @@ +# 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.action_inbox import ActionInbox + from datadog_api_client.v2.model.automation_rule_user import AutomationRuleUser + from datadog_api_client.v2.model.automation_rule import AutomationRule + + +class InboxRuleAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_inbox import ActionInbox + from datadog_api_client.v2.model.automation_rule_user import AutomationRuleUser + from datadog_api_client.v2.model.automation_rule import AutomationRule + + return { + "action": (ActionInbox,), + "created_at": (int,), + "created_by": (AutomationRuleUser,), + "enabled": (bool,), + "modified_at": (int,), + "modified_by": (AutomationRuleUser,), + "name": (str,), + "rule": (AutomationRule,), + } + + 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: ActionInbox, + created_at: int, + created_by: AutomationRuleUser, + enabled: bool, + modified_at: int, + modified_by: AutomationRuleUser, + name: str, + rule: AutomationRule, + **kwargs, + ): + """ + Attributes of the inbox rule + + :param action: Action of the inbox rule + :type action: ActionInbox + + :param created_at: Date as Unix timestamp in milliseconds + :type created_at: int + + :param created_by: User creating or modifying a rule + :type created_by: AutomationRuleUser + + :param enabled: Field used to enable or disable the rule. + :type enabled: bool + + :param modified_at: Date as Unix timestamp in milliseconds + :type modified_at: int + + :param modified_by: User creating or modifying a rule + :type modified_by: AutomationRuleUser + + :param name: Name of the pipeline rule + :type name: str + + :param rule: The definition of an automation pipeline rule scope. + A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + The query can be used to filter resources on tags and attributes. + The issue type and rule types fields are required. + :type rule: AutomationRule + """ + 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_response.py b/src/datadog_api_client/v2/model/inbox_rule_response.py new file mode 100644 index 0000000000..568f113522 --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_rule_response.py @@ -0,0 +1,43 @@ +# 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 import InboxRule + + +class InboxRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rule import InboxRule + + return { + "data": (InboxRule,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[InboxRule, UnsetType] = unset, **kwargs): + """ + Response object which includes an inbox rule. + + :param data: Inbox rules are used to prioritize and add relevant vulnerabilities to your Security Inbox. + An inbox rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + :type data: InboxRule, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/inbox_rules_type.py b/src/datadog_api_client/v2/model/inbox_rules_type.py new file mode 100644 index 0000000000..5d94f8084d --- /dev/null +++ b/src/datadog_api_client/v2/model/inbox_rules_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 InboxRulesType(ModelSimple): + """ + The pipeline rule type associated to 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["InboxRulesType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +InboxRulesType.INBOX_RULES = InboxRulesType("inbox_rules") diff --git a/src/datadog_api_client/v2/model/issue_type.py b/src/datadog_api_client/v2/model/issue_type.py new file mode 100644 index 0000000000..533a1af963 --- /dev/null +++ b/src/datadog_api_client/v2/model/issue_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 IssueType(ModelSimple): + """ + The type of issues on which the rule applies + + :param value: If omitted defaults to "vulnerability". Must be one of ["vulnerability"]. + :type value: str + """ + + allowed_values = { + "vulnerability", + } + VULNERABILITY: ClassVar["IssueType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IssueType.VULNERABILITY = IssueType("vulnerability") diff --git a/src/datadog_api_client/v2/model/mute_reason.py b/src/datadog_api_client/v2/model/mute_reason.py new file mode 100644 index 0000000000..a934529656 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_reason.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class MuteReason(ModelSimple): + """ + Reason for muting a vulnerability + + :param value: Must be one of ["duplicate", "external_solution", "false_positive", "internal_solution", "no_fix_available", "other", "pending_fix", "risk_accepted"]. + :type value: str + """ + + allowed_values = { + "duplicate", + "external_solution", + "false_positive", + "internal_solution", + "no_fix_available", + "other", + "pending_fix", + "risk_accepted", + } + DUPLICATE: ClassVar["MuteReason"] + EXTERNAL_SOLUTION: ClassVar["MuteReason"] + FALSE_POSITIVE: ClassVar["MuteReason"] + INTERNAL_SOLUTION: ClassVar["MuteReason"] + NO_FIX_AVAILABLE: ClassVar["MuteReason"] + OTHER: ClassVar["MuteReason"] + PENDING_FIX: ClassVar["MuteReason"] + RISK_ACCEPTED: ClassVar["MuteReason"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +MuteReason.DUPLICATE = MuteReason("duplicate") +MuteReason.EXTERNAL_SOLUTION = MuteReason("external_solution") +MuteReason.FALSE_POSITIVE = MuteReason("false_positive") +MuteReason.INTERNAL_SOLUTION = MuteReason("internal_solution") +MuteReason.NO_FIX_AVAILABLE = MuteReason("no_fix_available") +MuteReason.OTHER = MuteReason("other") +MuteReason.PENDING_FIX = MuteReason("pending_fix") +MuteReason.RISK_ACCEPTED = MuteReason("risk_accepted") diff --git a/src/datadog_api_client/v2/model/mute_rule.py b/src/datadog_api_client/v2/model/mute_rule.py new file mode 100644 index 0000000000..c57a17a81b --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mute_rule_attributes import MuteRuleAttributes + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + +class MuteRule(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule_attributes import MuteRuleAttributes + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + return { + "attributes": (MuteRuleAttributes,), + "id": (UUID,), + "type": (MuteRulesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: MuteRuleAttributes, id: UUID, type: MuteRulesType, **kwargs): + """ + Mute rules are used to proactively filter out known false positives or accepted risks. + A mute rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + + :param attributes: Attributes of the mute rule + :type attributes: MuteRuleAttributes + + :param id: The ID of a pipeline rule + :type id: UUID + + :param type: The pipeline rule type associated to mute rules + :type type: MuteRulesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/mute_rule_attributes.py b/src/datadog_api_client/v2/model/mute_rule_attributes.py new file mode 100644 index 0000000000..4f86c8c8cc --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_attributes.py @@ -0,0 +1,100 @@ +# 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.action_mute import ActionMute + from datadog_api_client.v2.model.automation_rule_user import AutomationRuleUser + from datadog_api_client.v2.model.automation_rule import AutomationRule + + +class MuteRuleAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_mute import ActionMute + from datadog_api_client.v2.model.automation_rule_user import AutomationRuleUser + from datadog_api_client.v2.model.automation_rule import AutomationRule + + return { + "action": (ActionMute,), + "created_at": (int,), + "created_by": (AutomationRuleUser,), + "enabled": (bool,), + "modified_at": (int,), + "modified_by": (AutomationRuleUser,), + "name": (str,), + "rule": (AutomationRule,), + } + + 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: ActionMute, + created_at: int, + created_by: AutomationRuleUser, + enabled: bool, + modified_at: int, + modified_by: AutomationRuleUser, + name: str, + rule: AutomationRule, + **kwargs, + ): + """ + Attributes of the mute rule + + :param action: Action of the mute rule + :type action: ActionMute + + :param created_at: Date as Unix timestamp in milliseconds + :type created_at: int + + :param created_by: User creating or modifying a rule + :type created_by: AutomationRuleUser + + :param enabled: Field used to enable or disable the rule. + :type enabled: bool + + :param modified_at: Date as Unix timestamp in milliseconds + :type modified_at: int + + :param modified_by: User creating or modifying a rule + :type modified_by: AutomationRuleUser + + :param name: Name of the pipeline rule + :type name: str + + :param rule: The definition of an automation pipeline rule scope. + A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + The query can be used to filter resources on tags and attributes. + The issue type and rule types fields are required. + :type rule: AutomationRule + """ + super().__init__(kwargs) + + self_.action = action + self_.created_at = created_at + self_.created_by = created_by + self_.enabled = enabled + self_.modified_at = modified_at + self_.modified_by = modified_by + self_.name = name + self_.rule = rule diff --git a/src/datadog_api_client/v2/model/mute_rule_response.py b/src/datadog_api_client/v2/model/mute_rule_response.py new file mode 100644 index 0000000000..9c41b84926 --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rule_response.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mute_rule import MuteRule + + +class MuteRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rule import MuteRule + + return { + "data": (MuteRule,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[MuteRule, UnsetType] = unset, **kwargs): + """ + Response object which includes a mute rule. + + :param data: Mute rules are used to proactively filter out known false positives or accepted risks. + A mute rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + :type data: MuteRule, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/mute_rules_type.py b/src/datadog_api_client/v2/model/mute_rules_type.py new file mode 100644 index 0000000000..5f779e3bfa --- /dev/null +++ b/src/datadog_api_client/v2/model/mute_rules_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 MuteRulesType(ModelSimple): + """ + The pipeline rule type associated to mute rules + + :param value: If omitted defaults to "mute_rules". Must be one of ["mute_rules"]. + :type value: str + """ + + allowed_values = { + "mute_rules", + } + MUTE_RULES: ClassVar["MuteRulesType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +MuteRulesType.MUTE_RULES = MuteRulesType("mute_rules") diff --git a/src/datadog_api_client/v2/model/patch_inbox_rules_parameters.py b/src/datadog_api_client/v2/model/patch_inbox_rules_parameters.py new file mode 100644 index 0000000000..c775162b72 --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_inbox_rules_parameters.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.patch_inbox_rules_parameters_data import PatchInboxRulesParametersData + + +class PatchInboxRulesParameters(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_inbox_rules_parameters_data import PatchInboxRulesParametersData + + return { + "data": (PatchInboxRulesParametersData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[PatchInboxRulesParametersData, UnsetType] = unset, **kwargs): + """ + Body of the inbox rule patch request + + :param data: Data of the inbox rule patch request: the rule UUID, the rule type, and the rule attributes. All fields are required. + :type data: PatchInboxRulesParametersData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/patch_inbox_rules_parameters_data.py b/src/datadog_api_client/v2/model/patch_inbox_rules_parameters_data.py new file mode 100644 index 0000000000..517642351e --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_inbox_rules_parameters_data.py @@ -0,0 +1,59 @@ +# 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.patch_inbox_rules_parameters_data_attributes import ( + PatchInboxRulesParametersDataAttributes, + ) + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + +class PatchInboxRulesParametersData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_inbox_rules_parameters_data_attributes import ( + PatchInboxRulesParametersDataAttributes, + ) + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + return { + "attributes": (PatchInboxRulesParametersDataAttributes,), + "id": (UUID,), + "type": (InboxRulesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: PatchInboxRulesParametersDataAttributes, id: UUID, type: InboxRulesType, **kwargs): + """ + Data of the inbox rule patch request: the rule UUID, the rule type, and the rule attributes. All fields are required. + + :param attributes: Attributes of the inbox rule patch request: the rule name, the rule details, the associated action, and the enabled field. + :type attributes: PatchInboxRulesParametersDataAttributes + + :param id: The ID of a pipeline rule + :type id: UUID + + :param type: The pipeline rule type associated to inbox rules + :type type: InboxRulesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/patch_inbox_rules_parameters_data_attributes.py b/src/datadog_api_client/v2/model/patch_inbox_rules_parameters_data_attributes.py new file mode 100644 index 0000000000..77ca5d3205 --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_inbox_rules_parameters_data_attributes.py @@ -0,0 +1,75 @@ +# 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.action_inbox import ActionInbox + from datadog_api_client.v2.model.automation_rule import AutomationRule + + +class PatchInboxRulesParametersDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_inbox import ActionInbox + from datadog_api_client.v2.model.automation_rule import AutomationRule + + return { + "action": (ActionInbox,), + "enabled": (bool,), + "name": (str,), + "rule": (AutomationRule,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: Union[ActionInbox, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + rule: Union[AutomationRule, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of the inbox rule patch request: the rule name, the rule details, the associated action, and the enabled field. + + :param action: Action of the inbox rule + :type action: ActionInbox, optional + + :param enabled: Field used to enable or disable the rule. + :type enabled: bool, optional + + :param name: Name of the pipeline rule + :type name: str, optional + + :param rule: The definition of an automation pipeline rule scope. + A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + The query can be used to filter resources on tags and attributes. + The issue type and rule types fields are required. + :type rule: AutomationRule, optional + """ + if action is not unset: + kwargs["action"] = action + if enabled is not unset: + kwargs["enabled"] = enabled + if name is not unset: + kwargs["name"] = name + if rule is not unset: + kwargs["rule"] = rule + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/patch_mute_rule_parameters.py b/src/datadog_api_client/v2/model/patch_mute_rule_parameters.py new file mode 100644 index 0000000000..8f741e79aa --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_mute_rule_parameters.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.patch_mute_rule_parameters_data import PatchMuteRuleParametersData + + +class PatchMuteRuleParameters(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_mute_rule_parameters_data import PatchMuteRuleParametersData + + return { + "data": (PatchMuteRuleParametersData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[PatchMuteRuleParametersData, UnsetType] = unset, **kwargs): + """ + Body of the mute rule patch request + + :param data: Data of the mute rule patch request: the rule UUID, the rule type, and the rule attributes. All fields are required. + :type data: PatchMuteRuleParametersData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/patch_mute_rule_parameters_data.py b/src/datadog_api_client/v2/model/patch_mute_rule_parameters_data.py new file mode 100644 index 0000000000..bc6f6be243 --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_mute_rule_parameters_data.py @@ -0,0 +1,59 @@ +# 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.patch_mute_rule_parameters_data_attributes import ( + PatchMuteRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + +class PatchMuteRuleParametersData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_mute_rule_parameters_data_attributes import ( + PatchMuteRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + return { + "attributes": (PatchMuteRuleParametersDataAttributes,), + "id": (UUID,), + "type": (MuteRulesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: PatchMuteRuleParametersDataAttributes, id: UUID, type: MuteRulesType, **kwargs): + """ + Data of the mute rule patch request: the rule UUID, the rule type, and the rule attributes. All fields are required. + + :param attributes: Attributes of the mute rule patch request: the rule name, the rule details, the associated action, and the enabled field. + :type attributes: PatchMuteRuleParametersDataAttributes + + :param id: The ID of a pipeline rule + :type id: UUID + + :param type: The pipeline rule type associated to mute rules + :type type: MuteRulesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/patch_mute_rule_parameters_data_attributes.py b/src/datadog_api_client/v2/model/patch_mute_rule_parameters_data_attributes.py new file mode 100644 index 0000000000..adcc6efa6c --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_mute_rule_parameters_data_attributes.py @@ -0,0 +1,75 @@ +# 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.action_mute import ActionMute + from datadog_api_client.v2.model.automation_rule import AutomationRule + + +class PatchMuteRuleParametersDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_mute import ActionMute + from datadog_api_client.v2.model.automation_rule import AutomationRule + + return { + "action": (ActionMute,), + "enabled": (bool,), + "name": (str,), + "rule": (AutomationRule,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__( + self_, + action: Union[ActionMute, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + rule: Union[AutomationRule, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of the mute rule patch request: the rule name, the rule details, the associated action, and the enabled field. + + :param action: Action of the mute rule + :type action: ActionMute, optional + + :param enabled: Field used to enable or disable the rule. + :type enabled: bool, optional + + :param name: Name of the pipeline rule + :type name: str, optional + + :param rule: The definition of an automation pipeline rule scope. + A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + The query can be used to filter resources on tags and attributes. + The issue type and rule types fields are required. + :type rule: AutomationRule, optional + """ + if action is not unset: + kwargs["action"] = action + if enabled is not unset: + kwargs["enabled"] = enabled + if name is not unset: + kwargs["name"] = name + if rule is not unset: + kwargs["rule"] = rule + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/reorder_inbox_rules_parameters.py b/src/datadog_api_client/v2/model/reorder_inbox_rules_parameters.py new file mode 100644 index 0000000000..6006e4a7d5 --- /dev/null +++ b/src/datadog_api_client/v2/model/reorder_inbox_rules_parameters.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.reorder_inbox_rules_parameters_data import ReorderInboxRulesParametersData + + +class ReorderInboxRulesParameters(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.reorder_inbox_rules_parameters_data import ReorderInboxRulesParametersData + + return { + "data": ([ReorderInboxRulesParametersData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[ReorderInboxRulesParametersData], UnsetType] = unset, **kwargs): + """ + Body of the inbox rule reorder request: the full list of inbox rules, which must be provided in the new order. + + :param data: The ``ReorderInboxRulesParameters`` ``data``. + :type data: [ReorderInboxRulesParametersData], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/reorder_inbox_rules_parameters_data.py b/src/datadog_api_client/v2/model/reorder_inbox_rules_parameters_data.py new file mode 100644 index 0000000000..507656acc4 --- /dev/null +++ b/src/datadog_api_client/v2/model/reorder_inbox_rules_parameters_data.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_rules_type import InboxRulesType + + +class ReorderInboxRulesParametersData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + return { + "id": (UUID,), + "type": (InboxRulesType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: InboxRulesType, **kwargs): + """ + Data of the inbox rule reorder request: the rule UUID, the rule type, and the rule attributes. All fields are required. + + :param id: The ID of a pipeline rule + :type id: UUID + + :param type: The pipeline rule type associated to inbox rules + :type type: InboxRulesType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/reorder_mute_rules_parameters.py b/src/datadog_api_client/v2/model/reorder_mute_rules_parameters.py new file mode 100644 index 0000000000..d2643d8dbf --- /dev/null +++ b/src/datadog_api_client/v2/model/reorder_mute_rules_parameters.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.reorder_mute_rules_parameters_data import ReorderMuteRulesParametersData + + +class ReorderMuteRulesParameters(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.reorder_mute_rules_parameters_data import ReorderMuteRulesParametersData + + return { + "data": ([ReorderMuteRulesParametersData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[ReorderMuteRulesParametersData], UnsetType] = unset, **kwargs): + """ + Body of the mute rule reorder request: the full list of mute rules, which must be provided in the new order. + + :param data: The ``ReorderMuteRulesParameters`` ``data``. + :type data: [ReorderMuteRulesParametersData], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/reorder_mute_rules_parameters_data.py b/src/datadog_api_client/v2/model/reorder_mute_rules_parameters_data.py new file mode 100644 index 0000000000..6004cce2e7 --- /dev/null +++ b/src/datadog_api_client/v2/model/reorder_mute_rules_parameters_data.py @@ -0,0 +1,47 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + +class ReorderMuteRulesParametersData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + return { + "id": (UUID,), + "type": (MuteRulesType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: MuteRulesType, **kwargs): + """ + Data of the mute rule reorder request: a rule UUID and its type. All fields are required. + + :param id: The ID of a pipeline rule + :type id: UUID + + :param type: The pipeline rule type associated to mute rules + :type type: MuteRulesType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/security_rule_severity.py b/src/datadog_api_client/v2/model/security_rule_severity.py new file mode 100644 index 0000000000..2f2e73285b --- /dev/null +++ b/src/datadog_api_client/v2/model/security_rule_severity.py @@ -0,0 +1,50 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SecurityRuleSeverity(ModelSimple): + """ + Severity of a security rule + + :param value: Must be one of ["critical", "high", "medium", "low", "unknown", "info"]. + :type value: str + """ + + allowed_values = { + "critical", + "high", + "medium", + "low", + "unknown", + "info", + } + CRITICAL: ClassVar["SecurityRuleSeverity"] + HIGH: ClassVar["SecurityRuleSeverity"] + MEDIUM: ClassVar["SecurityRuleSeverity"] + LOW: ClassVar["SecurityRuleSeverity"] + UNKNOWN: ClassVar["SecurityRuleSeverity"] + INFO: ClassVar["SecurityRuleSeverity"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SecurityRuleSeverity.CRITICAL = SecurityRuleSeverity("critical") +SecurityRuleSeverity.HIGH = SecurityRuleSeverity("high") +SecurityRuleSeverity.MEDIUM = SecurityRuleSeverity("medium") +SecurityRuleSeverity.LOW = SecurityRuleSeverity("low") +SecurityRuleSeverity.UNKNOWN = SecurityRuleSeverity("unknown") +SecurityRuleSeverity.INFO = SecurityRuleSeverity("info") diff --git a/src/datadog_api_client/v2/model/security_rule_types_items.py b/src/datadog_api_client/v2/model/security_rule_types_items.py new file mode 100644 index 0000000000..cc0aac9d6e --- /dev/null +++ b/src/datadog_api_client/v2/model/security_rule_types_items.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SecurityRuleTypesItems(ModelSimple): + """ + Security rule type + + :param value: Must be one of ["application_code_vulnerability", "application_library_vulnerability", "attack_path", "container_image_vulnerability", "host_vulnerability", "identity_risk", "misconfiguration", "api_security"]. + :type value: str + """ + + allowed_values = { + "application_code_vulnerability", + "application_library_vulnerability", + "attack_path", + "container_image_vulnerability", + "host_vulnerability", + "identity_risk", + "misconfiguration", + "api_security", + } + APPLICATION_CODE_VULNERABILITY: ClassVar["SecurityRuleTypesItems"] + APPLICATION_LIBRARY_VULNERABILITY: ClassVar["SecurityRuleTypesItems"] + ATTACK_PATH: ClassVar["SecurityRuleTypesItems"] + CONTAINER_IMAGE_VULNERABILITY: ClassVar["SecurityRuleTypesItems"] + HOST_VULNERABILITY: ClassVar["SecurityRuleTypesItems"] + IDENTITY_RISK: ClassVar["SecurityRuleTypesItems"] + MISCONFIGURATION: ClassVar["SecurityRuleTypesItems"] + API_SECURITY: ClassVar["SecurityRuleTypesItems"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY = SecurityRuleTypesItems("application_code_vulnerability") +SecurityRuleTypesItems.APPLICATION_LIBRARY_VULNERABILITY = SecurityRuleTypesItems("application_library_vulnerability") +SecurityRuleTypesItems.ATTACK_PATH = SecurityRuleTypesItems("attack_path") +SecurityRuleTypesItems.CONTAINER_IMAGE_VULNERABILITY = SecurityRuleTypesItems("container_image_vulnerability") +SecurityRuleTypesItems.HOST_VULNERABILITY = SecurityRuleTypesItems("host_vulnerability") +SecurityRuleTypesItems.IDENTITY_RISK = SecurityRuleTypesItems("identity_risk") +SecurityRuleTypesItems.MISCONFIGURATION = SecurityRuleTypesItems("misconfiguration") +SecurityRuleTypesItems.API_SECURITY = SecurityRuleTypesItems("api_security") diff --git a/src/datadog_api_client/v2/model/update_inbox_rule_parameters.py b/src/datadog_api_client/v2/model/update_inbox_rule_parameters.py new file mode 100644 index 0000000000..bc8dde9643 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_inbox_rule_parameters.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_inbox_rule_parameters_data import UpdateInboxRuleParametersData + + +class UpdateInboxRuleParameters(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_inbox_rule_parameters_data import UpdateInboxRuleParametersData + + return { + "data": (UpdateInboxRuleParametersData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[UpdateInboxRuleParametersData, UnsetType] = unset, **kwargs): + """ + Body of the inbox rule update request + + :param data: Data of the inbox rule update request: the rule id, the rule type, and the rule attributes. All fields are required. + :type data: UpdateInboxRuleParametersData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_inbox_rule_parameters_data.py b/src/datadog_api_client/v2/model/update_inbox_rule_parameters_data.py new file mode 100644 index 0000000000..5306d68030 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_inbox_rule_parameters_data.py @@ -0,0 +1,59 @@ +# 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.create_inbox_rule_parameters_data_attributes import ( + CreateInboxRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + +class UpdateInboxRuleParametersData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_inbox_rule_parameters_data_attributes import ( + CreateInboxRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType + + return { + "attributes": (CreateInboxRuleParametersDataAttributes,), + "id": (UUID,), + "type": (InboxRulesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: CreateInboxRuleParametersDataAttributes, id: UUID, type: InboxRulesType, **kwargs): + """ + Data of the inbox rule update request: the rule id, the rule type, and the rule attributes. All fields are required. + + :param attributes: Attributes of the inbox rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + :type attributes: CreateInboxRuleParametersDataAttributes + + :param id: The ID of a pipeline rule + :type id: UUID + + :param type: The pipeline rule type associated to inbox rules + :type type: InboxRulesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/update_mute_rule_parameters.py b/src/datadog_api_client/v2/model/update_mute_rule_parameters.py new file mode 100644 index 0000000000..550e76fd9a --- /dev/null +++ b/src/datadog_api_client/v2/model/update_mute_rule_parameters.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_mute_rule_parameters_data import UpdateMuteRuleParametersData + + +class UpdateMuteRuleParameters(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_mute_rule_parameters_data import UpdateMuteRuleParametersData + + return { + "data": (UpdateMuteRuleParametersData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[UpdateMuteRuleParametersData, UnsetType] = unset, **kwargs): + """ + Body of the mute rule update request + + :param data: Data of the mute rule update request: the rule id, the rule type, and the rule attributes. All fields are required. + :type data: UpdateMuteRuleParametersData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_mute_rule_parameters_data.py b/src/datadog_api_client/v2/model/update_mute_rule_parameters_data.py new file mode 100644 index 0000000000..2089d91d5f --- /dev/null +++ b/src/datadog_api_client/v2/model/update_mute_rule_parameters_data.py @@ -0,0 +1,59 @@ +# 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.create_mute_rule_parameters_data_attributes import ( + CreateMuteRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + +class UpdateMuteRuleParametersData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_mute_rule_parameters_data_attributes import ( + CreateMuteRuleParametersDataAttributes, + ) + from datadog_api_client.v2.model.mute_rules_type import MuteRulesType + + return { + "attributes": (CreateMuteRuleParametersDataAttributes,), + "id": (UUID,), + "type": (MuteRulesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: CreateMuteRuleParametersDataAttributes, id: UUID, type: MuteRulesType, **kwargs): + """ + Data of the mute rule update request: the rule id, the rule type, and the rule attributes. All fields are required. + + :param attributes: Attributes of the mute rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + :type attributes: CreateMuteRuleParametersDataAttributes + + :param id: The ID of a pipeline rule + :type id: UUID + + :param type: The pipeline rule type associated to mute rules + :type type: MuteRulesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index a235450d87..f5e247d053 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -67,6 +67,8 @@ from datadog_api_client.v2.model.action_connection_data_update import ActionConnectionDataUpdate from datadog_api_client.v2.model.action_connection_integration import ActionConnectionIntegration from datadog_api_client.v2.model.action_connection_integration_update import ActionConnectionIntegrationUpdate +from datadog_api_client.v2.model.action_inbox import ActionInbox +from datadog_api_client.v2.model.action_mute import ActionMute from datadog_api_client.v2.model.active_billing_dimensions_attributes import ActiveBillingDimensionsAttributes from datadog_api_client.v2.model.active_billing_dimensions_body import ActiveBillingDimensionsBody from datadog_api_client.v2.model.active_billing_dimensions_response import ActiveBillingDimensionsResponse @@ -136,6 +138,8 @@ from datadog_api_client.v2.model.authn_mappings_response import AuthNMappingsResponse from datadog_api_client.v2.model.authn_mappings_sort import AuthNMappingsSort from datadog_api_client.v2.model.authn_mappings_type import AuthNMappingsType +from datadog_api_client.v2.model.automation_rule import AutomationRule +from datadog_api_client.v2.model.automation_rule_user import AutomationRuleUser from datadog_api_client.v2.model.aws_cur_config import AwsCURConfig from datadog_api_client.v2.model.aws_cur_config_attributes import AwsCURConfigAttributes from datadog_api_client.v2.model.aws_cur_config_patch_data import AwsCURConfigPatchData @@ -482,6 +486,16 @@ CreateDataDeletionRequestBodyDataType, ) from datadog_api_client.v2.model.create_data_deletion_response_body import CreateDataDeletionResponseBody +from datadog_api_client.v2.model.create_inbox_rule_parameters import CreateInboxRuleParameters +from datadog_api_client.v2.model.create_inbox_rule_parameters_data import CreateInboxRuleParametersData +from datadog_api_client.v2.model.create_inbox_rule_parameters_data_attributes import ( + CreateInboxRuleParametersDataAttributes, +) +from datadog_api_client.v2.model.create_mute_rule_parameters import CreateMuteRuleParameters +from datadog_api_client.v2.model.create_mute_rule_parameters_data import CreateMuteRuleParametersData +from datadog_api_client.v2.model.create_mute_rule_parameters_data_attributes import ( + CreateMuteRuleParametersDataAttributes, +) from datadog_api_client.v2.model.create_notification_rule_parameters import CreateNotificationRuleParameters from datadog_api_client.v2.model.create_notification_rule_parameters_data import CreateNotificationRuleParametersData from datadog_api_client.v2.model.create_notification_rule_parameters_data_attributes import ( @@ -953,6 +967,10 @@ from datadog_api_client.v2.model.ip_allowlist_type import IPAllowlistType from datadog_api_client.v2.model.ip_allowlist_update_request import IPAllowlistUpdateRequest from datadog_api_client.v2.model.idp_metadata_form_data import IdPMetadataFormData +from datadog_api_client.v2.model.inbox_rule import InboxRule +from datadog_api_client.v2.model.inbox_rule_attributes import InboxRuleAttributes +from datadog_api_client.v2.model.inbox_rule_response import InboxRuleResponse +from datadog_api_client.v2.model.inbox_rules_type import InboxRulesType from datadog_api_client.v2.model.incident_attachment_attachment_type import IncidentAttachmentAttachmentType from datadog_api_client.v2.model.incident_attachment_attributes import IncidentAttachmentAttributes from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData @@ -1119,6 +1137,7 @@ from datadog_api_client.v2.model.intake_payload_accepted import IntakePayloadAccepted from datadog_api_client.v2.model.interface_attributes import InterfaceAttributes from datadog_api_client.v2.model.interface_attributes_status import InterfaceAttributesStatus +from datadog_api_client.v2.model.issue_type import IssueType from datadog_api_client.v2.model.jsonapi_error_item import JSONAPIErrorItem from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource from datadog_api_client.v2.model.jsonapi_error_response import JSONAPIErrorResponse @@ -1438,6 +1457,11 @@ from datadog_api_client.v2.model.monthly_cost_attribution_meta import MonthlyCostAttributionMeta from datadog_api_client.v2.model.monthly_cost_attribution_pagination import MonthlyCostAttributionPagination from datadog_api_client.v2.model.monthly_cost_attribution_response import MonthlyCostAttributionResponse +from datadog_api_client.v2.model.mute_reason import MuteReason +from datadog_api_client.v2.model.mute_rule import MuteRule +from datadog_api_client.v2.model.mute_rule_attributes import MuteRuleAttributes +from datadog_api_client.v2.model.mute_rule_response import MuteRuleResponse +from datadog_api_client.v2.model.mute_rules_type import MuteRulesType from datadog_api_client.v2.model.notification_rule import NotificationRule from datadog_api_client.v2.model.notification_rule_attributes import NotificationRuleAttributes from datadog_api_client.v2.model.notification_rule_response import NotificationRuleResponse @@ -1508,6 +1532,14 @@ from datadog_api_client.v2.model.partial_application_key import PartialApplicationKey from datadog_api_client.v2.model.partial_application_key_attributes import PartialApplicationKeyAttributes from datadog_api_client.v2.model.partial_application_key_response import PartialApplicationKeyResponse +from datadog_api_client.v2.model.patch_inbox_rules_parameters import PatchInboxRulesParameters +from datadog_api_client.v2.model.patch_inbox_rules_parameters_data import PatchInboxRulesParametersData +from datadog_api_client.v2.model.patch_inbox_rules_parameters_data_attributes import ( + PatchInboxRulesParametersDataAttributes, +) +from datadog_api_client.v2.model.patch_mute_rule_parameters import PatchMuteRuleParameters +from datadog_api_client.v2.model.patch_mute_rule_parameters_data import PatchMuteRuleParametersData +from datadog_api_client.v2.model.patch_mute_rule_parameters_data_attributes import PatchMuteRuleParametersDataAttributes from datadog_api_client.v2.model.patch_notification_rule_parameters import PatchNotificationRuleParameters from datadog_api_client.v2.model.patch_notification_rule_parameters_data import PatchNotificationRuleParametersData from datadog_api_client.v2.model.patch_notification_rule_parameters_data_attributes import ( @@ -1660,6 +1692,10 @@ from datadog_api_client.v2.model.relationship_to_user_team_user_data import RelationshipToUserTeamUserData from datadog_api_client.v2.model.relationship_to_users import RelationshipToUsers from datadog_api_client.v2.model.remediation import Remediation +from datadog_api_client.v2.model.reorder_inbox_rules_parameters import ReorderInboxRulesParameters +from datadog_api_client.v2.model.reorder_inbox_rules_parameters_data import ReorderInboxRulesParametersData +from datadog_api_client.v2.model.reorder_mute_rules_parameters import ReorderMuteRulesParameters +from datadog_api_client.v2.model.reorder_mute_rules_parameters_data import ReorderMuteRulesParametersData from datadog_api_client.v2.model.reorder_retention_filters_request import ReorderRetentionFiltersRequest from datadog_api_client.v2.model.response_meta_attributes import ResponseMetaAttributes from datadog_api_client.v2.model.restriction_policy import RestrictionPolicy @@ -1958,6 +1994,8 @@ ) from datadog_api_client.v2.model.security_monitoring_triage_user import SecurityMonitoringTriageUser from datadog_api_client.v2.model.security_monitoring_user import SecurityMonitoringUser +from datadog_api_client.v2.model.security_rule_severity import SecurityRuleSeverity +from datadog_api_client.v2.model.security_rule_types_items import SecurityRuleTypesItems from datadog_api_client.v2.model.selectors import Selectors from datadog_api_client.v2.model.sensitive_data_scanner_config_request import SensitiveDataScannerConfigRequest from datadog_api_client.v2.model.sensitive_data_scanner_configuration import SensitiveDataScannerConfiguration @@ -2260,6 +2298,10 @@ from datadog_api_client.v2.model.update_app_response import UpdateAppResponse from datadog_api_client.v2.model.update_app_response_data import UpdateAppResponseData from datadog_api_client.v2.model.update_app_response_data_attributes import UpdateAppResponseDataAttributes +from datadog_api_client.v2.model.update_inbox_rule_parameters import UpdateInboxRuleParameters +from datadog_api_client.v2.model.update_inbox_rule_parameters_data import UpdateInboxRuleParametersData +from datadog_api_client.v2.model.update_mute_rule_parameters import UpdateMuteRuleParameters +from datadog_api_client.v2.model.update_mute_rule_parameters_data import UpdateMuteRuleParametersData from datadog_api_client.v2.model.update_open_api_response import UpdateOpenAPIResponse from datadog_api_client.v2.model.update_open_api_response_attributes import UpdateOpenAPIResponseAttributes from datadog_api_client.v2.model.update_open_api_response_data import UpdateOpenAPIResponseData @@ -2429,6 +2471,8 @@ "ActionConnectionDataUpdate", "ActionConnectionIntegration", "ActionConnectionIntegrationUpdate", + "ActionInbox", + "ActionMute", "ActiveBillingDimensionsAttributes", "ActiveBillingDimensionsBody", "ActiveBillingDimensionsResponse", @@ -2498,6 +2542,8 @@ "AuthNMappingsResponse", "AuthNMappingsSort", "AuthNMappingsType", + "AutomationRule", + "AutomationRuleUser", "AwsCURConfig", "AwsCURConfigAttributes", "AwsCURConfigPatchData", @@ -2776,6 +2822,12 @@ "CreateDataDeletionRequestBodyData", "CreateDataDeletionRequestBodyDataType", "CreateDataDeletionResponseBody", + "CreateInboxRuleParameters", + "CreateInboxRuleParametersData", + "CreateInboxRuleParametersDataAttributes", + "CreateMuteRuleParameters", + "CreateMuteRuleParametersData", + "CreateMuteRuleParametersDataAttributes", "CreateNotificationRuleParameters", "CreateNotificationRuleParametersData", "CreateNotificationRuleParametersDataAttributes", @@ -3143,6 +3195,10 @@ "IPAllowlistType", "IPAllowlistUpdateRequest", "IdPMetadataFormData", + "InboxRule", + "InboxRuleAttributes", + "InboxRuleResponse", + "InboxRulesType", "IncidentAttachmentAttachmentType", "IncidentAttachmentAttributes", "IncidentAttachmentData", @@ -3277,6 +3333,7 @@ "IntakePayloadAccepted", "InterfaceAttributes", "InterfaceAttributesStatus", + "IssueType", "JSONAPIErrorItem", "JSONAPIErrorItemSource", "JSONAPIErrorResponse", @@ -3542,6 +3599,11 @@ "MonthlyCostAttributionMeta", "MonthlyCostAttributionPagination", "MonthlyCostAttributionResponse", + "MuteReason", + "MuteRule", + "MuteRuleAttributes", + "MuteRuleResponse", + "MuteRulesType", "NotificationRule", "NotificationRuleAttributes", "NotificationRuleResponse", @@ -3610,6 +3672,12 @@ "PartialApplicationKey", "PartialApplicationKeyAttributes", "PartialApplicationKeyResponse", + "PatchInboxRulesParameters", + "PatchInboxRulesParametersData", + "PatchInboxRulesParametersDataAttributes", + "PatchMuteRuleParameters", + "PatchMuteRuleParametersData", + "PatchMuteRuleParametersDataAttributes", "PatchNotificationRuleParameters", "PatchNotificationRuleParametersData", "PatchNotificationRuleParametersDataAttributes", @@ -3748,6 +3816,10 @@ "RelationshipToUserTeamUserData", "RelationshipToUsers", "Remediation", + "ReorderInboxRulesParameters", + "ReorderInboxRulesParametersData", + "ReorderMuteRulesParameters", + "ReorderMuteRulesParametersData", "ReorderRetentionFiltersRequest", "ResponseMetaAttributes", "RestrictionPolicy", @@ -3964,6 +4036,8 @@ "SecurityMonitoringThirdPartyRuleCaseCreate", "SecurityMonitoringTriageUser", "SecurityMonitoringUser", + "SecurityRuleSeverity", + "SecurityRuleTypesItems", "Selectors", "SensitiveDataScannerConfigRequest", "SensitiveDataScannerConfiguration", @@ -4218,6 +4292,10 @@ "UpdateAppResponse", "UpdateAppResponseData", "UpdateAppResponseDataAttributes", + "UpdateInboxRuleParameters", + "UpdateInboxRuleParametersData", + "UpdateMuteRuleParameters", + "UpdateMuteRuleParametersData", "UpdateOpenAPIResponse", "UpdateOpenAPIResponseAttributes", "UpdateOpenAPIResponseData", diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_successfully_created_the_inbox_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_successfully_created_the_inbox_rule_response.frozen new file mode 100644 index 0000000000..fa7eeec304 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_successfully_created_the_inbox_rule_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:16.327Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_successfully_created_the_inbox_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_successfully_created_the_inbox_rule_response.yaml new file mode 100644 index 0000000000..ac481e6813 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_successfully_created_the_inbox_rule_response.yaml @@ -0,0 +1,37 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"e0e466a5-6a37-4311-85e3-41edcd5bf075","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1738076176650,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076176650,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/e0e466a5-6a37-4311-85e3-41edcd5bf075 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_successfully_created_the_mute_rule_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_successfully_created_the_mute_rule_response.frozen new file mode 100644 index 0000000000..cbf80eeb30 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_successfully_created_the_mute_rule_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:17.189Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_successfully_created_the_mute_rule_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_successfully_created_the_mute_rule_response.yaml new file mode 100644 index 0000000000..f5e5109969 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_successfully_created_the_mute_rule_response.yaml @@ -0,0 +1,37 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":{"id":"84f9054f-4fb3-46a9-a032-2d8d3d6d61dd","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1738076177608,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076177608,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/84f9054f-4fb3-46a9-a032-2d8d3d6d61dd + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_not_found_response.frozen new file mode 100644 index 0000000000..8b357295e1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:22.778Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_not_found_response.yaml new file mode 100644 index 0000000000..d8c81e09d8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.frozen new file mode 100644 index 0000000000..ace09a134e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:23.246Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.yaml new file mode 100644 index 0000000000..5c1100464a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.yaml @@ -0,0 +1,51 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1738076183","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":{"id":"8b2eba88-d569-457c-a257-81dca506a008","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076183701,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076183701,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1738076183","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/8b2eba88-d569-457c-a257-81dca506a008 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/8b2eba88-d569-457c-a257-81dca506a008 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_not_found_response.frozen new file mode 100644 index 0000000000..d07adb5452 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:33.003Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_not_found_response.yaml new file mode 100644 index 0000000000..ce126aba53 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_rule_successfully_deleted_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_rule_successfully_deleted_response.frozen new file mode 100644 index 0000000000..861cc179c8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_rule_successfully_deleted_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:33.378Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_rule_successfully_deleted_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_rule_successfully_deleted_response.yaml new file mode 100644 index 0000000000..bfd9ad8053 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_rule_successfully_deleted_response.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"items to focus on"},"enabled":true,"name":"Test-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1738076193","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"c5278cb5-0b73-4259-a131-f4e39e3ce507","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076193807,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076193807,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1738076193","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/c5278cb5-0b73-4259-a131-f4e39e3ce507 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/c5278cb5-0b73-4259-a131-f4e39e3ce507 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_mute_rule_details_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_mute_rule_details_response.frozen new file mode 100644 index 0000000000..e3487da310 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_mute_rule_details_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:44.817Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_mute_rule_details_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_mute_rule_details_response.yaml new file mode 100644 index 0000000000..54e5cfa21a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_mute_rule_details_response.yaml @@ -0,0 +1,50 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1738076204","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":{"id":"4c45a22e-76c1-4dd8-b0a4-b759c69f12b5","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076205227,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076205227,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1738076204","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/4c45a22e-76c1-4dd8-b0a4-b759c69f12b5 + response: + body: + string: '{"data":{"id":"4c45a22e-76c1-4dd8-b0a4-b759c69f12b5","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076205227,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076205227,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1738076204","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/4c45a22e-76c1-4dd8-b0a4-b759c69f12b5 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_not_found_response.frozen new file mode 100644 index 0000000000..8960e1e184 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:46.132Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_not_found_response.yaml new file mode 100644 index 0000000000..33cbc0b378 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_inbox_rule_details_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_inbox_rule_details_response.frozen new file mode 100644 index 0000000000..40f13f871e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_inbox_rule_details_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:50.068Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_inbox_rule_details_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_inbox_rule_details_response.yaml new file mode 100644 index 0000000000..1c5e282c60 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_inbox_rule_details_response.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"items to focus on"},"enabled":true,"name":"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1738076210","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"0d3e2f13-ffda-4802-aec8-1c0a4936dc23","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076210476,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076210476,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1738076210","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/0d3e2f13-ffda-4802-aec8-1c0a4936dc23 + response: + body: + string: '{"data":{"id":"0d3e2f13-ffda-4802-aec8-1c0a4936dc23","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076210476,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076210476,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1738076210","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/0d3e2f13-ffda-4802-aec8-1c0a4936dc23 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_not_found_response.frozen new file mode 100644 index 0000000000..46e326e8e7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:51.376Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_not_found_response.yaml new file mode 100644 index 0000000000..5b2dd69226 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_inbox_rules_returns_the_list_of_inbox_rules_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_inbox_rules_returns_the_list_of_inbox_rules_response.frozen new file mode 100644 index 0000000000..3bd78eb9f8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_inbox_rules_returns_the_list_of_inbox_rules_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:54.480Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_inbox_rules_returns_the_list_of_inbox_rules_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_inbox_rules_returns_the_list_of_inbox_rules_response.yaml new file mode 100644 index 0000000000..2a4ddfe57d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_inbox_rules_returns_the_list_of_inbox_rules_response.yaml @@ -0,0 +1,78 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"items to focus on"},"enabled":true,"name":"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1738076214","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"1b5ede63-c593-4408-a54c-dc8418d36a50","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076214890,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076214890,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1738076214","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":[{"id":"720e23e6-3aa2-4792-9dff-df02f86676ad","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736869747695,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736869747695,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1736869747","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"307d8a2f-a82d-4272-9d38-6a859251d0a6","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736936332401,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736936332401,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_Bad_Request_response-1736936332","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"9e4361c5-e21b-4e59-90ae-57214151b2b2","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736936704349,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736936704349,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1736936704","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"1ad42562-e1be-4ec2-a510-6923e6d708a4","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736937094878,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736937094878,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1736937094","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"2ce28a6e-0975-48cc-9bff-de1a9edd94e2","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736937364153,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736937364153,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1736937363","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"bd638ded-e784-48c9-87bf-a3de72138f44","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736938273788,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736938274279,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"6717872d-9ac1-4570-8480-720b0f6f3193","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736938776235,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736938776235,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"1b50cdb7-5218-4989-9afc-e0d144d642e2","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736938883731,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736938883731,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736938883","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"b6ea190b-0317-40ba-a7ad-844e1e89a767","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736939052699,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736939052699,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1736939052","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"4f18dc53-d185-44d4-846c-561ec59bbf72","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736952258489,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952258489,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"0294b7cd-ecf4-4e30-bf00-542e53e9918b","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736952539376,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952539376,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1736952538","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"5e57a84a-a64e-4551-8c70-71e164df56ea","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736952677206,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952677695,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"8db7bc0b-0ff9-4936-8eba-32ff56c42f0d","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736953111545,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953111545,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1736953111","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"754ec766-45e1-4617-92f2-2c685640cfa5","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736953380911,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953380911,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1736953380","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"5e7dd814-ba12-4536-be51-b29aa3dff555","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736953540702,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953541190,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"9a53ae69-e980-4088-b57c-260f07da4706","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736953562530,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953562530,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1736953562","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"b6525132-929b-4c7a-ad7e-c51b66521219","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736955793842,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736955793842,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736955793","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"f4e5ffe8-b035-4f0e-9fdb-34fc3cbe1d68","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736956113141,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736956113141,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1736956112","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"fdc17395-9f98-4b1f-9643-21642074109c","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736956188814,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736956188814,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_Bad_Request_response-1736956188","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"0d0010f5-0255-46ff-94ac-ae52239d6369","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736957603847,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736957603847,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_Bad_Request_response-1736957603","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"4079ea57-aa2a-4da6-b7b9-1f186492dc6c","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736972574272,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736972574272,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736972573","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"1b5ede63-c593-4408-a54c-dc8418d36a50","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076214890,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076214890,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1738076214","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/1b5ede63-c593-4408-a54c-dc8418d36a50 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_mute_rules_returns_the_list_of_mute_rules_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_mute_rules_returns_the_list_of_mute_rules_response.frozen new file mode 100644 index 0000000000..4b6e550c32 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_mute_rules_returns_the_list_of_mute_rules_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:56:56.037Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_mute_rules_returns_the_list_of_mute_rules_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_mute_rules_returns_the_list_of_mute_rules_response.yaml new file mode 100644 index 0000000000..2c483eed43 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_ordered_list_of_mute_rules_returns_the_list_of_mute_rules_response.yaml @@ -0,0 +1,58 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1738076216","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":{"id":"781a0ca4-a262-4390-80ae-50a5ea91c59b","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076216450,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076216450,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1738076216","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":[{"id":"4601dcaf-d7ee-40ef-9ce5-7eed3a83f69a","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736870838826,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736870838826,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1736870838","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"a479725a-8692-42d0-bf9c-0d63ca642345","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while"},"created_at":1736873422906,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736873422906,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"48589a8d-1a79-443a-8b05-11209ac9be54","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736931543287,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736931543287,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1736931542","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"cb8e7dec-f5fa-4d20-b731-21d7685e3084","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736931564718,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736931564718,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1736931564","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"714e8c5d-1d83-4646-968d-35586ad7ddc4","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736931593302,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736931593302,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736931592","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"aec50bc5-e9c0-4101-953e-0f87d5138c10","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736931614635,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736931614635,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736931614","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"9e2d8004-e866-47d3-8e47-069051522e60","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while"},"created_at":1736934594769,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736934594769,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"1f0eda8c-86a3-4670-889b-4f95d47445e1","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736934778778,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736934778778,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736934778","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"128ceab0-9c15-4421-be66-f5131b171755","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736934800187,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736934800187,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736934799","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"cca4499a-19c3-4642-af33-2051458b9e80","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736935335347,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736935335347,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1736935334","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"b77f1a5f-0aeb-4ed7-8451-d9d3f0eef4a0","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736935380165,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736935380165,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736935379","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"009b952a-5ae5-45ea-bf4c-5b42cd414739","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736935847643,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736935847643,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_Bad_Request_response-1736935847","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"82563439-591a-4a2f-9061-eddf0f30cc40","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736936710612,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736936710612,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736936710","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"2d2b5a1d-8bb4-440c-a95c-8e4fef7ac478","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736938961065,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736938961065,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736938960","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"fb6be9d0-fe60-449a-91b2-5a2647ea9b45","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736952343752,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952343752,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1736952343","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"8eaf899d-519f-430e-a03f-bf0001259a78","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736952429326,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952429326,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736952428","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"5e08217f-eca0-4502-ac23-3d6490d8cd66","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1736952606711,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952607199,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"11ec6d30-e044-487e-b560-83e17e571001","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736952628631,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952628631,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736952628","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"746e3593-b6ba-4fcd-b100-7d298b4c6454","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while"},"created_at":1736953059610,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953059610,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"2ef91fd4-4e8f-4f47-8745-58cff2874da7","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736953256564,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953256564,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_Bad_Request_response-1736953256","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"dfc987db-7584-4f48-9e80-f5ba91145132","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736953277997,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953277997,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1736953277","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"1d1e9077-8c7d-44b4-9a5e-6f3f9e516ff0","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736953429788,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953429788,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736953429","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"ab5208f6-88d2-4bd4-9392-a0020b9fec60","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736953491759,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953491759,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736953491","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"3ffd9263-0460-4cd8-95ca-0f1e43624490","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736954925280,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736954925280,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1736954924","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"690679b5-99e9-46ed-a11e-ce03915fe063","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736955128456,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736955128456,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736955128","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"c151d2d4-5917-4d83-bb60-e82eecaf36a1","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736956108775,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736956108775,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1736956108","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"c5c3dcfa-b30b-4db6-8fd8-60c96cb94bac","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736963169276,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736963169276,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Bad_Request_response-1736963168","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"45d5d101-eb05-4dc2-926b-079900bb7ad6","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736970911790,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736970911790,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Bad_Request_response-1736970911","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"781a0ca4-a262-4390-80ae-50a5ea91c59b","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076216450,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076216450,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1738076216","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/781a0ca4-a262-4390-80ae-50a5ea91c59b + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_mute_rule_successfully_patched_response.frozen b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_mute_rule_successfully_patched_response.frozen new file mode 100644 index 0000000000..022691fea8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_mute_rule_successfully_patched_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:02.493Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_mute_rule_successfully_patched_response.yaml b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_mute_rule_successfully_patched_response.yaml new file mode 100644 index 0000000000..720579cdc4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_mute_rule_successfully_patched_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1738076222","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":{"id":"d7a109ad-032f-4f25-b80c-de7fef3f7b94","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076222803,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076222803,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1738076222","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"d7a109ad-032f-4f25-b80c-de7fef3f7b94","type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/d7a109ad-032f-4f25-b80c-de7fef3f7b94 + response: + body: + string: '{"data":{"id":"d7a109ad-032f-4f25-b80c-de7fef3f7b94","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1738076222803,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076223290,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/d7a109ad-032f-4f25-b80c-de7fef3f7b94 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_not_found_response.frozen new file mode 100644 index 0000000000..f3a7764883 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:03.825Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_not_found_response.yaml new file mode 100644 index 0000000000..d539f48bda --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_not_found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_bad_request_response.frozen new file mode 100644 index 0000000000..9ddcd4054f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:10.433Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_bad_request_response.yaml new file mode 100644 index 0000000000..4afac3d1b3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_bad_request_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"items to focus on"},"enabled":true,"name":"Test-Patch_an_inbox_rule_returns_Bad_Request_response-1738076230","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"7fffd998-9474-451a-b750-a306120b5fe7","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076230847,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076230847,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_an_inbox_rule_returns_Bad_Request_response-1738076230","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"invalid":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"7fffd998-9474-451a-b750-a306120b5fe7","type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/7fffd998-9474-451a-b750-a306120b5fe7 + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Error while + unmarshalling JSON API request"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/7fffd998-9474-451a-b750-a306120b5fe7 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_inbox_rule_successfully_patched_response.frozen b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_inbox_rule_successfully_patched_response.frozen new file mode 100644 index 0000000000..0b9ed6f52c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_inbox_rule_successfully_patched_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:11.757Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_inbox_rule_successfully_patched_response.yaml b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_inbox_rule_successfully_patched_response.yaml new file mode 100644 index 0000000000..dc88578cbe --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_inbox_rule_successfully_patched_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"items to focus on"},"enabled":true,"name":"Test-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1738076231","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"b1cae592-90ba-424c-8398-1d0e2f4a4689","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076232178,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076232178,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1738076231","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"b1cae592-90ba-424c-8398-1d0e2f4a4689","type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/b1cae592-90ba-424c-8398-1d0e2f4a4689 + response: + body: + string: '{"data":{"id":"b1cae592-90ba-424c-8398-1d0e2f4a4689","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1738076232178,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076232662,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/b1cae592-90ba-424c-8398-1d0e2f4a4689 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_not_found_response.frozen new file mode 100644 index 0000000000..f2582e8b23 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:13.093Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_not_found_response.yaml new file mode 100644 index 0000000000..7b0a29f02b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_not_found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_bad_request_response.frozen new file mode 100644 index 0000000000..61e377441d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:17.105Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_bad_request_response.yaml new file mode 100644 index 0000000000..36b2c49533 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_bad_request_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Update_a_mute_rule_returns_Bad_Request_response-1738076237","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":{"id":"c3ea4deb-588b-4340-874c-6ed929273635","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076237517,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076237517,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_a_mute_rule_returns_Bad_Request_response-1738076237","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"invalid":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"c3ea4deb-588b-4340-874c-6ed929273635","type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/c3ea4deb-588b-4340-874c-6ed929273635 + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Error while + unmarshalling JSON API request"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/c3ea4deb-588b-4340-874c-6ed929273635 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_mute_rule_successfully_updated_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_mute_rule_successfully_updated_response.frozen new file mode 100644 index 0000000000..6d09d070e0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_mute_rule_successfully_updated_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:18.388Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_mute_rule_successfully_updated_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_mute_rule_successfully_updated_response.yaml new file mode 100644 index 0000000000..3e07321e43 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_mute_rule_successfully_updated_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1738076238","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":{"id":"edf96f66-5f69-4d05-a027-4157260b2bb7","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076238794,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076238794,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1738076238","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"edf96f66-5f69-4d05-a027-4157260b2bb7","type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/edf96f66-5f69-4d05-a027-4157260b2bb7 + response: + body: + string: '{"data":{"id":"edf96f66-5f69-4d05-a027-4157260b2bb7","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1738076238794,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076239278,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/edf96f66-5f69-4d05-a027-4157260b2bb7 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_not_found_response.frozen new file mode 100644 index 0000000000..277ceb52d2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:19.708Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_not_found_response.yaml new file mode 100644 index 0000000000..bc424c5216 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_not_found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen new file mode 100644 index 0000000000..9ee63a2d98 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:20.205Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml new file mode 100644 index 0000000000..06554d1354 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1738076240","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + string: '{"data":{"id":"dd1f2131-9b79-4510-a18b-523bc53158bb","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1738076240624,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076240624,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1738076240","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"mute_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/dd1f2131-9b79-4510-a18b-523bc53158bb + response: + body: + string: '{"errors":[{"status":"422","title":"Unprocessable Entity","detail":"Rule + Ids in path and in request body differ"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/dd1f2131-9b79-4510-a18b-523bc53158bb + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_bad_request_response.frozen new file mode 100644 index 0000000000..17d150b940 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:27.999Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_bad_request_response.yaml new file mode 100644 index 0000000000..c4ede9e8ed --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_bad_request_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"items to focus on"},"enabled":true,"name":"Test-Update_an_inbox_rule_returns_Bad_Request_response-1738076247","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"2304d942-bdea-4c7e-9899-2f5882eba53a","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076248310,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076248310,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_an_inbox_rule_returns_Bad_Request_response-1738076247","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"invalid":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"2304d942-bdea-4c7e-9899-2f5882eba53a","type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/2304d942-bdea-4c7e-9899-2f5882eba53a + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Error while + unmarshalling JSON API request"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/2304d942-bdea-4c7e-9899-2f5882eba53a + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_inbox_rule_successfully_updated_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_inbox_rule_successfully_updated_response.frozen new file mode 100644 index 0000000000..3d40712bb9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_inbox_rule_successfully_updated_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:29.306Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_inbox_rule_successfully_updated_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_inbox_rule_successfully_updated_response.yaml new file mode 100644 index 0000000000..9296ec8028 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_inbox_rule_successfully_updated_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"items to focus on"},"enabled":true,"name":"Test-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1738076249","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"a4b6b6fd-641c-4633-b6b0-cc53fde68159","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076249602,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076249602,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1738076249","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"a4b6b6fd-641c-4633-b6b0-cc53fde68159","type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/a4b6b6fd-641c-4633-b6b0-cc53fde68159 + response: + body: + string: '{"data":{"id":"a4b6b6fd-641c-4633-b6b0-cc53fde68159","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1738076249602,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076250066,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/a4b6b6fd-641c-4633-b6b0-cc53fde68159 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_not_found_response.frozen new file mode 100644 index 0000000000..525ddb90fb --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:30.606Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_not_found_response.yaml new file mode 100644 index 0000000000..379b202e84 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_not_found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000 + response: + body: + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen new file mode 100644 index 0000000000..74aa9ac75b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen @@ -0,0 +1 @@ +2025-01-28T14:57:30.963Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml new file mode 100644 index 0000000000..c4a3fad0c4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"items to focus on"},"enabled":true,"name":"Test-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1738076250","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + string: '{"data":{"id":"faae7573-c106-4d14-8dbc-585e003f51c1","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1738076251372,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1738076251372,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1738076250","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"inbox_rules"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/faae7573-c106-4d14-8dbc-585e003f51c1 + response: + body: + string: '{"errors":[{"status":"422","title":"Unprocessable Entity","detail":"Rule + Ids in path and in request body differ"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/faae7573-c106-4d14-8dbc-585e003f51c1 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 9f928a1afc..3c7c1e57e3 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -571,6 +571,30 @@ "tag": "Security Monitoring", "operationId": "CreateVulnerabilityNotificationRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"inbox_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"rule\": {\n \"issue_type\": \"vulnerability\",\n \"rule_types\": [\"misconfiguration\", \"attack_path\"],\n \"rule_ids\": [],\n \"severities\": [\"critical\"],\n \"query\": \"\"\n },\n \"action\": {\n \"reason_description\": \"items to focus on\"\n },\n \"enabled\": true\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_inbox_rule\" in the system", + "key": "valid_inbox_rule", + "tag": "Security Monitoring", + "operationId": "CreateInboxRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"mute_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"rule\": {\n \"issue_type\": \"vulnerability\",\n \"rule_types\": [\"misconfiguration\", \"attack_path\"],\n \"rule_ids\": [],\n \"severities\": [\"critical\"],\n \"query\": \"\"\n },\n \"action\": {\n \"reason\": \"duplicate\"\n },\n \"enabled\": true\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_mute_rule\" in the system", + "key": "valid_mute_rule", + "tag": "Security Monitoring", + "operationId": "CreateMuteRule" + }, { "parameters": [ { diff --git a/tests/v2/features/security_monitoring.feature b/tests/v2/features/security_monitoring.feature index a82f2a3dcd..e42eb9ca82 100644 --- a/tests/v2/features/security_monitoring.feature +++ b/tests/v2/features/security_monitoring.feature @@ -235,6 +235,34 @@ Feature: Security Monitoring And the response "message" is equal to "Test rule" And the response "isEnabled" is equal to true + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Create a new inbox rule returns "Bad Request" response + Given new "CreateInboxRule" request + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Create a new inbox rule returns "Successfully created the inbox rule" response + Given new "CreateInboxRule" request + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "type": "inbox_rules"}} + When the request is sent + Then the response status is 201 Successfully created the inbox rule + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Create a new mute rule returns "Bad Request" response + Given new "CreateMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Create a new mute rule returns "Successfully created the mute rule" response + Given new "CreateMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 201 Successfully created the mute rule + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Create a new signal-based rule returns "Bad Request" response Given new "CreateSignalNotificationRule" request @@ -324,6 +352,21 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail" And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345" + @team:DataDog/cloud-security-posture-management + Scenario: Delete a mute rule returns "Not Found" response + Given new "DeleteMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Delete a mute rule returns "Rule successfully deleted" response + Given there is a valid "valid_mute_rule" in the system + And new "DeleteMuteRule" request + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted + @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -445,6 +488,21 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @team:DataDog/cloud-security-posture-management + Scenario: Delete an inbox rule returns "Not Found" response + Given new "DeleteInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Delete an inbox rule returns "Rule successfully deleted" response + Given there is a valid "valid_inbox_rule" in the system + And new "DeleteInboxRule" request + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted + @generated @skip @team:DataDog/asm-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetSBOM" enabled @@ -657,6 +715,29 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Bad Request" response + Given new "GetMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Mute rule details" response + Given new "GetMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 200 Mute rule details + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Not Found" response + Given new "GetMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get details of a signal-based rule returns "Bad Request" response Given new "GetSignalNotificationRule" request @@ -701,6 +782,29 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 Notification rule details. + @skip @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Bad Request" response + Given new "GetInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Inbox rule details" response + Given new "GetInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 200 Inbox rule details + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Not Found" response + Given new "GetInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/cloud-security-posture-management Scenario: Get the list of signal-based rules returns "The list of notification rules." response Given there is a valid "valid_signal_notification_rule" in the system @@ -715,6 +819,20 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 The list of notification rules. + @team:DataDog/cloud-security-posture-management + Scenario: Get the ordered list of inbox rules returns "The list of inbox rules" response + Given new "GetInboxRules" request + And there is a valid "valid_inbox_rule" in the system + When the request is sent + Then the response status is 200 The list of inbox rules + + @team:DataDog/cloud-security-posture-management + Scenario: Get the ordered list of mute rules returns "The list of mute rules" response + Given new "GetMuteRules" request + And there is a valid "valid_mute_rule" in the system + When the request is sent + Then the response status is 200 The list of mute rules + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: List findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListFindings" enabled @@ -889,6 +1007,41 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Bad Request" response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Mute rule successfully patched" response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Mute rule successfully patched + + @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Not Found" response + Given new "PatchMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "The server cannot process the request because it contains invalid data." response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + @team:DataDog/cloud-security-posture-management Scenario: Patch a signal-based rule returns "Bad Request" response Given new "PatchSignalNotificationRule" request @@ -957,6 +1110,69 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Bad Request" response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Inbox rule successfully patched" response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 200 Inbox rule successfully patched + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Not Found" response + Given new "PatchInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "The server cannot process the request because it contains invalid data." response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of inbox rules in the pipeline returns "Bad Request" response + Given new "ReorderInboxRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "inbox_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of inbox rules in the pipeline returns "The list of inbox rules" response + Given new "ReorderInboxRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "inbox_rules"}]} + When the request is sent + Then the response status is 200 The list of inbox rules + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of mute rules in the pipeline returns "Bad Request" response + Given new "ReorderMuteRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of mute rules in the pipeline returns "The list of mute rules" response + Given new "ReorderMuteRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 200 The list of mute rules + @team:DataDog/k9-cloud-security-platform Scenario: Run a historical job returns "Bad Request" response Given operation "RunHistoricalJob" enabled @@ -1038,6 +1254,41 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}_cloud_updated" And the response "id" has the same value as "cloud_configuration_rule.id" + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Bad Request" response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Mute rule successfully updated" response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Mute rule successfully updated + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Not Found" response + Given new "UpdateMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "The server cannot process the request because it contains invalid data." response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a security filter returns "Bad Request" response Given new "UpdateSecurityFilter" request @@ -1138,6 +1389,41 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}-Updated" And the response "id" has the same value as "security_rule.id" + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Bad Request" response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Inbox rule successfully updated" response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 200 Inbox rule successfully updated + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Not Found" response + Given new "UpdateInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "The server cannot process the request because it contains invalid data." response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-typescript @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Validate a detection rule returns "Bad Request" response Given new "ValidateSecurityMonitoringRule" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index bb87359755..778d245019 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2147,6 +2147,104 @@ "type": "idempotent" } }, + "GetInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateInboxRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteInboxRule", + "parameters": [ + { + "name": "inbox_rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "PatchInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "UpdateInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateMuteRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteMuteRule", + "parameters": [ + { + "name": "mute_rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "PatchMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "UpdateMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListCloudWorkloadSecurityAgentRules": { "tag": "CSM Threats", "undo": {