-
Notifications
You must be signed in to change notification settings - Fork 13
Kerberos Single Sign-On does not work #16
Comments
I had similar problem (but I'm using squid for kerberos auth) |
Also be sure that XHR requests generated for server name (not ip). |
Could you share your Squid configuration? |
The key part is that:
|
I'm not sure how to mimic this in the Apache configuration. For Single Sign-On to works properly user session needs to be authenticated using X-Remote-User header. But if I disable Kerberos for some requests to /api/system/sessions the Apache doesn't add X-Remote-User header, authentication fails and Graylog shows standard login form. |
graylog will work with session auth header only |
It's true only if you already got the session somehow. I've spent hours trying different configurations. But maybe I just can't catch your point. Do you have spare Apache server to test the above configuration yourself? And don't forget to open a browser in incognito mode or you may share some previous session. |
Actualy I don't want to run Apache :) |
You are just right! I need to create initial session by passing the X-Remote-User header with correct Kerberos user principal in this header but I can't because only Kerberos knows the principal name and it needs to be disabled for the same request. The "chicken or the egg" :) Maybe I should try Squid if it works for you... But the main problem is that Graylog breaks standard proxy authentication algorithm (including but not limited to Kerberos) by its own unexpected Authorization header. |
Yep. Sure graylog auth header is a root problem. This is what I did with squid config. |
Myabe the problem is that you sending auth header as |
The From my limited Kerberos knowledge, the client needs to follow a few steps to get a valid Kerberos ticket, in which case the client is the Graylog web interface code running in the browser. |
Kerberos works as expected, there is no problem with tickets. But Graylog's Basic auth breaks Kerberos auth as both rely on Authorization header. So, technically SSO plugin can't be used for SSO with Apache + Kerberos. At least, until some workaround is found. |
Ah, then I misunderstood. So Kerberos is relying on being able to use the |
Sure! But not only Kerberos. As soon as "Require valid-user" added to Apache configuration it starts using Authentication header depending on AuthType. And of course everything breaks with unexpected (for Apache) Graylog's "Authorization: Basic undefined:session" header. |
Ok, I see. As this is something that needs to changed in Graylog server, I don't think we will be able to do anything about it before 3.0. |
Squid could be used as workaround. |
Full working squid3 config:
|
@kroepke, I see you have added this to the 2.2.0 milestone. |
It is possible to use Kerberos SSO with nginx with some trickery in the config file, and the same may be possible with Apache. This snippet of nginx config works for me:
The key thing is to enable or disable Kerberos auth based on the type of Basic auth presented by the client. If the client presents Basic auth with a password of "session" or "token", that means the client is trying to use Graylog session or token-based authentication, with the token in the username, and Kerberos authentication shouldn't be enabled/required. However an exception to that rule is if the username is "undefined" - that's a sign that the client is logged out and so Kerberos authentication should be enabled for that request, to sign them in. After that request, the client should obtain a valid session token, use that for future requests, and no longer require Kerberos auth until their session expires. |
This is still a bug. Any chance graylog can move away from misusing the Authorization header? |
We will deprecate and remove this plugin in the near future, it was never a good idea in the first place, and as you note its implementation is flawed. For a replacement we need to rework some intervals though and that process is not finished yet. Sorry for the inconvenience. |
The idea was good, and with the workarounds it works great. I hope it returns without the need for workarounds. |
@kroepke I'm not sure you are understanding the issue. There is nothing inherently wrong with the graylog-plugin-auth-sso plugin. The issue is that Graylog itself (even when the graylog-plugin-auth-sso plugin is disabled) is mis-using the Authorization header for its own session management. If that internal session handling was moved to a header such as "AuthorizationGraylogSession" instead of "Authorization" there would be no issue. This misuse of the Authorization header interferes with Kerberos implementations that are outside of both graylog and the graylog-plugin-auth-sso plugin. |
Kerberos Single Sign-On does not work
I've tried to setup Kerberos Single Sign-On to Graylog 2.1 on my Apache HTTP Server proxy.
My current Apache HTTP Server proxy configuration:
First of all I've created user [email protected] via Graylog WEB UI /system/authentication/users and configured SSO Plugin /system/authentication/config/sso to trust X-Remote-User HTTP header.
To test SSO plugin works as expected I've added static header to my configuration:
With the above configuration I always login as [email protected] without prompting for password.
So, the Kerberos part uses mod_auth_gssapi https://github.com/modauthgssapi/mod_auth_gssapi
With the above configuration Apache HTTP Server authenticates me as [email protected] but Graylog API session is not authorized
Request headers:
Response headers:
Seems like request to /api/system/sessions breaks Kerberos auth (header WWW-Authenticate: Negotiate) by adding HTTP header "Authorization: Basic dW5kZWZpbmVkOnNlc3Npb24=".
Environment
The text was updated successfully, but these errors were encountered: