<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Date: Wed, 10 Aug 2016 09:02:29 +0200<br>
From: Petr Spacek <<a href="mailto:pspacek@redhat.com">pspacek@redhat.com</a>><br>
To: <a href="mailto:freeipa-users@redhat.com">freeipa-users@redhat.com</a><br>
Subject: Re: [Freeipa-users] FreeIPA Session Management (WebUI,<br>
Kerberos, ...?)<br>
Message-ID: <<a href="mailto:e6b5b192-5acf-dacc-8765-994e623499a8@redhat.com">e6b5b192-5acf-dacc-8765-<wbr>994e623499a8@redhat.com</a>><br>
Content-Type: text/plain; charset=windows-1252<br>
<br>
On 9.8.2016 21:37, Joe Thielen wrote:<br>
> First off, let me say THANK YOU to all of you who've helped make FreeIPA<br>
> what it is. I think it's a fantastic project and it's amazing what it has<br>
> achieved.<br>
><br>
> Second off, I'm still quite new to FreeIPA, especially the internals. This<br>
> includes Kerberos. I'm also very very limited at Python (I come from a PHP<br>
> background - please don't hold it against me). I have toyed around with<br>
> LDAP a little bit before looking at FreeIPA.<br>
><br>
> After re-reading this e-mail I think it'd be important to note here at the<br>
> top that my focus is on web-based apps and non-kerberized clients. The web<br>
> app server would be an IPA client. I don't foresee a lot of terminal-based<br>
> stuff going on, aside from potential admin CLI tasks (for the web-based<br>
> app).<br>
><br>
> I apologize in advance for the length of this e-mail. I have searched, a<br>
> lot, to try and answer my own questions. That's actually how I found<br>
> FreeIPA in the first place. I've looked at the site/wiki, the mailing list<br>
> archive, and the Internet in general. But I've been unable to find a<br>
> solution, or suggestions, which achieves exactly what I'm looking for. It<br>
> may be that I'm just using the wrong terminology and/or getting lost in the<br>
> buzzwords.<br>
><br>
> What I'm trying to figure out is if there is a way to centrally manage<br>
> sessions, in addition to everything else FreeIPA currently does. I'm not<br>
> necessarily just talking about WebUI sessions, I'd like external web apps<br>
> to be able to make use of it too. And, I'd like to be able to manage them<br>
> via the WebUI.<br>
><br>
> For example, let's say "joe" logs in to the WebUI (OR another web app tied<br>
> to FreeIPA). Now, on another computer, "admin" logs into the WebUI. Can<br>
> admin have a way to see that "joe" logged in, and, if need be, kill Joe's<br>
> session?<br>
><br>
> I'd like for it to maintain history. For each login/session, I'd like to<br>
> see who logged in, when, from where, what their last access was, when they<br>
> logged out (or if their session timed out), and the logout reason (manual<br>
> logout, session timeout, or admin intervention).<br>
><br>
> But like I said, I'm not just looking for WebUI sessions.<br>
><br>
> Let's say I create a web app. I put it on a machine which is an IPA<br>
> client. Thanks to the wealth of documentation and options, I have a<br>
> variety of methods to achieve authentication. FreeIPA makes this great,<br>
> and for that I'm thankful. However, in most of the documentation, it just<br>
> says "create the session" cookie, and the rest is left as an exercise to<br>
> the reader. I'm familiar with web apps and have implemented session<br>
> management before. What I'd love to see is FreeIPA to be able to handle<br>
> not just the auth but also the session management.<br>
><br>
> Why? Because I'd not like to have to re-invent the wheel. And I'm trying<br>
> to see if there is already some method to do this that I'm just<br>
> fundamentally missing. Or at least if there are enough pieces that I could<br>
> put together to make it happen.<br>
><br>
> For "fun", I've tried to set up auth using different methods. I've<br>
> successfully set it up using intercept_form_submit_module and<br>
> lookup_identity_module. That's pretty neat, works great for auth. But, as<br>
> far as I can tell, this method doesn't create a session or login trail in<br>
> the memcached DB. In fact, I can't really find any trail aside from the<br>
> Kerberos logging messages in /var/log/krbkdc.log.<br>
><br>
> I've also used Tobias Sette's php-freeipa from GitHub. That works great<br>
> too... for auth. And since that uses the JSON API, it looks like it does<br>
> create a record in the memcached DB. So I suppose this could be one way<br>
> in, maybe by a FreeIPA plugin?<br>
><br>
> I guess I'm running in circles because then again I think... "what about<br>
> pure Kerberos" clients... or those using intercept_form_submit_module?<br>
> I'm not familiar with PAM. But from what I can tell, I assume there is a<br>
> way to add a "pluggable" module for it too. But on the server? i.e., if a<br>
> Kerberos session is established, is there a way, via PAM (or something<br>
> else?) to log that session to the FreeIPA server? I think this is kinda<br>
> what Kerberos is trying to get away from, but for the use cases I'm<br>
> thinking of, it'd be a big feature. In my searching I've seen things like<br>
> nss_mysql which look interesting, but of course wouldn't mesh with the<br>
> FreeIPA WebUI memcached method.<br>
><br>
> Speaking of which, I know that memcached is not by any means a permanent<br>
> session log, and I understand it's not intended to be. So would this go<br>
> into the LDAP tree? Would this clog it up too much? I'm looking to store<br>
> a year of info... or more depending on the scenario.<br>
><br>
> I've briefly looked at the Apache Shiro project. I'm not a Java guy, but<br>
> from I'm reading it kind of has the right idea. It even notes that the<br>
> session management portions can be accessed from other apps (on other<br>
> machines) and not necessarily from Java. But due to the whole thing being<br>
> a mostly-Java product, I get lost far too easily. If this were already in<br>
> FreeIPA I think that's kind of what I'm looking for.<br>
><br>
> A single source of session information on the server. Along with the<br>
> ability to view/search it via the FreeIPA WebUI (which I assume would mean<br>
> it'd come from the JSON API).<br>
><br>
> For someone creating a new app from scratch, this would not only cover the<br>
> user/IdM and auth items, but also session management, and allow for more<br>
> administrative control (kill a session administratively). I think this<br>
> would really decrease the barrier to entry and give app authors a "known<br>
> good" path to follow. Especially smaller, domain- or niche-specific<br>
> projects.<br>
><br>
> I've looked at the FreeIPA session recording page (<br>
> <a href="http://www.freeipa.org/page/Session_Recording" rel="noreferrer" target="_blank">http://www.freeipa.org/page/<wbr>Session_Recording</a>). That looks neat. However,<br>
> if I'm reading it right, it's just for terminal sessions. It mentions<br>
> being able to record login info, but being a newbie I can't quite follow<br>
> exactly how it's achieving this goal (is that part all a function of tlog?).<br>
><br>
> Anyway, again, I apologize for this very long e-mail. Am I totally barking<br>
> up the wrong tree? Is this something FreeIPA can do and I just haven't<br>
> figured out how? Or would it require far too much customization and/or be<br>
> too far outside of the core functionality? Any hints, suggestions, or even<br>
> criticism would be appreciated.<br>
<br>
Hello,<br>
<br>
I'm not a web-app guy but I would recommend you to look at SAML protocol and<br>
project Keycloak (which can be integrated with FreeIPA).<br>
<br>
AFAIK SAML gives you single-sign-on + ability to forcibly log-out users (kill<br>
their sessions). Still, it does not give you one central session (while still<br>
allowing the central management).<br>
<br>
Hopefully others will be able to elaborate on this.<br>
<br>
--<br>
Petr^2 Spacek<br>
<br></blockquote></div><br></div><div class="gmail_extra">Hi Petr. Thanks for your reply. I did look at SAML before I found FreeIPA. I was able to get it up and running (simpleSAMLphp - both server and client), but I didn't find that it did what I wanted it to do.<br><br></div><div class="gmail_extra">Hey project Keycloak looks neat, I will look further into that!<br><br></div><div class="gmail_extra">Thanks again.<br></div></div>