diff --git a/.apigentools-info b/.apigentools-info index 3c966edc6b..d482bda2e9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-22 15:54:08.561505", - "spec_repo_commit": "7a8ea4b1" + "regenerated": "2025-01-23 14:30:10.407085", + "spec_repo_commit": "e2b0a91f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-22 15:54:08.576092", - "spec_repo_commit": "7a8ea4b1" + "regenerated": "2025-01-23 14:30:10.421296", + "spec_repo_commit": "e2b0a91f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a06d74ae8e..9f213d57a2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -782,6 +782,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: @@ -836,6 +858,13 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Unauthorized + UnprocessableEntityResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: The server cannot process the request because it contains invalid + data. schemas: APIErrorResponse: description: API error response. @@ -1730,6 +1759,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: @@ -7403,6 +7457,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/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + 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/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - name + - rule + type: object CreateOpenAPIResponse: description: Response for `CreateOpenAPI` operation. properties: @@ -9115,6 +9239,11 @@ components: type: number type: array type: object + Date: + description: Date as Unix timestamp in milliseconds + example: 1722439510282 + format: int64 + type: integer DeleteAppResponse: description: The definition of `DeleteAppResponse` object. properties: @@ -10297,6 +10426,10 @@ components: - score - severity type: object + Enabled: + description: Field used to enable or disable the rule. + example: true + type: boolean EntityAttributes: description: Entity attributes. properties: @@ -13352,6 +13485,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/Date' + created_by: + $ref: '#/components/schemas/RuleUser' + enabled: + $ref: '#/components/schemas/Enabled' + modified_at: + $ref: '#/components/schemas/Date' + modified_by: + $ref: '#/components/schemas/RuleUser' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + 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: @@ -15557,6 +15751,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: @@ -19381,6 +19583,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/Date' + created_by: + $ref: '#/components/schemas/RuleUser' + enabled: + $ref: '#/components/schemas/Enabled' + modified_at: + $ref: '#/components/schemas/Date' + modified_by: + $ref: '#/components/schemas/RuleUser' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + 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 NullableRelationshipToUser: description: Relationship to user. nullable: true @@ -20234,6 +20521,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/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + 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/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + type: object Permission: description: Permission object. properties: @@ -22227,6 +22582,50 @@ components: - new_advisories - avoided_advisories type: object + ReorderInboxRulesParameters: + description: 'Body of the inbox rule reorder request: the full list of inbox + rules needs to 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 + needs to 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: @@ -22874,6 +23273,33 @@ components: type: string x-enum-varnames: - ROLES + Rule: + 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/RuleTypes' + severities: + description: The security rules severities to consider + items: + $ref: '#/components/schemas/RuleSeverity' + type: array + required: + - issue_type + - rule_types + type: object RuleAttributes: description: Details of a rule. properties: @@ -22915,12 +23341,46 @@ components: 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 + RuleName: + description: Name of the pipeline rule + example: Rule 1 + type: string RuleOutcomeRelationships: description: The JSON:API relationship to a scorecard rule. properties: 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: + - critical + - high + - medium + - low + - unknown + - info + example: critical + type: string + x-enum-varnames: + - CRITICAL + - HIGH + - MEDIUM + - LOW + - UNKNOWN + - INFO RuleType: default: rule description: The JSON:API type for scorecard rules. @@ -22930,6 +23390,46 @@ components: type: string x-enum-varnames: - RULE + RuleTypes: + description: Security rule types + example: + - application_code_vulnerability + items: + $ref: '#/components/schemas/RuleTypesItems' + type: array + RuleTypesItems: + 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 + RuleUser: + 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 RumMetricCompute: description: The compute rule to compute the rum-based metric. properties: @@ -29307,6 +29807,11 @@ components: type: string x-enum-varnames: - SECRET + 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. @@ -29540,6 +30045,48 @@ components: deployment: $ref: '#/components/schemas/DeploymentRelationship' 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: @@ -43929,6 +44476,559 @@ paths: x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' + /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 need to 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 will be 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 will not be 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/UnprocessableEntityResponse' + '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 will be 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/UnprocessableEntityResponse' + '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 need to 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 will be 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 will not be 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/UnprocessableEntityResponse' + '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 will be 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/UnprocessableEntityResponse' + '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 826f7dbace..97d696e52a 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 ---------------------------------------------------------------------------- @@ -2881,6 +2895,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\_open\_api\_response module ---------------------------------------------------------------- @@ -5499,6 +5555,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 --------------------------------------------------------------------------- @@ -6549,6 +6633,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 ---------------------------------------------------------------- @@ -8397,6 +8488,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.nullable\_relationship\_to\_user module --------------------------------------------------------------------- @@ -8845,6 +8971,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.permission module ----------------------------------------------- @@ -9454,6 +9622,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 ------------------------------------------------------------------------- @@ -9769,6 +9965,13 @@ datadog\_api\_client.v2.model.roles\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.rule module +----------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rule + :members: + :show-inheritance: + datadog\_api\_client.v2.model.rule\_attributes module ----------------------------------------------------- @@ -9783,6 +9986,13 @@ datadog\_api\_client.v2.model.rule\_outcome\_relationships module :members: :show-inheritance: +datadog\_api\_client.v2.model.rule\_severity module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rule_severity + :members: + :show-inheritance: + datadog\_api\_client.v2.model.rule\_type module ----------------------------------------------- @@ -9790,6 +10000,20 @@ datadog\_api\_client.v2.model.rule\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.rule\_types\_items module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rule_types_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.rule\_user module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.rule_user + :members: + :show-inheritance: + datadog\_api\_client.v2.model.rum\_aggregate\_bucket\_value module ------------------------------------------------------------------ @@ -13045,6 +13269,34 @@ datadog\_api\_client.v2.model.update\_app\_response\_relationship 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..e28c1b9cd5 --- /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.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.rule import Rule +from datadog_api_client.v2.model.rule_severity import RuleSeverity +from datadog_api_client.v2.model.rule_types_items import RuleTypesItems + +body = CreateInboxRuleParameters( + data=CreateInboxRuleParametersData( + attributes=CreateInboxRuleParametersDataAttributes( + action=ActionInbox( + reason_description="We want to focus on these items.", + ), + enabled=True, + name="Rule 1", + rule=Rule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + RuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + RuleSeverity.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..93e964729d --- /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.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.rule import Rule +from datadog_api_client.v2.model.rule_severity import RuleSeverity +from datadog_api_client.v2.model.rule_types_items import RuleTypesItems + +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=Rule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + RuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + RuleSeverity.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..648a1e7a15 --- /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.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.rule import Rule +from datadog_api_client.v2.model.rule_severity import RuleSeverity +from datadog_api_client.v2.model.rule_types_items import RuleTypesItems + +# 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=Rule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + RuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + RuleSeverity.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..7aab31642b --- /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.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.rule import Rule +from datadog_api_client.v2.model.rule_severity import RuleSeverity +from datadog_api_client.v2.model.rule_types_items import RuleTypesItems + +# 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=Rule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + RuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + RuleSeverity.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..8d8af714f7 --- /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.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.rule import Rule +from datadog_api_client.v2.model.rule_severity import RuleSeverity +from datadog_api_client.v2.model.rule_types_items import RuleTypesItems +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=Rule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + RuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + RuleSeverity.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..188affc3ff --- /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.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.rule import Rule +from datadog_api_client.v2.model.rule_severity import RuleSeverity +from datadog_api_client.v2.model.rule_types_items import RuleTypesItems +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=Rule( + issue_type=IssueType.VULNERABILITY, + query="key:val", + rule_ids=[ + "rule-id-1", + ], + rule_types=[ + RuleTypesItems.APPLICATION_CODE_VULNERABILITY, + ], + severities=[ + RuleSeverity.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 f2ebb7f35a..5479687df5 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 @@ -32,6 +33,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 @@ -183,6 +194,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,), @@ -266,6 +317,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, @@ -467,6 +564,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,), @@ -1181,6 +1356,98 @@ 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._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,), @@ -1266,6 +1533,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,), @@ -1436,6 +1755,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, @@ -1511,6 +1868,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, @@ -1669,6 +2060,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, @@ -2673,6 +3122,84 @@ 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 will not be 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 will not be 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 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 need to 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 will be 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 need to 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 will be 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, @@ -2777,6 +3304,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 will be 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 will be 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/create_inbox_rule_parameters.py b/src/datadog_api_client/v2/model/create_inbox_rule_parameters.py new file mode 100644 index 0000000000..a4103b3f97 --- /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..b73a6f3f24 --- /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..c9898fc448 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_inbox_rule_parameters_data_attributes.py @@ -0,0 +1,66 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_inbox import ActionInbox + from datadog_api_client.v2.model.rule import Rule + + +class CreateInboxRuleParametersDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_inbox import ActionInbox + from datadog_api_client.v2.model.rule import Rule + + return { + "action": (ActionInbox,), + "enabled": (bool,), + "name": (str,), + "rule": (Rule,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__(self_, action: ActionInbox, name: str, rule: Rule, 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: Rule + """ + 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..e1246b421d --- /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..606892d4ae --- /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..b1ef49ebdc --- /dev/null +++ b/src/datadog_api_client/v2/model/create_mute_rule_parameters_data_attributes.py @@ -0,0 +1,66 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.action_mute import ActionMute + from datadog_api_client.v2.model.rule import Rule + + +class CreateMuteRuleParametersDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_mute import ActionMute + from datadog_api_client.v2.model.rule import Rule + + return { + "action": (ActionMute,), + "enabled": (bool,), + "name": (str,), + "rule": (Rule,), + } + + attribute_map = { + "action": "action", + "enabled": "enabled", + "name": "name", + "rule": "rule", + } + + def __init__(self_, action: ActionMute, name: str, rule: Rule, 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: Rule + """ + 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..05d5c701db --- /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.rule_user import RuleUser + from datadog_api_client.v2.model.rule import Rule + + +class InboxRuleAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_inbox import ActionInbox + from datadog_api_client.v2.model.rule_user import RuleUser + from datadog_api_client.v2.model.rule import Rule + + return { + "action": (ActionInbox,), + "created_at": (int,), + "created_by": (RuleUser,), + "enabled": (bool,), + "modified_at": (int,), + "modified_by": (RuleUser,), + "name": (str,), + "rule": (Rule,), + } + + 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: RuleUser, + enabled: bool, + modified_at: int, + modified_by: RuleUser, + name: str, + rule: Rule, + **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: RuleUser + + :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: RuleUser + + :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: Rule + """ + 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..615ace8842 --- /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.rule_user import RuleUser + from datadog_api_client.v2.model.rule import Rule + + +class MuteRuleAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_mute import ActionMute + from datadog_api_client.v2.model.rule_user import RuleUser + from datadog_api_client.v2.model.rule import Rule + + return { + "action": (ActionMute,), + "created_at": (int,), + "created_by": (RuleUser,), + "enabled": (bool,), + "modified_at": (int,), + "modified_by": (RuleUser,), + "name": (str,), + "rule": (Rule,), + } + + 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: RuleUser, + enabled: bool, + modified_at: int, + modified_by: RuleUser, + name: str, + rule: Rule, + **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: RuleUser + + :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: RuleUser + + :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: Rule + """ + 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..88ba676137 --- /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.rule import Rule + + +class PatchInboxRulesParametersDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_inbox import ActionInbox + from datadog_api_client.v2.model.rule import Rule + + return { + "action": (ActionInbox,), + "enabled": (bool,), + "name": (str,), + "rule": (Rule,), + } + + 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[Rule, 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: Rule, 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..6699f3b533 --- /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.rule import Rule + + +class PatchMuteRuleParametersDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.action_mute import ActionMute + from datadog_api_client.v2.model.rule import Rule + + return { + "action": (ActionMute,), + "enabled": (bool,), + "name": (str,), + "rule": (Rule,), + } + + 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[Rule, 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: Rule, 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..d9e4df8727 --- /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 needs to 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..bd4bb0f567 --- /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 needs to 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/rule.py b/src/datadog_api_client/v2/model/rule.py new file mode 100644 index 0000000000..8329afd85a --- /dev/null +++ b/src/datadog_api_client/v2/model/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.rule_types_items import RuleTypesItems + from datadog_api_client.v2.model.rule_severity import RuleSeverity + + +class Rule(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.issue_type import IssueType + from datadog_api_client.v2.model.rule_types_items import RuleTypesItems + from datadog_api_client.v2.model.rule_severity import RuleSeverity + + return { + "issue_type": (IssueType,), + "query": (str,), + "rule_ids": ([str],), + "rule_types": ([RuleTypesItems],), + "severities": ([RuleSeverity],), + } + + 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[RuleTypesItems], + query: Union[str, UnsetType] = unset, + rule_ids: Union[List[str], UnsetType] = unset, + severities: Union[List[RuleSeverity], 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: [RuleTypesItems] + + :param severities: The security rules severities to consider + :type severities: [RuleSeverity], 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/rule_severity.py b/src/datadog_api_client/v2/model/rule_severity.py new file mode 100644 index 0000000000..f4a8249f0c --- /dev/null +++ b/src/datadog_api_client/v2/model/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 RuleSeverity(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["RuleSeverity"] + HIGH: ClassVar["RuleSeverity"] + MEDIUM: ClassVar["RuleSeverity"] + LOW: ClassVar["RuleSeverity"] + UNKNOWN: ClassVar["RuleSeverity"] + INFO: ClassVar["RuleSeverity"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RuleSeverity.CRITICAL = RuleSeverity("critical") +RuleSeverity.HIGH = RuleSeverity("high") +RuleSeverity.MEDIUM = RuleSeverity("medium") +RuleSeverity.LOW = RuleSeverity("low") +RuleSeverity.UNKNOWN = RuleSeverity("unknown") +RuleSeverity.INFO = RuleSeverity("info") diff --git a/src/datadog_api_client/v2/model/rule_types_items.py b/src/datadog_api_client/v2/model/rule_types_items.py new file mode 100644 index 0000000000..1daad7f1fc --- /dev/null +++ b/src/datadog_api_client/v2/model/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 RuleTypesItems(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["RuleTypesItems"] + APPLICATION_LIBRARY_VULNERABILITY: ClassVar["RuleTypesItems"] + ATTACK_PATH: ClassVar["RuleTypesItems"] + CONTAINER_IMAGE_VULNERABILITY: ClassVar["RuleTypesItems"] + HOST_VULNERABILITY: ClassVar["RuleTypesItems"] + IDENTITY_RISK: ClassVar["RuleTypesItems"] + MISCONFIGURATION: ClassVar["RuleTypesItems"] + API_SECURITY: ClassVar["RuleTypesItems"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +RuleTypesItems.APPLICATION_CODE_VULNERABILITY = RuleTypesItems("application_code_vulnerability") +RuleTypesItems.APPLICATION_LIBRARY_VULNERABILITY = RuleTypesItems("application_library_vulnerability") +RuleTypesItems.ATTACK_PATH = RuleTypesItems("attack_path") +RuleTypesItems.CONTAINER_IMAGE_VULNERABILITY = RuleTypesItems("container_image_vulnerability") +RuleTypesItems.HOST_VULNERABILITY = RuleTypesItems("host_vulnerability") +RuleTypesItems.IDENTITY_RISK = RuleTypesItems("identity_risk") +RuleTypesItems.MISCONFIGURATION = RuleTypesItems("misconfiguration") +RuleTypesItems.API_SECURITY = RuleTypesItems("api_security") diff --git a/src/datadog_api_client/v2/model/rule_user.py b/src/datadog_api_client/v2/model/rule_user.py new file mode 100644 index 0000000000..7f9f58909f --- /dev/null +++ b/src/datadog_api_client/v2/model/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 RuleUser(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/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 abeb5208fa..6f3d2c0448 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 @@ -481,6 +483,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_open_api_response import CreateOpenAPIResponse from datadog_api_client.v2.model.create_open_api_response_attributes import CreateOpenAPIResponseAttributes from datadog_api_client.v2.model.create_open_api_response_data import CreateOpenAPIResponseData @@ -964,6 +976,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 @@ -1143,6 +1159,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 @@ -1461,6 +1478,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.nullable_relationship_to_user import NullableRelationshipToUser from datadog_api_client.v2.model.nullable_relationship_to_user_data import NullableRelationshipToUserData from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship @@ -1527,6 +1549,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.permission import Permission from datadog_api_client.v2.model.permission_attributes import PermissionAttributes from datadog_api_client.v2.model.permissions_response import PermissionsResponse @@ -1673,6 +1703,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 @@ -1718,9 +1752,13 @@ from datadog_api_client.v2.model.roles_response import RolesResponse from datadog_api_client.v2.model.roles_sort import RolesSort from datadog_api_client.v2.model.roles_type import RolesType +from datadog_api_client.v2.model.rule import Rule from datadog_api_client.v2.model.rule_attributes import RuleAttributes from datadog_api_client.v2.model.rule_outcome_relationships import RuleOutcomeRelationships +from datadog_api_client.v2.model.rule_severity import RuleSeverity from datadog_api_client.v2.model.rule_type import RuleType +from datadog_api_client.v2.model.rule_types_items import RuleTypesItems +from datadog_api_client.v2.model.rule_user import RuleUser from datadog_api_client.v2.model.rum_metric_compute import RumMetricCompute from datadog_api_client.v2.model.rum_metric_compute_aggregation_type import RumMetricComputeAggregationType from datadog_api_client.v2.model.rum_metric_create_attributes import RumMetricCreateAttributes @@ -2274,6 +2312,10 @@ from datadog_api_client.v2.model.update_app_response_data_attributes import UpdateAppResponseDataAttributes from datadog_api_client.v2.model.update_app_response_data_type import UpdateAppResponseDataType from datadog_api_client.v2.model.update_app_response_relationship import UpdateAppResponseRelationship +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 @@ -2443,6 +2485,8 @@ "ActionConnectionDataUpdate", "ActionConnectionIntegration", "ActionConnectionIntegrationUpdate", + "ActionInbox", + "ActionMute", "ActiveBillingDimensionsAttributes", "ActiveBillingDimensionsBody", "ActiveBillingDimensionsResponse", @@ -2789,6 +2833,12 @@ "CreateDataDeletionRequestBodyData", "CreateDataDeletionRequestBodyDataType", "CreateDataDeletionResponseBody", + "CreateInboxRuleParameters", + "CreateInboxRuleParametersData", + "CreateInboxRuleParametersDataAttributes", + "CreateMuteRuleParameters", + "CreateMuteRuleParametersData", + "CreateMuteRuleParametersDataAttributes", "CreateOpenAPIResponse", "CreateOpenAPIResponseAttributes", "CreateOpenAPIResponseData", @@ -3170,6 +3220,10 @@ "IPAllowlistType", "IPAllowlistUpdateRequest", "IdPMetadataFormData", + "InboxRule", + "InboxRuleAttributes", + "InboxRuleResponse", + "InboxRulesType", "IncidentAttachmentAttachmentType", "IncidentAttachmentAttributes", "IncidentAttachmentData", @@ -3311,6 +3365,7 @@ "IntakePayloadAccepted", "InterfaceAttributes", "InterfaceAttributesStatus", + "IssueType", "JSONAPIErrorItem", "JSONAPIErrorItemSource", "JSONAPIErrorResponse", @@ -3575,6 +3630,11 @@ "MonthlyCostAttributionMeta", "MonthlyCostAttributionPagination", "MonthlyCostAttributionResponse", + "MuteReason", + "MuteRule", + "MuteRuleAttributes", + "MuteRuleResponse", + "MuteRulesType", "NullableRelationshipToUser", "NullableRelationshipToUserData", "NullableUserRelationship", @@ -3639,6 +3699,12 @@ "PartialApplicationKey", "PartialApplicationKeyAttributes", "PartialApplicationKeyResponse", + "PatchInboxRulesParameters", + "PatchInboxRulesParametersData", + "PatchInboxRulesParametersDataAttributes", + "PatchMuteRuleParameters", + "PatchMuteRuleParametersData", + "PatchMuteRuleParametersDataAttributes", "Permission", "PermissionAttributes", "PermissionsResponse", @@ -3773,6 +3839,10 @@ "RelationshipToUserTeamUserData", "RelationshipToUsers", "Remediation", + "ReorderInboxRulesParameters", + "ReorderInboxRulesParametersData", + "ReorderMuteRulesParameters", + "ReorderMuteRulesParametersData", "ReorderRetentionFiltersRequest", "ResponseMetaAttributes", "RestrictionPolicy", @@ -3818,9 +3888,13 @@ "RolesResponse", "RolesSort", "RolesType", + "Rule", "RuleAttributes", "RuleOutcomeRelationships", + "RuleSeverity", "RuleType", + "RuleTypesItems", + "RuleUser", "RumMetricCompute", "RumMetricComputeAggregationType", "RumMetricCreateAttributes", @@ -4244,6 +4318,10 @@ "UpdateAppResponseDataAttributes", "UpdateAppResponseDataType", "UpdateAppResponseRelationship", + "UpdateInboxRuleParameters", + "UpdateInboxRuleParametersData", + "UpdateMuteRuleParameters", + "UpdateMuteRuleParametersData", "UpdateOpenAPIResponse", "UpdateOpenAPIResponseAttributes", "UpdateOpenAPIResponseData", diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_bad_request_response.frozen new file mode 100644 index 0000000000..10159685ee --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:24.310Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_bad_request_response.yaml new file mode 100644 index 0000000000..d8e864a997 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_inbox_rule_returns_bad_request_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"]}}}}' + 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: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"\" expected one of \"inbox_rules\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_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..18e27819e0 --- /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-23T08:40:24.671Z \ 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..612dcf5260 --- /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":"9699508b-4736-416c-a8a7-1b7343eb9d42","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1737621625085,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621625085,"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/9699508b-4736-416c-a8a7-1b7343eb9d42 + 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_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_bad_request_response.frozen new file mode 100644 index 0000000000..ce25e95432 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-23T13:40:58.713Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_bad_request_response.yaml new file mode 100644 index 0000000000..a12b68f9e6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_new_mute_rule_returns_bad_request_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"]}}}}' + 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: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"\" expected one of \"mute_rules\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_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..3f78331241 --- /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-23T13:40:59.068Z \ 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..de1b329395 --- /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":"f5497c52-4c9b-4a2c-bf17-0a506827464e","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1737639659503,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639659503,"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/f5497c52-4c9b-4a2c-bf17-0a506827464e + 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..bf323f82b6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:02.850Z \ 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..adb4a014ae --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_mute_rule_returns_rule_successfully_deleted_response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:03.310Z \ 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..8c52fbc75b --- /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-1737639663","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":"ba7a16f1-4f80-417d-a868-6b5f14dd3328","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639663734,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639663734,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1737639663","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/ba7a16f1-4f80-417d-a868-6b5f14dd3328 + 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/ba7a16f1-4f80-417d-a868-6b5f14dd3328 + 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..c04a6bdec5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:36.673Z \ 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..83caacd996 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_inbox_rule_returns_rule_successfully_deleted_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:37.024Z \ 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..f0a2e6d16a --- /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-1737621637","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":"6d6379c8-16a2-42a0-9119-5a76c0d947fc","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621637438,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621637438,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1737621637","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/6d6379c8-16a2-42a0-9119-5a76c0d947fc + 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/6d6379c8-16a2-42a0-9119-5a76c0d947fc + 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_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_bad_request_response.frozen new file mode 100644 index 0000000000..69d2f61dc5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:21.694Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_bad_request_response.yaml new file mode 100644 index 0000000000..d83fe2b599 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_a_mute_rule_returns_bad_request_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/invalid-uuid + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"ruleId not + a valid UUID"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +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..cc80c8a24b --- /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-23T13:41:22.134Z \ 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..3bf44d38f8 --- /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-1737639682","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":"54f22733-b8d8-4b02-9b93-a9e608dfd489","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639682560,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639682560,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1737639682","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/54f22733-b8d8-4b02-9b93-a9e608dfd489 + response: + body: + string: '{"data":{"id":"54f22733-b8d8-4b02-9b93-a9e608dfd489","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639682560,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639682560,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1737639682","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/54f22733-b8d8-4b02-9b93-a9e608dfd489 + 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..fe145d2ba3 --- /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-23T13:41:23.432Z \ 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_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_bad_request_response.frozen new file mode 100644 index 0000000000..120578100b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:49.949Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_bad_request_response.yaml new file mode 100644 index 0000000000..c3e9a57a8a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_details_of_an_inbox_rule_returns_bad_request_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/invalid-uuid + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"ruleId not + a valid UUID"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +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..f28a13e3a9 --- /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-23T08:40:50.399Z \ 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..fddaf00cb4 --- /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-1737621650","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":"77f32ef7-0abb-40cd-a36e-51a19999c78a","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621650715,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621650715,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1737621650","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/77f32ef7-0abb-40cd-a36e-51a19999c78a + response: + body: + string: '{"data":{"id":"77f32ef7-0abb-40cd-a36e-51a19999c78a","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621650715,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621650715,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1737621650","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/77f32ef7-0abb-40cd-a36e-51a19999c78a + 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..21366f0187 --- /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-23T08:40:51.721Z \ 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..1403a61496 --- /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-23T08:40:52.068Z \ 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..555b9fd269 --- /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-1737621652","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":"82c9b4a9-d362-46fb-b143-aadc4b89a98d","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621652480,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621652480,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1737621652","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":"82c9b4a9-d362-46fb-b143-aadc4b89a98d","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621652480,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621652480,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1737621652","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/82c9b4a9-d362-46fb-b143-aadc4b89a98d + 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..617ca30f59 --- /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-23T13:41:27.633Z \ 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..1b107aacd3 --- /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-1737639687","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":"7b381b30-fc50-47fb-95a0-0fb56b1f9b58","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639688054,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639688054,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1737639687","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":"7b381b30-fc50-47fb-95a0-0fb56b1f9b58","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639688054,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639688054,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1737639687","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/7b381b30-fc50-47fb-95a0-0fb56b1f9b58 + 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..61240646a7 --- /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-23T13:41:33.878Z \ 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..ec70321574 --- /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-1737639693","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":"e1af2efd-e6c3-42a7-b0d5-b1250be228f5","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639694186,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639694186,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1737639693","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":"e1af2efd-e6c3-42a7-b0d5-b1250be228f5","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/e1af2efd-e6c3-42a7-b0d5-b1250be228f5 + response: + body: + string: '{"data":{"id":"e1af2efd-e6c3-42a7-b0d5-b1250be228f5","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1737639694186,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639694642,"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/e1af2efd-e6c3-42a7-b0d5-b1250be228f5 + 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..11a478123e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:35.168Z \ 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_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen new file mode 100644 index 0000000000..e7595f2f4a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:35.525Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml b/tests/v2/cassettes/test_scenarios/test_patch_a_mute_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml new file mode 100644 index 0000000000..094a308944 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_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-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1737639695","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":"887dda05-1701-4530-b21e-0608692270bb","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639695933,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639695933,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1737639695","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: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/887dda05-1701-4530-b21e-0608692270bb + 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/887dda05-1701-4530-b21e-0608692270bb + 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_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..cf45b6d83f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:03.189Z \ 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..291b911742 --- /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-1737621663","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":"b9b74321-b7e6-4b06-b0cf-c3670962467b","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621663602,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621663602,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_an_inbox_rule_returns_Bad_Request_response-1737621663","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":"b9b74321-b7e6-4b06-b0cf-c3670962467b","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/b9b74321-b7e6-4b06-b0cf-c3670962467b + 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/b9b74321-b7e6-4b06-b0cf-c3670962467b + 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..7c42250c79 --- /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-23T08:41:04.479Z \ 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..217aa5137f --- /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-1737621664","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":"1a524ec9-504d-4aa0-9c81-52a994cfe8c1","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621664886,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621664886,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1737621664","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":"1a524ec9-504d-4aa0-9c81-52a994cfe8c1","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/1a524ec9-504d-4aa0-9c81-52a994cfe8c1 + response: + body: + string: '{"data":{"id":"1a524ec9-504d-4aa0-9c81-52a994cfe8c1","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1737621664886,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621665366,"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/1a524ec9-504d-4aa0-9c81-52a994cfe8c1 + 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..ee50e94ff1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:05.792Z \ 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_patch_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen new file mode 100644 index 0000000000..f11dc3ee0e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:06.264Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml b/tests/v2/cassettes/test_scenarios/test_patch_an_inbox_rule_returns_the_server_cannot_process_the_request_because_it_contains_invalid_data_response.yaml new file mode 100644 index 0000000000..cd44d61667 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_patch_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-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1737621666","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":"1068be59-ede3-4937-a632-e99800fae69d","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621666672,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621666672,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1737621666","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: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/1068be59-ede3-4937-a632-e99800fae69d + 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/1068be59-ede3-4937-a632-e99800fae69d + 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_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..a27df8153f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:44.191Z \ 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..1e43362678 --- /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-1737639704","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":"d54c43cb-1ff0-4f60-a3cc-2794815252a8","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639704499,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639704499,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_a_mute_rule_returns_Bad_Request_response-1737639704","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":"d54c43cb-1ff0-4f60-a3cc-2794815252a8","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/d54c43cb-1ff0-4f60-a3cc-2794815252a8 + 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/d54c43cb-1ff0-4f60-a3cc-2794815252a8 + 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..83b8f33ec6 --- /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-23T13:41:45.445Z \ 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..ad6077ea4d --- /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-1737639705","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":"fa5829ab-aee5-458e-abc7-86b8f0a4687f","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639705754,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639705754,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1737639705","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":"fa5829ab-aee5-458e-abc7-86b8f0a4687f","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/fa5829ab-aee5-458e-abc7-86b8f0a4687f + response: + body: + string: '{"data":{"id":"fa5829ab-aee5-458e-abc7-86b8f0a4687f","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1737639705754,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639706208,"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/fa5829ab-aee5-458e-abc7-86b8f0a4687f + 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..76217e7065 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_mute_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:46.701Z \ 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..3e138c549d --- /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-23T13:41:47.047Z \ 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..fc293d7066 --- /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-1737639707","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":"0582999c-857d-4be3-8aeb-5f70920f04fe","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639707463,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639707463,"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-1737639707","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/0582999c-857d-4be3-8aeb-5f70920f04fe + 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/0582999c-857d-4be3-8aeb-5f70920f04fe + 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..3229314250 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:21.299Z \ 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..575d20b093 --- /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-1737621681","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":"ebe5f9b6-a0fe-4422-9909-2116aa9cb057","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621681706,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621681706,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_an_inbox_rule_returns_Bad_Request_response-1737621681","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":"ebe5f9b6-a0fe-4422-9909-2116aa9cb057","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/ebe5f9b6-a0fe-4422-9909-2116aa9cb057 + 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/ebe5f9b6-a0fe-4422-9909-2116aa9cb057 + 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..564f112807 --- /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-23T08:41:22.606Z \ 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..902d43eaf8 --- /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-1737621682","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":"1cc830c9-b1ea-4a80-bc54-db42bb0ac198","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621683029,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621683029,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1737621682","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":"1cc830c9-b1ea-4a80-bc54-db42bb0ac198","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/1cc830c9-b1ea-4a80-bc54-db42bb0ac198 + response: + body: + string: '{"data":{"id":"1cc830c9-b1ea-4a80-bc54-db42bb0ac198","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1737621683029,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621683396,"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/1cc830c9-b1ea-4a80-bc54-db42bb0ac198 + 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..9f7cf1e216 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_inbox_rule_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:23.940Z \ 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..09f4343019 --- /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-23T08:41:24.430Z \ 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..c3f3f05e6e --- /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_-1737621684","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":"a7b01380-2a2f-4664-8ac4-912d14791749","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621684732,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621684732,"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_-1737621684","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/a7b01380-2a2f-4664-8ac4-912d14791749 + 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/a7b01380-2a2f-4664-8ac4-912d14791749 + 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 e5c2cbcc48..fcafe2e1ff 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -547,6 +547,30 @@ "tag": "Service Scorecards", "operationId": "CreateScorecardRule" }, + { + "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 5a2330a8f3..58bb35e15d 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 + @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"]}}}} + 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 + + @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"]}}}} + 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/k9-cloud-security-platform Scenario: Create a security filter returns "Bad Request" response Given new "CreateSecurityFilter" request @@ -296,6 +324,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 @@ -328,7 +371,7 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a suppression rule returns "Not Found" response Given new "DeleteSecurityMonitoringSuppression" request - And request contains "suppression_id" parameter with value "does-not-exist" + And request contains "suppression_id" parameter with value "00000000-0000-0000-0000-426655000000" When the request is sent Then the response status is 404 Not Found @@ -387,6 +430,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 @@ -599,6 +657,64 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Bad Request" response + Given new "GetMuteRule" request + And request contains "mute_rule_id" parameter with value "invalid-uuid" + 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 + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Bad Request" response + Given new "GetInboxRule" request + And request contains "inbox_rule_id" parameter with value "invalid-uuid" + 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 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 @@ -773,6 +889,104 @@ 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 + + @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 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 + + @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 @@ -854,6 +1068,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 @@ -954,6 +1203,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 a195ddc9e5..76ae165eb6 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2073,6 +2073,104 @@ "type": "safe" } }, + "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": {