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

presence detection callback #2048

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

James-Pickett
Copy link
Contributor

No description provided.

@James-Pickett James-Pickett changed the title make presence detection call back part of krypto wrap presence detection callback Jan 14, 2025
@@ -222,6 +226,14 @@ func (e *kryptoEcMiddleware) Wrap(next http.Handler) http.Handler {
// so just add the session id manually
context.WithValue(callbackReq.Context(), multislogger.KolideSessionIdKey, kolideSessionId[0]),
)

// here we want to create an additional callback for presence detection, but it's only going to be valid if we have the session (saml) id
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is true? maybe ... I dunno, K2 could always look up the request ID

ee/localserver/krypto-ec-middleware.go Outdated Show resolved Hide resolved
@@ -459,3 +475,110 @@ func (bhr *bufferedHttpResponse) WriteHeader(code int) {
func (bhr *bufferedHttpResponse) Bytes() []byte {
return bhr.buf.Bytes()
}

func (e *kryptoEcMiddleware) presenceDetectionCallback(callbackReq *http.Request, cmdReq v2CmdRequestType, challengeBox *challenge.OuterChallenge, kolideSessionId []string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*kryptoEcMiddleware is pretty big. Does this need to hang inside that struct?

@@ -222,6 +226,14 @@ func (e *kryptoEcMiddleware) Wrap(next http.Handler) http.Handler {
// so just add the session id manually
context.WithValue(callbackReq.Context(), multislogger.KolideSessionIdKey, kolideSessionId[0]),
)

// here we want to create an additional callback for presence detection, but it's only going to be valid if we have the session (saml) id
presenceDetectionCallbackReq := callbackReq.Clone(context.WithoutCancel(callbackReq.Context()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the rails side would be easier if we used a different URL. Probably okay to try either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants