---
title: "Returns a list of Secrets rules"
method: GET
path: "/api/v2/static-analysis/secrets/rules"
tags: ["Security Monitoring"]
---

# Returns a list of Secrets rules

`GET /api/v2/static-analysis/secrets/rules`

Returns a list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID.

## Response `200`

OK

- SecretRuleArray — A collection of secret detection rules returned by the list endpoint.
  - `data` SecretRuleData[], required — The list of secret detection rules.
    - `attributes` SecretRuleDataAttributes — The attributes of a secret detection rule, including its pattern, priority, and validation configuration.
      - `default_included_keywords` string[] — A list of keywords that are included by default when scanning for secrets matching this rule.
      - `description` string — A detailed explanation of what type of secret this rule detects.
      - `license` string — The license under which this secret rule is distributed.
      - `match_validation` SecretRuleDataAttributesMatchValidation — Configuration for validating whether a detected secret is active by making an HTTP request and inspecting the response.
        - `endpoint` string — The URL endpoint to call when validating a detected secret.
        - `hosts` string[] — The list of hostnames to include when performing secret match validation.
        - `http_method` string — The HTTP method (e.g., GET, POST) to use when making the validation request.
        - `invalid_http_status_code` SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems[] — The HTTP status code ranges that indicate the detected secret is invalid or inactive.
          - `end` integer — The inclusive upper bound of the HTTP status code range.
          - `start` integer — The inclusive lower bound of the HTTP status code range.
        - `request_headers` object — A map of HTTP header names to values to include in the validation request.
        - `timeout_seconds` integer — The maximum number of seconds to wait for a response during validation before timing out.
        - `type` string — The type of match validation to perform (e.g., http).
        - `valid_http_status_code` SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems[] — The HTTP status code ranges that indicate the detected secret is valid and active.
          - `end` integer — The inclusive upper bound of the HTTP status code range.
          - `start` integer — The inclusive lower bound of the HTTP status code range.
      - `name` string — The unique name of the secret detection rule.
      - `pattern` string — The regular expression pattern used to identify potential secrets in source code or configuration.
      - `priority` string — The priority level of this rule, used to rank findings when multiple rules match.
      - `sds_id` string — The identifier of the corresponding Sensitive Data Scanner rule, if one exists.
      - `validators` string[] — A list of validator identifiers used to further confirm a detected secret is genuine.
    - `id` string — The unique identifier of the secret rule resource.
    - `type` 'secret_rule', required — Secret rule resource type.

## Other responses

- `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)
