-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Requirements
In our environment we have existing front-ends that provide Kerberos and OIDC authentication to users. These front-ends are already available and serving diverse back-ends running different services. What they do is to set some HTTP headers to be consumed by back-ends that can only talk to these front-ends. These headers contain information about the identity of the caller and are blindly trusted by the isolated backends.
Typically the front-ends are implemented with Apache using for instance mod_auth_openidc
and mod_auth_gssapi
although the technologies vary.
Hence, we'd like to contribute a patch to allow configuring aaasvc in a way that it delegates authentication to a trusted front-end by consuming for instance the REMOTE_USER
HTTP header. This could be addressed by an userlist-like authenticator with a few changes where:
- No passwords will be stored whatsoever.
- Users known to aaasvc will be served the way they're served by the
userlist
authenticator. - Optionally, tokens with a default profile containing default policies will be served for unknown users (not in the local DB).
In short, if aaasvc was configured this way, it would sign tokens for any user as presented by the front-end if there's a default profile, otherwise only for users explicitly declared in the local database.
This new feature could perhaps cover issue#33, as the caller could have the desired Kerberos support almost for free by configuring an Apache daemon in front.
Implementation ideas
Some ideas for implementation that of course are open for discussion:
Extend userlist.go
It's obvious that there are things in common between the already existing authenticator userlist
and the one needed to implement the proposed change. As an initial idea, userlist
could be patched in a way that, if a given config setting is enabled, it would ignore any user/password pair fed via /login
and simply look at REMOTE_USER
and continue. Other changes would be required to implement the optional no-user-found fallback explained above.
Write a new authenticator
Another obvious approach would be to write an authenticator from scratch, strongly inspired by userlist.go
. It's not clear to me how it would fit with the existing URL handlers so perhaps it makes sense to evaluate separately using the existing API entrypoint or declare a new one for this.
-
Reuse (abuse)
/login
I haven't looked into detail but I imagine that, as things stand today, the way Swagger implements the API it'll make the request to fail if the user and the password are not fed. If we wanted to reuse this API entry point, that would have to be relaxed and the value of certain headers should be embedded into
LoginRequest
to be consumed by the authenticator, I guess. -
Create a new API entrypoint (for instance
/delegated_login
)This would allow us to avoid overloading
LoginRequest
and have a separate model for this type of "lightweight" authentication request. However, I don't know if the code base is currently flexible enough to assign different authenticators to different API entrypoints. I haven't looked that deep, to be honest.
Write a generic userlist authenticator and extend it
Put the common functionality of both authenticators (user list lookups, claims generation, token building, etc) in a higher class and then subclass two implementations, namely userlistpasswd
and userlistdelegated
(just examples). API-wise, make /login
work with any of these. I'm not familiar with Go so I don't know if this is possible.
Conclusions
As you can probably feel from my proposals, I'm not very familiar with the code base. That's precisely why I wanted to have a discussion first to see what would be in your opinion the most cost-effective way of action or even if this proposal makes any sense at all.