Skip to content

Commit d943082

Browse files
[SIEM][Detection Engine] Critical blocker, fixes schema accepting values it should not (#55488)
## Summary * This fixes the schema accepting values the UI cannot handle at this point with severity. It's best to just set it to a small fixed enumeration of values. * From feedback from people the values should have more defaults and be more consistent in the schema so gave defaults for `from`, `to`, and `interval`. * Removed dead query examples that cannot happen because immutable cannot be set by end users anymore * Changes the version and other sections to be integer only and not allow floats * Added unit tests ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~ ~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~ ~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~ - [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios ~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~ ### For maintainers ~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~ - [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
1 parent e48317f commit d943082

29 files changed

+480
-265
lines changed

x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jest.mock('../../rules/get_prepackaged_rules', () => {
3434
to: 'now',
3535
index: ['index-1'],
3636
name: 'some-name',
37-
severity: 'severity',
37+
severity: 'low',
3838
interval: '5m',
3939
type: 'query',
4040
version: 2, // set one higher than the mocks which is set to 1 to trigger updates

x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rule_status_route.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jest.mock('../../rules/get_prepackaged_rules', () => {
3333
to: 'now',
3434
index: ['index-1'],
3535
name: 'some-name',
36-
severity: 'severity',
36+
severity: 'low',
3737
interval: '5m',
3838
type: 'query',
3939
version: 2, // set one higher than the mocks which is set to 1 to trigger updates

0 commit comments

Comments
 (0)