kibana icon indicating copy to clipboard operation
kibana copied to clipboard

[Fleet] Allow exclamation mark in enrollment token name

Open jillguyonnet opened this issue 1 year ago • 6 comments

Summary

Closes https://github.com/elastic/kibana/issues/191719

Attempting to generate a Fleet enrollment token with a name that ends with ! produces a malformed ES query which causes POST agents/enrollment_api_keys to fail with 500.

This PR adds a narrow fix by escaping question marks (which is a query_string special character).

Note: this query probably wouldn't be necessary if we removed the constraint of unique name, as discussed in https://github.com/elastic/kibana/issues/155550.

jillguyonnet avatar Aug 30 '24 08:08 jillguyonnet

:robot: GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

obltmachine avatar Aug 30 '24 08:08 obltmachine

Pinging @elastic/fleet (Team:Fleet)

elasticmachine avatar Aug 30 '24 09:08 elasticmachine

Thanks @juliaElastic!

There is a list of special characters: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax. I tried them all, most work besides some fairly unusual ones (&& for example). I thought about making a more robust function, but I wasn't sure the effort would be worth it considering we might eventually lift the name uniqueness constraint. WDYT?

jillguyonnet avatar Aug 30 '24 10:08 jillguyonnet

There is a list of special characters: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax. I tried them all, most work besides some fairly unusual ones (&& for example). I thought about making a more robust function, but I wasn't sure the effort would be worth it considering we might eventually lift the name uniqueness constraint. WDYT?

I agree, probably not worth putting more effort now. Thanks for confirming.

juliaElastic avatar Aug 30 '24 10:08 juliaElastic

@elasticmachine merge upstream

jillguyonnet avatar Aug 30 '24 11:08 jillguyonnet

:green_heart: Build Succeeded

Metrics [docs]

✅ unchanged

History

  • :broken_heart: Build #231046 failed 729aa9a6c2cd88e3fa0b85072441dc6a62f9f548

To update your PR or re-run it, just comment with: @elasticmachine merge upstream

cc @jillguyonnet

kibana-ci avatar Aug 30 '24 13:08 kibana-ci