Skip to content

Commit

Permalink
[8.x] [ResponseOps] Get rid from dot in siem index name (#204196) (#2…
Browse files Browse the repository at this point in the history
…04371)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ResponseOps] Get rid from dot in siem index name
(#204196)](#204196)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Julia","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-16T12:02:35Z","message":"[ResponseOps]
Get rid from dot in siem index name (#204196)\n\nFixes:
https://github.com/elastic/kibana-team/issues/1334\r\n\r\n\r\nCheck the
PR satisfies following conditions. \r\n\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"d0270e57ce66296c7d6975579483743f512fa834","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","Feature:Cases","backport:prev-minor","v8.18.0"],"title":"[ResponseOps]
Get rid from dot in siem index
name","number":204196,"url":"https://github.com/elastic/kibana/pull/204196","mergeCommit":{"message":"[ResponseOps]
Get rid from dot in siem index name (#204196)\n\nFixes:
https://github.com/elastic/kibana-team/issues/1334\r\n\r\n\r\nCheck the
PR satisfies following conditions. \r\n\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"d0270e57ce66296c7d6975579483743f512fa834"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204196","number":204196,"mergeCommit":{"message":"[ResponseOps]
Get rid from dot in siem index name (#204196)\n\nFixes:
https://github.com/elastic/kibana-team/issues/1334\r\n\r\n\r\nCheck the
PR satisfies following conditions. \r\n\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"d0270e57ce66296c7d6975579483743f512fa834"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia <[email protected]>
  • Loading branch information
kibanamachine and guskovaue authored Dec 16, 2024
1 parent 018a2a5 commit cffd0f3
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export default ({ getService }: FtrProviderContext): void => {
const supertest = getService('supertest');
const es = getService('es');
const supertestWithoutAuth = getService('supertestWithoutAuth');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');

describe('find_cases', () => {
Expand Down Expand Up @@ -560,16 +559,11 @@ export default ({ getService }: FtrProviderContext): void => {
});

describe('alerts', () => {
const defaultSignalsIndex = '.siem-signals-default-000001';
const defaultSignalsIndex = 'siem-signals-default-000001';
const signalID = '4679431ee0ba3209b6fcd60a255a696886fe0a7d18f5375de510ff5b68fa6b78';
const signalID2 = '1023bcfea939643c5e51fd8df53797e0ea693cee547db579ab56d96402365c1e';

beforeEach(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/cases/signals/default');
});

afterEach(async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/cases/signals/default');
await deleteAllCaseItems(es);
});

Expand All @@ -592,11 +586,6 @@ export default ({ getService }: FtrProviderContext): void => {
owner: 'securitySolutionFixture',
},
});

// There is potential for the alert index to not be refreshed by the time the second comment is created
// which could attempt to update the alert status again and will encounter a conflict so this will
// ensure that the index is up to date before we try to update the next alert status
await es.indices.refresh({ index: defaultSignalsIndex });
}

const patchedCase = await createComment({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export default ({ getService }: FtrProviderContext): void => {
caseId: postedCase.id,
params: {
alertId: '4679431ee0ba3209b6fcd60a255a696886fe0a7d18f5375de510ff5b68fa6b78',
index: '.siem-signals-default-000001',
index: 'siem-signals-default-000001',
rule: { id: 'test-rule-id', name: 'test-index-id' },
type: AttachmentType.alert,
owner: 'securitySolutionFixture',
Expand Down Expand Up @@ -593,7 +593,7 @@ export default ({ getService }: FtrProviderContext): void => {
caseId: postedCaseId,
params: {
alertId: '4679431ee0ba3209b6fcd60a255a696886fe0a7d18f5375de510ff5b68fa6b78',
index: '.siem-signals-default-000001',
index: 'siem-signals-default-000001',
rule: { id: 'test-rule-id', name: 'test-index-id' },
type: AttachmentType.alert,
owner: 'securitySolutionFixture',
Expand Down Expand Up @@ -1528,7 +1528,7 @@ export default ({ getService }: FtrProviderContext): void => {

describe('alerts', () => {
describe('Update', () => {
const defaultSignalsIndex = '.siem-signals-default-000001';
const defaultSignalsIndex = 'siem-signals-default-000001';

beforeEach(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/cases/signals/default');
Expand Down Expand Up @@ -1662,7 +1662,7 @@ export default ({ getService }: FtrProviderContext): void => {
});

describe('No update', () => {
const defaultSignalsIndex = '.siem-signals-default-000001';
const defaultSignalsIndex = 'siem-signals-default-000001';

beforeEach(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/cases/signals/duplicate_ids');
Expand All @@ -1681,12 +1681,12 @@ export default ({ getService }: FtrProviderContext): void => {
});
};

// this id exists only in .siem-signals-default-000001
// this id exists only in siem-signals-default-000001
const signalIDInFirstIndex =
'cae78067e65582a3b277c1ad46ba3cb29044242fe0d24bbf3fcde757fdd31d1c';
// This id exists in both .siem-signals-default-000001 and .siem-signals-default-000002
// This id exists in both siem-signals-default-000001 and siem-signals-default-000002
const signalIDInSecondIndex = 'duplicate-signal-id';
const signalsIndex2 = '.siem-signals-default-000002';
const signalsIndex2 = 'siem-signals-default-000002';

const individualCase = await createCase(supertest, {
...postCaseReq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default ({ getService }: FtrProviderContext): void => {
const esArchiver = getService('esArchiver');

describe('update_alert_status', () => {
const defaultSignalsIndex = '.siem-signals-default-000001';
const defaultSignalsIndex = 'siem-signals-default-000001';

beforeEach(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/cases/signals/default');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ export default ({ getService }: FtrProviderContext): void => {
'48bdf505176b47705da896fb58bc2070768c072778f5412f162abec2ff6ca67b',
],
index: [
'.siem-signals-default-000001',
'.siem-signals-default-000001',
'.siem-signals-default-000001',
'.siem-signals-default-000001',
'.siem-signals-default-000001',
'.siem-signals-default-000001',
'siem-signals-default-000001',
'siem-signals-default-000001',
'siem-signals-default-000001',
'siem-signals-default-000001',
'siem-signals-default-000001',
'siem-signals-default-000001',
],
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ export default ({ getService }: FtrProviderContext): void => {
});

describe('alerts', () => {
const defaultSignalsIndex = '.siem-signals-default-000001';
const defaultSignalsIndex = 'siem-signals-default-000001';
const signalID = '4679431ee0ba3209b6fcd60a255a696886fe0a7d18f5375de510ff5b68fa6b78';
const signalID2 = '1023bcfea939643c5e51fd8df53797e0ea693cee547db579ab56d96402365c1e';

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
".alerts-security.alerts-default": {
"is_write_index": false
},
".siem-signals-default": {
"siem-signals-default": {
"is_write_index": true
}
},
"index": ".siem-signals-default-000001",
"index": "siem-signals-default-000001",
"mappings": {
"_meta": {
"aliases_version": 1,
Expand Down Expand Up @@ -4981,8 +4981,8 @@
"settings": {
"index": {
"lifecycle": {
"name": ".siem-signals-default",
"rollover_alias": ".siem-signals-default"
"name": "siem-signals-default",
"rollover_alias": "siem-signals-default"
},
"mapping": {
"total_fields": {
Expand All @@ -5001,7 +5001,7 @@
"value": {
"aliases": {
},
"index": ".siem-signals-default-000002",
"index": "siem-signals-default-000002",
"mappings": {
"_meta": {
"aliases_version": 1,
Expand Down Expand Up @@ -9973,8 +9973,8 @@
"settings": {
"index": {
"lifecycle": {
"name": ".siem-signals-default",
"rollover_alias": ".siem-signals-default"
"name": "siem-signals-default",
"rollover_alias": "siem-signals-default"
},
"mapping": {
"total_fields": {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
".alerts-security.alerts-default": {
"is_write_index": false
},
".siem-signals-default": {
"siem-signals-default": {
"is_write_index": true
}
},
"index": ".siem-signals-default-000001",
"index": "siem-signals-default-000001",
"mappings": {
"_meta": {
"aliases_version": 1,
Expand Down Expand Up @@ -4981,8 +4981,8 @@
"settings": {
"index": {
"lifecycle": {
"name": ".siem-signals-default",
"rollover_alias": ".siem-signals-default"
"name": "siem-signals-default",
"rollover_alias": "siem-signals-default"
},
"mapping": {
"total_fields": {
Expand Down

0 comments on commit cffd0f3

Please sign in to comment.