osquery / osquery-go

Go bindings for osquery
MIT License
386 stars 78 forks source link

added error condition for exceeding socket path character limit #100

Closed James-Pickett closed 2 years ago

James-Pickett commented 2 years ago

The length of the socket path passed to osquery-go should not exceed 97 characters because a "." and a uuid of up to 5 characters is added to the provided socket path. If the total socket path exceeds 103 characters, this will error. Why can a socket not be greater than 103 characters?

https://unix.stackexchange.com/questions/367008/why-is-socket-path-length-limited-to-a-hundred-chars

I have read that some systems allow 108, I tested this on on m1 macOS monterey 12.4 and when the total socket path (uuid included) was greater than 103, I got an error.

This PR adds an error condition to ensure given path does not exceed 97 characters and an associated unit test.