-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[EDR workflows] Osquery serverless tests #163795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
da74227
e96b274
ee821ed
c5348d0
a3f7c8f
10a72e1
bbc4605
429ca68
14d26f8
6e9c3d8
3bd9fd2
e1dc322
054b9b0
e67fb56
cbdb767
453850e
47a18c6
41d6384
a0db043
177bc0e
d330bef
7191f8d
e2da32c
be09e33
585ce18
c3770df
af5a765
91544c6
7880a5f
1e808a1
ea3fd67
ac0907a
0af7a70
add5958
21bbb56
811e55e
af108bc
dd0d5ba
f8f08ef
4e15ae5
cad0189
6f1d48c
abd2dec
3ee6ff4
416cbf9
ae711f0
38ef6fa
cb01742
e1d326f
91d92d8
6e696c4
6359fd6
0375475
5c4c410
386e1a1
fe8b13e
98c8a65
214ef7e
d35aff0
e0f4fe2
42266f3
bbf95cc
5e38470
4ca976b
5e8ddc5
8e5cea6
39067df
4c3c38b
30ec676
68cfcc0
783f79e
e310070
29d0d4e
4097329
0c71da5
32a9d12
58dfc14
541a229
48f51d2
2671d97
c39e693
13d5c91
3107e3f
fd8bd66
f5588ed
8233637
717ba85
30d1203
d39e031
9fadd64
75d81c1
b157854
c8cf993
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| source .buildkite/scripts/common/util.sh | ||
| source .buildkite/scripts/steps/functional/common_cypress.sh | ||
|
|
||
| .buildkite/scripts/bootstrap.sh | ||
| node scripts/build_kibana_platform_plugins.js | ||
jbudz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| export JOB=kibana-osquery-cypress-serverless | ||
|
|
||
| echo "--- Security Osquery Serverless Cypress" | ||
|
|
||
| yarn --cwd x-pack/plugins/osquery cypress:serverless:run | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| * 2.0. | ||
| */ | ||
|
|
||
| import { tag } from '../../tags'; | ||
| import { | ||
| cleanupPack, | ||
| cleanupAgentPolicy, | ||
|
|
@@ -28,11 +29,9 @@ import { | |
| interceptAgentPolicyId, | ||
| policyContainsIntegration, | ||
| } from '../../tasks/integrations'; | ||
|
|
||
| import { login } from '../../tasks/login'; | ||
| import { findAndClickButton, findFormFieldByRowsLabelAndType } from '../../tasks/live_query'; | ||
|
|
||
| describe('ALL - Add Integration', () => { | ||
| describe('ALL - Add Integration', { tags: [tag.ESS, tag.BROKEN_IN_SERVERLESS] }, () => { | ||
| let savedQueryId: string; | ||
|
|
||
| before(() => { | ||
|
|
@@ -42,7 +41,7 @@ describe('ALL - Add Integration', () => { | |
| }); | ||
|
|
||
| beforeEach(() => { | ||
| login(); | ||
| cy.login('elastic'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we have to login as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed to soc_manager in general + added a 'viewer' role. But to answer your question: we didn't have to change to elastic in ESS, it was done just for unification.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok this specific login is still elastic, as it was login() before. because we need more access to fleet here. the other tests are changed back into soc_manager. |
||
| }); | ||
|
|
||
| after(() => { | ||
|
|
@@ -63,7 +62,7 @@ describe('ALL - Add Integration', () => { | |
| cy.get(`[url="${NAV_SEARCH_INPUT_OSQUERY_RESULTS.MANAGER}"]`).should('exist').click(); | ||
| }); | ||
|
|
||
| describe('Add and upgrade integration', () => { | ||
| describe('Add and upgrade integration', { tags: [tag.ESS] }, () => { | ||
| const oldVersion = '0.7.4'; | ||
| const [integrationName, policyName] = generateRandomStringName(2); | ||
| let policyId: string; | ||
|
|
@@ -78,7 +77,7 @@ describe('ALL - Add Integration', () => { | |
| cleanupAgentPolicy(policyId); | ||
| }); | ||
|
|
||
| it('should add the old integration and be able to upgrade it', () => { | ||
| it('should add the old integration and be able to upgrade it', { tags: tag.ESS }, () => { | ||
| cy.visit(createOldOsqueryPath(oldVersion)); | ||
| addCustomIntegration(integrationName, policyName); | ||
| policyContainsIntegration(integrationName, policyName); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| * 2.0. | ||
| */ | ||
|
|
||
| import { LIVE_QUERY_EDITOR } from '../../screens/live_query'; | ||
| import { | ||
| cleanupCase, | ||
| cleanupPack, | ||
|
|
@@ -14,17 +15,18 @@ import { | |
| loadRule, | ||
| packFixture, | ||
| } from '../../tasks/api_fixtures'; | ||
| import { ROLE, login } from '../../tasks/login'; | ||
| import { | ||
| addToCase, | ||
| checkActionItemsInResults, | ||
| clickRuleName, | ||
| loadRuleAlerts, | ||
| submitQuery, | ||
| viewRecentCaseAndCheckResults, | ||
| } from '../../tasks/live_query'; | ||
| import { generateRandomStringName, interceptCaseId } from '../../tasks/integrations'; | ||
|
|
||
| describe('Alert Event Details - Cases', () => { | ||
| import { tag } from '../../tags'; | ||
| import { ServerlessRoleName } from '../../support/roles'; | ||
| describe('Alert Event Details - Cases', { tags: [tag.ESS, tag.SERVERLESS] }, () => { | ||
gergoabraham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| let ruleId: string; | ||
| let ruleName: string; | ||
| let packId: string; | ||
|
|
@@ -44,9 +46,9 @@ describe('Alert Event Details - Cases', () => { | |
| }); | ||
|
|
||
| beforeEach(() => { | ||
| login(ROLE.soc_manager); | ||
| cy.login(ServerlessRoleName.SOC_MANAGER); | ||
| cy.visit('/app/security/rules'); | ||
| cy.contains(ruleName).click(); | ||
| clickRuleName(ruleName); | ||
| }); | ||
|
|
||
| after(() => { | ||
|
|
@@ -72,10 +74,10 @@ describe('Alert Event Details - Cases', () => { | |
| cy.getBySel('expand-event').first().click({ force: true }); | ||
| cy.getBySel('take-action-dropdown-btn').click(); | ||
| cy.getBySel('osquery-action-item').click(); | ||
| cy.contains('Run a set of queries in a pack').wait(500).click(); | ||
| cy.getBySel('select-live-pack').within(() => { | ||
| cy.getBySel('comboBoxInput').type(`${packName}{downArrow}{enter}`); | ||
| }); | ||
| cy.contains(/^\d+ agen(t|ts) selected/); | ||
| cy.contains('Run a set of queries in a pack').click(); | ||
| cy.get(LIVE_QUERY_EDITOR).should('not.exist'); | ||
| cy.getBySel('select-live-pack').click().type(`${packName}{downArrow}{enter}`); | ||
| submitQuery(); | ||
| cy.get('[aria-label="Add to Case"]').first().click(); | ||
| cy.getBySel('cases-table-add-case-filter-bar').click(); | ||
|
|
@@ -91,7 +93,8 @@ describe('Alert Event Details - Cases', () => { | |
| }); | ||
| }); | ||
|
|
||
| describe('Case', () => { | ||
| // verify why calling new action doesnt add to response actions list | ||
| describe.skip('Case', () => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we could use tags instead of skipping it fully?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this tests fails on both envs, I'll have to take a look into why that functionality broke on new flyout. |
||
| let caseId: string; | ||
|
|
||
| before(() => { | ||
|
|
@@ -134,6 +137,7 @@ describe('Alert Event Details - Cases', () => { | |
| cases: true, | ||
| timeline: true, | ||
| }); | ||
|
|
||
| addToCase(caseId); | ||
| viewRecentCaseAndCheckResults(); | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can replace this with
and remove lines 8 and 9. Sorry about the earlier suggestion, I got the abstraction layers mixed up.