You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Detection Engine] Remove Endpoint List bootstrap calls from Rule-related routes (elastic#258266)
## Summary
This PR removes two calls to `createEndpointList()` from rule-related
code paths. [PR elastic#233289](elastic#233289)
removed the use of endpoint exceptions in rules, so ensuring the
endpoint list exists in these rule routes is no longer required.
Dropping these calls fixes a 9.3 issue where users with **only** the
Rules Kibana feature could not preview rules, because the routes were
invoking `createEndpointList()`, which depended on list/exception
permissions those users do not have. The problem was first seen on the
Alerts RBAC branch but affects current 9.3 behavior.
### Expected behavior for rules that reference an endpoint exception
list
- **Until the feature flag is enabled/removed:** Rules keep using any
associated endpoint exception list when the
`endpointExceptionsMovedUnderManagement` feature flag is off. No change
to that behavior.
- **When the user cannot read the endpoint exception list:** Endpoint
exceptions are ignored (no error). Rule creation and preview succeed;
only endpoint exception list items are skipped for that execution. A new
integration test under `create_rules` covers this: a user with only the
Rules feature can create and preview a rule that references the endpoint
exception list, and the preview completes successfully with no errors
while endpoint exceptions are ignored.
---
## How to Review
1. **Feature flag and execution:** Ensure rule execution and
`getExceptions` still respect `endpointExceptionsMovedUnderManagement`
(endpoint lists filtered out when the flag is on) and that missing read
permission for the endpoint list results in endpoint exceptions being
ignored, not in failures.
1. **New integration test:** Run the new test that uses a role with only
the Rules feature (e.g. `rulesAllPreviewIndexRole`), creates a rule that
references the endpoint exception list, and runs a rule preview. It
should pass and assert that the preview returns no errors (validating
that endpoint exceptions are ignored when the user cannot read the
endpoint list).
1. **Regression:** Run the existing detections/rule creation and
prebuilt-rule installation tests to confirm no regressions from removing
`createEndpointList()`.
### Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Copy file name to clipboardExpand all lines: x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.ts
Copy file name to clipboardExpand all lines: x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts
Copy file name to clipboardExpand all lines: x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/basic_license_essentials_tier/find_rule_exception_references.ts
Copy file name to clipboardExpand all lines: x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_preview/preview_rules.ts
'Missing "read" privileges for the ".preview.alerts-security.alerts" or ".internal.preview.alerts-security.alerts" indices. Without these privileges you cannot use the Rule Preview feature.',
Copy file name to clipboardExpand all lines: x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/create_rules.ts
Copy file name to clipboardExpand all lines: x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/utils/auth/roles.ts
Copy file name to clipboardExpand all lines: x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/alerts_table_flow/endpoint_exceptions.cy.ts
Copy file name to clipboardExpand all lines: x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/shared_exception_lists_management/shared_exception_list_page/filter_table.cy.ts
Copy file name to clipboardExpand all lines: x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/shared_exception_lists_management/shared_exception_list_page/manage_lists.cy.ts
0 commit comments