-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add host risk tab to Hosts page (#122980)
* Add host risk tab to Hosts page Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
934302d
commit d862d9b
Showing
77 changed files
with
3,472 additions
and
2,138 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
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
52 changes: 52 additions & 0 deletions
52
x-pack/plugins/security_solution/cypress/integration/host_details/risk_tab.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,52 @@ | ||
/* | ||
* 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 { loginAndWaitForHostDetailsPage } from '../../tasks/login'; | ||
|
||
import { cleanKibana } from '../../tasks/common'; | ||
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; | ||
import { TABLE_CELL, TABLE_ROWS } from '../../screens/alerts_details'; | ||
|
||
describe('risk tab', () => { | ||
before(() => { | ||
cleanKibana(); | ||
esArchiverLoad('risky_hosts'); | ||
}); | ||
|
||
after(() => { | ||
esArchiverUnload('risky_hosts'); | ||
}); | ||
|
||
it('renders risk tab', () => { | ||
loginAndWaitForHostDetailsPage('siem-kibana'); | ||
cy.get('[data-test-subj="navigation-hostRisk"]').click(); | ||
waitForTableToLoad(); | ||
|
||
cy.get('[data-test-subj="topHostScoreContributors"]') | ||
.find(TABLE_ROWS) | ||
.within(() => { | ||
cy.get(TABLE_CELL).contains('Unusual Linux Username'); | ||
}); | ||
}); | ||
|
||
it('shows risk information overlay when button is clicked', () => { | ||
loginAndWaitForHostDetailsPage('siem-kibana'); | ||
cy.get('[data-test-subj="navigation-hostRisk"]').click(); | ||
waitForTableToLoad(); | ||
|
||
cy.get('[data-test-subj="open-risk-information-flyout-trigger"]').click(); | ||
|
||
cy.get('[data-test-subj="open-risk-information-flyout"] .euiFlyoutHeader').contains( | ||
'How is host risk calculated?' | ||
); | ||
}); | ||
}); | ||
|
||
export const waitForTableToLoad = () => { | ||
cy.get('.euiBasicTable-loading').should('exist'); | ||
cy.get('.euiBasicTable-loading').should('not.exist'); | ||
}; |
43 changes: 43 additions & 0 deletions
43
x-pack/plugins/security_solution/cypress/integration/hosts/host_risk_tab.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,43 @@ | ||
/* | ||
* 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 { cleanKibana } from '../../tasks/common'; | ||
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; | ||
import { navigateToHostRiskDetailTab } from '../../tasks/host_risk'; | ||
import { | ||
HOST_BY_RISK_TABLE_CELL, | ||
HOST_BY_RISK_TABLE_FILTER, | ||
HOST_BY_RISK_TABLE_FILTER_CRITICAL, | ||
} from '../../screens/hosts/host_risk'; | ||
import { loginAndWaitForPage } from '../../tasks/login'; | ||
import { HOSTS_URL } from '../../urls/navigation'; | ||
|
||
describe('risk tab', () => { | ||
before(() => { | ||
cleanKibana(); | ||
esArchiverLoad('risky_hosts'); | ||
loginAndWaitForPage(HOSTS_URL); | ||
navigateToHostRiskDetailTab(); | ||
}); | ||
|
||
after(() => { | ||
esArchiverUnload('risky_hosts'); | ||
}); | ||
|
||
it('renders the table', () => { | ||
cy.get(HOST_BY_RISK_TABLE_CELL).eq(3).should('have.text', 'siem-kibana'); | ||
cy.get(HOST_BY_RISK_TABLE_CELL).eq(4).should('have.text', '21.00'); | ||
cy.get(HOST_BY_RISK_TABLE_CELL).eq(5).should('have.text', 'Low'); | ||
}); | ||
|
||
it('filters the table', () => { | ||
cy.get(HOST_BY_RISK_TABLE_FILTER).click(); | ||
cy.get(HOST_BY_RISK_TABLE_FILTER_CRITICAL).click(); | ||
|
||
cy.get(HOST_BY_RISK_TABLE_CELL).eq(3).should('not.have.text', 'siem-kibana'); | ||
}); | ||
}); |
20 changes: 0 additions & 20 deletions
20
x-pack/plugins/security_solution/cypress/integration/hosts/risky_hosts_kpi.spec.ts
This file was deleted.
Oops, something went wrong.
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
1 change: 1 addition & 0 deletions
1
...curity_solution/public/common/components/header_section/__snapshots__/index.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.