Skip to content

[AI4DSOC] Add possibility to disable Stack Rules, Rules Settings and Maintenance window based on Serverless Tier#214586

Merged
tomsonpl merged 25 commits intoelastic:mainfrom
tomsonpl:hide-alerting-features
Apr 22, 2025
Merged

[AI4DSOC] Add possibility to disable Stack Rules, Rules Settings and Maintenance window based on Serverless Tier#214586
tomsonpl merged 25 commits intoelastic:mainfrom
tomsonpl:hide-alerting-features

Conversation

@tomsonpl
Copy link
Copy Markdown
Contributor

@tomsonpl tomsonpl commented Mar 14, 2025

Description

Disable Rules Settings, Maintenance Window, and Rules UI in Search AI Lake Tier (AI for the SOC product).

This PR adds configuration options to disable Rules Settings, Maintenance Window, and Rules UI in the Search AI Lake tier. These changes are part of the effort to streamline the feature set available in this specific tier.


Changes

  • Added configuration flags in serverless.security.search_ai_lake.yml:

    xpack.alerting.maintenanceWindow.enabled: false
    xpack.alerting.rulesSettings.enabled: false
    xpack.trigger_actions_ui.rules.enabled: false
  • Modified the alerting plugin to support enabling/disabling rule settings and maintenance window features

  • Modified the triggers_actions_ui plugin to support enabling/disabling the Stack Rules UI


Testing

  • Verified that when these settings are disabled in the Search AI Lake tier:
    • Maintenance Window UI is not accessible
    • Stack Rules is not registered in the management section
    • Rules Settings UI is not accessible (can this exist without Stack Rules) ?

Please add the following configuration to your serverless.security.dev.yml file:

xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]

Closes: https://github.com/elastic/security-team/issues/12099
Closes: https://github.com/elastic/security-team/issues/12100

Partially Closes: https://github.com/elastic/security-team/issues/12396

@tomsonpl tomsonpl self-assigned this Mar 14, 2025
@tomsonpl
Copy link
Copy Markdown
Contributor Author

/ci

@tomsonpl
Copy link
Copy Markdown
Contributor Author

/ci

@tomsonpl
Copy link
Copy Markdown
Contributor Author

/ci

@tomsonpl
Copy link
Copy Markdown
Contributor Author

tomsonpl commented Apr 2, 2025

/ci

@tomsonpl tomsonpl marked this pull request as ready for review April 2, 2025 15:13
@tomsonpl tomsonpl requested review from a team as code owners April 2, 2025 15:13
@tomsonpl tomsonpl added release_note:skip Skip the PR/issue when compiling release notes Team:Security Generative AI Security Generative AI backport:version Backport to applied version labels v9.1.0 labels Apr 2, 2025
Comment on lines +5 to +6
xpack.alerting.maintenanceWindow.enabled: false
xpack.alerting.rulesSettings.enabled: false
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.

note: If I understand correctly these two entries don't disable plugins, they look more like feature flags of the alerting plugin that's enabled, so maybe you should place them under something other than the ## Disable plugins section?

I know we don't do this frequently, but it'd super helpful to future readers if the comments in the config file would clarify why exactly you set what you set.

Copy link
Copy Markdown
Contributor Author

@tomsonpl tomsonpl Apr 4, 2025

Choose a reason for hiding this comment

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

Hmm, do you mean something like ## Disable features next to plugins? Since these 2 are part of a plugin's features and not a plugin itself?

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.

Added a comment :) Thanks @azasypkin !

@pmuellr
Copy link
Copy Markdown
Contributor

pmuellr commented Apr 4, 2025

@cnasikas I'm wondering a couple things regarding not registering the feature:

  • do we have other scenarios where we don't register certain features? I'm not sure we do, and wondering what the effects would be
  • how will routes respond when the feature is not enabled? There's nothing directly here about the routes, so I assume you can still use them, but wondering what's going to happen. I think ideally, the routes would all respond with a "not authorized" sort of response (feels like and looks like that's what it should/will do)
  • I think we probably want a FT for this scenario to make sure we get the right response for MW and settings when the features are disabled; I think hitting a single API for each is fine, presumably we have auth tests for all this anyway so one API should be good enough to test for this scenario
  • BWC / ZDT issues - there doesn't seem to be any issues of that sort directly in this code, but where we run into issues with config changes is when older versions end up seeing new config - like kibana controller adding settings before all the running kibanas can accept the change. I think if the changes to use these new settings are confined to config/serverless.security.search_ai_lake.yml and nowhere outside of Kibana (eg, the controller), we should be good.

@tomsonpl - could you try using some of the mw routes with a Kibana instance with these features disabled to see what the results are? They aren't doc'd but you can find them under
x-pack/platform/plugins/shared/alerting/server/routes/maintenance_window/apis

@tomsonpl
Copy link
Copy Markdown
Contributor Author

tomsonpl commented Apr 4, 2025

Hey @pmuellr thanks for your comment, these are totally valid concerns.

I tested API routes to create a new MW:

POST kbn:/internal/alerting/rules/maintenance_window
{
    "title": "test",
    "duration": 1000,
    "r_rule": {
        "dtstart": "1743775356936"
    }
}

which returned a validation error, so the route is registered anyway - my hope was that the routes are not being registered.

When I enter http://0.0.0.0:5601/app/management/insightsAndAlerting/maintenanceWindows with feature being not enabled it shows Management main page (without changing url).

@tomsonpl
Copy link
Copy Markdown
Contributor Author

tomsonpl commented Apr 8, 2025

Is there anything I can do here to help review this? :) Thanks!
cc: @cnasikas @pmuellr

@tomsonpl tomsonpl marked this pull request as draft April 9, 2025 19:38
@tomsonpl tomsonpl added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels labels Apr 28, 2025
@mgiota
Copy link
Copy Markdown
Contributor

mgiota commented May 27, 2025

I am in the process of backporting my PR into 8.19 and while resolving some conflicts in my PR, I noticed this PR was not backported. @pmuellr Here's a Slack thread with more info on the topic of backporting stuff into 8.19

@tomsonpl tomsonpl added backport:version Backport to applied version labels v8.19.0 and removed backport:skip This PR does not require backporting labels May 27, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15273422197

@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15273422284

@tomsonpl
Copy link
Copy Markdown
Contributor Author

Hey, thanks for raising this! I looked for some more detailed information on what should be merged, and I think you're right, in the end this one should be backported.
I'll try to get it done today.

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [ftr] split x-pack discover config (#217483)

Manual backport

To create the backport manually run:

node scripts/backport --pr 214586

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [ftr] split x-pack discover config (#217483)

Manual backport

To create the backport manually run:

node scripts/backport --pr 214586

Questions ?

Please refer to the Backport tool documentation

@tomsonpl
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@tomsonpl
Copy link
Copy Markdown
Contributor Author

I created a backport manually where I kept all the alerting code changes, but did not include the AI SOC parts. Since the functionality is dependent on other PRs, not merged to 8.19.

tomsonpl added a commit to tomsonpl/kibana that referenced this pull request May 27, 2025
…Maintenance window based on Serverless Tier (elastic#214586)

(cherry picked from commit 6356f2c)

# Conflicts:
#	.buildkite/ftr_platform_stateful_configs.yml
#	config/serverless.security.search_ai_lake.yml
#	src/platform/test/plugin_functional/test_suites/core_plugins/rendering.ts
#	x-pack/platform/plugins/shared/alerting/server/config.test.ts
#	x-pack/platform/plugins/shared/alerting/server/config.ts
#	x-pack/platform/plugins/shared/alerting/server/index.ts
#	x-pack/test/security_solution_cypress/cypress/e2e/ai4dsoc/capabilities/access.cy.ts
#	x-pack/test/security_solution_cypress/cypress/e2e/ai4dsoc/constants.ts
#	x-pack/test/security_solution_cypress/cypress/e2e/ai4dsoc/navigation/navigation.cy.ts
#	x-pack/test/security_solution_cypress/cypress/urls/navigation.ts
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 28, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @tomsonpl

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…nanceWindow capability (elastic#218999)

## Summary

This PR fixes an issue with the ResponseOps alerts table not handling
the `maintenanceWindow` capability being `undefined`. In the AI4DSOC
effort, [we recently
disabled](elastic#214586) the
`maintenanceWindow` capability which cause the
`useBulkGetMaintenanceWindowsQuery` hook to crash.

Current behavior


https://github.com/user-attachments/assets/8ab8c97f-04a0-45cb-95e7-cc9114e87190

Fixed behavior


https://github.com/user-attachments/assets/0749bda3-7838-47b7-a65b-5c9b6a92a245

### Checklist

- [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

relates to elastic/security-team#11973

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @tomsonpl

tomsonpl added a commit to tomsonpl/kibana that referenced this pull request May 30, 2025
…Maintenance window based on Serverless Tier (elastic#214586)

(cherry picked from commit 6356f2c)

# Conflicts:
#	.buildkite/ftr_platform_stateful_configs.yml
#	config/serverless.security.search_ai_lake.yml
#	src/platform/test/plugin_functional/test_suites/core_plugins/rendering.ts
#	x-pack/platform/plugins/shared/alerting/server/config.test.ts
#	x-pack/platform/plugins/shared/alerting/server/config.ts
#	x-pack/platform/plugins/shared/alerting/server/index.ts
#	x-pack/platform/plugins/shared/triggers_actions_ui/public/plugin.ts
#	x-pack/test/security_solution_cypress/cypress/e2e/ai4dsoc/capabilities/access.cy.ts
#	x-pack/test/security_solution_cypress/cypress/e2e/ai4dsoc/constants.ts
#	x-pack/test/security_solution_cypress/cypress/e2e/ai4dsoc/navigation/navigation.cy.ts
#	x-pack/test/security_solution_cypress/cypress/urls/navigation.ts
@tomsonpl
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @tomsonpl

PhilippeOberti added a commit to PhilippeOberti/kibana that referenced this pull request May 30, 2025
…nanceWindow capability (elastic#218999)

## Summary

This PR fixes an issue with the ResponseOps alerts table not handling
the `maintenanceWindow` capability being `undefined`. In the AI4DSOC
effort, [we recently
disabled](elastic#214586) the
`maintenanceWindow` capability which cause the
`useBulkGetMaintenanceWindowsQuery` hook to crash.

Current behavior

https://github.com/user-attachments/assets/8ab8c97f-04a0-45cb-95e7-cc9114e87190

Fixed behavior

https://github.com/user-attachments/assets/0749bda3-7838-47b7-a65b-5c9b6a92a245

### Checklist

- [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

relates to elastic/security-team#11973

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 23ad755)
PhilippeOberti added a commit to PhilippeOberti/kibana that referenced this pull request May 30, 2025
…nanceWindow capability (elastic#218999)

## Summary

This PR fixes an issue with the ResponseOps alerts table not handling
the `maintenanceWindow` capability being `undefined`. In the AI4DSOC
effort, [we recently
disabled](elastic#214586) the
`maintenanceWindow` capability which cause the
`useBulkGetMaintenanceWindowsQuery` hook to crash.

Current behavior

https://github.com/user-attachments/assets/8ab8c97f-04a0-45cb-95e7-cc9114e87190

Fixed behavior

https://github.com/user-attachments/assets/0749bda3-7838-47b7-a65b-5c9b6a92a245

### Checklist

- [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

relates to elastic/security-team#11973

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 23ad755)
tomsonpl added a commit that referenced this pull request Jun 2, 2025
…gs and Maintenance window based on Serverless Tier (#214586) (#221998)
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 2, 2025
PhilippeOberti added a commit to PhilippeOberti/kibana that referenced this pull request Jun 4, 2025
…nanceWindow capability (elastic#218999)

## Summary

This PR fixes an issue with the ResponseOps alerts table not handling
the `maintenanceWindow` capability being `undefined`. In the AI4DSOC
effort, [we recently
disabled](elastic#214586) the
`maintenanceWindow` capability which cause the
`useBulkGetMaintenanceWindowsQuery` hook to crash.

Current behavior

https://github.com/user-attachments/assets/8ab8c97f-04a0-45cb-95e7-cc9114e87190

Fixed behavior

https://github.com/user-attachments/assets/0749bda3-7838-47b7-a65b-5c9b6a92a245

### Checklist

- [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

relates to elastic/security-team#11973

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 23ad755)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Security Generative AI Security Generative AI v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.