Filter endpoint list exceptions in DE logic#233289
Filter endpoint list exceptions in DE logic#233289nkhristinin merged 15 commits intoelastic:mainfrom
Conversation
|
/ci |
|
/ci |
|
/ci |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
denar50
left a comment
There was a problem hiding this comment.
I tested it locally and it works as expected. LGTM!
| ) | ||
| : lists; | ||
|
|
||
| if (filteredLists.length > 0) { |
There was a problem hiding this comment.
nit: you can do an early return here so the try/catch block is not nested inside the if. It makes the code easier to read.
if (filteredLists.length === 0) {
return [];
}
try {
...
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
Starting backport for target branches: 9.2 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
|
## Summary Related: elastic/security-team#13777 We are filtering endpoint exceptions from DE execution logic. Update tests so that endpoint exceptions don't affect alerts generated right now (they should be excluded on the endpoint) ### How to test: Enable FF - `endpointExceptionsMovedUnderManagement` 1. Install elastic defender (you can click add elastic defend later at the end) - http://localhost:5601/app/security/administration/endpoints <img width="1325" height="650" alt="Screenshot 2025-09-09 at 10 38 13" src="https://github.com/user-attachments/assets/1b642cc8-ec4c-471a-bcd7-5b0086fc2f90" /> 2. Now you should have `Endpoint Security (Elastic Defend)` installed. 3. Let's create 2 events. You can manipulate user.name to check how exceptions works later. ``` POST logs-endpoint.alerts-1/_doc { "event.kind": "alert", "event.module": "endpoint", "event.ingested": "2025-09-09T08:39:55.101Z", "@timestamp": "2025-09-09T08:39:55.101Z", "user.name": "hello1", "host": { "os": { "name": "windows", "type": "windows" } } } POST logs-endpoint.alerts-1/_doc { "event.kind": "alert", "event.module": "endpoint", "event.ingested": "2025-09-09T08:39:55.101Z", "@timestamp": "2025-09-09T08:39:55.101Z", "user.name": "hello2", "host": { "os": { "name": "windows", "type": "windows" } } } ``` 4. For the rule, change the interval/schedule if you need to create alerts more easily. 5. Add endpoint exceptions (windows, and user.name - some value, for example hello1). <img width="1455" height="577" alt="Screenshot 2025-09-09 at 11 13 18" src="https://github.com/user-attachments/assets/ed7e83a2-25bf-4254-8362-5e863ee77e3f" /> -- With FF enabled, we should see 2 alerts generated for `user.name` `hello1` and `hello2`. With FF disabled, the exception should work on the DE side, so you only see 1 alert for `hello2`. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit b1713c3)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `9.2`: - [Filter endpoint list exceptions in DE logic (#233289)](#233289) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Khristinin Nikita","email":"nikita.khristinin@elastic.co"},"sourceCommit":{"committedDate":"2025-10-08T17:01:57Z","message":"Filter endpoint list exceptions in DE logic (#233289)\n\n## Summary\n\nRelated: https://github.com/elastic/security-team/issues/13777\n\nWe are filtering endpoint exceptions from DE execution logic.\n\nUpdate tests so that endpoint exceptions don't affect alerts generated\nright now (they should be excluded on the endpoint)\n\n\n### How to test:\n\nEnable FF - `endpointExceptionsMovedUnderManagement`\n\n1. Install elastic defender (you can click add elastic defend later at\nthe end) - http://localhost:5601/app/security/administration/endpoints\n<img width=\"1325\" height=\"650\" alt=\"Screenshot 2025-09-09 at 10 38 13\"\nsrc=\"https://github.com/user-attachments/assets/1b642cc8-ec4c-471a-bcd7-5b0086fc2f90\"\n/>\n\n2. Now you should have `Endpoint Security (Elastic Defend)` installed.\n\n3. Let's create 2 events. You can manipulate user.name to check how\nexceptions works later.\n\n```\nPOST logs-endpoint.alerts-1/_doc\n{\n \"event.kind\": \"alert\",\n \"event.module\": \"endpoint\",\n \"event.ingested\": \"2025-09-09T08:39:55.101Z\",\n \"@timestamp\": \"2025-09-09T08:39:55.101Z\",\n \"user.name\": \"hello1\",\n \"host\": {\n \"os\": {\n \"name\": \"windows\", \n \"type\": \"windows\" \n }\n }\n}\n\nPOST logs-endpoint.alerts-1/_doc\n{\n \"event.kind\": \"alert\",\n \"event.module\": \"endpoint\",\n \"event.ingested\": \"2025-09-09T08:39:55.101Z\",\n \"@timestamp\": \"2025-09-09T08:39:55.101Z\",\n \"user.name\": \"hello2\",\n \"host\": {\n \"os\": {\n \"name\": \"windows\", \n \"type\": \"windows\" \n }\n }\n}\n```\n\n4. For the rule, change the interval/schedule if you need to create\nalerts more easily.\n\n5. Add endpoint exceptions (windows, and user.name - some value, for\nexample hello1).\n\n<img width=\"1455\" height=\"577\" alt=\"Screenshot 2025-09-09 at 11 13 18\"\nsrc=\"https://github.com/user-attachments/assets/ed7e83a2-25bf-4254-8362-5e863ee77e3f\"\n/>\n\n\n--\n\nWith FF enabled, we should see 2 alerts generated for `user.name`\n`hello1` and `hello2`.\n\nWith FF disabled, the exception should work on the DE side, so you only\nsee 1 alert for `hello2`.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1713c38ba3e4a7b6e99e6c867868ae39045cae1","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:deprecation","backport:version","v9.2.0","v9.3.0"],"title":"Filter endpoint list exceptions in DE logic","number":233289,"url":"https://github.com/elastic/kibana/pull/233289","mergeCommit":{"message":"Filter endpoint list exceptions in DE logic (#233289)\n\n## Summary\n\nRelated: https://github.com/elastic/security-team/issues/13777\n\nWe are filtering endpoint exceptions from DE execution logic.\n\nUpdate tests so that endpoint exceptions don't affect alerts generated\nright now (they should be excluded on the endpoint)\n\n\n### How to test:\n\nEnable FF - `endpointExceptionsMovedUnderManagement`\n\n1. Install elastic defender (you can click add elastic defend later at\nthe end) - http://localhost:5601/app/security/administration/endpoints\n<img width=\"1325\" height=\"650\" alt=\"Screenshot 2025-09-09 at 10 38 13\"\nsrc=\"https://github.com/user-attachments/assets/1b642cc8-ec4c-471a-bcd7-5b0086fc2f90\"\n/>\n\n2. Now you should have `Endpoint Security (Elastic Defend)` installed.\n\n3. Let's create 2 events. You can manipulate user.name to check how\nexceptions works later.\n\n```\nPOST logs-endpoint.alerts-1/_doc\n{\n \"event.kind\": \"alert\",\n \"event.module\": \"endpoint\",\n \"event.ingested\": \"2025-09-09T08:39:55.101Z\",\n \"@timestamp\": \"2025-09-09T08:39:55.101Z\",\n \"user.name\": \"hello1\",\n \"host\": {\n \"os\": {\n \"name\": \"windows\", \n \"type\": \"windows\" \n }\n }\n}\n\nPOST logs-endpoint.alerts-1/_doc\n{\n \"event.kind\": \"alert\",\n \"event.module\": \"endpoint\",\n \"event.ingested\": \"2025-09-09T08:39:55.101Z\",\n \"@timestamp\": \"2025-09-09T08:39:55.101Z\",\n \"user.name\": \"hello2\",\n \"host\": {\n \"os\": {\n \"name\": \"windows\", \n \"type\": \"windows\" \n }\n }\n}\n```\n\n4. For the rule, change the interval/schedule if you need to create\nalerts more easily.\n\n5. Add endpoint exceptions (windows, and user.name - some value, for\nexample hello1).\n\n<img width=\"1455\" height=\"577\" alt=\"Screenshot 2025-09-09 at 11 13 18\"\nsrc=\"https://github.com/user-attachments/assets/ed7e83a2-25bf-4254-8362-5e863ee77e3f\"\n/>\n\n\n--\n\nWith FF enabled, we should see 2 alerts generated for `user.name`\n`hello1` and `hello2`.\n\nWith FF disabled, the exception should work on the DE side, so you only\nsee 1 alert for `hello2`.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1713c38ba3e4a7b6e99e6c867868ae39045cae1"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/233289","number":233289,"mergeCommit":{"message":"Filter endpoint list exceptions in DE logic (#233289)\n\n## Summary\n\nRelated: https://github.com/elastic/security-team/issues/13777\n\nWe are filtering endpoint exceptions from DE execution logic.\n\nUpdate tests so that endpoint exceptions don't affect alerts generated\nright now (they should be excluded on the endpoint)\n\n\n### How to test:\n\nEnable FF - `endpointExceptionsMovedUnderManagement`\n\n1. Install elastic defender (you can click add elastic defend later at\nthe end) - http://localhost:5601/app/security/administration/endpoints\n<img width=\"1325\" height=\"650\" alt=\"Screenshot 2025-09-09 at 10 38 13\"\nsrc=\"https://github.com/user-attachments/assets/1b642cc8-ec4c-471a-bcd7-5b0086fc2f90\"\n/>\n\n2. Now you should have `Endpoint Security (Elastic Defend)` installed.\n\n3. Let's create 2 events. You can manipulate user.name to check how\nexceptions works later.\n\n```\nPOST logs-endpoint.alerts-1/_doc\n{\n \"event.kind\": \"alert\",\n \"event.module\": \"endpoint\",\n \"event.ingested\": \"2025-09-09T08:39:55.101Z\",\n \"@timestamp\": \"2025-09-09T08:39:55.101Z\",\n \"user.name\": \"hello1\",\n \"host\": {\n \"os\": {\n \"name\": \"windows\", \n \"type\": \"windows\" \n }\n }\n}\n\nPOST logs-endpoint.alerts-1/_doc\n{\n \"event.kind\": \"alert\",\n \"event.module\": \"endpoint\",\n \"event.ingested\": \"2025-09-09T08:39:55.101Z\",\n \"@timestamp\": \"2025-09-09T08:39:55.101Z\",\n \"user.name\": \"hello2\",\n \"host\": {\n \"os\": {\n \"name\": \"windows\", \n \"type\": \"windows\" \n }\n }\n}\n```\n\n4. For the rule, change the interval/schedule if you need to create\nalerts more easily.\n\n5. Add endpoint exceptions (windows, and user.name - some value, for\nexample hello1).\n\n<img width=\"1455\" height=\"577\" alt=\"Screenshot 2025-09-09 at 11 13 18\"\nsrc=\"https://github.com/user-attachments/assets/ed7e83a2-25bf-4254-8362-5e863ee77e3f\"\n/>\n\n\n--\n\nWith FF enabled, we should see 2 alerts generated for `user.name`\n`hello1` and `hello2`.\n\nWith FF disabled, the exception should work on the DE side, so you only\nsee 1 alert for `hello2`.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1713c38ba3e4a7b6e99e6c867868ae39045cae1"}}]}] BACKPORT--> Co-authored-by: Khristinin Nikita <nikita.khristinin@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
|
Hi! This PR has a
If the change should not be listed in the release notes, please use the If this helps, we have a page describing release notes best practices for PRs (Elastic access only) |
## Summary Related: elastic/security-team#13777 We are filtering endpoint exceptions from DE execution logic. Update tests so that endpoint exceptions don't affect alerts generated right now (they should be excluded on the endpoint) ### How to test: Enable FF - `endpointExceptionsMovedUnderManagement` 1. Install elastic defender (you can click add elastic defend later at the end) - http://localhost:5601/app/security/administration/endpoints <img width="1325" height="650" alt="Screenshot 2025-09-09 at 10 38 13" src="https://github.com/user-attachments/assets/1b642cc8-ec4c-471a-bcd7-5b0086fc2f90" /> 2. Now you should have `Endpoint Security (Elastic Defend)` installed. 3. Let's create 2 events. You can manipulate user.name to check how exceptions works later. ``` POST logs-endpoint.alerts-1/_doc { "event.kind": "alert", "event.module": "endpoint", "event.ingested": "2025-09-09T08:39:55.101Z", "@timestamp": "2025-09-09T08:39:55.101Z", "user.name": "hello1", "host": { "os": { "name": "windows", "type": "windows" } } } POST logs-endpoint.alerts-1/_doc { "event.kind": "alert", "event.module": "endpoint", "event.ingested": "2025-09-09T08:39:55.101Z", "@timestamp": "2025-09-09T08:39:55.101Z", "user.name": "hello2", "host": { "os": { "name": "windows", "type": "windows" } } } ``` 4. For the rule, change the interval/schedule if you need to create alerts more easily. 5. Add endpoint exceptions (windows, and user.name - some value, for example hello1). <img width="1455" height="577" alt="Screenshot 2025-09-09 at 11 13 18" src="https://github.com/user-attachments/assets/ed7e83a2-25bf-4254-8362-5e863ee77e3f" /> -- With FF enabled, we should see 2 alerts generated for `user.name` `hello1` and `hello2`. With FF disabled, the exception should work on the DE side, so you only see 1 alert for `hello2`. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Related: elastic/security-team#13777 We are filtering endpoint exceptions from DE execution logic. Update tests so that endpoint exceptions don't affect alerts generated right now (they should be excluded on the endpoint) ### How to test: Enable FF - `endpointExceptionsMovedUnderManagement` 1. Install elastic defender (you can click add elastic defend later at the end) - http://localhost:5601/app/security/administration/endpoints <img width="1325" height="650" alt="Screenshot 2025-09-09 at 10 38 13" src="https://github.com/user-attachments/assets/1b642cc8-ec4c-471a-bcd7-5b0086fc2f90" /> 2. Now you should have `Endpoint Security (Elastic Defend)` installed. 3. Let's create 2 events. You can manipulate user.name to check how exceptions works later. ``` POST logs-endpoint.alerts-1/_doc { "event.kind": "alert", "event.module": "endpoint", "event.ingested": "2025-09-09T08:39:55.101Z", "@timestamp": "2025-09-09T08:39:55.101Z", "user.name": "hello1", "host": { "os": { "name": "windows", "type": "windows" } } } POST logs-endpoint.alerts-1/_doc { "event.kind": "alert", "event.module": "endpoint", "event.ingested": "2025-09-09T08:39:55.101Z", "@timestamp": "2025-09-09T08:39:55.101Z", "user.name": "hello2", "host": { "os": { "name": "windows", "type": "windows" } } } ``` 4. For the rule, change the interval/schedule if you need to create alerts more easily. 5. Add endpoint exceptions (windows, and user.name - some value, for example hello1). <img width="1455" height="577" alt="Screenshot 2025-09-09 at 11 13 18" src="https://github.com/user-attachments/assets/ed7e83a2-25bf-4254-8362-5e863ee77e3f" /> -- With FF enabled, we should see 2 alerts generated for `user.name` `hello1` and `hello2`. With FF disabled, the exception should work on the DE side, so you only see 1 alert for `hello2`. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…o add endpoint exceptions to rule execution (elastic#242480) ## Summary Conditionally render endpoint exceptions UI checkbox under "About Rule" advanced settings. UI change related to: elastic#233289 (cherry picked from commit 98685d9)
…o add endpoint exceptions to rule execution (elastic#242480) ## Summary Conditionally render endpoint exceptions UI checkbox under "About Rule" advanced settings. UI change related to: elastic#233289
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
Related: https://github.com/elastic/security-team/issues/13777
We are filtering endpoint exceptions from DE execution logic.
Update tests so that endpoint exceptions don't affect alerts generated right now (they should be excluded on the endpoint)
How to test:
Enable FF -
endpointExceptionsMovedUnderManagementNow you should have
Endpoint Security (Elastic Defend)installed.Let's create 2 events. You can manipulate user.name to check how exceptions works later.
For the rule, change the interval/schedule if you need to create alerts more easily.
Add endpoint exceptions (windows, and user.name - some value, for example hello1).
--
With FF enabled, we should see 2 alerts generated for
user.namehello1andhello2.With FF disabled, the exception should work on the DE side, so you only see 1 alert for
hello2.