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

[Cloud Security] CNVM: Error Persists in Kibana Search with Asterisk (*) and No Double Quotes #157954

Closed
nick-alayil opened this issue May 17, 2023 · 10 comments · Fixed by #162555
Assignees
Labels
8.10 candidate bug Fixes for quality problems that affect the customer experience good first issue low hanging fruit Team:Cloud Security Cloud Security team related verified

Comments

@nick-alayil
Copy link

nick-alayil commented May 17, 2023

Kibana version:
BC4
VERSION: 8.8.0
BUILD: 63092
COMMIT: ba9b182

Describe the bug:
Kibana results in an error when searching for a field value with an asterisk (*) and without using double quotes. Even after clearing the search query and refreshing the page, the error continues to appear. The only way to resolve this issue is to log out of Kibana and log back in, which eliminates the error.

Steps to reproduce:

  1. Install CNVM
  2. Install agent using CloudFormation
  3. Wait until vulnerability are discovered
  4. Navigate to Findings page and click on Vulnerabilities tab
  5. Run a search query - vulnerability.package.name : ssl

Expected behavior:
Display results matching the search criteria or show empty state with call to action for reset filters if there is no match.

Screen recording (if relevant):

Screen.Recording.2023-05-16.at.1.06.43.PM.mov
@nick-alayil nick-alayil added bug Fixes for quality problems that affect the customer experience Team:Cloud Security Cloud Security team related 8.8 candidate labels May 17, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

@nick-alayil nick-alayil changed the title [Cloud Security] CNVM is displaying incorrect details for a finding in the flyout. [Cloud Security] CNVM: Error Persists in Kibana Search with Asterisk (*) and No Double Quotes May 17, 2023
@tehilashn
Copy link

After syncing with @nick-alayil - this is not a showstopper for 8.8.
If we solve soon and there's another BC (due to other blockers) then it might get in.
otherwise it will be for 8.9 (and 8.8.1 if we wish)

@kfirpeled
Copy link
Contributor

DOD: give a way to recover from that error

@tehilashn tehilashn added the good first issue low hanging fruit label Jul 24, 2023
@maxcold maxcold self-assigned this Jul 24, 2023
@maxcold
Copy link
Contributor

maxcold commented Jul 25, 2023

Some findings after looking into the issue:

  1. There seems to be a change in the logic since 8.8, now the behavior is different between Misconfigurations and Vulnerabilities. In Misconfigurations the search bar is still shown when the error occurs, so the user can recover by adjusting the search. This is in line with how for example Alerts handles this.
    Suggestion: make Vulnerabilities consistent with Misconfigurations in that regard and keep the search bar on the page in case of errors. This way the user can recover from errors
    2023-07-25 11 52 13
  2. There is an unhandled exception caused by the usage of the leading wildcard symbol on the resource vulnerabilities page. The user can recover from this error by reloading the page, so it's not that critical in my opinion.
    Suggestion: I will spend some time looking into this unhandled exception, but if no quick fix is found we can create a separate bug ticket around that to track it separately
Screenshot 2023-07-25 at 11 57 00 3. The usage of the leading wildcard in Kibana is configurable via `query:allowLeadingWildcards` advanced setting, which is enabled by default. Meaning the search with the leading wildcard shouldn't lead to an error. The setting is there for performance reasons, on large datasets leading wildcard search can be very expensive. Our plugin doesn't seem to respect this setting.

Suggestion: create a ticket to track the support for this setting and prioritize it separately. In my opinion, this inconsistency can be annoying for users but probably not a major problem
Screenshot 2023-07-25 at 12 05 08

@maxcold
Copy link
Contributor

maxcold commented Jul 27, 2023

created a draft PR fixing points 1 and 2 from my comment , will look into 3

@maxcold
Copy link
Contributor

maxcold commented Jul 28, 2023

added the support for point 3 (query:allowLeadingWildcards setting). No need for separate issues to be created, if we are ok with the way of handling the leading wildcard search, I will move the PR from draft to open

@maxcold
Copy link
Contributor

maxcold commented Jul 31, 2023

@nick-alayil can you take a look at this comment #157954 (comment) and check if the proposed fixes make sense? I already implemented all three, so no need for additional tickets if you agree with the fixes

maxcold added a commit that referenced this issue Aug 3, 2023
…dling when it is disabled (#162555)

## Summary
The PR: 
- fixes #157954
- allows a user to recover from
#157954 by rendering the search
bar even when an error occurs (in line with how Misconfiguration
behaves)
- enables the support of `query:allowLeadingWildcard` setting of Kibana
- fixes unhandled exception on Resource Vulnerabilities page
- fixes the loading state on the search bar in Vulnerabilities which
wasn't working before
![2023-07-26 13 09
20](https://github.com/elastic/kibana/assets/478762/dcb251e5-d75d-4f8f-815d-958f48098461)

---------

Co-authored-by: Kibana Machine <[email protected]>
@tehilashn
Copy link

Thank you @maxcold - I think everything you suggested makes sense.

@nick-alayil
Copy link
Author

Just reviewed this ticket. Though I see it's already closed, thanks @maxcold for the thoughtful decisions and excellent work done here. Kudos! 👍

@mitodrummer
Copy link
Contributor

mitodrummer commented Aug 22, 2023

Evidence:

Findings.-.Kibana.-.Google.Chrome.2023-08-22.16-07-31.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.10 candidate bug Fixes for quality problems that affect the customer experience good first issue low hanging fruit Team:Cloud Security Cloud Security team related verified
Projects
None yet
7 participants