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

[RAC][Rule Registry] Generate ECS fieldmap from ECS 8.0 #123012

Merged
merged 9 commits into from
Jan 19, 2022

Conversation

rylnd
Copy link
Contributor

@rylnd rylnd commented Jan 14, 2022

Summary

This is the result of running the generate_ecs_fieldmap script against ECS' 8.0 branch.

Checklist

This is the result of running the generate_ecs_fieldmap script against
ECS' 8.0 branch.
@rylnd
Copy link
Contributor Author

rylnd commented Jan 14, 2022

Scanning CI it looks like this is the offending error, currently:

│ proc [kibana] [2022-01-14T00:59:57.161+00:00][ERROR][plugins.ruleRegistry] ResponseError: mapper_parsing_exception: [mapper_parsing_exception] Reason: Failed to parse mapping: Field [scaling_factor] is required

│ proc [kibana] [2022-01-14T00:54:43.051+00:00][ERROR][plugins.ruleRegistry] Error: Failure installing common resources shared between all indices. mapper_parsing_exception: [mapper_parsing_exception] Reason: Failed to parse mapping: Field [scaling_factor] is required

I'm not sure which field that pertains to, but will continue to investigate.

Comment on lines 1498 to 1502
'host.cpu.usage': {
type: 'scaled_float',
array: false,
required: false,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is the source of the mapping error, the script that generates this file doesn't pick up the scaling_factor from the ECS file (https://github.com/elastic/ecs/blob/main/generated/ecs/ecs_flat.yml#L4646) and scaling_factor is a required property for scaled_float fields.

This is a required field for e.g. scaled_float fields, so we need to
reflect its value in our field map.
It does not appear that this value was ever being set, nor does this
value appear in ECS' flat output, so I'm removing it for now to keep our
types as accurate as possible.
This is a required field for type: alias fields.
This now exceeds the default of 1000.
Apparently 1300 wasn't enough, either.
@rylnd
Copy link
Contributor Author

rylnd commented Jan 14, 2022

For posterity: the errors related to these changes look to be due to #108941 and the resulting PR.

Makes this field optional, since the technical component template
doesn't currently use it.
Including the newest ECS fields, this index now exceeds 1600 fields.
This value should probably be derived from the composed template's
limits, but for now this allows the template to be created.
@rylnd rylnd marked this pull request as ready for review January 15, 2022 01:59
@rylnd
Copy link
Contributor Author

rylnd commented Jan 18, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 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
apm 2.8MB 2.8MB +33.4KB
observability 357.8KB 391.2KB +33.4KB
total +66.7KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @rylnd

@ecezalp
Copy link
Contributor

ecezalp commented Jan 18, 2022

threat fields w/ both threat.enrichments.* and threat.indicator.* LGTM, thanks

@rylnd rylnd added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Jan 18, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@rylnd rylnd added the auto-backport Deprecated - use backport:version if exact versions are needed label Jan 19, 2022
@rylnd rylnd merged commit 8737691 into elastic:main Jan 19, 2022
@kibanamachine
Copy link
Contributor

The following labels were identified as gaps in your version labels and will be added automatically:

  • v8.1.0

If any of these should not be on your pull request, please manually remove them.

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 19, 2022
* Generate ECS fieldmap from ECS 8.0

This is the result of running the generate_ecs_fieldmap script against
ECS' 8.0 branch.

* Account for scaling_factor property from ECS

This is a required field for e.g. scaled_float fields, so we need to
reflect its value in our field map.

* Remove unused, unset property from FieldMap

It does not appear that this value was ever being set, nor does this
value appear in ECS' flat output, so I'm removing it for now to keep our
types as accurate as possible.

* Add path back to FieldMap definition

This is a required field for type: alias fields.

* Try upping the fields limit on our ECS component template

This now exceeds the default of 1000.

* Bump our field limit a bit more

Apparently 1300 wasn't enough, either.

* Fix type error

Makes this field optional, since the technical component template
doesn't currently use it.

* Bump the field limit of our composed template

Including the newest ECS fields, this index now exceeds 1600 fields.
This value should probably be derived from the composed template's
limits, but for now this allows the template to be created.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 8737691)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.0

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

Questions ?

Please refer to the Backport tool documentation

@rylnd rylnd deleted the update_ecs_mappings_8_0 branch January 19, 2022 02:09
kibanamachine added a commit that referenced this pull request Jan 19, 2022
…23334)

* Generate ECS fieldmap from ECS 8.0

This is the result of running the generate_ecs_fieldmap script against
ECS' 8.0 branch.

* Account for scaling_factor property from ECS

This is a required field for e.g. scaled_float fields, so we need to
reflect its value in our field map.

* Remove unused, unset property from FieldMap

It does not appear that this value was ever being set, nor does this
value appear in ECS' flat output, so I'm removing it for now to keep our
types as accurate as possible.

* Add path back to FieldMap definition

This is a required field for type: alias fields.

* Try upping the fields limit on our ECS component template

This now exceeds the default of 1000.

* Bump our field limit a bit more

Apparently 1300 wasn't enough, either.

* Fix type error

Makes this field optional, since the technical component template
doesn't currently use it.

* Bump the field limit of our composed template

Including the newest ECS fields, this index now exceeds 1600 fields.
This value should probably be derived from the composed template's
limits, but for now this allows the template to be created.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 8737691)

Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
@KOTungseth KOTungseth added the Team:Detections and Resp Security Detection Response Team label Jan 19, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

FrankHassanabad pushed a commit that referenced this pull request Jan 20, 2022
## Summary

New ECS FieldMap was generated in #123012, however since it only contained changes to `Rule Registry` code the `Security Solution` Cypress tests were not run, and thus did not catch this field change.

See #122661 (comment) for details. Confirmed w/ @madirey that expected value is indeed `5` now that `host.geo.continent_code` has been [added](https://github.com/elastic/kibana/pull/123012/files#diff-a1647ccb73ef26c8c8b6aefd87084504b146af72fcb088ccacad93fcaad15b69R1524-R1528).


Some failing PR's from `main`:
#123357
#121644
#123352

### 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
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 20, 2022
…123429)

## Summary

New ECS FieldMap was generated in elastic#123012, however since it only contained changes to `Rule Registry` code the `Security Solution` Cypress tests were not run, and thus did not catch this field change.

See elastic#122661 (comment) for details. Confirmed w/ @madirey that expected value is indeed `5` now that `host.geo.continent_code` has been [added](https://github.com/elastic/kibana/pull/123012/files#diff-a1647ccb73ef26c8c8b6aefd87084504b146af72fcb088ccacad93fcaad15b69R1524-R1528).

Some failing PR's from `main`:
elastic#123357
elastic#121644
elastic#123352

### 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

(cherry picked from commit d6917fc)
kibanamachine added a commit that referenced this pull request Jan 20, 2022
…#123433)

## Summary

New ECS FieldMap was generated in #123012, however since it only contained changes to `Rule Registry` code the `Security Solution` Cypress tests were not run, and thus did not catch this field change.

See #122661 (comment) for details. Confirmed w/ @madirey that expected value is indeed `5` now that `host.geo.continent_code` has been [added](https://github.com/elastic/kibana/pull/123012/files#diff-a1647ccb73ef26c8c8b6aefd87084504b146af72fcb088ccacad93fcaad15b69R1524-R1528).

Some failing PR's from `main`:
#123357
#121644
#123352

### 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

(cherry picked from commit d6917fc)

Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
ogupte pushed a commit to ogupte/kibana that referenced this pull request Jan 28, 2022
* Generate ECS fieldmap from ECS 8.0

This is the result of running the generate_ecs_fieldmap script against
ECS' 8.0 branch.

* Account for scaling_factor property from ECS

This is a required field for e.g. scaled_float fields, so we need to
reflect its value in our field map.

* Remove unused, unset property from FieldMap

It does not appear that this value was ever being set, nor does this
value appear in ECS' flat output, so I'm removing it for now to keep our
types as accurate as possible.

* Add path back to FieldMap definition

This is a required field for type: alias fields.

* Try upping the fields limit on our ECS component template

This now exceeds the default of 1000.

* Bump our field limit a bit more

Apparently 1300 wasn't enough, either.

* Fix type error

Makes this field optional, since the technical component template
doesn't currently use it.

* Bump the field limit of our composed template

Including the newest ECS fields, this index now exceeds 1600 fields.
This value should probably be derived from the composed template's
limits, but for now this allows the template to be created.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
ogupte pushed a commit to ogupte/kibana that referenced this pull request Jan 28, 2022
…123429)

## Summary

New ECS FieldMap was generated in elastic#123012, however since it only contained changes to `Rule Registry` code the `Security Solution` Cypress tests were not run, and thus did not catch this field change.

See elastic#122661 (comment) for details. Confirmed w/ @madirey that expected value is indeed `5` now that `host.geo.continent_code` has been [added](https://github.com/elastic/kibana/pull/123012/files#diff-a1647ccb73ef26c8c8b6aefd87084504b146af72fcb088ccacad93fcaad15b69R1524-R1528).


Some failing PR's from `main`:
elastic#123357
elastic#121644
elastic#123352

### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:RAC label obsolete release_note:enhancement Team:Detections and Resp Security Detection Response Team Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants