---
title: "List rules"
method: GET
path: "/api/v2/security_monitoring/rules"
tags: ["Security Monitoring"]
---

# List rules

`GET /api/v2/security_monitoring/rules`

List rules.

## Query parameters

- `page[size]` integer
- `page[number]` integer
- `query` string
- `sort` 'name' | 'creation_date' | 'update_date' | 'enabled' | 'type' | 'highest_severity' | 'source' | '-name' | '-creation_date' | '-update_date' | '-enabled' | '-type' | '-highest_severity' | '-source' — The sort parameters used for querying security monitoring rules.

## Response `200`

OK

- SecurityMonitoringListRulesResponse — List of rules.
  - `data` SecurityMonitoringRuleResponse[] — Array containing the list of rules.
    - union — Create a new rule.
      - SecurityMonitoringStandardRuleResponse — Rule.
        - `calculatedFields` CalculatedField[] — Calculated fields. Only allowed for scheduled rules - in other words, when schedulingOptions is also defined.
          - `expression` string, required — Expression.
          - `name` string, required — Field name.
        - `cases` SecurityMonitoringRuleCase[] — Cases for generating signals.
          - `actions` SecurityMonitoringRuleCaseAction[] — Action to perform for each rule case.
            - `options` SecurityMonitoringRuleCaseActionOptions — Options for the rule action
              - …
            - `type` 'block_ip' | 'block_user' | 'user_behavior' | 'flag_ip' — The action type.
          - `condition` string — A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated based on the event counts in the previously defined queries.
          - `customStatus` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity of the Security Signal.
          - `name` string — Name of the case.
          - `notifications` string[] — Notification targets for each rule case.
          - `status` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity of the Security Signal.
        - `complianceSignalOptions` CloudConfigurationRuleComplianceSignalOptions — How to generate compliance signals. Useful for cloud_configuration rules only.
          - `defaultActivationStatus` boolean, nullable — The default activation status.
          - `defaultGroupByFields` string[], nullable — The default group by fields.
          - `userActivationStatus` boolean, nullable — Whether signals will be sent.
          - `userGroupByFields` string[], nullable — Fields to use to group findings by when sending signals.
        - `createdAt` integer — When the rule was created, timestamp in milliseconds.
        - `creationAuthorId` integer — User ID of the user who created the rule.
        - `customMessage` string — Custom/Overridden message for generated signals (used in case of Default rule update).
        - `customName` string — Custom/Overridden name of the rule (used in case of Default rule update).
        - `defaultTags` string[] — Default Tags for default rules (included in tags)
        - `deprecationDate` integer — When the rule will be deprecated, timestamp in milliseconds.
        - `filters` SecurityMonitoringFilter[] — Additional queries to filter matched events before they are processed. This field is deprecated for log detection, signal correlation, and workload security rules.
          - `action` 'require' | 'suppress' — The type of filtering action.
          - `query` string — Query for selecting logs to apply the filtering action.
        - `groupSignalsBy` string[] — Additional grouping to perform on top of the existing groups in the query section. Must be a subset of the existing groups.
        - `hasExtendedTitle` boolean — Whether the notifications include the triggering group-by values in their title.
        - `id` string — The ID of the rule.
        - `isDefault` boolean — Whether the rule is included by default.
        - `isDeleted` boolean — Whether the rule has been deleted.
        - `isEnabled` boolean — Whether the rule is enabled.
        - `message` string — Message for generated signals.
        - `name` string — The name of the rule.
        - `options` SecurityMonitoringRuleOptions — Options.
          - `anomalyDetectionOptions` SecurityMonitoringRuleAnomalyDetectionOptions — Options on anomaly detection method.
            - `bucketDuration` 300 | 600 | 900 | 1800 | 3600 | 10800 — Duration in seconds of the time buckets used to aggregate events matched by the rule. Must be greater than or equal to 300.
            - `detectionTolerance` 1 | 2 | 3 | 4 | 5 — An optional parameter that sets how permissive anomaly detection is. Higher values require higher deviations before triggering a signal.
            - `instantaneousBaseline` boolean — When set to true, Datadog uses previous values that fall within the defined learning window to construct the baseline, enabling the system to establish an accurate baseline more rapidly rather than relying solely on gradual learning over time.
            - `learningDuration` 1 | 6 | 12 | 24 | 48 | 168 | 336 — Learning duration in hours. Anomaly detection waits for at least this amount of historical data before it starts evaluating.
            - `learningPeriodBaseline` integer — An optional override baseline to apply while the rule is in the learning period. Must be greater than or equal to 0.
          - `complianceRuleOptions` CloudConfigurationComplianceRuleOptions — Options for cloud_configuration rules. Fields `resourceType` and `regoRule` are mandatory when managing custom `cloud_configuration` rules.
            - `complexRule` boolean — Whether the rule is a complex one. Must be set to true if `regoRule.resourceTypes` contains more than one item. Defaults to false.
            - `regoRule` CloudConfigurationRegoRule — Rule details.
              - …
            - `resourceType` string — Main resource type to be checked by the rule. It should be specified again in `regoRule.resourceTypes`.
          - `decreaseCriticalityBasedOnEnv` boolean — If true, signals in non-production environments have a lower severity than what is defined by the rule case, which can reduce signal noise. The severity is decreased by one level: `CRITICAL` in production becomes `HIGH` in non-production, `HIGH` becomes `MEDIUM` and so on. `INFO` remains `INFO`. The decrement is applied when the environment tag of the signal starts with `staging`, `test` or `dev`.
          - `detectionMethod` 'threshold' | 'new_value' | 'anomaly_detection' | 'impossible_travel' | 'hardcoded' | 'third_party' | 'anomaly_threshold' | 'sequence_detection' — The detection method.
          - `evaluationWindow` 0 | 60 | 300 | 600 | 900 | 1800 | 3600 | 7200 | 10800 | 21600 | 43200 | 86400 — A time window is specified to match when at least one of the cases matches true. This is a sliding window and evaluates in real time. For third party detection method, this field is not used.
          - `hardcodedEvaluatorType` 'log4shell' — Hardcoded evaluator type.
          - `impossibleTravelOptions` SecurityMonitoringRuleImpossibleTravelOptions — Options on impossible travel detection method.
            - `baselineUserLocations` boolean — If true, signals are suppressed for the first 24 hours. In that time, Datadog learns the user's regular access locations. This can be helpful to reduce noise and infer VPN usage or credentialed API access.
            - `baselineUserLocationsDuration` integer, nullable — The duration in days during which Datadog learns the user's regular access locations. After this period, signals are generated for accesses from unknown locations.
          - `keepAlive` 0 | 60 | 300 | 600 | 900 | 1800 | 3600 | 7200 | 10800 | 21600 | 43200 | 86400 — Once a signal is generated, the signal will remain "open" if a case is matched at least once within this keep alive window. For third party detection method, this field is not used.
          - `maxSignalDuration` 0 | 60 | 300 | 600 | 900 | 1800 | 3600 | 7200 | 10800 | 21600 | 43200 | 86400 — A signal will "close" regardless of the query being matched once the time exceeds the maximum duration. This time is calculated from the first seen timestamp.
          - `newValueOptions` SecurityMonitoringRuleNewValueOptions — Options on new value detection method.
            - `forgetAfter` integer — The duration in days after which a learned value is forgotten.
            - `instantaneousBaseline` boolean — When set to true, Datadog uses previous values that fall within the defined learning window to construct the baseline, enabling the system to establish an accurate baseline more rapidly rather than relying solely on gradual learning over time.
            - `learningDuration` integer — The duration in days during which values are learned, and after which signals will be generated for values that weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.
            - `learningMethod` 'duration' | 'threshold' — The learning method used to determine when signals should be generated for values that weren't learned.
            - `learningThreshold` 0 | 1 — A number of occurrences after which signals will be generated for values that weren't learned.
          - `sequenceDetectionOptions` SecurityMonitoringRuleSequenceDetectionOptions — Options on sequence detection method.
            - `stepTransitions` SecurityMonitoringRuleSequenceDetectionStepTransition[] — Transitions defining the allowed order of steps and their evaluation windows.
              - …
            - `steps` SecurityMonitoringRuleSequenceDetectionStep[] — Steps that define the conditions to be matched in sequence.
              - …
          - `thirdPartyRuleOptions` SecurityMonitoringRuleThirdPartyOptions — Options on third party detection method.
            - `defaultNotifications` string[] — Notification targets for the logs that do not correspond to any of the cases.
            - `defaultStatus` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity of the Security Signal.
            - `rootQueries` SecurityMonitoringThirdPartyRootQuery[] — Queries to be combined with third party case queries. Each of them can have different group by fields, to aggregate differently based on the type of alert.
              - …
            - `signalTitleTemplate` string — A template for the signal title; if omitted, the title is generated based on the case name.
        - `queries` SecurityMonitoringStandardRuleQuery[] — Queries for selecting logs which are part of the rule.
          - `aggregation` 'count' | 'cardinality' | 'sum' | 'max' | 'new_value' | 'geo_data' | 'event_count' | 'none' — The aggregation type.
          - `customQueryExtension` string — Query extension to append to the logs query.
          - `dataSource` 'logs' | 'audit' | 'app_sec_spans' | 'spans' | 'security_runtime' | 'network' | 'events' | 'security_signals' — Source of events, either logs, audit trail, security signals, or Datadog events. `app_sec_spans` is deprecated in favor of `spans`.
          - `distinctFields` string[] — Field for which the cardinality is measured. Sent as an array.
          - `groupByFields` string[] — Fields to group by.
          - `hasOptionalGroupByFields` boolean — When false, events without a group-by value are ignored by the rule. When true, events with missing group-by fields are processed with `N/A`, replacing the missing values.
          - `index` string — **This field is currently unstable and might be removed in a minor version upgrade.** The index to run the query on, if the `dataSource` is `logs`. Only used for scheduled rules - in other words, when the `schedulingOptions` field is present in the rule payload.
          - `indexes` string[] — List of indexes to query when the `dataSource` is `logs`. Only used for scheduled rules, such as when the `schedulingOptions` field is present in the rule payload.
          - `metric` string — (Deprecated) The target field to aggregate over when using the sum or max aggregations. `metrics` field should be used instead.
          - `metrics` string[] — Group of target fields to aggregate over when using the sum, max, geo data, or new value aggregations. The sum, max, and geo data aggregations only accept one value in this list, whereas the new value aggregation accepts up to five values.
          - `name` string — Name of the query.
          - `query` string — Query to run on logs.
        - `referenceTables` SecurityMonitoringReferenceTable[] — Reference tables for the rule.
          - `checkPresence` boolean — Whether to include or exclude the matched values.
          - `columnName` string — The name of the column in the reference table.
          - `logFieldPath` string — The field in the log to match against the reference table.
          - `ruleQueryName` string — The name of the query to apply the reference table to.
          - `tableName` string — The name of the reference table.
        - `schedulingOptions` SecurityMonitoringSchedulingOptions, nullable — Options for scheduled rules. When this field is present, the rule runs based on the schedule. When absent, it runs real-time on ingested logs.
          - `rrule` string — Schedule for the rule queries, written in RRULE syntax. See [RFC](https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html) for syntax reference.
          - `start` string — Start date for the schedule, in ISO 8601 format without timezone.
          - `timezone` string — Time zone of the start date, in the [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) format.
        - `tags` string[] — Tags for generated signals.
        - `thirdPartyCases` SecurityMonitoringThirdPartyRuleCase[] — Cases for generating signals from third-party rules. Only available for third-party rules.
          - `customStatus` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity of the Security Signal.
          - `name` string — Name of the case.
          - `notifications` string[] — Notification targets for each rule case.
          - `query` string — A query to map a third party event to this case.
          - `status` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity of the Security Signal.
        - `type` 'log_detection' | 'infrastructure_configuration' | 'workload_security' | 'cloud_configuration' | 'application_security' | 'api_security' | 'workload_activity' — The rule type.
        - `updateAuthorId` integer — User ID of the user who updated the rule.
        - `updatedAt` integer — The date the rule was last updated, in milliseconds.
        - `version` integer — The version of the rule.
      - SecurityMonitoringSignalRuleResponse — Rule.
        - `cases` SecurityMonitoringRuleCase[] — Cases for generating signals.
          - `actions` SecurityMonitoringRuleCaseAction[] — Action to perform for each rule case.
            - `options` SecurityMonitoringRuleCaseActionOptions — Options for the rule action
              - …
            - `type` 'block_ip' | 'block_user' | 'user_behavior' | 'flag_ip' — The action type.
          - `condition` string — A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated based on the event counts in the previously defined queries.
          - `customStatus` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity of the Security Signal.
          - `name` string — Name of the case.
          - `notifications` string[] — Notification targets for each rule case.
          - `status` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity of the Security Signal.
        - `createdAt` integer — When the rule was created, timestamp in milliseconds.
        - `creationAuthorId` integer — User ID of the user who created the rule.
        - `customMessage` string — Custom/Overridden message for generated signals (used in case of Default rule update).
        - `customName` string — Custom/Overridden name of the rule (used in case of Default rule update).
        - `deprecationDate` integer — When the rule will be deprecated, timestamp in milliseconds.
        - `filters` SecurityMonitoringFilter[] — Additional queries to filter matched events before they are processed. This field is deprecated for log detection, signal correlation, and workload security rules.
          - `action` 'require' | 'suppress' — The type of filtering action.
          - `query` string — Query for selecting logs to apply the filtering action.
        - `hasExtendedTitle` boolean — Whether the notifications include the triggering group-by values in their title.
        - `id` string — The ID of the rule.
        - `isDefault` boolean — Whether the rule is included by default.
        - `isDeleted` boolean — Whether the rule has been deleted.
        - `isEnabled` boolean — Whether the rule is enabled.
        - `message` string — Message for generated signals.
        - `name` string — The name of the rule.
        - `options` SecurityMonitoringRuleOptions — Options.
          - `anomalyDetectionOptions` SecurityMonitoringRuleAnomalyDetectionOptions — Options on anomaly detection method.
            - `bucketDuration` 300 | 600 | 900 | 1800 | 3600 | 10800 — Duration in seconds of the time buckets used to aggregate events matched by the rule. Must be greater than or equal to 300.
            - `detectionTolerance` 1 | 2 | 3 | 4 | 5 — An optional parameter that sets how permissive anomaly detection is. Higher values require higher deviations before triggering a signal.
            - `instantaneousBaseline` boolean — When set to true, Datadog uses previous values that fall within the defined learning window to construct the baseline, enabling the system to establish an accurate baseline more rapidly rather than relying solely on gradual learning over time.
            - `learningDuration` 1 | 6 | 12 | 24 | 48 | 168 | 336 — Learning duration in hours. Anomaly detection waits for at least this amount of historical data before it starts evaluating.
            - `learningPeriodBaseline` integer — An optional override baseline to apply while the rule is in the learning period. Must be greater than or equal to 0.
          - `complianceRuleOptions` CloudConfigurationComplianceRuleOptions — Options for cloud_configuration rules. Fields `resourceType` and `regoRule` are mandatory when managing custom `cloud_configuration` rules.
            - `complexRule` boolean — Whether the rule is a complex one. Must be set to true if `regoRule.resourceTypes` contains more than one item. Defaults to false.
            - `regoRule` CloudConfigurationRegoRule — Rule details.
              - …
            - `resourceType` string — Main resource type to be checked by the rule. It should be specified again in `regoRule.resourceTypes`.
          - `decreaseCriticalityBasedOnEnv` boolean — If true, signals in non-production environments have a lower severity than what is defined by the rule case, which can reduce signal noise. The severity is decreased by one level: `CRITICAL` in production becomes `HIGH` in non-production, `HIGH` becomes `MEDIUM` and so on. `INFO` remains `INFO`. The decrement is applied when the environment tag of the signal starts with `staging`, `test` or `dev`.
          - `detectionMethod` 'threshold' | 'new_value' | 'anomaly_detection' | 'impossible_travel' | 'hardcoded' | 'third_party' | 'anomaly_threshold' | 'sequence_detection' — The detection method.
          - `evaluationWindow` 0 | 60 | 300 | 600 | 900 | 1800 | 3600 | 7200 | 10800 | 21600 | 43200 | 86400 — A time window is specified to match when at least one of the cases matches true. This is a sliding window and evaluates in real time. For third party detection method, this field is not used.
          - `hardcodedEvaluatorType` 'log4shell' — Hardcoded evaluator type.
          - `impossibleTravelOptions` SecurityMonitoringRuleImpossibleTravelOptions — Options on impossible travel detection method.
            - `baselineUserLocations` boolean — If true, signals are suppressed for the first 24 hours. In that time, Datadog learns the user's regular access locations. This can be helpful to reduce noise and infer VPN usage or credentialed API access.
            - `baselineUserLocationsDuration` integer, nullable — The duration in days during which Datadog learns the user's regular access locations. After this period, signals are generated for accesses from unknown locations.
          - `keepAlive` 0 | 60 | 300 | 600 | 900 | 1800 | 3600 | 7200 | 10800 | 21600 | 43200 | 86400 — Once a signal is generated, the signal will remain "open" if a case is matched at least once within this keep alive window. For third party detection method, this field is not used.
          - `maxSignalDuration` 0 | 60 | 300 | 600 | 900 | 1800 | 3600 | 7200 | 10800 | 21600 | 43200 | 86400 — A signal will "close" regardless of the query being matched once the time exceeds the maximum duration. This time is calculated from the first seen timestamp.
          - `newValueOptions` SecurityMonitoringRuleNewValueOptions — Options on new value detection method.
            - `forgetAfter` integer — The duration in days after which a learned value is forgotten.
            - `instantaneousBaseline` boolean — When set to true, Datadog uses previous values that fall within the defined learning window to construct the baseline, enabling the system to establish an accurate baseline more rapidly rather than relying solely on gradual learning over time.
            - `learningDuration` integer — The duration in days during which values are learned, and after which signals will be generated for values that weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.
            - `learningMethod` 'duration' | 'threshold' — The learning method used to determine when signals should be generated for values that weren't learned.
            - `learningThreshold` 0 | 1 — A number of occurrences after which signals will be generated for values that weren't learned.
          - `sequenceDetectionOptions` SecurityMonitoringRuleSequenceDetectionOptions — Options on sequence detection method.
            - `stepTransitions` SecurityMonitoringRuleSequenceDetectionStepTransition[] — Transitions defining the allowed order of steps and their evaluation windows.
              - …
            - `steps` SecurityMonitoringRuleSequenceDetectionStep[] — Steps that define the conditions to be matched in sequence.
              - …
          - `thirdPartyRuleOptions` SecurityMonitoringRuleThirdPartyOptions — Options on third party detection method.
            - `defaultNotifications` string[] — Notification targets for the logs that do not correspond to any of the cases.
            - `defaultStatus` 'info' | 'low' | 'medium' | 'high' | 'critical' — Severity of the Security Signal.
            - `rootQueries` SecurityMonitoringThirdPartyRootQuery[] — Queries to be combined with third party case queries. Each of them can have different group by fields, to aggregate differently based on the type of alert.
              - …
            - `signalTitleTemplate` string — A template for the signal title; if omitted, the title is generated based on the case name.
        - `queries` SecurityMonitoringSignalRuleResponseQuery[] — Queries for selecting logs which are part of the rule.
          - `aggregation` 'count' | 'cardinality' | 'sum' | 'max' | 'new_value' | 'geo_data' | 'event_count' | 'none' — The aggregation type.
          - `correlatedByFields` string[] — Fields to correlate by.
          - `correlatedQueryIndex` integer — Index of the rule query used to retrieve the correlated field.
          - `defaultRuleId` string — Default Rule ID to match on signals.
          - `distinctFields` string[] — Field for which the cardinality is measured. Sent as an array.
          - `groupByFields` string[] — Fields to group by.
          - `metrics` string[] — Group of target fields to aggregate over.
          - `name` string — Name of the query.
          - `ruleId` string — Rule ID to match on signals.
        - `tags` string[] — Tags for generated signals.
        - `type` 'signal_correlation' — The rule type.
        - `updateAuthorId` integer — User ID of the user who updated the rule.
        - `version` integer — The version of the rule.
  - `meta` ResponseMetaAttributes — Object describing meta attributes of response.
    - `page` Pagination — Pagination object.
      - `total_count` integer — Total count.
      - `total_filtered_count` integer — Total count of elements matched by the filter.

## Other responses

- `400` — Bad Request
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/versions/da68bf029e4c/schema)
