-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Create Entity Store index #175025
[Security Solution] Create Entity Store index #175025
Conversation
c3fb8b7
to
bf900ae
Compare
bf900ae
to
73ed106
Compare
5836e7f
to
c6c9b29
Compare
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-entity-analytics (Team:Entity Analytics) |
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.
ftr_configs.yml
@elasticmachine merge upstream |
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.
Thanks, this looks good!
I think you need a change to the request_context mock: diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts
index cb0b48b8e3f..4f436bfcf2a 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts
@@ -116,6 +116,7 @@ const createSecuritySolutionRequestContextMock = (
const kibanaRequest = requestMock.create();
return {
+ getEntityStoreDataClient: jest.fn(() => { throw new Error('Not implemented') }),
core,
getServerBasePath: jest.fn(() => ''),
getEndpointAuthz: jest.fn(async () => |
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.
Great work 🚀 A few more general questions
logger: this.options.logger, | ||
options: { | ||
index: getEntityStoreIndex(this.options.namespace), | ||
mappings: mappingFromFieldMap(entityStoreFieldMap, 'strict'), |
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 know this is a pattern used in other places, but I'm interested. What is the benefit of the field map instead of just storing as a pure elastic mapping?
I have looked at our used of mappingFromFieldMap
and I couldn't see where the field map is used anywhere else?
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 just keep it for consistency. Maybe @nkhristinin or @rylnd can answer this question.
x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/init.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/init.ts
Show resolved
Hide resolved
@elasticmachine merge upstream |
💔 Build FailedFailed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @machadoum |
1a7f155
into
elastic:security/feature/entity-store-poc
**This PR is going to be merged to the [entity-store-poc](https://github.com/elastic/kibana/tree/security/feature/entity-store-poc) feature branch; it won't impact the main branch.** ## Summary * Create `entity_store/init` route that creates the Entity Store index. * Create FTR tests. ### Out of scope * User fields are out of scope. * API privileges are out of scope. ### How to test it? * Call API ``` KIBANA_URL="http://localhost:5601" USER_PASS="{USER}:{PASSWORD}" curl "$KIBANA_URL/internal/entity_store/init" \ -H 'kbn-xsrf:bleh' \ --user "$USER_PASS"\ -X 'POST' \ -H 'elastic-api-version: 1' ``` * Open the console and check if the index `.entities.entities-default` exists #### Run tests **serverless** `yarn run initialize-server:ea:default entity_store serverless` `yarn run run-tests:ea:default entity_store serverless serverlessEnv` **ess** `yarn run initialize-server:ea:default entity_store ess` `yarn run run-tests:ea:default entity_store ess essEnv` ### Checklist - [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 --------- Co-authored-by: Kibana Machine <[email protected]>
This PR is going to be merged to the entity-store-poc feature branch; it won't impact the main branch.
Summary
entity_store/init
route that creates the Entity Store index.Out of scope
How to test it?
.entities.entities-default
existsRun tests
serverless
yarn run initialize-server:ea:default entity_store serverless
yarn run run-tests:ea:default entity_store serverless serverlessEnv
ess
yarn run initialize-server:ea:default entity_store ess
yarn run run-tests:ea:default entity_store ess essEnv
Checklist