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

[libbeat] RFC 3164 process ID parsing issues #38947

Closed
taylor-swanson opened this issue Apr 15, 2024 · 1 comment · Fixed by #38982
Closed

[libbeat] RFC 3164 process ID parsing issues #38947

taylor-swanson opened this issue Apr 15, 2024 · 1 comment · Fixed by #38982
Assignees
Labels
bug libbeat Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution

Comments

@taylor-swanson
Copy link
Contributor

If an RFC 3164 syslog event includes square brackets in the message portion of the event, the process ID will be set to everything from the first square bracket, just before the process ID, and everything to the last square bracket in the message.

For example:

<114>Apr 12 13:30:01 aaaaaa001.adm.domain aaaaaa001[25259]: my.some.domain 10.11.12.13 - USERNAME [12/Apr/2024:13:29:59.993 +0200] /skodas "GET /skodas/group/pod-documentation/aaa HTTP/1.1" 301 301 290bytes 1 10327
                                                   ^ - From here to -------------------------------------------------------here -^

Resulting process ID:

25259]: my.some.domain 10.11.12.13 - USERNAME [12/Apr/2024:13:29:59.993 +0200

This is caused by the pattern for the process ID being too relaxed, allowing all printable characters (including closing square brackets). While the parser ensures the value of the process ID must be contained between a pair of square brackets, it does not care how many square brackets are in between. The solution is to lock down the pattern to a more acceptable range of characters. Since this is a process ID, digits would be the best option.

@taylor-swanson taylor-swanson added bug libbeat Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution labels Apr 15, 2024
@taylor-swanson taylor-swanson self-assigned this Apr 15, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug libbeat Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants