buzzfeed / sso

sso, aka S.S.Octopus, aka octoboi, is a single sign-on solution for securing internal services
MIT License
3.07k stars 187 forks source link

Null user getting re-authenticated #291

Closed tuananhnguyen-ct closed 4 years ago

tuananhnguyen-ct commented 4 years ago

Describe the bug I found some logs every 30 seconds indicating that buzzfeed is trying to authenticate a null user

in auth

{"error":"http: named cookie not present","level":"error","msg":"error loading session","remote_address":"x.x.x.x","service":"sso-authenticator"}

in proxy

{"error":"http: named cookie not present","level":"error","msg":"error authenticating user","remote_address":"x.x.x.x","service":"sso-proxy"}
{"level":"info","msg":"starting OAuth flow","service":"sso-proxy","sign_in_url":{"Scheme":"https","Opaque":"","User":null,"Host":"_our_public_endpoint_","Path":"/oauth2/sign_in","RawPath":"","ForceQuery":false,"RawQuery":"_redacted_","Fragment":""}}
{"action":"proxy","http_status":302,"level":"info","msg":"","remote_address":"x.x.x.x","request_duration":0.79801,"request_method":"GET","request_uri":"_our_public_endpoint_","service":"sso-proxy","user":"","user_agent":"Go-http-client/1.1"}

Is there anything we can do to drop that check or ignore it, since we want to setup an alert for any failed login attempt?

Jusshersmith commented 4 years ago

Hi @tuananhnguyen-ct! Sorry for such a long delay of this response.

Based on the logs you've sent the request looks like it could be some form of incorrectly configured health check perhaps? This would likely error while checking for an existing session, and attempt to start the oauth flow through sso-auth.

If this is the case, there's a /ping endpoint that can be used instead for health checks.

tuananhnguyen-ct commented 4 years ago

That's great, thanks a lot @Jusshersmith