Skip to content
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

[Security Solution] Changes default role for serverless from admin to platform_engineer #183608

Merged
merged 33 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
baefab0
changes default role for serverless
MadameSheema May 16, 2024
5850a71
adjustment
MadameSheema May 16, 2024
95bc0a9
updates archives indexes names
MadameSheema May 21, 2024
c197ff1
Merge branch 'main' into cypress/changing-role
MadameSheema May 21, 2024
6d911ca
fixes
MadameSheema May 22, 2024
e3a6d2b
fixing data view
MadameSheema May 22, 2024
b32f421
more fixes
MadameSheema May 22, 2024
0191cdb
fixes investigations tests
MadameSheema May 22, 2024
11e2f02
fixes eql test
MadameSheema May 23, 2024
489cb03
fixes entity analytics tests
MadameSheema May 23, 2024
f487d3f
fixes cases tests
MadameSheema May 23, 2024
971175c
fixes explore tests
MadameSheema May 23, 2024
0e611bd
fixes investigations issue
MadameSheema May 23, 2024
d4c6565
fixes API test
MadameSheema May 23, 2024
bcc180e
fixes investigations test
MadameSheema May 23, 2024
d9ce991
Merge branch 'main' into cypress/changing-role
MadameSheema May 23, 2024
ce4956d
typo
MadameSheema May 23, 2024
7883cc2
skips maintenance window test
MadameSheema May 23, 2024
fa9be8e
fixes explore test
MadameSheema May 23, 2024
6877408
adds ticket to callout test
MadameSheema May 23, 2024
8432822
refactor
MadameSheema May 24, 2024
9ebd848
updates readme
MadameSheema May 24, 2024
870d8d3
adds ticket for tracking purposes
MadameSheema May 24, 2024
e570f5b
Merge branch 'main' into cypress/changing-role
MadameSheema May 24, 2024
e594b29
updates platform engineer role to include maintenance window all privs
dhurley14 May 24, 2024
115aad3
Revert "updates platform engineer role to include maintenance window …
MadameSheema May 24, 2024
e1e1711
Update x-pack/test/security_solution_cypress/cypress/e2e/detection_re…
MadameSheema May 24, 2024
b02872f
Merge branch 'main' into cypress/changing-role
MadameSheema May 27, 2024
6898fea
Merge branch 'main' into cypress/changing-role
MadameSheema May 27, 2024
0a2abad
Merge branch 'main' into cypress/changing-role
MadameSheema May 27, 2024
f8d56b2
Merge branch 'main' into cypress/changing-role
MadameSheema May 28, 2024
e868a2a
Merge branch 'main' into cypress/changing-role
MadameSheema Jun 3, 2024
f35ae55
fixes failing test
MadameSheema Jun 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "doc",
"value": {
"index": "no_at_timestamp_field",
"index": "auditbeat-no_at_timestamp_field",
"source": {
"locale": "pt",
"event.category": "configuration",
Expand All @@ -14,7 +14,7 @@
{
"type": "doc",
"value": {
"index": "no_at_timestamp_field",
"index": "auditbeat-no_at_timestamp_field",
"source": {
"locale": "es",
"event.category": "configuration",
Expand All @@ -27,7 +27,7 @@
{
"type": "doc",
"value": {
"index": "no_at_timestamp_field",
"index": "auditbeat-no_at_timestamp_field",
"source": {
"locale": "ua",
"event.category": "configuration",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "index",
"value": {
"index": "no_at_timestamp_field",
"index": "auditbeat-no_at_timestamp_field",
"mappings": {
"dynamic": "strict",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ export default ({ getService }: FtrProviderContext) => {

it('specifying only timestamp_field results in a warning, and no alerts are generated', async () => {
const rule: EqlRuleCreateProps = {
...getEqlRuleForAlertTesting(['no_at_timestamp_field']),
...getEqlRuleForAlertTesting(['auditbeat-no_at_timestamp_field']),
timestamp_field: 'event.ingested',
};

Expand All @@ -878,7 +878,7 @@ export default ({ getService }: FtrProviderContext) => {

expect(_log.errors).to.be.empty();
expect(_log.warnings).to.contain(
'The following indices are missing the timestamp field "@timestamp": ["no_at_timestamp_field"]'
'The following indices are missing the timestamp field "@timestamp": ["auditbeat-no_at_timestamp_field"]'
);

const previewAlerts = await getPreviewAlerts({ es, previewId });
Expand All @@ -887,7 +887,7 @@ export default ({ getService }: FtrProviderContext) => {

it('specifying only timestamp_override results in an error, and no alerts are generated', async () => {
const rule: EqlRuleCreateProps = {
...getEqlRuleForAlertTesting(['no_at_timestamp_field']),
...getEqlRuleForAlertTesting(['auditbeat-no_at_timestamp_field']),
timestamp_override: 'event.ingested',
};

Expand All @@ -906,7 +906,7 @@ export default ({ getService }: FtrProviderContext) => {

it('specifying both timestamp_override and timestamp_field results in alert creation with no warnings or errors', async () => {
const rule: EqlRuleCreateProps = {
...getEqlRuleForAlertTesting(['no_at_timestamp_field']),
...getEqlRuleForAlertTesting(['auditbeat-no_at_timestamp_field']),
timestamp_field: 'event.ingested',
timestamp_override: 'event.ingested',
};
Expand Down
10 changes: 7 additions & 3 deletions x-pack/test/security_solution_cypress/cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,15 @@ Store the saved key on `~/.elastic/cloud.json` using the following format:
}
```

Store the email and password of the account you used to login in the QA Environment at the root directory of your Kibana project on `.ftr/role_users.json`, using the following format:
By default all our Serverless tests are executed with the `platform_engineer` role.

So you need to add to your organization a new user that has the required role. You can achieve that by using email aliases.

Store the email and password of the account of the `platform_engineer` user at the root directory of your Kibana project on `.ftr/role_users.json`, using the following format:

```json
{
"admin": {
"platform_engineer": {
"email": "<email>",
"password": "<password>"
}
Expand All @@ -380,7 +384,7 @@ If you want to execute a test using Cypress on visual mode with MKI, you need to

```json
{
"admin": {
"platform_engineer": {
"email": "<email>",
"password": "<password>"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ describe('Close matching Alerts ', { tags: ['@ess', '@serverless'] }, () => {
cy.task('esArchiverLoad', { archiveName: 'exceptions' });

login();
postDataView('exceptions-*');
postDataView('auditbeat-exceptions-*');
createRule(
getNewRule({
query: 'agent.name:*',
data_view_id: 'exceptions-*',
data_view_id: 'auditbeat-exceptions-*',
interval: '1m',
rule_id: 'rule_testing',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
openExceptionFlyoutFromEmptyViewerPrompt,
visitRuleDetailsPage,
clickEnableRuleSwitch,
waitForTheRuleToBeExecuted,
goToAlertsTab,
} from '../../../../../tasks/rule_details';
import {
Expand Down Expand Up @@ -43,7 +42,7 @@ describe('Exceptions match_any', { tags: ['@ess', '@serverless'] }, () => {
login();
createRule(
getNewRule({
index: ['exceptions-*'],
index: ['auditbeat-exceptions-*'],
enabled: false,
query: '*',
from: 'now-438300h',
Expand Down Expand Up @@ -77,7 +76,6 @@ describe('Exceptions match_any', { tags: ['@ess', '@serverless'] }, () => {

goToAlertsTab();

waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

// Will match document with value "foo" and document with value "FOO"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
openEditException,
removeException,
visitRuleDetailsPage,
waitForTheRuleToBeExecuted,
} from '../../../../../tasks/rule_details';

import {
Expand All @@ -46,7 +45,7 @@ import {
} from '../../../../../screens/exceptions';
import { waitForAlertsToPopulate } from '../../../../../tasks/create_new_rule';

const DATAVIEW = 'exceptions-*';
const DATAVIEW = 'auditbeat-exceptions-*';

describe(
'Add exception using data views from rule details',
Expand Down Expand Up @@ -131,7 +130,6 @@ describe(
// now that there are no more exceptions, the docs should match and populate alerts
goToAlertsTab();
goToOpenedAlertsOnRuleDetailsPage();
waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(ALERTS_COUNT).should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
INTERVAL_ABBR_VALUE,
} from '../../../../screens/rule_details';

import { getDetails, waitForTheRuleToBeExecuted } from '../../../../tasks/rule_details';
import { getDetails } from '../../../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetailsOf } from '../../../../tasks/alerts_detection_rules';
import { deleteAlertsAndRules } from '../../../../tasks/api_calls/common';
import {
Expand Down Expand Up @@ -138,7 +138,6 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => {
.should('have.text', `${humanizedDuration}`);
});

waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(ALERTS_COUNT).should('have.text', expectedNumberOfAlerts);
Expand Down Expand Up @@ -175,7 +174,6 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => {
createAndEnableRule();
openRuleManagementPageViaBreadcrumbs();
goToRuleDetailsOf(rule.name);
waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(ALERTS_COUNT).should('have.text', expectedNumberOfSequenceAlerts);
Expand Down Expand Up @@ -203,7 +201,7 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => {
visit(CREATE_RULE_URL);
selectEqlRuleType();
getIndexPatternClearButton().click();
getRuleIndexInput().type(`no_at_timestamp_field{enter}`);
getRuleIndexInput().type(`auditbeat-no_at_timestamp_field{enter}`);

cy.get(RULES_CREATION_FORM).find(EQL_QUERY_INPUT).should('exist');
cy.get(RULES_CREATION_FORM).find(EQL_QUERY_INPUT).should('be.visible');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
INTERVAL_ABBR_VALUE,
} from '../../../../screens/rule_details';

import { getDetails, waitForTheRuleToBeExecuted } from '../../../../tasks/rule_details';
import { getDetails } from '../../../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetailsOf } from '../../../../tasks/alerts_detection_rules';
import { deleteAlertsAndRules } from '../../../../tasks/api_calls/common';
import {
Expand Down Expand Up @@ -149,7 +149,6 @@ describe(
.should('have.text', `${humanizedDuration}`);
});

waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(ALERT_DATA_GRID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import {
} from '../../../../tasks/create_new_rule';
import { login } from '../../../../tasks/login';
import { visit } from '../../../../tasks/navigation';
import { getDetails, waitForTheRuleToBeExecuted } from '../../../../tasks/rule_details';
import { getDetails } from '../../../../tasks/rule_details';
import { CREATE_RULE_URL } from '../../../../urls/navigation';
import { openRuleManagementPageViaBreadcrumbs } from '../../../../tasks/rules_management';

Expand Down Expand Up @@ -149,7 +149,6 @@ describe('Rules override', { tags: ['@ess', '@serverless'] }, () => {
.should('have.text', `${humanizedDuration}`);
});

waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(ALERTS_COUNT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ import {
} from '../../../../tasks/create_new_rule';
import { login } from '../../../../tasks/login';
import { visit } from '../../../../tasks/navigation';
import {
getDetails,
assertDetailsNotExist,
waitForTheRuleToBeExecuted,
} from '../../../../tasks/rule_details';
import { getDetails, assertDetailsNotExist } from '../../../../tasks/rule_details';
import { openRuleManagementPageViaBreadcrumbs } from '../../../../tasks/rules_management';
import { CREATE_RULE_URL } from '../../../../urls/navigation';

Expand Down Expand Up @@ -147,7 +143,6 @@ describe(
.should('have.text', `${humanizedDuration}`);
});

waitForTheRuleToBeExecuted();
waitForAlertsToPopulate();

cy.get(ALERTS_COUNT).should(($count) => expect(+$count.text().split(' ')[0]).to.be.lt(100));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import { login } from '../../../../tasks/login';
import { visit } from '../../../../tasks/navigation';
import { RULES_MANAGEMENT_URL } from '../../../../urls/rules_management';

// https://github.com/elastic/kibana/issues/184160
describe(
'Maintenance window callout on Rule Management page',
{ tags: ['@ess', '@serverless'] },
{ tags: ['@ess', '@serverless', '@skipInServerless'] },
() => {
let maintenanceWindowId = '';

Expand Down
Loading