Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution][PoC] AI 4 SOC navigation approach 2 #212652

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

semd
Copy link
Contributor

@semd semd commented Feb 27, 2025

Summary

This approach implements the RBAC by disabling (not registering) entire Kibana features.

Approach 1 is: #212128

Screenshots

Security + AI

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

Screenshot 2025-03-05 at 17 16 36

Custom roles creation

Screenshot 2025-03-05 at 17 16 50

Only AI

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

left_nav_ai_soc

Custom role creation

custom_role_ai_soc

Only security

xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'security', product_tier: 'search_ai_lake' },
  ]
Left nav

...

Custom role creation

Screenshot 2025-03-05 at 18 14 37

@semd semd self-assigned this Feb 27, 2025
@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

@@ -108,6 +108,7 @@ export class FeatureRegistry {
for (const [featureId, featureOverride] of Object.entries(overrides)) {
const feature = this.kibanaFeatures[featureId];
if (!feature) {
continue;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs to be discussed with @elastic/kibana-security

Copy link
Member

Choose a reason for hiding this comment

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

I have a few questions to better understand what you’re trying to achieve:

  1. What is the process for changing the product tier/line?
  2. Is it something a user can do themselves?
  3. Is the current tier stored somewhere in ES, or is it a config value?
  4. Does the change require a Kibana restart?
  5. In which offerings is it possible to dynamically update tiers/lines (ECH, ECS, on-prem)?

I vaguely remember that dynamic configuration was only possible in Elastic Cloud (or even only in Serverless?), where the configuration flag for the current tier lived in the Kibana config and was managed by infra (controller?). Is that still the case? If so, is there any reason the code that changes the tier config in the Kibana config couldn’t also alter overrides in the config?

Copy link
Contributor

Choose a reason for hiding this comment

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

To the best of my knowledge:

  1. the configuration is done through the Cloud UI.
  2. Good question: @angorayc do you know?
  3. 99% just the config value
  4. Yes
  5. Only serverless.

I think the overrides changes the capabilities, right? We're here trying to not even register the feature which makes the corresponding RBAC privileges not even visible for the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @azasypkin, thanks for taking a look. Sorry that this line is outdated, I should have removed this continue;, it's no longer needed. In the previous approach that I implemented I was skipping the registration of the siem/siemV2 feature when the new tier was enabled, in the current approach this feature is always registered, just with a different configuration for this new tier.

I vaguely remember that dynamic configuration was only possible in Elastic Cloud (or even only in Serverless?), where the configuration flag for the current tier lived in the Kibana config and was managed by infra (controller?). Is that still the case? If so, is there any reason the code that changes the tier config in the Kibana config couldn’t also alter overrides in the config?

You have a good memory. That's right. In serverless, we use the project controller to create the tiers and roles configuration that we read from Kibana. This approach worked well, and I think we should follow a similar approach. However, I think we should be careful and try to minimize the cross-repo dependencies we introduce, they have become problematic in different ways for the predefined role definitions: we have to keep duplicates in Kibana which are confusing and hard to maintain in sync with the production configs.

I think we should be able to keep the single source of truth inside Kibana, and use the project-controller as the decision maker. I was thinking about having a yaml file with different definitions of the features overrides, one per tier, or maybe having one file per tier would also make sense (e.g. security.essentials.override.yml, security.complete.overrides.yml...), inside Kibana. And the project-controller somehow applies one of them depending on the current tier. Or maybe Kibana itself should pick the correct override config, using the tiers config that is already provided by the project-controller.

wdyt?

cc @YulNaumenko

Copy link
Member

Choose a reason for hiding this comment

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

in the current approach this feature is always registered, just with a different configuration for this new tier.

Aha, good to know. That should definitely simplify things.

However, I think we should be careful and try to minimize the cross-repo dependencies we introduce, they have become problematic in different ways for the predefined role definitions: we have to keep duplicates in Kibana which are confusing and hard to maintain in sync with the production configs.

Agree. The only reason I mentioned controller is that I thought you were skipping the feature registration completely, and hence it would make sense for controller to remove overrides for the feature that doesn’t exist from the config as well. But since you changed your approach, we don’t need to do that.

I think we should be able to keep the single source of truth inside Kibana, and use the project-controller as the decision maker. I was thinking about having a yaml file with different definitions of the features overrides, one per tier, or maybe having one file per tier would also make sense (e.g. security.essentials.override.yml, security.complete.overrides.yml...), inside Kibana. And the project-controller somehow applies one of them depending on the current tier. Or maybe Kibana itself should pick the correct override config, using the tiers config that is already provided by the project-controller.
Here’s the proofread version of your text:

If I understand your current approach correctly, you’re just changing the feature definition at runtime depending on the tier. If so, it sounds much easier than doing this via the configuration like we did with feature overrides. If it fully works for you and doesn't require any nasty hacks (?), I think it’s better to keep what you have, but let’s discuss this during our sync later today to make sure I’m not missing anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@azasypkin

If I understand your current approach correctly, you’re just changing the feature definition at runtime depending on the tier. If so, it sounds much easier than doing this via the configuration like we did with feature overrides. If it fully works for you and doesn't require any nasty hacks (?), I think it’s better to keep what you have, but let’s discuss this during our sync later today to make sure I’m not missing anything.

Great! glad that you like the idea, but that's only for Security features.
The missing part is with other features outside the Security plugin, that we also need we need to disable/hide for this tier, such as Fleet, Osquery...
This is what we want to discuss with you, the proposal of having a different override configuration per tier is meant to solve this.

@azasypkin azasypkin self-requested a review March 4, 2025 13:19
@azasypkin
Copy link
Member

(tagging myself for review to provide preliminary feedback)

configurator.timeline = getTimelineProductFeaturesConfigurator(enabledProductFeatureKeys);
configurator.notes = getNotesProductFeaturesConfigurator(enabledProductFeatureKeys);

// timeline and notes are not available for the searchAiLake tier within Security
Copy link
Contributor

@tomsonpl tomsonpl Mar 4, 2025

Choose a reason for hiding this comment

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

Leaving this here so we do not forget:
Screenshot 2025-03-04 at 16 13 41

With this config:

{ product_line: 'security', product_tier: 'search_ai_lake' },
{ product_line: 'ai_soc', product_tier: 'search_ai_lake' },

we should not see timelines, notes, and siem_migration.

@ashokaditya This is why we talked about not registering them in the first place (approach 2). You did the approach 1 with capabilities.
Does the trick for the most parts but not all :P
What do you think? 👍

@@ -104,21 +104,6 @@ export const getSecurityBaseKibanaFeature = ({
},
app: [APP_ID, CLOUD_POSTURE_APP_ID, CLOUD_DEFEND_APP_ID, 'kibana'],
catalogue: [APP_ID],
api: [
Copy link
Member

Choose a reason for hiding this comment

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

question: I’m not familiar enough with the mechanics here or whether these API privileges are needed, but we’re not making a breaking change for users who have roles with this privielge, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

To best of my knowledge, this is safe. We are just moving these privileges to product_feature_config which also add's the possibility to be run against PLI configuration.
CC: @semd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, this is safe. We are just moving things around to make them tier-dependent.

  • All existing tiers will have these privileges configured with the same API/UI actions as currently.
  • The new tier will have these privileges configured with a new set of API/UI actions specific to this tier.

Copy link
Member

Choose a reason for hiding this comment

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

Roger that, thanks for clarifying!

@@ -108,6 +108,7 @@ export class FeatureRegistry {
for (const [featureId, featureOverride] of Object.entries(overrides)) {
const feature = this.kibanaFeatures[featureId];
if (!feature) {
continue;
Copy link
Member

Choose a reason for hiding this comment

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

I have a few questions to better understand what you’re trying to achieve:

  1. What is the process for changing the product tier/line?
  2. Is it something a user can do themselves?
  3. Is the current tier stored somewhere in ES, or is it a config value?
  4. Does the change require a Kibana restart?
  5. In which offerings is it possible to dynamically update tiers/lines (ECH, ECS, on-prem)?

I vaguely remember that dynamic configuration was only possible in Elastic Cloud (or even only in Serverless?), where the configuration flag for the current tier lived in the Kibana config and was managed by infra (controller?). Is that still the case? If so, is there any reason the code that changes the tier config in the Kibana config couldn’t also alter overrides in the config?

Copy link
Contributor

@tomsonpl tomsonpl left a comment

Choose a reason for hiding this comment

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

Thanks @azasypkin,
These are great questions, I tried to answer to the best of my knowledge, however also cc'ying @semd since he's the great mind behind this approach.

@@ -104,21 +104,6 @@ export const getSecurityBaseKibanaFeature = ({
},
app: [APP_ID, CLOUD_POSTURE_APP_ID, CLOUD_DEFEND_APP_ID, 'kibana'],
catalogue: [APP_ID],
api: [
Copy link
Contributor

Choose a reason for hiding this comment

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

To best of my knowledge, this is safe. We are just moving these privileges to product_feature_config which also add's the possibility to be run against PLI configuration.
CC: @semd

@@ -108,6 +108,7 @@ export class FeatureRegistry {
for (const [featureId, featureOverride] of Object.entries(overrides)) {
const feature = this.kibanaFeatures[featureId];
if (!feature) {
continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

To the best of my knowledge:

  1. the configuration is done through the Cloud UI.
  2. Good question: @angorayc do you know?
  3. 99% just the config value
  4. Yes
  5. Only serverless.

I think the overrides changes the capabilities, right? We're here trying to not even register the feature which makes the corresponding RBAC privileges not even visible for the user.

@@ -53,27 +48,21 @@ export const registerProductFeatures = (
// Cases are always enabled (both for security and AI-SOC)
configurator.cases = getCasesProductFeaturesConfigurator(enabledProductFeatureKeys);

if (productLines[ProductLine.security]) {
// TODO: clarify what happens with siem migrations
if (productLines[ProductLine.security] && !productTiers[ProductTier.searchAiLake]) {
Copy link
Contributor

@tomsonpl tomsonpl Mar 5, 2025

Choose a reason for hiding this comment

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

I wouldn't hide Security fully, just the timelines and notes (oh an siem_migrations). Because now if the config is:


    { product_line: 'security', product_tier: 'search_ai_lake' },
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },

We won't have security.

}

if (productLines[ProductLine.aiSoc]) {
if (productLines[ProductLine.aiSoc] && productTiers[ProductTier.searchAiLake]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is not necessary, moreover would block us from using this with higher tiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants