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 #212128

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

Conversation

semd
Copy link
Contributor

@semd semd commented Feb 21, 2025

Summary

This is an example of navigation changes to implement the AI 4 SOC.

It's built on top of existing functionalities (navigationTree, ProductFeatures, AppLinks configs, capabilities...). It does not require any modification of existing frameworks.

Screenshot

Note

When the classic navigation is deprecated we won't need to support both config formats, so we'll be able to clean and simplify the navigation links infrastructure. For now, we need to stay compatible, this is a simple way to accomplish the goal without major changes. When we do the refactor we will be able to create a static nav tree for "AI 4 SOC".

Test:

in your config/serverless.security.dev.yml:

xpack.securitySolutionServerless.productTypes:
  [
    # { product_line: 'security', product_tier: 'complete' },
    { product_line: 'ai', product_tier: 'essentials' },
    # { product_line: 'endpoint', product_tier: 'complete' },
    # { product_line: 'cloud', product_tier: 'complete' },
  ]

Important parts:

Left nav links

The applyAiSocNavigation is where we update the navigationTree only when the productLevel.ai is enabled. Here we can make any modifications to the tree:

export const applyAiSocNavigation = (
draft: WritableDraft<NavigationTreeDefinition<AppDeepLinkId>>
): void => {
const group = draft.body[0] as WritableDraft<GroupDefinition<AppDeepLinkId, string, string>>;
const [attachDiscovery] = group.children.reduce<Array<NodeDefinition<AppDeepLinkId>>>(
(nodes, category) => {
const [attachDiscoveryNode] = remove(category.children ?? [], {
id: SecurityPageName.attackDiscovery,
});
if (attachDiscoveryNode) {
nodes.push(attachDiscoveryNode);
}
return nodes;
},
[]
);
if (attachDiscovery) {
group.appendHorizontalRule = true; // does not seem to work :( talk with sharedUx team
const aiGroup: GroupDefinition<AppDeepLinkId, string, string> = {
type: 'navGroup',
id: 'security_solution_ai_nav',
title: 'AI for SOC',
icon: AssistantIcon,
children: [attachDiscovery],
breadcrumbStatus: 'hidden',
defaultIsCollapsed: false,
isCollapsible: false,
};
draft.body = [aiGroup];
}
};

Disable links

With the current approach, the easiest way to make links inaccessible (left nav, global search, direct URL access...) it to use the capabilities property of the links, and add the capabilities conditionally for the ProductFeature, creating new if necessary.

I implemented the example for rules, alerts, explore, dashboards, timeline, and notes.

@semd semd self-assigned this Feb 21, 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!

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.

2 participants