Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97632,7 +97632,7 @@ components:
- version
type: object
NotificationRulePreviewNotificationStatus:
description: The notification status for the given rule type. `SUCCESS` means a matching event was found and the notification was sent successfully. `DEFAULT` means no matching event was found and a default placeholder notification was sent instead. `ERROR` means an error occurred while sending the notification.
description: The notification status for the given rule type. `SUCCESS` means a matching event was found and the test notification was queued. `DEFAULT` means no matching event was found and a placeholder test notification was queued instead. `ERROR` means the test notification couldn't be built or queued. A queued notification can still fail to reach its target later, and this status doesn't report it.
enum:
- SUCCESS
- DEFAULT
Expand Down Expand Up @@ -262640,7 +262640,36 @@ paths:
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/security_monitoring/configuration/notification_rules/send_notification_preview:
post:
description: Send a notification preview to test that a notification rule's targets are properly configured.
description: |-
Send a notification preview to test that a notification rule's targets are properly configured.
The request body has the same shape as the body of `CreateSignalNotificationRule` and `CreateVulnerabilityNotificationRule`.
The preview sends test notifications to the targets but doesn't save a notification rule. To save the rule, use
`CreateSignalNotificationRule` or `CreateVulnerabilityNotificationRule`.

Fields to set in `data.attributes`:
- `selectors.trigger_source`: `security_signals` for a signal-based rule, or `security_findings` for a rule on security findings and vulnerabilities.
- `selectors.rule_types`: with `security_signals`, any of `application_security`, `log_detection`, `workload_security`
and `signal_correlation`. With `security_findings`, any of
`application_code_vulnerability`, `application_library_vulnerability`, `attack_path`, `container_image_vulnerability`,
`identity_risk`, `misconfiguration`, `api_security`, `host_vulnerability`, `iac_misconfiguration`, `sast_vulnerability`,
`secret_vulnerability`, `workload_activity`, `sensitive_data` and `serverless_function_code_vulnerability`.
Set at least one rule type. An empty list, or a rule type that doesn't match `selectors.trigger_source`, is rejected with HTTP 400.
The preview runs once for each rule type in this list.
- `selectors.severities`: any of `critical`, `high`, `medium`, `low` and `info`. The value `unknown` is rejected with HTTP 400.
- `selectors.query`: one or several `key:value` pairs on tags and attributes, for example `env:prod`, up to 6,000 characters.
- `targets`: a list of 1 to 20 notification handles, each starting with `@` and up to 500 characters. Use `@<EMAIL>` for an email address,
`@slack-<CHANNEL>` or `@slack-<ACCOUNT>-<CHANNEL>` for a Slack channel, `@pagerduty-<SERVICE_NAME>` for a PagerDuty service,
and `@webhook-<WEBHOOK_NAME>` for a webhook. Other integrations use `@<INTEGRATION_NAME>-<VALUES>`, such as `@teams-` or `@jira-`.
Handles that contain parentheses `()` are not supported. In HIPAA-compliant organizations, webhook targets are rejected with a 403.
With `security_findings`, `@case-`, `@incident-`, `@jira-` and `@linear-` targets are rejected with HTTP 400.
- `time_aggregation`: with `security_signals`, leave it out or set it to `0`. With `security_findings`, leave it out, set it to `0`,
or set it between 1,800 and 2,592,000 seconds (30 minutes to 30 days). `@workflow-` targets are rejected when it's greater than `0`.

The integration behind each target (Slack, PagerDuty, and so on) must already be configured in Datadog.
The response has one result per rule type. `SUCCESS` means a matching event was found and the test notification was queued.
`DEFAULT` means no matching event was found and a placeholder test notification was queued instead.
`ERROR` means the test notification couldn't be built or queued. A queued notification can still fail to reach its target later,
for example when the target's integration isn't configured or a target team doesn't exist, and the response doesn't report it.
operationId: SendSecurityMonitoringNotificationPreview
requestBody:
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31292,6 +31292,50 @@ public NotificationRulePreviewResponse sendSecurityMonitoringNotificationPreview

