diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/plugins/security_solution/common/experimental_features.ts index 55a52c73f356c..80d15b98febd8 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/plugins/security_solution/common/experimental_features.ts @@ -22,9 +22,10 @@ export const allowedExperimentalValues = Object.freeze({ pendingActionResponsesWithAck: true, policyListEnabled: true, policyResponseInFleetEnabled: true, + threatIntelligenceEnabled: false, /** - * This is used for enabling the end to end tests for the security_solution telemetry. + * This is used for enabling the end-to-end tests for the security_solution telemetry. * We disable the telemetry since we don't have specific roles or permissions around it and * we don't want people to be able to violate security by getting access to whole documents * around telemetry they should not. diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap index 75ba4ed32052a..aad1966666534 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/__snapshots__/index.test.tsx.snap @@ -142,16 +142,6 @@ Object { "name": "Users", "onClick": [Function], }, - Object { - "data-href": "securitySolutionUI/threat-intelligence", - "data-test-subj": "navigation-threat-intelligence", - "disabled": false, - "href": "securitySolutionUI/threat-intelligence", - "id": "threat-intelligence", - "isSelected": false, - "name": "Threat Intelligence", - "onClick": [Function], - }, ], "name": "Explore", }, diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.tsx b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.tsx index 0444b183e9425..3a010bdb4fd7a 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.tsx @@ -31,6 +31,9 @@ export const useSecuritySolutionNavigation = () => { const disabledNavTabs = [ ...(!useIsExperimentalFeatureEnabled('kubernetesEnabled') ? ['kubernetes'] : []), + ...(!useIsExperimentalFeatureEnabled('threatIntelligenceEnabled') + ? ['threat-intelligence'] + : []), ]; const enabledNavTabs: GenericNavRecord = omit(disabledNavTabs, navTabs); diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_navigation_items.tsx b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_navigation_items.tsx index 334960d6e86b3..f58b48dc35009 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_navigation_items.tsx +++ b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_navigation_items.tsx @@ -113,7 +113,9 @@ function usePrimaryNavigationItemsToDisplay(navTabs: Record) { ...(navTabs[SecurityPageName.users] != null ? [navTabs[SecurityPageName.users]] : []), - navTabs[SecurityPageName.threatIntelligence], + ...(navTabs[SecurityPageName.threatIntelligence] != null + ? [navTabs[SecurityPageName.threatIntelligence]] + : []), ], }, { diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/links.ts b/x-pack/plugins/security_solution/public/threat_intelligence/links.ts index f5610dd3e931c..81a5f2cdbcbd6 100644 --- a/x-pack/plugins/security_solution/public/threat_intelligence/links.ts +++ b/x-pack/plugins/security_solution/public/threat_intelligence/links.ts @@ -15,6 +15,7 @@ export const links: LinkItem = { id: SecurityPageName.threatIntelligence, title: THREAT_INTELLIGENCE, path: THREAT_INTELLIGENCE_PATH, + experimentalKey: 'threatIntelligenceEnabled', landingImage: threatIntelligencePageImg, description: i18n.translate('xpack.securitySolution.appLinks.threatIntelligence.description', { defaultMessage: diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx b/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx index 65b1440c49d2c..578ca28a5a9cc 100644 --- a/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx +++ b/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx @@ -6,20 +6,29 @@ */ import React from 'react'; +import { Redirect } from 'react-router-dom'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; import { ThreatIntelligencePage } from './pages/threat_intelligence'; import { SecurityPageName, THREAT_INTELLIGENCE_PATH } from '../../common/constants'; import type { SecuritySubPluginRoutes } from '../app/types'; +import { useIsExperimentalFeatureEnabled } from '../common/hooks/use_experimental_features'; -const ThreatIntelligenceRoutes = () => ( - - - -); +const ThreatIntelligenceRoutes = () => { + const enabled = useIsExperimentalFeatureEnabled('threatIntelligenceEnabled'); + if (!enabled) { + return ; + } + + return ( + + + + ); +}; export const routes: SecuritySubPluginRoutes = [ { path: THREAT_INTELLIGENCE_PATH, - render: ThreatIntelligenceRoutes, + component: ThreatIntelligenceRoutes, }, ]; diff --git a/x-pack/test/security_solution_cypress/config.ts b/x-pack/test/security_solution_cypress/config.ts index 9527b0ff37217..4fbd5e510c38c 100644 --- a/x-pack/test/security_solution_cypress/config.ts +++ b/x-pack/test/security_solution_cypress/config.ts @@ -52,6 +52,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { 'riskyHostsEnabled', 'riskyUsersEnabled', 'insightsRelatedAlertsByProcessAncestry', + 'threatIntelligenceEnabled', ])}`, `--home.disableWelcomeScreen=true`, ], diff --git a/x-pack/test/threat_intelligence_cypress/config.ts b/x-pack/test/threat_intelligence_cypress/config.ts index 4b5b2c361c1b9..43d80103c5a64 100644 --- a/x-pack/test/threat_intelligence_cypress/config.ts +++ b/x-pack/test/threat_intelligence_cypress/config.ts @@ -51,6 +51,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { `--xpack.securitySolution.enableExperimental=${JSON.stringify([ 'riskyHostsEnabled', 'riskyUsersEnabled', + 'threatIntelligenceEnabled', ])}`, `--home.disableWelcomeScreen=true`, ],