Skip to content

[Response Ops][Alerting] Add additional features to alerting rules#252703

Merged
denar50 merged 41 commits intoelastic:mainfrom
denar50:expose-permission-on-rules-to-modify-gap-autofill-scheduler
Mar 6, 2026
Merged

[Response Ops][Alerting] Add additional features to alerting rules#252703
denar50 merged 41 commits intoelastic:mainfrom
denar50:expose-permission-on-rules-to-modify-gap-autofill-scheduler

Conversation

@denar50
Copy link
Copy Markdown
Contributor

@denar50 denar50 commented Feb 11, 2026

If you're here because your Kibana feature suddenly changed...

That is happening because this PR is extracting features from alerting.rule.all, namely enable, manual_run and manage_rule_settings (see this change). Your role had alerting.rule.all, so I added the rest of the features to it to ensure backwards compatibility. If you think your Kibana feature doesn't need any of those, you're welcome to remove them in a follow up PR.

Summary

ResposneOps previously created two alerting features on rules SOs in this PR: enable and manual_run, in order to enable the RBAC efforts in the Detection Engine.

Now we are introducing a sub feature within the Rules feature inside the security solution to grant access to "rule settings management" which comprises the ability to manage the gap fill schedulers (see the ticket here).

However we encountered that there is no alerting privilege for rules that matches this new Kibana sub feature.
Additionally we found that the existing alerting.rule.all feature does not allow us to toggle privileges off once it is granted (see the video below where we are able to bypass rules rbac permissions by calling an endpoint that performs authorization using only alerting privileges)

rule-subfeature-issue.mov

Therefore this PR :

  • introduces a new feature called manage_rule_settings feature for rule SOs in the alerting framework based on the previous PR.
  • fixes the issue where users with alerting.rule.all will always have all permissions of subfeatures even when they are explicitly toggled off through the Kibana Security role management UI.
    This is done by extracting the new alerting features from alerting.rule.all into their own features. This triggers a change in all existing Kibana features that previously included alerting.rule.all since now we will have to explicitly add enable, manual_run and manage_rule_settings in those places.

How was this tested?

I put these commits on top of my branch where I have the "Rules management settings" sub feature which is using the alerting feature provided in this PR.

manage_rule_settings

I create a role with read only access to the rule feature and only this sub feature enable. I am then able to create operate the gap fill scheduler. See the video below 👇

alerts-rbac-test.mov

Issue with alerting.rule.all

I created a role that has all the permissions for rules, I toggled off enable and then tried to reproduce the issue I previously recorded.

alert.rule.all.fixed.mov

@elastic elastic deleted a comment from elasticmachine Feb 11, 2026
@elastic elastic deleted a comment from elasticmachine Feb 12, 2026
@denar50 denar50 force-pushed the expose-permission-on-rules-to-modify-gap-autofill-scheduler branch from d716807 to 699c3aa Compare February 12, 2026 14:49
@denar50 denar50 marked this pull request as ready for review February 12, 2026 19:14
@denar50 denar50 requested review from a team as code owners February 12, 2026 19:14
@denar50 denar50 self-assigned this Feb 12, 2026
@denar50 denar50 added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Feb 12, 2026
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner February 13, 2026 12:35
@botelastic botelastic bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label Feb 13, 2026
@elastic elastic deleted a comment from elasticmachine Feb 16, 2026
@darnautov darnautov self-requested a review February 17, 2026 10:29
@darnautov darnautov added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:fix labels Mar 3, 2026
@darnautov
Copy link
Copy Markdown
Contributor

I think we should also update x-pack/solutions/observability/plugins/observability/server/features/logs_feature.ts and x-pack/platform/plugins/shared/ml/common/types/capabilities.ts?

@denar50 denar50 requested review from a team as code owners March 3, 2026 13:14
},
},
};

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.

Let's add a user with "all" on alertsFixture but with the manual_run sub-feature excluded. And use it to assert alerting.rule.all no longer implicitly grants sub-features