/**
* Send a notification preview to test that a notification rule's targets are properly configured.
* The request body has the same shape as the body of <code>CreateSignalNotificationRule</code>
* and <code>CreateVulnerabilityNotificationRule</code>. The preview sends test notifications to
* the targets but doesn't save a notification rule. To save the rule, use <code>
* CreateSignalNotificationRule</code> or <code>CreateVulnerabilityNotificationRule</code>.
*
* <p>Fields to set in <code>data.attributes</code>: - <code>selectors.trigger_source</code>:
* <code>security_signals</code> for a signal-based rule, or <code>security_findings</code> for a
* rule on security findings and vulnerabilities. - <code>selectors.rule_types</code>: with <code>
* security_signals</code>, any of <code>application_security</code>, <code>log_detection</code>,
* <code>workload_security</code> and <code>signal_correlation</code>. With <code>
* security_findings</code>, any of <code>application_code_vulnerability</code>, <code>
* application_library_vulnerability</code>, <code>attack_path</code>, <code>
* container_image_vulnerability</code>, <code>identity_risk</code>, <code>misconfiguration</code>
* , <code>api_security</code>, <code>host_vulnerability</code>, <code>iac_misconfiguration</code>
* , <code>sast_vulnerability</code>, <code>secret_vulnerability</code>, <code>workload_activity
* </code>, <code>sensitive_data</code> and <code>serverless_function_code_vulnerability</code>.
* Set at least one rule type. An empty list, or a rule type that doesn't match <code>
* selectors.trigger_source</code>, is rejected with HTTP 400. The preview runs once for each rule
* type in this list. - <code>selectors.severities</code>: any of <code>critical</code>, <code>
* high</code>, <code>medium</code>, <code>low</code> and <code>info</code>. The value <code>
* unknown</code> is rejected with HTTP 400. - <code>selectors.query</code>: one or several <code>
* key:value</code> pairs on tags and attributes, for example <code>env:prod</code>, up to 6,000
* characters. - <code>targets</code>: a list of 1 to 20 notification handles, each starting with
* <code>@</code> and up to 500 characters. Use <code>@&lt;EMAIL&gt;</code> for an email address,
* <code>@slack-&lt;CHANNEL&gt;</code> or <code>@slack-&lt;ACCOUNT&gt;-&lt;CHANNEL&gt;</code> for
* a Slack channel, <code>@pagerduty-&lt;SERVICE_NAME&gt;</code> for a PagerDuty service, and
* <code>@webhook-&lt;WEBHOOK_NAME&gt;</code> for a webhook. Other integrations use <code>
* @&lt;INTEGRATION_NAME&gt;-&lt;VALUES&gt;</code>, such as <code>@teams-</code> or <code>@jira-
* </code>. Handles that contain parentheses <code>()</code> are not supported. In HIPAA-compliant
* organizations, webhook targets are rejected with a 403. With <code>security_findings</code>,
* <code>@case-</code>, <code>@incident-</code>, <code>@jira-</code> and <code>@linear-</code>
* targets are rejected with HTTP 400. - <code>time_aggregation</code>: with <code>
* security_signals</code>, leave it out or set it to <code>0</code>. With <code>security_findings
* </code>, leave it out, set it to <code>0</code>, or set it between 1,800 and 2,592,000 seconds
* (30 minutes to 30 days). <code>@workflow-</code> targets are rejected when it's greater than
* <code>0</code>.
*
* <p>The integration behind each target (Slack, PagerDuty, and so on) must already be configured
* in Datadog. The response has one result per rule type. <code>SUCCESS</code> means a matching
* event was found and the test notification was queued. <code>DEFAULT</code> means no matching
* event was found and a placeholder test notification was queued instead. <code>ERROR</code>
* means the test notification couldn't be built or queued. A queued notification can still fail
* to reach its target later, for example when the target's integration isn't configured or a
* target team doesn't exist, and the response doesn't report it.
*
* @param body (required)
* @return ApiResponse&lt;NotificationRulePreviewResponse&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@

/**
* The notification status for the given rule type. <code>SUCCESS</code> means a matching event was
* found and the notification was sent successfully. <code>DEFAULT</code> means no matching event
* was found and a default placeholder notification was sent instead. <code>ERROR</code> means an
* error occurred while sending the notification.
* found and the test notification was queued. <code>DEFAULT</code> means no matching event was
* found and a placeholder test notification was queued instead. <code>ERROR</code> means the test
* notification couldn't be built or queued. A queued notification can still fail to reach its
* target later, and this status doesn't report it.
*/
@JsonSerialize(
using =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ public NotificationRulePreviewResult notificationStatus(

/**
* The notification status for the given rule type. <code>SUCCESS</code> means a matching event
* was found and the notification was sent successfully. <code>DEFAULT</code> means no matching
* event was found and a default placeholder notification was sent instead. <code>ERROR</code>
* means an error occurred while sending the notification.
* was found and the test notification was queued. <code>DEFAULT</code> means no matching event
* was found and a placeholder test notification was queued instead. <code>ERROR</code> means the
* test notification couldn't be built or queued. A queued notification can still fail to reach
* its target later, and this status doesn't report it.
*
* @return notificationStatus
*/
Expand Down
Loading