mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
- show/hide navbar entries in both old and new navigation per feature flag value
- load plugin per feature flag value
- flag: xpack.securitySolution.enableExperimental: ['threatIntelligenceEnabled']
https://github.com/elastic/security-team/issues/4505
(cherry picked from commit ff28e68159
)
Co-authored-by: Philippe Oberti <philippe.oberti@elastic.co>
This commit is contained in:
parent
62ed40b0aa
commit
31726b19b9
8 changed files with 26 additions and 18 deletions
|
@ -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.
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
|
|
|
@ -31,6 +31,9 @@ export const useSecuritySolutionNavigation = () => {
|
|||
|
||||
const disabledNavTabs = [
|
||||
...(!useIsExperimentalFeatureEnabled('kubernetesEnabled') ? ['kubernetes'] : []),
|
||||
...(!useIsExperimentalFeatureEnabled('threatIntelligenceEnabled')
|
||||
? ['threat-intelligence']
|
||||
: []),
|
||||
];
|
||||
const enabledNavTabs: GenericNavRecord = omit(disabledNavTabs, navTabs);
|
||||
|
||||
|
|
|
@ -113,7 +113,9 @@ function usePrimaryNavigationItemsToDisplay(navTabs: Record<string, NavTab>) {
|
|||
...(navTabs[SecurityPageName.users] != null
|
||||
? [navTabs[SecurityPageName.users]]
|
||||
: []),
|
||||
navTabs[SecurityPageName.threatIntelligence],
|
||||
...(navTabs[SecurityPageName.threatIntelligence] != null
|
||||
? [navTabs[SecurityPageName.threatIntelligence]]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 = () => (
|
||||
<TrackApplicationView viewId={SecurityPageName.threatIntelligence}>
|
||||
<ThreatIntelligencePage />
|
||||
</TrackApplicationView>
|
||||
);
|
||||
const ThreatIntelligenceRoutes = () => {
|
||||
const enabled = useIsExperimentalFeatureEnabled('threatIntelligenceEnabled');
|
||||
if (!enabled) {
|
||||
return <Redirect to="/" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<TrackApplicationView viewId={SecurityPageName.threatIntelligence}>
|
||||
<ThreatIntelligencePage />
|
||||
</TrackApplicationView>
|
||||
);
|
||||
};
|
||||
|
||||
export const routes: SecuritySubPluginRoutes = [
|
||||
{
|
||||
path: THREAT_INTELLIGENCE_PATH,
|
||||
render: ThreatIntelligenceRoutes,
|
||||
component: ThreatIntelligenceRoutes,
|
||||
},
|
||||
];
|
||||
|
|
|
@ -52,6 +52,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|||
'riskyHostsEnabled',
|
||||
'riskyUsersEnabled',
|
||||
'insightsRelatedAlertsByProcessAncestry',
|
||||
'threatIntelligenceEnabled',
|
||||
])}`,
|
||||
`--home.disableWelcomeScreen=true`,
|
||||
],
|
||||
|
|
|
@ -51,6 +51,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|||
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
|
||||
'riskyHostsEnabled',
|
||||
'riskyUsersEnabled',
|
||||
'threatIntelligenceEnabled',
|
||||
])}`,
|
||||
`--home.disableWelcomeScreen=true`,
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue