-
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.
[SecuritySolution] Remove transform delay time + add unattended setti…
…ng (#184797) ## Summary * Refresh risk score index after persisting risk score * Schedule the risk score transform after calculating the risk score for a single entity * Update transform config * Add `delay: 0s` * Add `managed` and `managed_by` metadata * Add `version` metadata (used by the migration) * Add `unattended: true` * Create a transform migration ## How to test it? ### Migration 1. Install risk engine on an old version 2. Upgrade version 3. Add new alerts with new host and user 4. Run the risk engine (you can wait or force it to run by switching the flag on/off) 5. Open the explore page (user|host)/risk-tab and check if the new user|host is present ### New installation 1. Install risk engine on an empty cluster 3. Add new alerts with new host and user 4. Run the risk engine (you can wait or force it to run by switching the flag on/off) 5. Open the explore page (user|host)/risk-tab and check if the new user|host is present ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
Showing
14 changed files
with
290 additions
and
52 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
52 changes: 52 additions & 0 deletions
52
...k/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.test.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 { getTransformOptions } from './configurations'; | ||
|
||
describe('getTransformOptions', () => { | ||
it('transform content has changed, please update the transform version and regenerate the snapshot', () => { | ||
const options = getTransformOptions({ | ||
dest: 'dest', | ||
source: ['source'], | ||
}); | ||
|
||
expect(options).toMatchInlineSnapshot(` | ||
Object { | ||
"_meta": Object { | ||
"managed": true, | ||
"managed_by": "security-entity-analytics", | ||
"version": 2, | ||
}, | ||
"dest": Object { | ||
"index": "dest", | ||
}, | ||
"frequency": "1h", | ||
"latest": Object { | ||
"sort": "@timestamp", | ||
"unique_key": Array [ | ||
"host.name", | ||
"user.name", | ||
], | ||
}, | ||
"settings": Object { | ||
"unattended": true, | ||
}, | ||
"source": Object { | ||
"index": Array [ | ||
"source", | ||
], | ||
}, | ||
"sync": Object { | ||
"time": Object { | ||
"delay": "0s", | ||
"field": "@timestamp", | ||
}, | ||
}, | ||
} | ||
`); | ||
}); | ||
}); |
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
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
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.