Suggested change
export const AllWithoutManualRunUser: User = {
username: 'all_without_manual_run',
fullName: 'all_without_manual_run',
password: 'all_without_manual_run-password',
role: {
name: 'all_without_manual_run_role',
kibana: [
{
feature: {
actions: ['all'],
alertsFixture: ['minimal_all', 'enable_disable', 'manage_rule_settings'],
},
spaces: ['space1'],
},
],
elasticsearch: {
indices: [
{
names: [`${ES_TEST_INDEX_NAME}*`],
privileges: ['all'],
},
],
},
},
};

then you can updates other tests like create_gap_auto_fill_scheduler.ts, update_gap_autp_fill_scheduler.ts etc, with assertions like "denies manual backfill scheduling when manual_run sub-feature is disabled"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

manage_rule_settings has permissions to trigger backfills though. I added two new users: one without any backfill permissions (manual_run and manage_rule_settings) and another without manage_rule_settings, and updated the tests related to gaps.

denar50 added 3 commits March 4, 2026 13:33
In order to verify that roles without explicit backfill features are denied even when they have alerting.rule.all
Copy link
Copy Markdown
Member

@gsoldevila gsoldevila left a comment

Choose a reason for hiding this comment

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

Core changes LGTM

Copy link
Copy Markdown
Contributor

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Contributor

@consulthys consulthys left a comment

Choose a reason for hiding this comment

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

LGT Stack Monitoring

Copy link
Copy Markdown
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@benakansara benakansara left a comment

Choose a reason for hiding this comment

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

actionable-obs changes LGTM

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 - unrelated to this PR but the @elastic/security-threat-hunting-investigations team is set as the only codeowners for the path x-pack/solutions/security/packages/features which I don't think is correct. We should split that up based on feature ownership, or add all the teams with features in the security solution as codeowners to that same path.

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout: [ platform / navigation ] plugin / local-serverless-security_complete - navigation - opens panel on legacy management landing page

Metrics [docs]

✅ unchanged

History

cc @denar50

Copy link
Copy Markdown
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

Code LGTM

@denar50 denar50 merged commit eed0992 into elastic:main Mar 6, 2026
18 checks passed
kapral18 pushed a commit to kapral18/kibana that referenced this pull request Mar 9, 2026
…lastic#252703)

# If you're here because your Kibana feature suddenly changed...
That is happening because this PR is extracting features from
`alerting.rule.all`, namely `enable`, `manual_run` and
`manage_rule_settings` (see [this
change](https://github.com/elastic/kibana/pull/252703/changes#diff-dc097e1e414af2ca21196b12c7d901373108da58de4dd7505cc169b0e62ec2d3L75)).
Your role had `alerting.rule.all`, so I added the rest of the features
to it to ensure backwards compatibility. If you think your Kibana
feature doesn't need any of those, you're welcome to remove them in a
follow up PR.
# Summary
ResposneOps previously created two alerting features on rules SOs in
[this PR](elastic#237526): `enable` and
`manual_run`, in order to enable the RBAC efforts in the Detection
Engine.

Now we are introducing a sub feature within the Rules feature inside the
security solution to grant access to "rule settings management" which
comprises the ability to manage the gap fill schedulers (see the ticket
[here](elastic/security-team#15244)).

However we encountered that there is no alerting privilege for rules
that matches this new Kibana sub feature.
Additionally we found that the existing `alerting.rule.all` feature does
not allow us to toggle privileges off once it is granted (see the video
below where we are able to bypass rules rbac permissions by calling an
endpoint that performs authorization using only alerting privileges)


https://github.com/user-attachments/assets/de2a38cd-259e-48aa-b1f2-a38c88f2de88

Therefore this PR :
- introduces a new feature called `manage_rule_settings` feature for
rule SOs in the alerting framework based on the previous PR.
- fixes the issue where users with `alerting.rule.all` will always have
all permissions of subfeatures even when they are explicitly toggled off
through the Kibana Security role management UI.
This is done by extracting the new alerting features from
`alerting.rule.all` into their own features. This triggers a change in
all existing Kibana features that previously included
`alerting.rule.all` since now we will have to explicitly add `enable`,
`manual_run` and `manage_rule_settings` in those places.

# How was this tested?
I put these commits on top of my branch where I have the "Rules
management settings" sub feature which is using the alerting feature
provided in this PR.

## `manage_rule_settings`
I create a role with read only access to the rule feature and only this
sub feature enable. I am then able to create operate the gap fill
scheduler. See the video below 👇



https://github.com/user-attachments/assets/2bc285a4-d35a-412c-a9fd-2153fdec1b9e


## Issue with `alerting.rule.all`
I created a role that has all the permissions for rules, I toggled off
`enable` and then tried to reproduce the issue I previously recorded.


https://github.com/user-attachments/assets/42d47fbf-5dd0-47ff-8f04-2a8f1c0591f9

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 11, 2026
…lastic#252703)

# If you're here because your Kibana feature suddenly changed...
That is happening because this PR is extracting features from
`alerting.rule.all`, namely `enable`, `manual_run` and
`manage_rule_settings` (see [this
change](https://github.com/elastic/kibana/pull/252703/changes#diff-dc097e1e414af2ca21196b12c7d901373108da58de4dd7505cc169b0e62ec2d3L75)).
Your role had `alerting.rule.all`, so I added the rest of the features
to it to ensure backwards compatibility. If you think your Kibana
feature doesn't need any of those, you're welcome to remove them in a
follow up PR.
# Summary
ResposneOps previously created two alerting features on rules SOs in
[this PR](elastic#237526): `enable` and
`manual_run`, in order to enable the RBAC efforts in the Detection
Engine.

Now we are introducing a sub feature within the Rules feature inside the
security solution to grant access to "rule settings management" which
comprises the ability to manage the gap fill schedulers (see the ticket
[here](elastic/security-team#15244)).

However we encountered that there is no alerting privilege for rules
that matches this new Kibana sub feature.
Additionally we found that the existing `alerting.rule.all` feature does
not allow us to toggle privileges off once it is granted (see the video
below where we are able to bypass rules rbac permissions by calling an
endpoint that performs authorization using only alerting privileges)


https://github.com/user-attachments/assets/de2a38cd-259e-48aa-b1f2-a38c88f2de88

Therefore this PR :
- introduces a new feature called `manage_rule_settings` feature for
rule SOs in the alerting framework based on the previous PR.
- fixes the issue where users with `alerting.rule.all` will always have
all permissions of subfeatures even when they are explicitly toggled off
through the Kibana Security role management UI.
This is done by extracting the new alerting features from
`alerting.rule.all` into their own features. This triggers a change in
all existing Kibana features that previously included
`alerting.rule.all` since now we will have to explicitly add `enable`,
`manual_run` and `manage_rule_settings` in those places.

# How was this tested?
I put these commits on top of my branch where I have the "Rules
management settings" sub feature which is using the alerting feature
provided in this PR.

## `manage_rule_settings`
I create a role with read only access to the rule feature and only this
sub feature enable. I am then able to create operate the gap fill
scheduler. See the video below 👇



https://github.com/user-attachments/assets/2bc285a4-d35a-412c-a9fd-2153fdec1b9e


## Issue with `alerting.rule.all`
I created a role that has all the permissions for rules, I toggled off
`enable` and then tried to reproduce the issue I previously recorded.


https://github.com/user-attachments/assets/42d47fbf-5dd0-47ff-8f04-2a8f1c0591f9

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
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 release_note:skip Skip the PR/issue when compiling release notes Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation Team:obs-ux-management Team:One Workflow Team label for One Workflow (Workflow automation) v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.