Skip to content

[Detection Engine] Extracts Rules/Alerts/Exceptions permission to new Rules feature privileges#239634

Merged
rylnd merged 84 commits intoelastic:mainfrom
rylnd:rules-rbac-new
Dec 8, 2025
Merged

[Detection Engine] Extracts Rules/Alerts/Exceptions permission to new Rules feature privileges#239634
rylnd merged 84 commits intoelastic:mainfrom
rylnd:rules-rbac-new

Conversation

@rylnd
Copy link
Copy Markdown
Contributor

@rylnd rylnd commented Oct 17, 2025

Note: this is a rewritten copy of the changes in #232113. Initial feedback and conversation can be found there.

Epic: https://github.com/elastic/security-team/issues/8799

Added a new Rules feature that controls access to:

  1. Detection rules
  2. Alerts
  3. Rule exceptions

In the first iteration, Rules feature doesn't allow more granular customization of a user's role as described in https://github.com/elastic/security-team/issues/8799. Granular controls will be extracted from the Rules feature as sub-features in future iterations.

Note also that this PR does not update existing prebuilt/test roles, as per this suggestion. That work is contained in a followup PR, which will be merged subsequent to this one.

How to test this PR

The extraction of the Rules feature from SIEM opens several new possibilities to configure roles.

Rule: none

image

This role configuration allows access to the rest of Security Solution without access to Detection Rules and Alerts.

  • Rules menu item is visible to the users, no Detection rules (SIEM), no Shared exceptions lists items in the menu. Benchmark rules and Migrations should still be accessible.
  • Users should not be able to access any rule page directly
  • Users cannot access the Alerts page, Alerts menu is hidden
  • No coverage page
  • Detection rule monitoring dashboard - depends on access to the .kibana-event-log-* - should not be visible to user
  • No security rules shown in Stack management -> Rules
  • For the security setup guide (Getting started) - no rule setup will be possible

Rule: read

This role configuration should allow users to read rules and visit any rule pages but without the ability to edit rules, alerts, or exceptions.

The minimal Kibana feature configuration:

image

Required index privileges:

image
  • Rule details page:
    • No action snoozing option,
    • No edit rule settings button or actions menu
    • “Enable” control is not editable
    • Export should be possible
  • In the rules table (Installed rules and Rules Monitoring tables):
    • Bulk actions: only Export option is present
    • “Enable” control is not editable
    • No action snoozing option
    • No edit rule settings button or actions menu
    • No “Create new rule” button
    • No “Import rule” button
  • “Add elastic rules” page:
    • No “Install rule” link
    • No “Install all” button
    • No install rule buttons/or greyed out on the rule flyout.
  • Rule Updates tab
    • No Update all, individual rule updates
    • On the update flyout - only option to Close, not Update button
  • Stack management Rules
    • Should not be possible to modify the security rules from there

Rule: all

This role configurration should have access to rules, alerts, and exceptions without limitations.

image image
  • Ability to create, import, edit, update and delete rules.
  • Rules write access, the user will be able to see rules and details and edit all rule details.

Testing Utils

Testing configs and scripts This bash script will add/update the kibana roles defined in the config.yml file into your local instance. Usernames will be the same as the role titles and all passwords are set to a default `changeme`

Additional areas to test

  • Old role configuration (siemV3) should work correctly. Roles created prior to this PR with siemV3:all should map to siemV4:all + rules:all. Roles with siemV3:read to siemV4:read and rules:read.
  • Serverless with predefined roles
  • Check the AI4SOC tier for regressions

PR Handoff TODOs

Release Note

Rules feature privileges are added to ESS. Access to Rules may now be explicitly set on both ESS and Serverless for user roles.

Docs Issue

@kibanamachine
Copy link
Copy Markdown
Contributor

Project deployed, see credentials at: https://buildkite.com/elastic/kibana-deploy-project-from-pr/builds/680

@logeekal

This comment was marked as resolved.

@e40pud
Copy link
Copy Markdown
Contributor

e40pud commented Oct 23, 2025

Mentioned this in the slack, we want to keep current behaviour that allows alerts modifying when "Security" set to "Read", meaning user should be able to modify alerts with the new "Rules" kibana privilege set to "Read".

Right now I'm getting this error:

Screenshot 2025-10-23 at 16 07 56

@rylnd rylnd added ci:cloud-redeploy Always create a new Cloud deployment ci:cloud-persist-deployment Persist cloud deployment indefinitely and removed ci:cloud-deploy Create or update a Cloud deployment ci:project-deploy-security Create a Security Serverless Project labels Oct 23, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Cloud deployment initiated, see credentials at: https://buildkite.com/elastic/kibana-deploy-cloud-from-pr/builds/506

@denar50
Copy link
Copy Markdown
Contributor

denar50 commented Oct 24, 2025

@logeekal thanks for the testing!
I have pushed a commit that fixes the permissions for the onboardings. So you should be able to see them now when only having rules read.

rylnd and others added 9 commits October 29, 2025 16:12
This does not include changes to existing roles, nor the role migration
machinery.
These changes were made automatically in an initial commit that added
our new features to roles; those changes have since been reverted
(320c34f), and thus there should not currently be any behavioral
changes in these files, which makes these stylistic changes even more
unnecessary.

