Start a rule proposal
https://api.datadoghq.com/api/v2/security_monitoring/rules/proposalshttps://api.us3.datadoghq.com/api/v2/security_monitoring/rules/proposalshttps://api.us5.datadoghq.com/api/v2/security_monitoring/rules/proposalshttps://api.datadoghq.eu/api/v2/security_monitoring/rules/proposalshttps://api.ap1.datadoghq.com/api/v2/security_monitoring/rules/proposalshttps://api.ap2.datadoghq.com/api/v2/security_monitoring/rules/proposalshttps://api.uk1.datadoghq.com/api/v2/security_monitoring/rules/proposalshttps://api.ddog-gov.com/api/v2/security_monitoring/rules/proposalshttps://api.us2.ddog-gov.com/api/v2/security_monitoring/rules/proposalsOverview
Start generating a proposed Cloud SIEM detection rule from a natural-language description, or from an SPL or KQL rule. The proposal is based on your organization's log sources, log fields, and existing detection rules. When logs from the matching source are available, the proposed query is tested against your recent logs.
The proposed rule is generated asynchronously. This endpoint returns a proposal id
with the status pending. To get the proposed rule, pass this id to the get-a-rule-proposal
endpoint and poll the endpoint until the status is completed or failed. A proposal
usually takes a few minutes, and up to 10 minutes.
This endpoint does not create or modify any detection rules in Cloud SIEM. To translate many rules at once, use batch migrations instead.
OAuth apps require the security_monitoring_rules_write authorization scope to access this endpoint.
Request
Body Data (required)
data [required]Data of the rule proposal to start.
attributes [required]Attributes of the rule proposal to start.
input [required]The natural-language description or rule to generate the proposed rule from, in the
format given by inputType.
inputType [required]The type of input to generate the proposed rule from: natural_language for a
plain-English description of the behavior to detect, spl for a Splunk SPL search or
saved search definition, or kql for a Microsoft KQL query. SPL inputs must be
self-contained, with search macros expanded.
natural_language, spl, kqltype [required]The rule proposal resource type. The value is always rule_proposals.
rule_proposalsrule_proposals{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}Response
Accepted
Response to a started rule proposal.
data [required]Data of the started rule proposal.
attributes [required]Attributes of the started rule proposal.
status [required]The status of the rule proposal, one of pending, in_progress, completed, or
failed. For a newly started rule proposal, the status is pending.
id [required]The ID of the rule proposal. Use it as proposal_id to check the proposal status and get the proposed rule.
type [required]The rule proposal resource type. The value is always rule_proposals.
rule_proposalsrule_proposals{
"data": {
"attributes": {
"status": "pending"
},
"id": "c968cf83-56c2-4d54-a993-6c86dfb83527",
"type": "rule_proposals"
}
}Bad Request
API error response.
errors [required]A list of errors.
codeAn application-specific error code.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"code": "invalid_request",
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Unauthorized
API error response.
errors [required]A list of errors.
codeAn application-specific error code.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"code": "invalid_request",
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Forbidden
API error response.
errors [required]A list of errors.
codeAn application-specific error code.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"code": "invalid_request",
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/security_monitoring/rules/proposals" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "rule_proposals",
"attributes": {
"inputType": "natural_language",
"input": "Detect repeated failed Okta logins followed by a successful login from the same IP."
}
}
}
EOF