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

[SecuritySolution] Add enrichPolicyExecutionInterval to entity enablement and init APIs #207374

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Jan 21, 2025

Summary

Add enrichPolicyExecutionIntervalparam to entity enablement and init APIs

How to test?

  • Start kibana
  • Call the entity store enablement API with a short value for enrichPolicyExecutionInterval param
  • Check in the logs if the enrichment process is running frequently
  • Clear the entity store
  • Call the entity store enablement API without enrichPolicyExecutionInterval param
  • Check in the logs if the enrichment process is running less frequently

Enable Entity store API call:

POST kbn:/api/entity_store/enable {
  "enrichPolicyExecutionInterval": "10s"
}

Init Entity store API call:

POST kbn:/api/entity_store/engines/user/init {
  "enrichPolicyExecutionInterval": "10s"
}

Enrich policy log message:

   │ info [o.e.x.e.EnrichPolicyRunner] [...] Policy [entity_store_field_retention_user_default_v1.0.0]: Running enrich policy

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Unit or functional tests were updated or added to match the most common scenarios
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

@machadoum machadoum self-assigned this Jan 21, 2025
@machadoum machadoum added release_note:fix v9.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Theme: entity_analytics Feature:Entity Analytics Security Solution Entity Analytics features Team:Entity Analytics Security Entity Analytics Team backport:version Backport to applied version labels v8.18.0 release_note:feature Makes this part of the condensed release notes and removed release_note:fix labels Jan 23, 2025
@machadoum machadoum marked this pull request as ready for review January 23, 2025 12:55
@machadoum machadoum requested a review from a team as a code owner January 23, 2025 12:55
@machadoum machadoum requested a review from CAWilson94 January 23, 2025 12:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

@machadoum machadoum marked this pull request as draft January 23, 2025 12:57
@machadoum machadoum marked this pull request as ready for review January 23, 2025 13:16
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 21.3MB 21.3MB +88.0B

cc @machadoum

Copy link
Contributor

@tiansivive tiansivive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Copy link
Contributor

@CAWilson94 CAWilson94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks Pablo! 🚀

@machadoum machadoum merged commit 1ca4d96 into elastic:main Jan 24, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12950280234

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 207374

Questions ?

Please refer to the Backport tool documentation

@machadoum
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

machadoum added a commit to machadoum/kibana that referenced this pull request Jan 24, 2025
…ment and init APIs (elastic#207374)

## Summary

Add `enrichPolicyExecutionInterval`param to entity enablement and init
APIs

### How to test?
* Start kibana
* Call the entity store enablement API with a short value for
`enrichPolicyExecutionInterval` param
* Check in the logs if the enrichment process is running frequently
* Clear the entity store
* Call the entity store enablement API without
`enrichPolicyExecutionInterval` param
* Check in the logs if the enrichment process is running less frequently

**Enable Entity store API call:**
```
POST kbn:/api/entity_store/enable {
  "enrichPolicyExecutionInterval": "10s"
}
```

**Init Entity store API call:**
```
POST kbn:/api/entity_store/engines/user/init {
  "enrichPolicyExecutionInterval": "10s"
}

```

**Enrich policy log message:**
```
   │ info [o.e.x.e.EnrichPolicyRunner] [...] Policy [entity_store_field_retention_user_default_v1.0.0]: Running enrich policy
```

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 1ca4d96)

