-
Notifications
You must be signed in to change notification settings - Fork 103
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
include arch and os in local server headers #1877
include arch and os in local server headers #1877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like forward progress
ee/localserver/server.go
Outdated
@@ -415,13 +416,14 @@ func (ls *localServer) presenceDetectionHandler(next http.Handler) http.Handler | |||
|
|||
// presence detection is only supported on macos currently | |||
if runtime.GOOS != "darwin" { | |||
w.Header().Add(kolideDurationSinceLastPresenceDetectionHeaderKey, presencedetection.DetectionFailedDurationValue.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this, we'll need to figure out how to differentiate between "not supported" and "timeout" or "error"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted it so we only return the presence response header when presence detection is actually requested.
That might give us enough data for some logic like
if failure && os == "linux"
// we no it's not supported
but maybe we need something more concrete like a failure_reason header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still pretty sure we're going to need to iterate. But I think it's okay to do it post merge.
Let's see, I think we have the following conditions:
It might additionally be interesting to track the reasons it failed. At least, if there are reasons we can track. So we probably do need some kind of header for why it failed. And one reason can be |
In the event that presence detection is requested for a non-supported OS, return default failure duration
-1s
. Always include OS and Arch in headers.