Spaces method and path for this operation:
post /s/{space_id}/api/detection_engine/rules/{id}/exceptions
Refer to Spaces for more information.
Create exception items that apply to a single detection rule.
POST
/api/detection_engine/rules/{id}/exceptions
curl \
--request POST 'https://localhost:5601/api/detection_engine/rules/330bdd28-eedf-40e1-bed0-f10176c7f9e0/exceptions' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '"{\n \"items\": [\n {\n \"description\": \"This is a sample detection type exception item.\",\n \"entries\": [\n {\n \"field\": \"actingProcess.file.signer\",\n \"operator\": \"excluded\",\n \"type\": \"exists\"\n },\n {\n \"field\": \"host.name\",\n \"operator\": \"included\",\n \"type\": \"match_any\",\n \"value\": [\n \"saturn\",\n \"jupiter\"\n ]\n }\n ],\n \"item_id\": \"simple_list_item\",\n \"list_id\": \"simple_list\",\n \"name\": \"Sample Exception List Item\",\n \"namespace_type\": \"single\",\n \"os_types\": [\n \"linux\"\n ],\n \"tags\": [\n \"malware\"\n ],\n \"type\": \"simple\"\n }\n ]\n}"'
Request example
{
"items": [
{
"description": "This is a sample detection type exception item.",
"entries": [
{
"field": "actingProcess.file.signer",
"operator": "excluded",
"type": "exists"
},
{
"field": "host.name",
"operator": "included",
"type": "match_any",
"value": [
"saturn",
"jupiter"
]
}
],
"item_id": "simple_list_item",
"list_id": "simple_list",
"name": "Sample Exception List Item",
"namespace_type": "single",
"os_types": [
"linux"
],
"tags": [
"malware"
],
"type": "simple"
}
]
}
Response examples (200)
[
{
"_version": "WzQsMV0=",
"comments": [],
"created_at": "2025-01-07T20:07:33.119Z",
"created_by": "elastic",
"description": "This is a sample detection type exception item.",
"entries": [
{
"field": "actingProcess.file.signer",
"operator": "excluded",
"type": "exists"
},
{
"field": "host.name",
"operator": "included",
"type": "match_any",
"value": [
"saturn",
"jupiter"
]
}
],
"id": "71a9f4b2-c85c-49b4-866f-c71eb9e67da2",
"item_id": "simple_list_item",
"list_id": "simple_list",
"name": "Sample Exception List Item",
"namespace_type": "single",
"os_types": [
"linux"
],
"tags": [
"malware"
],
"tie_breaker_id": "09434836-9db9-4942-a234-5a9268e0b34c",
"type": "simple",
"updated_at": "2025-01-07T20:07:33.119Z",
"updated_by": "elastic"
}
]
Response examples (400)
Bad payload
{
"error": "Bad Request",
"message": "Invalid request payload JSON format",
"statusCode": 400
}
{
"error": "Bad Request",
"message": "[request params]: id: Invalid uuid",
"statusCode": 400
}
Response examples (401)
{
"error": "Unauthorized",
"message": "[security_exception\\n\\tRoot causes:\\n\\t\\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
"statusCode": 401
}
Response examples (403)
{
"message": "Unable to create exception-list",
"status_code": 403
}
Response examples (500)
{
"message": "Internal Server Error",
"status_code": 500
}