# Conflicts:
#	oas_docs/output/kibana.serverless.yaml
#	oas_docs/output/kibana.yaml
#	x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/enable.gen.ts
#	x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/enable.schema.yaml
#	x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml
#	x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml
#	x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts
machadoum added a commit that referenced this pull request Jan 24, 2025
…enablement and init APIs (#207374) (#208223)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[SecuritySolution] Add enrichPolicyExecutionInterval to entity
enablement and init APIs
(#207374)](#207374)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Pablo
Machado","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-24T13:09:12Z","message":"[SecuritySolution]
Add enrichPolicyExecutionInterval to entity enablement and init APIs
(#207374)\n\n## Summary\n\nAdd `enrichPolicyExecutionInterval`param to
entity enablement and init\nAPIs\n\n### How to test?\n* Start kibana\n*
Call the entity store enablement API with a short value
for\n`enrichPolicyExecutionInterval` param\n* Check in the logs if the
enrichment process is running frequently\n* Clear the entity store\n*
Call the entity store enablement API
without\n`enrichPolicyExecutionInterval` param\n* Check in the logs if
the enrichment process is running less frequently\n\n\n**Enable Entity
store API call:**\n```\nPOST kbn:/api/entity_store/enable {\n
\"enrichPolicyExecutionInterval\": \"10s\"\n}\n```\n\n**Init Entity
store API call:**\n```\nPOST kbn:/api/entity_store/engines/user/init {\n
\"enrichPolicyExecutionInterval\": \"10s\"\n}\n\n```\n\n**Enrich policy
log message:**\n```\n │ info [o.e.x.e.EnrichPolicyRunner] [...] Policy
[entity_store_field_retention_user_default_v1.0.0]: Running enrich
policy\n```\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following
conditions. \n\nReviewers should verify this PR satisfies this list as
well.\n\n- [ ] [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\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"1ca4d967d926a3e6295cb08dcd55dcf1adbd351c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["v9.0.0","Team:
SecuritySolution","release_note:feature","Theme:
entity_analytics","Feature:Entity Analytics","Team:Entity
Analytics","backport:version","v8.18.0"],"title":"[SecuritySolution] Add
enrichPolicyExecutionInterval to entity enablement and init
APIs","number":207374,"url":"https://github.com/elastic/kibana/pull/207374","mergeCommit":{"message":"[SecuritySolution]
Add enrichPolicyExecutionInterval to entity enablement and init APIs
(#207374)\n\n## Summary\n\nAdd `enrichPolicyExecutionInterval`param to
entity enablement and init\nAPIs\n\n### How to test?\n* Start kibana\n*
Call the entity store enablement API with a short value
for\n`enrichPolicyExecutionInterval` param\n* Check in the logs if the
enrichment process is running frequently\n* Clear the entity store\n*
Call the entity store enablement API
without\n`enrichPolicyExecutionInterval` param\n* Check in the logs if
the enrichment process is running less frequently\n\n\n**Enable Entity
store API call:**\n```\nPOST kbn:/api/entity_store/enable {\n
\"enrichPolicyExecutionInterval\": \"10s\"\n}\n```\n\n**Init Entity
store API call:**\n```\nPOST kbn:/api/entity_store/engines/user/init {\n
\"enrichPolicyExecutionInterval\": \"10s\"\n}\n\n```\n\n**Enrich policy
log message:**\n```\n │ info [o.e.x.e.EnrichPolicyRunner] [...] Policy
[entity_store_field_retention_user_default_v1.0.0]: Running enrich
policy\n```\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following
conditions. \n\nReviewers should verify this PR satisfies this list as
well.\n\n- [ ] [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\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"1ca4d967d926a3e6295cb08dcd55dcf1adbd351c"}},"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/207374","number":207374,"mergeCommit":{"message":"[SecuritySolution]
Add enrichPolicyExecutionInterval to entity enablement and init APIs
(#207374)\n\n## Summary\n\nAdd `enrichPolicyExecutionInterval`param to
entity enablement and init\nAPIs\n\n### How to test?\n* Start kibana\n*
Call the entity store enablement API with a short value
for\n`enrichPolicyExecutionInterval` param\n* Check in the logs if the
enrichment process is running frequently\n* Clear the entity store\n*
Call the entity store enablement API
without\n`enrichPolicyExecutionInterval` param\n* Check in the logs if
the enrichment process is running less frequently\n\n\n**Enable Entity
store API call:**\n```\nPOST kbn:/api/entity_store/enable {\n
\"enrichPolicyExecutionInterval\": \"10s\"\n}\n```\n\n**Init Entity
store API call:**\n```\nPOST kbn:/api/entity_store/engines/user/init {\n
\"enrichPolicyExecutionInterval\": \"10s\"\n}\n\n```\n\n**Enrich policy
log message:**\n```\n │ info [o.e.x.e.EnrichPolicyRunner] [...] Policy
[entity_store_field_retention_user_default_v1.0.0]: Running enrich
policy\n```\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following
conditions. \n\nReviewers should verify this PR satisfies this list as
well.\n\n- [ ] [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\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"1ca4d967d926a3e6295cb08dcd55dcf1adbd351c"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <[email protected]>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Jan 27, 2025
…ment and init APIs (elastic#207374)

## Summary

Add `enrichPolicyExecutionInterval`param to entity enablement and init
APIs

### How to test?
* Start kibana
* Call the entity store enablement API with a short value for
`enrichPolicyExecutionInterval` param
* Check in the logs if the enrichment process is running frequently
* Clear the entity store
* Call the entity store enablement API without
`enrichPolicyExecutionInterval` param
* Check in the logs if the enrichment process is running less frequently


**Enable Entity store API call:**
```
POST kbn:/api/entity_store/enable {
  "enrichPolicyExecutionInterval": "10s"
}
```

**Init Entity store API call:**
```
POST kbn:/api/entity_store/engines/user/init {
  "enrichPolicyExecutionInterval": "10s"
}

```

**Enrich policy log message:**
```
   │ info [o.e.x.e.EnrichPolicyRunner] [...] Policy [entity_store_field_retention_user_default_v1.0.0]: Running enrich policy
```




### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Entity Analytics Security Solution Entity Analytics features release_note:feature Makes this part of the condensed release notes Team:Entity Analytics Security Entity Analytics Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Theme: entity_analytics v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants