-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Entity Analytics dashboard (#137688)
* Create Entity analytics page * Add Hosts risk dashboard to Entity analytics page * Add entity analytics to the old menu * Add entity analytics dashboard header * Add User risk dashboard to Entity analytics * Add entityAnalyticsDashoardEnabled feature flag * Move useEnableHostRiskFromUrl to a shared folder * Upgrade Entity analytics license to platinum * Add ml permission check for entity analytics dashboard old menu Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
acf675c
commit bbcadf1
Showing
51 changed files
with
2,061 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
x-pack/plugins/security_solution/cypress/integration/dashboards/entity_analytics.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* 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 { login, visit } from '../../tasks/login'; | ||
|
||
import { ENTITY_ANALYTICS_URL } from '../../urls/navigation'; | ||
|
||
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; | ||
import { cleanKibana } from '../../tasks/common'; | ||
import { | ||
ENABLE_HOST_RISK_SCORE_BUTTON, | ||
ENABLE_USER_RISK_SCORE_BUTTON, | ||
HOSTS_DONUT_CHART, | ||
HOSTS_TABLE, | ||
TABLE_ROWS, | ||
USERS_DONUT_CHART, | ||
USERS_TABLE, | ||
} from '../../screens/entity_analytics'; | ||
import { openRiskTableFilterAndSelectTheLowOption } from '../../tasks/host_risk'; | ||
|
||
describe('Entity Analytics Dashboard', () => { | ||
before(() => { | ||
cleanKibana(); | ||
login(); | ||
}); | ||
|
||
describe('Without data', () => { | ||
before(() => { | ||
visit(ENTITY_ANALYTICS_URL); | ||
}); | ||
|
||
it('shows enable host risk button', () => { | ||
cy.get(ENABLE_HOST_RISK_SCORE_BUTTON).should('be.visible'); | ||
}); | ||
|
||
it('shows enable user risk button', () => { | ||
cy.get(ENABLE_USER_RISK_SCORE_BUTTON).should('be.visible'); | ||
}); | ||
}); | ||
|
||
describe('With host risk data', () => { | ||
before(() => { | ||
esArchiverLoad('risky_hosts'); | ||
visit(ENTITY_ANALYTICS_URL); | ||
}); | ||
|
||
after(() => { | ||
esArchiverUnload('risky_hosts'); | ||
}); | ||
|
||
it('renders donut chart', () => { | ||
cy.get(HOSTS_DONUT_CHART).should('include.text', '6Total'); | ||
}); | ||
|
||
it('renders table', () => { | ||
cy.get(HOSTS_TABLE).should('be.visible'); | ||
cy.get(TABLE_ROWS).should('have.length', 5); | ||
}); | ||
|
||
it('filters by risk classification', () => { | ||
openRiskTableFilterAndSelectTheLowOption(); | ||
|
||
cy.get(HOSTS_DONUT_CHART).should('include.text', '1Total'); | ||
cy.get(TABLE_ROWS).should('have.length', 1); | ||
}); | ||
}); | ||
|
||
describe('With user risk data', () => { | ||
before(() => { | ||
esArchiverLoad('risky_users'); | ||
visit(ENTITY_ANALYTICS_URL); | ||
}); | ||
|
||
after(() => { | ||
esArchiverUnload('risky_users'); | ||
}); | ||
|
||
it('renders donut chart', () => { | ||
cy.get(USERS_DONUT_CHART).should('include.text', '6Total'); | ||
}); | ||
|
||
it('renders table', () => { | ||
cy.get(USERS_TABLE).should('be.visible'); | ||
cy.get(TABLE_ROWS).should('have.length', 5); | ||
}); | ||
|
||
it('filters by risk classification', () => { | ||
openRiskTableFilterAndSelectTheLowOption(); | ||
|
||
cy.get(USERS_DONUT_CHART).should('include.text', '1Total'); | ||
cy.get(TABLE_ROWS).should('have.length', 1); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const ENABLE_HOST_RISK_SCORE_BUTTON = '[data-test-subj="enable_host_risk_score"]'; | ||
|
||
export const HOSTS_DONUT_CHART = | ||
'[data-test-subj="entity_analytics_hosts"] [data-test-subj="donut-chart"]'; | ||
|
||
export const HOSTS_TABLE = '[data-test-subj="entity_analytics_hosts"] #hostRiskDashboardTable'; | ||
|
||
export const TABLE_ROWS = '.euiTableRow'; | ||
|
||
export const USERS_DONUT_CHART = | ||
'[data-test-subj="entity_analytics_users"] [data-test-subj="donut-chart"]'; | ||
|
||
export const USERS_TABLE = '[data-test-subj="entity_analytics_users"] #userRiskDashboardTable'; | ||
|
||
export const ENABLE_USER_RISK_SCORE_BUTTON = '[data-test-subj="enable_user_risk_score"]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.