elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.79k stars 8.19k forks source link

[KQL] Add support for case-insensitive searches #55378

Closed joswr1ght closed 2 weeks ago

joswr1ght commented 4 years ago

Describe the feature:

Requesting the implementation of an UPPER() function in KQL to be applied to fields, converting the record content to all uppercase.

UPPER(url.original):*SELECT*

KQL currently lacks a mechanism to perform case-insensitive searches. When using Kibana for system log analysis, attackers can evade detection by mixing case in data that would show up in web logs. For example, a search to identify a SQL injection attack utilizing the SQL UNION keyword might be:

url.original:*UNION*

An attacker who constructs an attack where the HTTP request uses the SQL keyword UnioN would evade detection with this KQL query.

Describe a specific use case for the feature:

Thank you for your consideration.

-Josh

elasticmachine commented 4 years ago

Pinging @elastic/kibana-app (Team:KibanaApp)

Bargs commented 4 years ago

This depends more on how your field was analyzed at ingestion time. If your field is configured to use the Lowercase token filter then your KQL queries on that field will be case insensitive.

joswr1ght commented 4 years ago

The use case I’m looking for is following the ingestion of Linux auth.log or access.log files using the Apache or Nginx modules with Filebeat. I’m not aware of a Filebeat configure mechanism to change the status of case-sensitivity during import, though I could be mistaken here.

Thanks!

joswr1ght commented 4 years ago

Following up on this, I don't believe the Filebeat module for Apache/Nginx/IIS web log ingestion offers an option to use the Lowercast token filter. The ability to query data with a KQL UPPER() function would be a useful addition, allowing analysts some post-import flexibility in how the data is evaluated.

elasticmachine commented 4 years ago

Pinging @elastic/kibana-app-arch (Team:AppArch)

joswr1ght commented 4 years ago

Just my semi-regular follow-up on this request. Thank you!

joswr1ght commented 4 years ago

Hey, just checking in again! You guys do great work, and this would be a fantastic feature to add to Kibana for log analysis. Thank you! 🙏

joswr1ght commented 4 years ago

Just checking in, any status on getting case-insensitive KQL match functionality?

wylieconlon commented 4 years ago

@joswr1ght There's been no direct work on this, but in the future release of 7.10, Elasticsearch will offer a case-insensitive option for wildcard searches. I'm proposing that we change KQL to use this by default in this issue, if you want to follow that discussion.

elasticmachine commented 1 year ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

willemdh commented 1 year ago

When will we be able to query case insensitive in Kibana KQL? I also see https://github.com/elastic/kibana/issues/134143 This seems like very basic search functionality?

kertal commented 2 weeks ago

Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner.

This works with ES|QL btw: https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-functions-operators.html#esql-to_upper