-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Dangling space at end of message strings can cause issues for monitoring and parsing of output #117067
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
Labels
>bug
:Security/Security
Security issues without another label
Team:Security
Meta label for security team
Comments
Pinging @elastic/es-security (Team:Security) |
ankit--sethi
added a commit
to ankit--sethi/elasticsearch
that referenced
this issue
Apr 28, 2025
This PR addresses elastic#117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message.
ankit--sethi
added a commit
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses #117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]>
ankit--sethi
added a commit
to ankit--sethi/elasticsearch
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses elastic#117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]> (cherry picked from commit 94854b3)
ankit--sethi
added a commit
to ankit--sethi/elasticsearch
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses elastic#117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]> (cherry picked from commit 94854b3)
ankit--sethi
added a commit
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses #117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]> (cherry picked from commit 94854b3)
ankit--sethi
added a commit
to ankit--sethi/elasticsearch
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses elastic#117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]> (cherry picked from commit 94854b3)
ankit--sethi
added a commit
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses #117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]> (cherry picked from commit 94854b3)
ankit--sethi
added a commit
to ankit--sethi/elasticsearch
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses elastic#117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]> (cherry picked from commit 94854b3)
ankit--sethi
added a commit
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses #117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]> (cherry picked from commit 94854b3)
ankit--sethi
added a commit
that referenced
this issue
May 1, 2025
* Remove dandling spaces wherever found. This PR addresses #117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message. * fix test * Update docs/changelog/127475.yaml * correct logic * fix test * fix tests * fix tests * fix tests * Update docs/changelog/127475.yaml * Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java Co-authored-by: Slobodan Adamović <[email protected]> * Update libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java Co-authored-by: Slobodan Adamović <[email protected]> * correctly reference issue * Update docs/changelog/127475.yaml --------- Co-authored-by: Slobodan Adamović <[email protected]> (cherry picked from commit 94854b3)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Security/Security
Security issues without another label
Team:Security
Meta label for security team
Elasticsearch Version
8.16.0
Installed Plugins
No response
Java Version
bundled
OS Version
Linux
Problem Description
Dangling space at end of message strings can cause issues for monitoring and parsing of logs. Users want to parse output using their tools and periodically they are finding messages with an unnecessary trailing space which can break some user parsers.
Steps to Reproduce
Examples of the messages with trailing extra space on last line of message.
https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java#L477
https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java#L582
"Grants monitor_data_frame_transforms cluster privileges, which enable you to use transforms. "
+ "This role also includes all Kibana privileges for the machine learning features. "
Most of the messages do not have a training space, for example the following doesn't have a trailing space:
https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java#L218
"Grants the minimum privileges required for any user of X-Pack monitoring other than those required to use Kibana. "
+ "This role grants access to the monitoring indices and grants privileges necessary "
+ "for reading basic cluster information. "
+ "This role also includes all Kibana privileges for the Elastic Stack monitoring features. "
+ "Monitoring users should also be assigned the kibana_admin role, "
+ "or another role with access to the Kibana instance."
Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: