diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3338e02c29d..2f16a529c9d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -97700,7 +97700,10 @@ components: $ref: "#/components/schemas/NotificationRulePreviewResult" type: array NotificationRuleQuery: - description: The query is composed of one or several key:value pairs, which can be used to filter security issues on tags and attributes. + description: |- + The query is composed of one or several key:value pairs, which can be used to filter security issues on tags and attributes. + It is at most 6,000 characters. Finding-based rules can't filter on attributes in the `@workflow` or `@_dd` + namespaces, on `@status`, or on `@compliance.evaluation`. example: (source:production_service OR env:prod) type: string NotificationRuleResponse: @@ -122959,7 +122962,8 @@ components: minimum: 1 type: integer RuleName: - description: Name of the notification rule. + description: |- + Name of the notification rule. At most 500 characters, and unique in the organization (case-insensitive). example: Rule 1 type: string RuleOutcomeRelationships: @@ -122996,7 +123000,15 @@ components: x-enum-varnames: - RULE RuleTypes: - description: Security rule types used as filters in security rules. + description: |- + Security rule types used as filters in security rules. + Signal-based notification rules accept `application_security`, `log_detection`, `workload_security`, and + `signal_correlation`. + Finding-based notification rules accept `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`. + Rule types that don't match the rule's `trigger_source` are rejected. example: [misconfiguration, attack_path] items: $ref: "#/components/schemas/RuleTypesItems" @@ -123005,8 +123017,8 @@ components: description: |- Security rule type which can be used in security rules. Signal-based notification rules can filter signals based on rule types application_security, log_detection, - workload_security, signal_correlation, cloud_configuration and infrastructure_configuration. - Vulnerability-based notification rules can filter vulnerabilities based on rule types application_code_vulnerability, + workload_security and signal_correlation. + Finding-based notification rules can filter findings based on rule types 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. @@ -137777,7 +137789,9 @@ components: rule_types: $ref: "#/components/schemas/RuleTypes" severities: - description: The security rules severities to consider. + description: |- + The security rules severities to consider. + Allowed values are `critical`, `high`, `medium`, `low`, and `info`; `unknown` is rejected. items: $ref: "#/components/schemas/RuleSeverity" type: array @@ -151565,6 +151579,14 @@ components: List of recipients to notify when a notification rule is triggered. Many different target types are supported, such as email addresses, Slack channels, and PagerDuty services. The appropriate integrations need to be properly configured to send notifications to the specified targets. + Each target is a handle that starts with `@`. Use `@` for an email address + (for example, `@john.doe@email.com`), and `@-` for an integration, such as + `@slack-`, `@pagerduty-`, `@jira-`, `@teams-`, `@servicenow-`, + or `@webhook-`. + Handles that include parentheses are not supported. + A rule can have at most 20 targets, each at most 500 characters long. Finding-based rules don't accept + `case`, `incident`, `jira`, or `linear` targets; use an automatic ticket creation rule for cases, + Jira, and Linear. example: ["@john.doe@email.com"] items: description: Recipients to notify. @@ -155942,8 +155964,8 @@ components: Time aggregation period (in seconds) is used to aggregate the results of the notification rule evaluation. Results are aggregated over a selected time frame using a rolling window, which updates with each new evaluation. Notifications are only sent for new issues discovered during the window. - Time aggregation is only available for vulnerability-based notification rules. When omitted or set to 0, no aggregation - is done. + Time aggregation is only available for finding-based notification rules. When omitted or set to 0, no aggregation + is done. Otherwise, it must be between 1800 (30 minutes) and 2592000 (30 days). example: 86400 format: int64 type: integer @@ -157133,7 +157155,7 @@ components: TriggerSource: description: |- The type of security issues on which the rule applies. Notification rules based on security signals need to use the trigger source "security_signals", - while notification rules based on security vulnerabilities need to use the trigger source "security_findings". + while notification rules based on security findings need to use the trigger source "security_findings". enum: - security_findings - security_signals @@ -161624,7 +161646,10 @@ components: - value type: object Version: - description: Version of the notification rule. It is updated when the rule is modified. + description: |- + Version of the notification rule. It is updated when the rule is modified. + When patching a rule, send the current `version` returned by the get or list operation; an older + `version` returns 409. example: 1 format: int64 type: integer @@ -259166,7 +259191,15 @@ paths: Please check the documentation regularly for updates. /api/v2/security/signals/notification_rules: get: - description: Returns the list of notification rules for security signals. + description: |- + Returns the list of notification rules for security signals. + A signal-based notification rule sends a notification to its `targets` when a security signal matches its + selectors (rule types, severities, and query), so you don't have to set up notifications on each detection rule. + Use the signal routes for rules whose `trigger_source` is `security_signals`. For rules on security findings, + such as vulnerabilities and misconfigurations (`trigger_source` `security_findings`), use + `GetVulnerabilityNotificationRules`. + This route only returns rules whose `trigger_source` is `security_signals`. The response isn't paginated: it + contains every such rule in the organization, and the route takes no paging parameters. operationId: GetSignalNotificationRules responses: "200": @@ -259187,7 +259220,22 @@ paths: permissions: - security_monitoring_notification_profiles_read post: - description: Create a new notification rule for security signals and return the created rule. + description: |- + Create a new notification rule for security signals and return the created rule. + Set `selectors.trigger_source` to `security_signals`. The signal routes only return rules with that trigger + source, so a rule with `security_findings` is read through `GetVulnerabilityNotificationRules` instead. + To notify on security findings, use `CreateVulnerabilityNotificationRule`. + `selectors.rule_types` accepts the signal rule types `application_security`, `log_detection`, + `workload_security`, and `signal_correlation`. + Give at least one; finding rule types are rejected. + `selectors.severities` accepts `critical`, `high`, `medium`, `low`, and `info`; `unknown` is rejected. + `selectors.query` is at most 6,000 characters. + Each entry in `targets` is a handle that starts with `@`, such as an email address + (`@john.doe@email.com`) or an integration handle (`@slack-`); see `targets`. + `time_aggregation` is only available for finding-based rules: omit it or set it to `0`. + Trial organizations can't use email address targets: the request returns 400. + Rule names must be unique in the organization (case-insensitive); a duplicate name returns 409. + An organization can have at most 1,000 signal-based rules; past that, the request returns 429. operationId: CreateSignalNotificationRule requestBody: content: @@ -259271,10 +259319,15 @@ paths: - security_monitoring_notification_profiles_write /api/v2/security/signals/notification_rules/{id}: delete: - description: Delete a notification rule for security signals. + description: |- + Delete a notification rule for security signals. + Get the rule `id` from `GetSignalNotificationRules`. + This route doesn't check the rule's `trigger_source`, so make sure the `id` belongs to a signal rule. + To stop notifications without deleting the rule, set `enabled` to `false` with + `PatchSignalNotificationRule` instead. operationId: DeleteSignalNotificationRule parameters: - - description: ID of the notification rule. + - description: ID of the notification rule, as returned in `data[].id` by `GetSignalNotificationRules`. in: path name: id required: true @@ -259301,10 +259354,14 @@ paths: permissions: - security_monitoring_notification_profiles_write get: - description: Get the details of a notification rule for security signals. + description: |- + Get the details of a notification rule for security signals. + Get the rule `id` from `GetSignalNotificationRules`. + Returns 404 when the rule's `trigger_source` is `security_findings`; read that rule with + `GetVulnerabilityNotificationRule` instead. operationId: GetSignalNotificationRule parameters: - - description: ID of the notification rule. + - description: ID of the notification rule, as returned in `data[].id` by `GetSignalNotificationRules`. in: path name: id required: true @@ -259364,10 +259421,32 @@ paths: permissions: - security_monitoring_notification_profiles_read patch: - description: "Partially update the notification rule. All fields are optional; if a field is not provided, it is not updated." + description: |- + Partially update the notification rule. All fields except `version` are optional; if a field is not provided, + it is not updated. Give at least one field to change. + Get the rule `id` from `GetSignalNotificationRules`, then read the rule with `GetSignalNotificationRule` + and send its current `version`. The `version` is incremented each time the rule is modified. + A `version` that isn't the current one returns 409: fetch the rule again and retry. + A missing or `0` `version` is rejected. + If you send `selectors`, it must include `trigger_source`, and every entry in `selectors.rule_types` must + match that trigger source (give at least one). For `security_findings`, the rule types are + `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`. + For `security_signals`, they are `application_security`, `log_detection`, `workload_security`, and + `signal_correlation`. + Changing `trigger_source` moves the rule to the other family's routes, and the change counts toward that + family's limit of 1,000 rules. + `selectors.severities` accepts `critical`, `high`, `medium`, `low`, and `info`; `unknown` is rejected. + `selectors.query` is at most 6,000 characters. Finding-based rules can't filter on attributes in the + `@workflow` or `@_dd` namespaces, on `@status`, or on `@compliance.evaluation`. + Each entry in `targets` is a handle that starts with `@`, such as an email address + (`@john.doe@email.com`) or an integration handle (`@slack-`); see `targets`. + Trial organizations can't use email address targets: the request returns 400. operationId: PatchSignalNotificationRule parameters: - - description: ID of the notification rule. + - description: ID of the notification rule, as returned in `data[].id` by `GetSignalNotificationRules`. in: path name: id required: true @@ -260110,7 +260189,16 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security/vulnerabilities/notification_rules: get: - description: Returns the list of notification rules for security vulnerabilities. + description: |- + Returns the list of notification rules for security findings. + A finding-based notification rule sends a notification to its `targets` when a security finding, such as a + vulnerability or a misconfiguration, matches its selectors (rule types, severities, and query). It can group + notifications over a `time_aggregation` window. + Use the finding routes (under `/api/v2/security/vulnerabilities/`) for rules whose `trigger_source` is + `security_findings`. For rules on security + signals (`trigger_source` `security_signals`), use `GetSignalNotificationRules`. + This route only returns rules whose `trigger_source` is `security_findings`. The response isn't paginated: it + contains every such rule in the organization, and the route takes no paging parameters. operationId: GetVulnerabilityNotificationRules responses: "200": @@ -260131,7 +260219,26 @@ paths: permissions: - security_monitoring_notification_profiles_read post: - description: Create a new notification rule for security vulnerabilities and return the created rule. + description: |- + Create a new notification rule for security findings and return the created rule. + Set `selectors.trigger_source` to `security_findings`. The finding routes only return rules with that + trigger source, so a rule with `security_signals` is read through `GetSignalNotificationRules` instead. + To notify on security signals, use `CreateSignalNotificationRule`. + `selectors.rule_types` accepts the finding rule types `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`. + Give at least one; signal rule types are rejected. + `selectors.severities` accepts `critical`, `high`, `medium`, `low`, and `info`; `unknown` is rejected. + `selectors.query` is at most 6,000 characters, and can't filter on attributes in the `@workflow` or `@_dd` + namespaces, on `@status`, or on `@compliance.evaluation`. + Each entry in `targets` is a handle that starts with `@`, such as an email address + (`@john.doe@email.com`) or an integration handle (`@slack-`); see `targets`. + `time_aggregation` is a rolling window in seconds, from `1800` (30 minutes) to `2592000` (30 days); omit it + or set it to `0` for no aggregation. + Trial organizations can't use email address targets: the request returns 400. + Rule names must be unique in the organization (case-insensitive); a duplicate name returns 409. + An organization can have at most 1,000 finding-based rules; past that, the request returns 429. operationId: CreateVulnerabilityNotificationRule requestBody: content: @@ -260216,10 +260323,15 @@ paths: - security_monitoring_notification_profiles_write /api/v2/security/vulnerabilities/notification_rules/{id}: delete: - description: Delete a notification rule for security vulnerabilities. + description: |- + Delete a notification rule for security findings. + Get the rule `id` from `GetVulnerabilityNotificationRules`. + This route doesn't check the rule's `trigger_source`, so make sure the `id` belongs to a finding rule. + To stop notifications without deleting the rule, set `enabled` to `false` with + `PatchVulnerabilityNotificationRule` instead. operationId: DeleteVulnerabilityNotificationRule parameters: - - description: ID of the notification rule. + - description: ID of the notification rule, as returned in `data[].id` by `GetVulnerabilityNotificationRules`. in: path name: id required: true @@ -260246,10 +260358,14 @@ paths: permissions: - security_monitoring_notification_profiles_write get: - description: Get the details of a notification rule for security vulnerabilities. + description: |- + Get the details of a notification rule for security findings. + Get the rule `id` from `GetVulnerabilityNotificationRules`. + Returns 404 when the rule's `trigger_source` is `security_signals`; read that rule with + `GetSignalNotificationRule` instead. operationId: GetVulnerabilityNotificationRule parameters: - - description: ID of the notification rule. + - description: ID of the notification rule, as returned in `data[].id` by `GetVulnerabilityNotificationRules`. in: path name: id required: true @@ -260310,10 +260426,32 @@ paths: permissions: - security_monitoring_notification_profiles_read patch: - description: "Partially update the notification rule. All fields are optional; if a field is not provided, it is not updated." + description: |- + Partially update the notification rule. All fields except `version` are optional; if a field is not provided, + it is not updated. Give at least one field to change. + Get the rule `id` from `GetVulnerabilityNotificationRules`, then read the rule with + `GetVulnerabilityNotificationRule` and send its current `version`. The `version` is incremented each time + the rule is modified. A `version` that isn't the current one returns 409: fetch the rule again and retry. + A missing or `0` `version` is rejected. + If you send `selectors`, it must include `trigger_source`, and every entry in `selectors.rule_types` must + match that trigger source (give at least one). For `security_findings`, the rule types are + `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`. + For `security_signals`, they are `application_security`, `log_detection`, `workload_security`, and + `signal_correlation`. + Changing `trigger_source` moves the rule to the other family's routes, and the change counts toward that + family's limit of 1,000 rules. + `selectors.severities` accepts `critical`, `high`, `medium`, `low`, and `info`; `unknown` is rejected. + `selectors.query` is at most 6,000 characters. Finding-based rules can't filter on attributes in the + `@workflow` or `@_dd` namespaces, on `@status`, or on `@compliance.evaluation`. + Each entry in `targets` is a handle that starts with `@`, such as an email address + (`@john.doe@email.com`) or an integration handle (`@slack-`); see `targets`. + Trial organizations can't use email address targets: the request returns 400. operationId: PatchVulnerabilityNotificationRule parameters: - - description: ID of the notification rule. + - description: ID of the notification rule, as returned in `data[].id` by `GetVulnerabilityNotificationRules`. in: path name: id required: true diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index 59ea99e9a66..eb2c7de5e3d 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -6630,7 +6630,23 @@ public CompletableFuture createSignalNotificationRuleA } /** - * Create a new notification rule for security signals and return the created rule. + * Create a new notification rule for security signals and return the created rule. Set + * selectors.trigger_source to security_signals. The signal routes only return + * rules with that trigger source, so a rule with security_findings is read through + * GetVulnerabilityNotificationRules instead. To notify on security findings, use + * CreateVulnerabilityNotificationRule. selectors.rule_types accepts the + * signal rule types application_security, log_detection, + * workload_security, and signal_correlation. Give at least one; finding rule + * types are rejected. selectors.severities accepts critical, high + * , medium, low, and info; unknown is + * rejected. selectors.query is at most 6,000 characters. Each entry in targets + * is a handle that starts with @, such as an email address ( + * @john.doe@email.com) or an integration handle (@slack-<VALUES>); see + * targets. time_aggregation is only available for finding-based rules: + * omit it or set it to 0. Trial organizations can't use email address targets: the + * request returns 400. Rule names must be unique in the organization (case-insensitive); a + * duplicate name returns 409. An organization can have at most 1,000 signal-based rules; past + * that, the request returns 429. * * @param body The body of the create notification rule request is composed of the rule type and * the rule attributes: the rule name, the selectors, the notification targets, and the rule @@ -7073,7 +7089,30 @@ public CompletableFuture createVulnerabilityNotificati } /** - * Create a new notification rule for security vulnerabilities and return the created rule. + * Create a new notification rule for security findings and return the created rule. Set + * selectors.trigger_source to security_findings. The finding routes only + * return rules with that trigger source, so a rule with security_signals is read + * through GetSignalNotificationRules instead. To notify on security signals, use + * CreateSignalNotificationRule. selectors.rule_types accepts the + * finding rule types 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. + * Give at least one; signal rule types are rejected. selectors.severities accepts + * critical, high, medium, low, and info + * ; unknown is rejected. selectors.query is at most 6,000 + * characters, and can't filter on attributes in the @workflow or @_dd + * namespaces, on @status, or on @compliance.evaluation. Each entry in + * targets is a handle that starts with @, such as an email address ( + * @john.doe@email.com) or an integration handle (@slack-<VALUES> + * ); see targets. time_aggregation is a rolling window in seconds, from + * 1800 (30 minutes) to 2592000 (30 days); omit it or set it to 0 + * for no aggregation. Trial organizations can't use email address targets: the request + * returns 400. Rule names must be unique in the organization (case-insensitive); a duplicate name + * returns 409. An organization can have at most 1,000 finding-based rules; past that, the request + * returns 429. * * @param body The body of the create notification rule request is composed of the rule type and * the rule attributes: the rule name, the selectors, the notification targets, and the rule @@ -10012,7 +10051,8 @@ public CompletableFuture> deleteSecurityMonitoringSuppressionW * *

See {@link #deleteSignalNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @throws ApiException if fails to make API call */ public void deleteSignalNotificationRule(String id) throws ApiException { @@ -10024,7 +10064,8 @@ public void deleteSignalNotificationRule(String id) throws ApiException { * *

See {@link #deleteSignalNotificationRuleWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @return CompletableFuture */ public CompletableFuture deleteSignalNotificationRuleAsync(String id) { @@ -10036,9 +10077,14 @@ public CompletableFuture deleteSignalNotificationRuleAsync(String id) { } /** - * Delete a notification rule for security signals. + * Delete a notification rule for security signals. Get the rule id from + * GetSignalNotificationRules. This route doesn't check the rule's trigger_source + * , so make sure the id belongs to a signal rule. To stop notifications + * without deleting the rule, set enabled to false with + * PatchSignalNotificationRule instead. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -10091,7 +10137,8 @@ public ApiResponse deleteSignalNotificationRuleWithHttpInfo(String id) thr * *

See {@link #deleteSignalNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @return CompletableFuture<ApiResponse<Void>> */ public CompletableFuture> deleteSignalNotificationRuleWithHttpInfoAsync( @@ -10146,7 +10193,8 @@ public CompletableFuture> deleteSignalNotificationRuleWithHttp * *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @throws ApiException if fails to make API call */ public void deleteVulnerabilityNotificationRule(String id) throws ApiException { @@ -10158,7 +10206,8 @@ public void deleteVulnerabilityNotificationRule(String id) throws ApiException { * *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @return CompletableFuture */ public CompletableFuture deleteVulnerabilityNotificationRuleAsync(String id) { @@ -10170,9 +10219,14 @@ public CompletableFuture deleteVulnerabilityNotificationRuleAsync(String i } /** - * Delete a notification rule for security vulnerabilities. + * Delete a notification rule for security findings. Get the rule id from + * GetVulnerabilityNotificationRules. This route doesn't check the rule's + * trigger_source, so make sure the id belongs to a finding rule. To stop + * notifications without deleting the rule, set enabled to false with + * PatchVulnerabilityNotificationRule instead. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -10227,7 +10281,8 @@ public ApiResponse deleteVulnerabilityNotificationRuleWithHttpInfo(String * *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @return CompletableFuture<ApiResponse<Void>> */ public CompletableFuture> deleteVulnerabilityNotificationRuleWithHttpInfoAsync( @@ -18051,7 +18106,8 @@ public CompletableFuture> getSignalEntitiesW * *

See {@link #getSignalNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @return NotificationRuleResponse * @throws ApiException if fails to make API call */ @@ -18064,7 +18120,8 @@ public NotificationRuleResponse getSignalNotificationRule(String id) throws ApiE * *

See {@link #getSignalNotificationRuleWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @return CompletableFuture<NotificationRuleResponse> */ public CompletableFuture getSignalNotificationRuleAsync(String id) { @@ -18076,9 +18133,13 @@ public CompletableFuture getSignalNotificationRuleAsyn } /** - * Get the details of a notification rule for security signals. + * Get the details of a notification rule for security signals. Get the rule id from + * GetSignalNotificationRules. Returns 404 when the rule's trigger_source + * is security_findings; read that rule with + * GetVulnerabilityNotificationRule instead. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @return ApiResponse<NotificationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -18133,7 +18194,8 @@ public ApiResponse getSignalNotificationRuleWithHttpIn * *

See {@link #getSignalNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ public CompletableFuture> @@ -18210,7 +18272,15 @@ public CompletableFuture getSignalNotificationRul } /** - * Returns the list of notification rules for security signals. + * Returns the list of notification rules for security signals. A signal-based notification rule + * sends a notification to its targets when a security signal matches its selectors + * (rule types, severities, and query), so you don't have to set up notifications on each + * detection rule. Use the signal routes for rules whose trigger_source is + * security_signals. For rules on security findings, such as vulnerabilities and + * misconfigurations (trigger_source security_findings), use + * GetVulnerabilityNotificationRules. This route only returns rules whose + * trigger_source is security_signals. The response isn't paginated: it + * contains every such rule in the organization, and the route takes no paging parameters. * * @return ApiResponse<NotificationRulesListResponse> * @throws ApiException if fails to make API call @@ -19943,7 +20013,8 @@ public ApiResponse getSuppressionVersionHi * *

See {@link #getVulnerabilityNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @return NotificationRuleResponse * @throws ApiException if fails to make API call */ @@ -19956,7 +20027,8 @@ public NotificationRuleResponse getVulnerabilityNotificationRule(String id) thro * *

See {@link #getVulnerabilityNotificationRuleWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @return CompletableFuture<NotificationRuleResponse> */ public CompletableFuture getVulnerabilityNotificationRuleAsync( @@ -19969,9 +20041,13 @@ public CompletableFuture getVulnerabilityNotificationR } /** - * Get the details of a notification rule for security vulnerabilities. + * Get the details of a notification rule for security findings. Get the rule id from + * GetVulnerabilityNotificationRules. Returns 404 when the rule's + * trigger_source is security_signals; read that rule with + * GetSignalNotificationRule instead. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @return ApiResponse<NotificationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -20026,7 +20102,8 @@ public ApiResponse getVulnerabilityNotificationRuleWit * *

See {@link #getVulnerabilityNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ public CompletableFuture> @@ -20104,7 +20181,16 @@ public CompletableFuture getVulnerabilityNotifica } /** - * Returns the list of notification rules for security vulnerabilities. + * Returns the list of notification rules for security findings. A finding-based notification rule + * sends a notification to its targets when a security finding, such as a + * vulnerability or a misconfiguration, matches its selectors (rule types, severities, and query). + * It can group notifications over a time_aggregation window. Use the finding routes + * (under /api/v2/security/vulnerabilities/) for rules whose trigger_source + * is security_findings. For rules on security signals (trigger_source + * security_signals), use GetSignalNotificationRules. This route + * only returns rules whose trigger_source is security_findings. The + * response isn't paginated: it contains every such rule in the organization, and the route takes + * no paging parameters. * * @return ApiResponse<NotificationRulesListResponse> * @throws ApiException if fails to make API call @@ -28244,7 +28330,8 @@ public CompletableFuture> muteSecurityFindings * *

See {@link #patchSignalNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @param body (required) * @return NotificationRuleResponse * @throws ApiException if fails to make API call @@ -28259,7 +28346,8 @@ public NotificationRuleResponse patchSignalNotificationRule( * *

See {@link #patchSignalNotificationRuleWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @param body (required) * @return CompletableFuture<NotificationRuleResponse> */ @@ -28273,10 +28361,35 @@ public CompletableFuture patchSignalNotificationRuleAs } /** - * Partially update the notification rule. All fields are optional; if a field is not provided, it - * is not updated. - * - * @param id ID of the notification rule. (required) + * Partially update the notification rule. All fields except version are optional; if + * a field is not provided, it is not updated. Give at least one field to change. Get the rule + * id from GetSignalNotificationRules, then read the rule with + * GetSignalNotificationRule and send its current version. The version + * is incremented each time the rule is modified. A version that isn't the + * current one returns 409: fetch the rule again and retry. A missing or 0 + * version is rejected. If you send selectors, it must include + * trigger_source, and every entry in selectors.rule_types must match that + * trigger source (give at least one). For security_findings, the rule types are + * 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. For security_signals, they + * are application_security, log_detection, workload_security + * , and signal_correlation. Changing trigger_source moves the + * rule to the other family's routes, and the change counts toward that family's limit of 1,000 + * rules. selectors.severities accepts critical, high, + * medium, low, and info; unknown is rejected. + * selectors.query is at most 6,000 characters. Finding-based rules can't filter on + * attributes in the @workflow or @_dd namespaces, on @status + * , or on @compliance.evaluation. Each entry in targets is a + * handle that starts with @, such as an email address (@john.doe@email.com + * ) or an integration handle (@slack-<VALUES>); see targets + * . Trial organizations can't use email address targets: the request returns 400. + * + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @param body (required) * @return ApiResponse<NotificationRuleResponse> * @throws ApiException if fails to make API call @@ -28339,7 +28452,8 @@ public ApiResponse patchSignalNotificationRuleWithHttp * *

See {@link #patchSignalNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetSignalNotificationRules. (required) * @param body (required) * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ @@ -28405,7 +28519,8 @@ public ApiResponse patchSignalNotificationRuleWithHttp * *

See {@link #patchVulnerabilityNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @param body (required) * @return NotificationRuleResponse * @throws ApiException if fails to make API call @@ -28420,7 +28535,8 @@ public NotificationRuleResponse patchVulnerabilityNotificationRule( * *

See {@link #patchVulnerabilityNotificationRuleWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @param body (required) * @return CompletableFuture<NotificationRuleResponse> */ @@ -28434,10 +28550,35 @@ public CompletableFuture patchVulnerabilityNotificatio } /** - * Partially update the notification rule. All fields are optional; if a field is not provided, it - * is not updated. - * - * @param id ID of the notification rule. (required) + * Partially update the notification rule. All fields except version are optional; if + * a field is not provided, it is not updated. Give at least one field to change. Get the rule + * id from GetVulnerabilityNotificationRules, then read the rule with + * GetVulnerabilityNotificationRule and send its current version. The + * version is incremented each time the rule is modified. A version that + * isn't the current one returns 409: fetch the rule again and retry. A missing or 0 + * version is rejected. If you send selectors, it must include + * trigger_source, and every entry in selectors.rule_types must match that + * trigger source (give at least one). For security_findings, the rule types are + * 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. For security_signals, they + * are application_security, log_detection, workload_security + * , and signal_correlation. Changing trigger_source moves the + * rule to the other family's routes, and the change counts toward that family's limit of 1,000 + * rules. selectors.severities accepts critical, high, + * medium, low, and info; unknown is rejected. + * selectors.query is at most 6,000 characters. Finding-based rules can't filter on + * attributes in the @workflow or @_dd namespaces, on @status + * , or on @compliance.evaluation. Each entry in targets is a + * handle that starts with @, such as an email address (@john.doe@email.com + * ) or an integration handle (@slack-<VALUES>); see targets + * . Trial organizations can't use email address targets: the request returns 400. + * + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @param body (required) * @return ApiResponse<NotificationRuleResponse> * @throws ApiException if fails to make API call @@ -28502,7 +28643,8 @@ public ApiResponse patchVulnerabilityNotificationRuleW * *

See {@link #patchVulnerabilityNotificationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param id ID of the notification rule, as returned in data[].id by + * GetVulnerabilityNotificationRules. (required) * @param body (required) * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateNotificationRuleParametersDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateNotificationRuleParametersDataAttributes.java index d3a740efdc6..69ccc76b4a7 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateNotificationRuleParametersDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateNotificationRuleParametersDataAttributes.java @@ -90,7 +90,8 @@ public CreateNotificationRuleParametersDataAttributes name(String name) { } /** - * Name of the notification rule. + * Name of the notification rule. At most 500 characters, and unique in the organization + * (case-insensitive). * * @return name */ @@ -169,6 +170,16 @@ public CreateNotificationRuleParametersDataAttributes addTargetsItem(String targ * List of recipients to notify when a notification rule is triggered. Many different target types * are supported, such as email addresses, Slack channels, and PagerDuty services. The appropriate * integrations need to be properly configured to send notifications to the specified targets. + * Each target is a handle that starts with @. Use @<EMAIL> for an + * email address (for example, @john.doe@email.com), and + * @<INTEGRATION_NAME>-<VALUES> for an integration, such as + * @slack-<VALUES>, @pagerduty-<VALUES>, + * @jira-<VALUES>, @teams-<VALUES>, + * @servicenow-<VALUES>, or @webhook-<WEBHOOK_NAME>. Handles that + * include parentheses are not supported. A rule can have at most 20 targets, each at most 500 + * characters long. Finding-based rules don't accept case, incident, + * jira, or linear targets; use an automatic ticket creation rule for + * cases, Jira, and Linear. * * @return targets */ @@ -191,8 +202,9 @@ public CreateNotificationRuleParametersDataAttributes timeAggregation(Long timeA * Time aggregation period (in seconds) is used to aggregate the results of the notification rule * evaluation. Results are aggregated over a selected time frame using a rolling window, which * updates with each new evaluation. Notifications are only sent for new issues discovered during - * the window. Time aggregation is only available for vulnerability-based notification rules. When - * omitted or set to 0, no aggregation is done. + * the window. Time aggregation is only available for finding-based notification rules. When + * omitted or set to 0, no aggregation is done. Otherwise, it must be between 1800 (30 minutes) + * and 2592000 (30 days). * * @return timeAggregation */ diff --git a/src/main/java/com/datadog/api/client/v2/model/NotificationRuleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleAttributes.java index 378efbf4cc0..eb95001ffac 100644 --- a/src/main/java/com/datadog/api/client/v2/model/NotificationRuleAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/NotificationRuleAttributes.java @@ -207,7 +207,8 @@ public NotificationRuleAttributes name(String name) { } /** - * Name of the notification rule. + * Name of the notification rule. At most 500 characters, and unique in the organization + * (case-insensitive). * * @return name */ @@ -261,6 +262,16 @@ public NotificationRuleAttributes addTargetsItem(String targetsItem) { * List of recipients to notify when a notification rule is triggered. Many different target types * are supported, such as email addresses, Slack channels, and PagerDuty services. The appropriate * integrations need to be properly configured to send notifications to the specified targets. + * Each target is a handle that starts with @. Use @<EMAIL> for an + * email address (for example, @john.doe@email.com), and + * @<INTEGRATION_NAME>-<VALUES> for an integration, such as + * @slack-<VALUES>, @pagerduty-<VALUES>, + * @jira-<VALUES>, @teams-<VALUES>, + * @servicenow-<VALUES>, or @webhook-<WEBHOOK_NAME>. Handles that + * include parentheses are not supported. A rule can have at most 20 targets, each at most 500 + * characters long. Finding-based rules don't accept case, incident, + * jira, or linear targets; use an automatic ticket creation rule for + * cases, Jira, and Linear. * * @return targets */ @@ -283,8 +294,9 @@ public NotificationRuleAttributes timeAggregation(Long timeAggregation) { * Time aggregation period (in seconds) is used to aggregate the results of the notification rule * evaluation. Results are aggregated over a selected time frame using a rolling window, which * updates with each new evaluation. Notifications are only sent for new issues discovered during - * the window. Time aggregation is only available for vulnerability-based notification rules. When - * omitted or set to 0, no aggregation is done. + * the window. Time aggregation is only available for finding-based notification rules. When + * omitted or set to 0, no aggregation is done. Otherwise, it must be between 1800 (30 minutes) + * and 2592000 (30 days). * * @return timeAggregation */ @@ -305,7 +317,9 @@ public NotificationRuleAttributes version(Long version) { } /** - * Version of the notification rule. It is updated when the rule is modified. + * Version of the notification rule. It is updated when the rule is modified. When patching a + * rule, send the current version returned by the get or list operation; an older + * version returns 409. * * @return version */ diff --git a/src/main/java/com/datadog/api/client/v2/model/NotificationRulePreviewResult.java b/src/main/java/com/datadog/api/client/v2/model/NotificationRulePreviewResult.java index 0dbd4855314..7533030f69d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/NotificationRulePreviewResult.java +++ b/src/main/java/com/datadog/api/client/v2/model/NotificationRulePreviewResult.java @@ -81,9 +81,8 @@ public NotificationRulePreviewResult ruleType(RuleTypesItems ruleType) { /** * Security rule type which can be used in security rules. Signal-based notification rules can - * filter signals based on rule types application_security, log_detection, workload_security, - * signal_correlation, cloud_configuration and infrastructure_configuration. Vulnerability-based - * notification rules can filter vulnerabilities based on rule types + * filter signals based on rule types application_security, log_detection, workload_security and + * signal_correlation. Finding-based notification rules can filter findings based on rule types * application_code_vulnerability, application_library_vulnerability, attack_path, * container_image_vulnerability, identity_risk, misconfiguration, api_security, * host_vulnerability, iac_misconfiguration, sast_vulnerability, secret_vulnerability, diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchNotificationRuleParametersDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PatchNotificationRuleParametersDataAttributes.java index 230c501f58e..fa690eaac4d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PatchNotificationRuleParametersDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/PatchNotificationRuleParametersDataAttributes.java @@ -83,7 +83,8 @@ public PatchNotificationRuleParametersDataAttributes name(String name) { } /** - * Name of the notification rule. + * Name of the notification rule. At most 500 characters, and unique in the organization + * (case-insensitive). * * @return name */ @@ -167,6 +168,16 @@ public PatchNotificationRuleParametersDataAttributes addTargetsItem(String targe * List of recipients to notify when a notification rule is triggered. Many different target types * are supported, such as email addresses, Slack channels, and PagerDuty services. The appropriate * integrations need to be properly configured to send notifications to the specified targets. + * Each target is a handle that starts with @. Use @<EMAIL> for an + * email address (for example, @john.doe@email.com), and + * @<INTEGRATION_NAME>-<VALUES> for an integration, such as + * @slack-<VALUES>, @pagerduty-<VALUES>, + * @jira-<VALUES>, @teams-<VALUES>, + * @servicenow-<VALUES>, or @webhook-<WEBHOOK_NAME>. Handles that + * include parentheses are not supported. A rule can have at most 20 targets, each at most 500 + * characters long. Finding-based rules don't accept case, incident, + * jira, or linear targets; use an automatic ticket creation rule for + * cases, Jira, and Linear. * * @return targets */ @@ -190,8 +201,9 @@ public PatchNotificationRuleParametersDataAttributes timeAggregation(Long timeAg * Time aggregation period (in seconds) is used to aggregate the results of the notification rule * evaluation. Results are aggregated over a selected time frame using a rolling window, which * updates with each new evaluation. Notifications are only sent for new issues discovered during - * the window. Time aggregation is only available for vulnerability-based notification rules. When - * omitted or set to 0, no aggregation is done. + * the window. Time aggregation is only available for finding-based notification rules. When + * omitted or set to 0, no aggregation is done. Otherwise, it must be between 1800 (30 minutes) + * and 2592000 (30 days). * * @return timeAggregation */ @@ -212,7 +224,9 @@ public PatchNotificationRuleParametersDataAttributes version(Long version) { } /** - * Version of the notification rule. It is updated when the rule is modified. + * Version of the notification rule. It is updated when the rule is modified. When patching a + * rule, send the current version returned by the get or list operation; an older + * version returns 409. * * @return version */ diff --git a/src/main/java/com/datadog/api/client/v2/model/RuleTypesItems.java b/src/main/java/com/datadog/api/client/v2/model/RuleTypesItems.java index b22316cbe2a..39af9525ec3 100644 --- a/src/main/java/com/datadog/api/client/v2/model/RuleTypesItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/RuleTypesItems.java @@ -20,13 +20,12 @@ /** * Security rule type which can be used in security rules. Signal-based notification rules can - * filter signals based on rule types application_security, log_detection, workload_security, - * signal_correlation, cloud_configuration and infrastructure_configuration. Vulnerability-based - * notification rules can filter vulnerabilities based on rule types 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. + * filter signals based on rule types application_security, log_detection, workload_security and + * signal_correlation. Finding-based notification rules can filter findings based on rule types + * 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. */ @JsonSerialize(using = RuleTypesItems.RuleTypesItemsSerializer.class) public class RuleTypesItems extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/Selectors.java b/src/main/java/com/datadog/api/client/v2/model/Selectors.java index f388bb9faa7..ed60522eedd 100644 --- a/src/main/java/com/datadog/api/client/v2/model/Selectors.java +++ b/src/main/java/com/datadog/api/client/v2/model/Selectors.java @@ -63,7 +63,9 @@ public Selectors query(String query) { /** * The query is composed of one or several key:value pairs, which can be used to filter security - * issues on tags and attributes. + * issues on tags and attributes. It is at most 6,000 characters. Finding-based rules can't filter + * on attributes in the @workflow or @_dd namespaces, on @status + * , or on @compliance.evaluation. * * @return query */ @@ -93,7 +95,16 @@ public Selectors addRuleTypesItem(RuleTypesItems ruleTypesItem) { } /** - * Security rule types used as filters in security rules. + * Security rule types used as filters in security rules. Signal-based notification rules accept + * application_security, log_detection, workload_security, + * and signal_correlation. Finding-based notification rules accept + * 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. Rule types that don't match the rule's + * trigger_source are rejected. * * @return ruleTypes */ @@ -123,7 +134,9 @@ public Selectors addSeveritiesItem(RuleSeverity severitiesItem) { } /** - * The security rules severities to consider. + * The security rules severities to consider. Allowed values are critical, high + * , medium, low, and info; unknown is + * rejected. * * @return severities */ @@ -147,7 +160,7 @@ public Selectors triggerSource(TriggerSource triggerSource) { /** * The type of security issues on which the rule applies. Notification rules based on security * signals need to use the trigger source "security_signals", while notification rules based on - * security vulnerabilities need to use the trigger source "security_findings". + * security findings need to use the trigger source "security_findings". * * @return triggerSource */ diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerSource.java b/src/main/java/com/datadog/api/client/v2/model/TriggerSource.java index 19cd1820e94..32da1feead2 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TriggerSource.java +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerSource.java @@ -21,7 +21,7 @@ /** * The type of security issues on which the rule applies. Notification rules based on security * signals need to use the trigger source "security_signals", while notification rules based on - * security vulnerabilities need to use the trigger source "security_findings". + * security findings need to use the trigger source "security_findings". */ @JsonSerialize(using = TriggerSource.TriggerSourceSerializer.class) public class TriggerSource extends ModelEnum {