Skip to content

Commit a95ed39

Browse files
[9.1] [Defend Workflows] Fix endpoint exceptions cypress test (elastic#229469) (elastic#231637)
# Backport This will backport the following commits from `main` to `9.1`: - [[Defend Workflows] Fix endpoint exceptions cypress test (elastic#229469)](elastic#229469) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Gergő Ábrahám","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-08-13T14:10:51Z","message":"[Defend Workflows] Fix endpoint exceptions cypress test (elastic#229469)\n\n## Summary\n\nThis PR fixes and re-enables Endpoint Exception cypress tests, in order\nto keep behavior intact while moving on Endpoint Exceptions out of\nDetections (https://github.com/elastic/security-team/issues/11812).\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"2e20740a8d258d962e054f79eef33fa8ef94e1e8","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Defend Workflows","OLM Sprint","backport:all-open","v9.2.0"],"title":"[Defend Workflows] Fix endpoint exceptions cypress test","number":229469,"url":"https://github.com/elastic/kibana/pull/229469","mergeCommit":{"message":"[Defend Workflows] Fix endpoint exceptions cypress test (elastic#229469)\n\n## Summary\n\nThis PR fixes and re-enables Endpoint Exception cypress tests, in order\nto keep behavior intact while moving on Endpoint Exceptions out of\nDetections (https://github.com/elastic/security-team/issues/11812).\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"2e20740a8d258d962e054f79eef33fa8ef94e1e8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229469","number":229469,"mergeCommit":{"message":"[Defend Workflows] Fix endpoint exceptions cypress test (elastic#229469)\n\n## Summary\n\nThis PR fixes and re-enables Endpoint Exception cypress tests, in order\nto keep behavior intact while moving on Endpoint Exceptions out of\nDetections (https://github.com/elastic/security-team/issues/11812).\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"2e20740a8d258d962e054f79eef33fa8ef94e1e8"}}]}] BACKPORT--> Co-authored-by: Gergő Ábrahám <[email protected]>
1 parent ae0f091 commit a95ed39

File tree

5 files changed

+54
-9
lines changed

5 files changed

+54
-9
lines changed

x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/alerts_table_flow/endpoint_exceptions.cy.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* 2.0.
66
*/
77

8+
import { deleteEndpointExceptionList } from '../../../../../tasks/api_calls/exceptions';
89
import { deleteAlertsAndRules } from '../../../../../tasks/api_calls/common';
910
import {
1011
expandFirstAlert,
@@ -28,7 +29,7 @@ import {
2829
} from '../../../../../tasks/exceptions';
2930
import { ALERTS_COUNT } from '../../../../../screens/alerts';
3031
import {
31-
ADD_AND_BTN,
32+
ADD_NESTED_BTN,
3233
EXCEPTION_CARD_ITEM_CONDITIONS,
3334
EXCEPTION_CARD_ITEM_NAME,
3435
EXCEPTION_ITEM_VIEWER_CONTAINER,
@@ -40,8 +41,7 @@ import {
4041
} from '../../../../../tasks/rule_details';
4142

4243
// TODO: https://github.com/elastic/kibana/issues/161539
43-
// See https://github.com/elastic/kibana/issues/163967
44-
describe.skip(
44+
describe(
4545
'Endpoint Exceptions workflows from Alert',
4646
{ tags: ['@ess', '@serverless', '@skipInServerless'] },
4747
() => {
@@ -53,6 +53,7 @@ describe.skip(
5353
cy.task('esArchiverUnload', { archiveName: 'endpoint' });
5454
login();
5555
deleteAlertsAndRules();
56+
deleteEndpointExceptionList();
5657

5758
cy.task('esArchiverLoad', { archiveName: 'endpoint' });
5859
createRule(getEndpointRule()).then((rule) => visitRuleDetailsPage(rule.body.id));
@@ -63,6 +64,7 @@ describe.skip(
6364

6465
after(() => {
6566
cy.task('esArchiverUnload', { archiveName: 'endpoint' });
67+
deleteEndpointExceptionList();
6668
});
6769

6870
it('Should be able to create and close single Endpoint exception from overflow menu', () => {
@@ -99,7 +101,8 @@ describe.skip(
99101
validateExceptionConditionField('file.Ext.code_signature');
100102
addExceptionFlyoutItemName(ITEM_NAME);
101103

102-
cy.get(ADD_AND_BTN).click();
104+
// Add non-nested condition
105+
cy.get(ADD_NESTED_BTN).click();
103106
// edit conditions
104107
addExceptionEntryFieldValueAndSelectSuggestion(ADDITIONAL_ENTRY, 6);
105108
addExceptionEntryFieldValueValue('foo', 4);

x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/alerts_table_flow/rule_exceptions/auto_populate_with_alert_data.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ describe('Auto populate exception with Alert data', { tags: ['@ess', '@serverles
3838
const ADDITIONAL_ENTRY = 'host.hostname';
3939

4040
beforeEach(() => {
41-
cy.task('esArchiverUnload', { archiveName: 'endpoint' });
42-
cy.task('esArchiverLoad', { archiveName: 'endpoint' });
41+
cy.task('esArchiverUnload', { archiveName: 'endpoint_2' });
42+
cy.task('esArchiverLoad', { archiveName: 'endpoint_2' });
4343
login();
4444
createRule(getEndpointRule()).then((rule) => visitRuleDetailsPage(rule.body.id));
4545

x-pack/test/security_solution_cypress/cypress/tasks/exceptions/conditions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const addExceptionConditions = (exception: Exception) => {
8080
};
8181

8282
export const validateExceptionConditionField = (value: string) => {
83-
cy.get(EXCEPTION_ITEM_CONTAINER).contains('span', value);
83+
cy.get(EXCEPTION_ITEM_CONTAINER).get(`input[value="${value}"]`).should('exist');
8484
};
8585

8686
export const addTwoAndedConditions = (

x-pack/test/security_solution_cypress/es_archives/endpoint/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"name": "siem-kibana"
6060
},
6161
"agent": {
62-
"type": "auditbeat",
62+
"type": "endpoint",
6363
"version": "8.1.0",
6464
"ephemeral_id": "f6df090f-656a-4a79-a6a1-0c8671c9752d",
6565
"id": "0ebd469b-c164-4734-00e6-96d018098dc7",

x-pack/test/security_solution_cypress/es_archives/endpoint/mappings.json

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,48 @@
1818
"@timestamp": {
1919
"type": "date"
2020
},
21+
"file": {
22+
"properties": {
23+
"Ext": {
24+
"properties": {
25+
"code_signature": {
26+
"type": "nested",
27+
"properties": {
28+
"subject_name": {
29+
"type": "keyword",
30+
"ignore_above": 1024
31+
},
32+
"trusted": {
33+
"type": "boolean"
34+
}
35+
}
36+
}
37+
}
38+
},
39+
"hash": {
40+
"properties": {
41+
"sha256": {
42+
"type": "keyword",
43+
"ignore_above": 1024
44+
}
45+
}
46+
},
47+
"path": {
48+
"type": "keyword",
49+
"ignore_above": 1024,
50+
"fields": {
51+
"caseless": {
52+
"type": "keyword",
53+
"ignore_above": 1024,
54+
"normalizer": "lowercase"
55+
},
56+
"text": {
57+
"type": "text"
58+
}
59+
}
60+
}
61+
}
62+
},
2163
"agent": {
2264
"properties": {
2365
"ephemeral_id": {
@@ -491,4 +533,4 @@
491533
}
492534
}
493535
}
494-
}
536+
}

0 commit comments

Comments
 (0)