-
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] Rule is created when the conditional logic "If alert matches a query" is left blank #159690
[Security Solution] Rule is created when the conditional logic "If alert matches a query" is left blank #159690
Conversation
…ert matches a query" is left blank elastic#156706
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
return setFieldErrors(null); | ||
} | ||
if (isSubmitted && !isSubmitting && isValid === false && field.errors.length) { | ||
if (isValid === false) { |
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.
After recent changes we do not call form.submit()
on rule creation, thus we cannot rely on isSubmitting
and isSubmitted
anymore here. Those two parameters will not be changed at all and we will not show error callout. Updated to only check whether isValid
field of the form has been updated, which happens when user clicks create button.
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.
Rule Management changes LGTM 👍
I didn't test the PR though - would be nice if someone from the Detection Engine team could do it.
@elasticmachine merge upstream |
@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.
Response Ops changes LGTM
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @e40pud |
…ert matches a query" is left blank (elastic#159690) ## Summary Original ticket: elastic#156706 These changes prevent user from creating/updating the rule when alert filter is selected and query left blank on the rule's action page. We gonna show an error saying "A custom query is required." in this case. <img width="1739" alt="Screenshot 2023-06-14 at 14 36 35" src="https://github.com/elastic/kibana/assets/2700761/0456f211-603c-44d9-9271-9cfdf59f12b6"> Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit 9b6ad72)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…"If alert matches a query" is left blank (#159690) (#161665) # Backport This will backport the following commits from `main` to `8.9`: - [[Security Solution] Rule is created when the conditional logic "If alert matches a query" is left blank (#159690)](#159690) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ievgen Sorokopud","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-07-11T14:27:24Z","message":"[Security Solution] Rule is created when the conditional logic \"If alert matches a query\" is left blank (#159690)\n\n## Summary\r\n\r\nOriginal ticket: https://github.com/elastic/kibana/issues/156706\r\n\r\nThese changes prevent user from creating/updating the rule when alert\r\nfilter is selected and query left blank on the rule's action page. We\r\ngonna show an error saying \"A custom query is required.\" in this case.\r\n\r\n<img width=\"1739\" alt=\"Screenshot 2023-06-14 at 14 36 35\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/0456f211-603c-44d9-9271-9cfdf59f12b6\">\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"9b6ad7280de61c0ed1471eda54b98a64d485b637","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","ci:cloud-deploy","Team:Detection Engine","v8.10.0","v8.9.1"],"number":159690,"url":"https://github.com/elastic/kibana/pull/159690","mergeCommit":{"message":"[Security Solution] Rule is created when the conditional logic \"If alert matches a query\" is left blank (#159690)\n\n## Summary\r\n\r\nOriginal ticket: https://github.com/elastic/kibana/issues/156706\r\n\r\nThese changes prevent user from creating/updating the rule when alert\r\nfilter is selected and query left blank on the rule's action page. We\r\ngonna show an error saying \"A custom query is required.\" in this case.\r\n\r\n<img width=\"1739\" alt=\"Screenshot 2023-06-14 at 14 36 35\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/0456f211-603c-44d9-9271-9cfdf59f12b6\">\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"9b6ad7280de61c0ed1471eda54b98a64d485b637"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159690","number":159690,"mergeCommit":{"message":"[Security Solution] Rule is created when the conditional logic \"If alert matches a query\" is left blank (#159690)\n\n## Summary\r\n\r\nOriginal ticket: https://github.com/elastic/kibana/issues/156706\r\n\r\nThese changes prevent user from creating/updating the rule when alert\r\nfilter is selected and query left blank on the rule's action page. We\r\ngonna show an error saying \"A custom query is required.\" in this case.\r\n\r\n<img width=\"1739\" alt=\"Screenshot 2023-06-14 at 14 36 35\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2700761/0456f211-603c-44d9-9271-9cfdf59f12b6\">\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"9b6ad7280de61c0ed1471eda54b98a64d485b637"}},{"branch":"8.9","label":"v8.9.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Ievgen Sorokopud <[email protected]>
Summary
Original ticket: #156706
These changes prevent user from creating/updating the rule when alert filter is selected and query left blank on the rule's action page. We gonna show an error saying "A custom query is required." in this case.