-
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 exception with a newline in comment throws a 500 on the _find
api "Unable to load exception items"
#201820
Comments
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
_find
api_find
api "Unable to load exception items"
Only known workaround is to export rules with exceptions that are failing, delete any newline chars and re-import them AND select the option on import to |
Pinging @elastic/security-detection-engine (Team:Detection Engine) |
I am experiencing this same issue as well. Upgraded from 8.15.2 - 8.16.1 and created an exception that had new line characters in it, then could no longer access any exceptions. Major issue! https://elasticstack.slack.com/archives/CNRTGB9A4/p1732843176608059 |
From what I am seeing, this could have been broken before I made the exception. |
@dhurley14 Could you please break this down on how to do this? I can't even list the exceptions without getting an error. |
@dhurley14 - FYI: two issues have now been reported from customers after upgrade to |
Known workaroundsFor custom rules, as mentioned above, one can:
For prebuilt rules, which do not support exporting/importing via the UI, we can instead use the Exception list API to modify the exceptions themselves:
|
Any timeline on a fix? Just wondering if it's worth waiting to upgrade instead of applying this work around. |
Also, this should be listed as known issue in the docs. |
We've been seeing the same error when it comes to exceptions. On Kibana 8.16.1.
Any updates on fixes? |
It has been indicated to us that the fix will be released at the end of December... |
Yikes okay. |
FYI You can export the Endpoint Security rules from the exception lists. We hadn't tried this before but rather tried from the Endpoint Security Rule. The only difference it seems is that this is at the end of the UI exported list: Then we used this PowerShell script to adjust the script: $rules = Get-Content .\endpoint_list.ndjson | ConvertFrom-Json
#Zayn's Brilliance
foreach ($rule in $rules){foreach($comment in $rules.comments){$comment.comment = $comment.comment.replace("`n","|####WASANEWLINE####|")}}
$rules | ForEach-Object {
$_ | ConvertTo-Json -Compress -Depth 25
} | Out-File list_modified.ndjson Now we will see how it imports. We had over 200+ exceptions. |
+1 Also seeing this and waiting for the fix. |
…e chars `\n` (elastic#202063) ## Summary Fixes: elastic#201820 Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 35aeac1) # Conflicts: # oas_docs/output/kibana.serverless.yaml
…e chars `\n` (elastic#202063) ## Summary Fixes: elastic#201820 Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 35aeac1) # Conflicts: # oas_docs/output/kibana.serverless.yaml # x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml
…e chars `\n` (elastic#202063) ## Summary Fixes: elastic#201820 Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 35aeac1) # Conflicts: # oas_docs/output/kibana.serverless.yaml # x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts # x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml
…e chars `\n` (elastic#202063) ## Summary Fixes: elastic#201820 Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Should the fix be implemented in 8.16.2 or 8.17.0 as the tag suggest ? |
Describe the bug:
After upgrading a deployment from any version below 8.16.0 to 8.16+, any rule exceptions with comments containing newline char
\n
will throw a 500 in the exception items_find
api, like when trying to view the exceptions in the rule details page.Importing a rule with an exception item containing a comment with a newline char
\n
will pass be imported succesfully, however fetching that item on the rule details page throws a 500 during response validation.Creating an exception item with a comment containing a
\n
char through the UI will yield a 400 as it fails validation. That validation is happening here:kibana/packages/kbn-openapi-common/schemas/primitives.gen.ts
Line 28 in 8487bc8
The above is the same validation that causes the response validation to fail. Introduced here: #185865 and validation began in 8.16.0 when validating response was added in a separate PR here: https://github.com/elastic/kibana/pull/185951/files#diff-a17301a97f3e637c351f1d698c12976dc05185b2a4b15e45eb5784c00faf4468R85
Kibana/Elasticsearch Stack version:
8.16.0+
Functional Area (e.g. Endpoint management, timelines, resolver, etc.):
Detection and Response
Steps to reproduce:
\n
Current behavior:
Expected behavior:
Exception items should be visible
The text was updated successfully, but these errors were encountered: