Skip to content

Commit

Permalink
[Security Solutions] Management navigation (#102685)
Browse files Browse the repository at this point in the history
* prepare new routing and migrate overview

* test fix and todo comments identified

* telemetry using app views

* navigation groups implemented

* cleaning

* export subplugin routes as route props array

* breadcrumbs changes and sidenav generation improvements

* jest tests for breadcrumbs and navigation changes

* retrocompatibility for sections that are not yet migrated to deepLinks

* management deepLinks and plugin refactoring

* home navigation changes

* management navigation migrated to deeplinks

* jest tests fixed

* header page back link improved and tests fixed

* type errors fixes

* improve home navigation encapsulation

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
2 people authored and XavierM committed Jun 24, 2021
1 parent b7fca6b commit 2fc3689
Show file tree
Hide file tree
Showing 78 changed files with 1,015 additions and 1,314 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ export const applicationUsageSchema = {
security_login: commonSchema,
security_logout: commonSchema,
security_overwritten_session: commonSchema,
securitySolution: commonSchema, // It's a forward app so we'll likely never report it
'securitySolution:administration': commonSchema,
securitySolution: commonSchema,
siem: commonSchema,
space_selector: commonSchema,
uptime: commonSchema,
Expand Down
131 changes: 0 additions & 131 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5411,137 +5411,6 @@
}
}
},
"securitySolution:administration": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "Always `main`"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 90 days"
}
},
"views": {
"type": "array",
"items": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "The application view being tracked"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application sub view since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application sub view is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 90 days"
}
}
}
}
}
}
},
"siem": {
"properties": {
"appId": {
Expand Down
32 changes: 23 additions & 9 deletions x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ export const INDICATOR_DESTINATION_PATH = 'threat.indicator';
export const DETECTIONS = 'detections';

export enum SecurityPageName {
alerts = 'alerts',
overview = 'overview',
detections = 'detections',
alerts = 'alerts',
rules = 'rules',
exceptions = 'exceptions',
hosts = 'hosts',
network = 'network',
timelines = 'timelines',
case = 'case',
administration = 'administration',
rules = 'rules',
exceptions = 'exceptions',
endpoints = 'endpoints',
trustedApps = 'trusted_apps',
eventFilters = 'event_filters',
}

export enum SecurityPageGroupName {
Expand All @@ -90,16 +94,26 @@ export const RULES_PATH = '/rules';
export const EXCEPTIONS_PATH = '/exceptions';
export const HOSTS_PATH = '/hosts';
export const NETWORK_PATH = '/network';
export const MANAGEMENT_PATH = '/administration';
export const ENDPOINTS_PATH = `${MANAGEMENT_PATH}/endpoints`;
export const TRUSTED_APPS_PATH = `${MANAGEMENT_PATH}/trusted_apps`;
export const EVENT_FILTERS_PATH = `${MANAGEMENT_PATH}/event_filters`;

export const APP_OVERVIEW_PATH = `${APP_PATH}${OVERVIEW_PATH}`;
export const APP_DETECTIONS_PATH = `${APP_PATH}/detections`;
export const APP_HOSTS_PATH = `${APP_PATH}/hosts`;
export const APP_NETWORK_PATH = `${APP_PATH}/network`;
export const APP_MANAGEMENT_PATH = `${APP_PATH}${MANAGEMENT_PATH}`;

export const APP_ALERTS_PATH = `${APP_PATH}${ALERTS_PATH}`;
export const APP_RULES_PATH = `${APP_PATH}${RULES_PATH}`;
export const APP_EXCEPTIONS_PATH = `${APP_PATH}${EXCEPTIONS_PATH}`;

export const APP_HOSTS_PATH = `${APP_PATH}/${HOSTS_PATH}`;
export const APP_NETWORK_PATH = `${APP_PATH}/${NETWORK_PATH}`;
export const APP_TIMELINES_PATH = `${APP_PATH}/timelines`;
export const APP_CASES_PATH = `${APP_PATH}/cases`;
export const APP_MANAGEMENT_PATH = `${APP_PATH}/administration`;
export const APP_RULES_PATH = `${APP_PATH}/rules`;
export const APP_ALERTS_PATH = `${APP_PATH}/alerts`;
export const APP_EXCEPTIONS_PATH = `${APP_PATH}/exceptions`;
export const APP_ENDPOINTS_PATH = `${APP_PATH}${ENDPOINTS_PATH}`;
export const APP_TRUSTED_APPS_PATH = `${APP_PATH}${TRUSTED_APPS_PATH}`;
export const APP_EVENT_FILTERS_PATH = `${APP_PATH}${EVENT_FILTERS_PATH}`;

export const CASES_APP_ID = `${APP_ID}:${SecurityPageName.case}`;
export const DETECTIONS_SUB_PLUGIN_ID = `${APP_ID}:${DETECTIONS}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import {
CASES,
DETECTIONS,
HOSTS,
ADMINISTRATION,
ENDPOINTS,
TRUSTED_APPS,
EVENT_FILTERS,
NETWORK,
OVERVIEW,
TIMELINES,
Expand All @@ -23,7 +25,9 @@ import {
CASES_URL,
HOSTS_URL,
KIBANA_HOME,
ADMINISTRATION_URL,
ENDPOINTS_URL,
TRUSTED_APPS_URL,
EVENT_FILTERS_URL,
NETWORK_URL,
OVERVIEW_URL,
TIMELINES_URL,
Expand Down Expand Up @@ -79,9 +83,17 @@ describe('top-level navigation common to all pages in the Security app', () => {
cy.url().should('include', CASES_URL);
});

it('navigates to the Administration page', () => {
navigateFromHeaderTo(ADMINISTRATION);
cy.url().should('include', ADMINISTRATION_URL);
it('navigates to the Endpoints page', () => {
navigateFromHeaderTo(ENDPOINTS);
cy.url().should('include', ENDPOINTS_URL);
});
it('navigates to the Trusted Apps page', () => {
navigateFromHeaderTo(TRUSTED_APPS);
cy.url().should('include', TRUSTED_APPS_URL);
});
it('navigates to the Event Filters page', () => {
navigateFromHeaderTo(EVENT_FILTERS);
cy.url().should('include', EVENT_FILTERS_URL);
});
});

Expand Down Expand Up @@ -124,6 +136,6 @@ describe('Kibana navigation to all pages in the Security app ', () => {

it('navigates to the Administration page', () => {
navigateFromKibanaCollapsibleTo(ADMINISTRATION_PAGE);
cy.url().should('include', ADMINISTRATION_URL);
cy.url().should('include', ENDPOINTS_URL);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export const HOSTS = '[data-test-subj="navigation-hosts"]';

export const KQL_INPUT = '[data-test-subj="queryInput"]';

export const ADMINISTRATION = '[data-test-subj="navigation-administration"]';
export const ENDPOINTS = '[data-test-subj="navigation-endpoints"]';

export const TRUSTED_APPS = '[data-test-subj="navigation-trusted_apps"]';

export const EVENT_FILTERS = '[data-test-subj="navigation-event_filters"]';

export const NETWORK = '[data-test-subj="navigation-network"]';

Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/security_solution/cypress/urls/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export const HOSTS_PAGE_TAB_URLS = {
uncommonProcesses: '/app/security/hosts/uncommonProcesses',
};
export const KIBANA_HOME = '/app/home#/';
export const ADMINISTRATION_URL = '/app/security/administration';
export const ENDPOINTS_URL = '/app/security/administration/endpoints';
export const TRUSTED_APPS_URL = '/app/security/administration/trusted_apps';
export const EVENT_FILTERS_URL = '/app/security/administration/event_filters';
export const NETWORK_URL = '/app/security/network';
export const OVERVIEW_URL = '/app/security/overview';
export const RULE_CREATION = 'app/security/rules/create';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { getDeepLinks } from '.';

describe('public search functions', () => {
it('returns a subset of links for basic license, full set for platinum', () => {
const basicLicense = 'basic';
const platinumLicense = 'platinum';
const basicLinks = getDeepLinks(basicLicense);
const platinumLinks = getDeepLinks(platinumLicense);

basicLinks.forEach((basicLink, index) => {
const platinumLink = platinumLinks[index];
expect(basicLink.id).toEqual(platinumLink.id);
const platinumDeepLinksCount = platinumLink.deepLinks?.length || 0;
const basicDeepLinksCount = basicLink.deepLinks?.length || 0;
expect(platinumDeepLinksCount).toBeGreaterThanOrEqual(basicDeepLinksCount);
});
});
});
Loading

0 comments on commit 2fc3689

Please sign in to comment.