Note: I also noticed that a few old references had (accidentally?)
remained in `security_roles.json` after `320c34f485`; this cleans those
up as well.
Instead of requiring siemVX read/all, it now requires securitySolutionRulesV1 read/all
It is unclear on wether "dashboards" and "integrations" should be exclusive to `siemV5` or `securitySolutionRulesV1`. So for now we are showing it when the user has either of those.
Now it requires the `securitySolutionRulesV1.all` privilege
@e40pud
Copy link
Copy Markdown
Contributor

e40pud commented Dec 3, 2025

@sdesalas

This is moving inside /public/detections/components (instead of /public/common/components) .

The MissingPrivilegesCallOut is not moving anywhere it is still inside the /public/common/components (here is the code).

There is a new component for detections missing privileges that added inside the /public/detections/components (here is the code).

@rylnd
Copy link
Copy Markdown
Contributor Author

rylnd commented Dec 3, 2025

@sdesalas @e40pud thanks for the heads up! I merged those changes in here and tested a few permutations of missing privileges. Things still look/behave as expected on our end 👍 :

Screenshot 2025-12-03 at 11 40 34 AM

Copy link
Copy Markdown
Contributor

@MichelLosier MichelLosier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for fleet

Copy link
Copy Markdown
Contributor

@pborgonovi pborgonovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@denar50 @rylnd @dplumlee
I've been doing extensive tests since draft PR thus I'm approving it from Sec Eng Prod end.

Copy link
Copy Markdown
Contributor

@logeekal logeekal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for incorporating all the changes from Automatic Migrations. I tested in ECH with all combinations of Dashboards and Rules Privileges and Automatic Migrations is working as expected.

Copy link
Copy Markdown
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I appreciate the e2e privilege testing strategy 👍

Copy link
Copy Markdown
Contributor

@dhurley14 dhurley14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for carrying this through @rylnd @denar50 @dplumlee.

INITIALIZE_SECURITY_SOLUTION,
],
savedObject: {
all: ['alert', ...savedObjects],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a future investigation:

In every siem feature we include 'alert' in the savedObject: all but skip it in the read privilege. I'm wondering if the addition of the 'alert' SO is redundant because that SO access is controlled via the alerting: { rule: ... feature? cc: @ymao1

 Conflicts:
	x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx
	x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts
	x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts
	x-pack/solutions/security/test/serverless/api_integration/test_suites/platform_security/authorization.ts
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Dec 8, 2025

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 8476 8477 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/security-solution-features 30 31 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 11.1MB 11.1MB -1.0KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/security-solution-features 10 11 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 169.6KB 170.1KB +526.0B
securitySolutionEss 34.4KB 34.5KB +59.0B
securitySolutionServerless 46.1KB 46.2KB +55.0B
total +640.0B
Unknown metric groups

API count

id before after diff
@kbn/security-solution-features 36 37 +1

History

cc @rylnd @denar50 @dplumlee

@rylnd rylnd merged commit 6647f81 into elastic:main Dec 8, 2025
13 checks passed
@rylnd rylnd added the Feature:Detection Alerts/Rules RBAC Security Solution RBAC for rules and alerts label Dec 8, 2025
mbondyra added a commit to mbondyra/kibana that referenced this pull request Dec 8, 2025
* commit '6647f813c9fa03ac0378e3d4756246e8dc4b4c76': (33 commits)
  [Detection Engine] Extracts Rules/Alerts/Exceptions permission to new Rules feature privileges (elastic#239634)
  [Agent Builder] Add Intro Tour (elastic#245551)
  Add datastream lifecycle support to indices metadata (elastic#245548)
  [Serverless] Update preconfigured connectors (elastic#245445)
  [Metrics][Discover] Discover to prefer line chars for time series data (elastic#244595)
  Update dependency @elastic/ebt to ^1.4.1 (main) (elastic#241629)
  [One Workflow] fix: request bodies with oneof schemas (`kibana.SetAlertsStatus`, etc) (elastic#245344)
  Update dependency ai to v5 (elastic#244675)
  Fix Discover trace waterfall behavior with duplicate spans (elastic#244984)
  [FSH] Migrated fs usage to kbn/fs for sample ingest (elastic#244163)
  Streamlang: Unskip type coercion test (elastic#245519)
  [Response Ops][Reporting] Fixing error in calculating delay value between retries (elastic#245431)
  Add TopNavMenuBeta to navigation plugin (elastic#243578)
  [scout] support custom servers configuration (elastic#244306)
  [Fleet] Run agentless background sync without dry run (elastic#245286)
  Fix Change Password Flaky Test (elastic#245443)
  Add new gap fill status for rules (elastic#242595)
  [Kibana Search] Move SLOs higher up in search results (elastic#245518)
  feat(slo): introduce find SLO instances internal route (elastic#245333)
  [FSH] Dropped unnecessary `fs` persistence for synthetics project code (elastic#244338)
  ...
@rylnd rylnd mentioned this pull request Dec 10, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting ci:cloud-persist-deployment Persist cloud deployment indefinitely ci:cloud-redeploy Always create a new Cloud deployment Feature:Detection Alerts/Rules RBAC Security Solution RBAC for rules and alerts release_note:feature Makes this part of the condensed release notes Team:Detection Engine Security Solution Detection Engine Area Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team:Fleet Team label for Observability Data Collection Fleet team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.