Skip to main content
POST
/
v1
/
namespaces
/
{tenant_meta.namespace}
/
secret-rules
CreateSecretRule
curl --request POST \
  --url https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/secret-rules \
  --header 'Content-Type: application/json' \
  --data '
{
  "meta": {
    "name": "<string>",
    "annotations": {},
    "description": "<string>",
    "index_data": {},
    "parent_kind": "<string>",
    "parent_uuid": "<string>",
    "tags": [
      "<string>"
    ]
  },
  "spec": {
    "allowlist": {
      "commits": [
        "<string>"
      ],
      "description": "<string>",
      "paths": [
        "<string>"
      ],
      "regex_target": "<string>",
      "regexes": [
        "<string>"
      ],
      "stop_words": [
        "<string>"
      ]
    },
    "description": "<string>",
    "disabled": true,
    "entropy": 123,
    "keywords": [
      "<string>"
    ],
    "path": "<string>",
    "regex": "<string>",
    "rule_id": "<string>",
    "secret_group": 123,
    "tags": [
      "<string>"
    ],
    "validation": {
      "description": "<string>",
      "h_request": {
        "body": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "header": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "method": "<string>",
        "method_name": "<string>",
        "query": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "uri": "<string>"
      },
      "h_response": {
        "failed_auth_codes": [
          123
        ],
        "invalid_code_regex": "<string>",
        "status_code": "<string>",
        "successful_auth_codes": [
          123
        ],
        "successful_response_data": {},
        "successful_response_text": "<string>"
      },
      "hmac_auth": {
        "hdr_name": "<string>",
        "secret": "<string>"
      },
      "http_request": {
        "body": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "header": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "method": "<string>",
        "method_name": "<string>",
        "query": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "uri": "<string>"
      },
      "http_response": {
        "failed_auth_codes": [
          123
        ],
        "invalid_code_regex": "<string>",
        "status_code": "<string>",
        "successful_auth_codes": [
          123
        ],
        "successful_response_data": {},
        "successful_response_text": "<string>"
      },
      "name": "<string>",
      "request_body": "<string>",
      "template_params": [
        {
          "values": [
            {
              "name": "TEMPLATE_PARAM_NAME_UNSPECIFIED",
              "value": "<string>"
            }
          ]
        }
      ]
    }
  },
  "propagate": true,
  "tenant_meta": {}
}
'
{
  "meta": {
    "name": "<string>",
    "annotations": {},
    "create_time": "2023-11-07T05:31:56Z",
    "created_by": "<string>",
    "description": "<string>",
    "index_data": {
      "data": [
        "<string>"
      ],
      "search_score": 123,
      "tenant": "<string>",
      "will_be_deleted_at": "2023-11-07T05:31:56Z"
    },
    "kind": "<string>",
    "parent_kind": "<string>",
    "parent_uuid": "<string>",
    "references": {},
    "tags": [
      "<string>"
    ],
    "update_time": "2023-11-07T05:31:56Z",
    "updated_by": "<string>",
    "upsert_time": "2023-11-07T05:31:56Z",
    "version": "<string>"
  },
  "spec": {
    "allowlist": {
      "commits": [
        "<string>"
      ],
      "description": "<string>",
      "paths": [
        "<string>"
      ],
      "regex_target": "<string>",
      "regexes": [
        "<string>"
      ],
      "stop_words": [
        "<string>"
      ]
    },
    "description": "<string>",
    "disabled": true,
    "entropy": 123,
    "keywords": [
      "<string>"
    ],
    "path": "<string>",
    "regex": "<string>",
    "rule_id": "<string>",
    "secret_group": 123,
    "tags": [
      "<string>"
    ],
    "validation": {
      "allowed_template_params": [
        {
          "name": "TEMPLATE_PARAM_NAME_UNSPECIFIED",
          "regex": "<string>"
        }
      ],
      "description": "<string>",
      "h_request": {
        "body": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "header": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "method": "<string>",
        "method_name": "<string>",
        "query": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "uri": "<string>"
      },
      "h_response": {
        "failed_auth_codes": [
          123
        ],
        "invalid_code_regex": "<string>",
        "status_code": "<string>",
        "successful_auth_codes": [
          123
        ],
        "successful_response_data": {},
        "successful_response_text": "<string>"
      },
      "hmac_auth": {
        "hdr_name": "<string>",
        "secret": "<string>"
      },
      "http_request": {
        "body": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "header": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "method": "<string>",
        "method_name": "<string>",
        "query": [
          {
            "authz": true,
            "key": "<string>",
            "separator": "<string>",
            "value": "<string>"
          }
        ],
        "uri": "<string>"
      },
      "http_response": {
        "failed_auth_codes": [
          123
        ],
        "invalid_code_regex": "<string>",
        "status_code": "<string>",
        "successful_auth_codes": [
          123
        ],
        "successful_response_data": {},
        "successful_response_text": "<string>"
      },
      "name": "<string>",
      "request_body": "<string>",
      "template_params": [
        {
          "values": [
            {
              "name": "TEMPLATE_PARAM_NAME_UNSPECIFIED",
              "value": "<string>"
            }
          ]
        }
      ]
    }
  },
  "propagate": true,
  "tenant_meta": {
    "namespace": "<string>"
  },
  "uuid": "<string>"
}

Path Parameters

tenant_meta.namespace
string
required

Namespaces are a way to organize organizational units into virtual groupings of resources. Namespaces must be a fully qualified name, for example, the child namespace of namespace "endor.prod" called "app" is called "endor.prod.app".

Body

application/json
meta
object
required

Common fields for all Endor Labs resources.

spec
object
required

Internal specification of the object.

Follows the specification of the gitleaks configuration object defined here: https://github.com/gitleaks/gitleaks/blob/master/config/rule.go

propagate
boolean

Propagate indicates that the object should be visible in children namespaces.

tenant_meta
Rules are associated with a tenant and namespace. · object

Rules are associated with a tenant and namespace.

Response

A successful response.

meta
object
required

Common fields for all Endor Labs resources.

spec
object
required

Internal specification of the object.

Follows the specification of the gitleaks configuration object defined here: https://github.com/gitleaks/gitleaks/blob/master/config/rule.go

propagate
boolean

Propagate indicates that the object should be visible in children namespaces.

tenant_meta
object

Tenant related data for the tenant containing the resource.

uuid
string

The UUID of the secret rule.