Forum Discussion
Authentication access policy for intranet site / APM Module
Hi there,
I've got a requirement for a new APM access policy, so I thought I'd field the question here. Has anyone got experience with the following type of requirements?
I've got an intranet site, the owners of which can't manage authentication at the web server side (for reasons that we won't go into for now...) So, they want the APM to manage it for them.
When a user hits the site/virtual server, they want to APM policy to do the following:
- When HTTP request is for a particular URi (for example /secure)
- Check for a currently logged in kerberos or NTLM session token in their session.
- If there is a kerberos token in the users session, run an AD/LDAP query getting their group memberships, and if they are a member of a particular group, grant them access to the requested resource.
- If there isn't a kerberos token, send them to an 'F5 Login page' and request AD auth and group checking before letting them in.
- All other Uri requests should just be allowed through. The authentication controls should only be enacted if the configured URLs are requested.
I'm fine with a standard access policy, but I haven't implemented Kerberos/NTLM SSO before. We want to capture the users currently logged on AD credentials and run an AD query on them. Obviously this will only work with domain joined PCs, that's what the second leg of the access policy is there for, to mop up not supported clients/browsers, or external users...
I'd be really keen to hear anyone's similar experiences or ideas. As I build up my design and implementation I'll share it here also. Hopefully we might all be able to learn something together! ;)
Cheers,
Gavin Connell-Otten
26 Replies
- Gavin_Connell-O
Nimbostratus
In fact, we obviously already utilise two VIPs for this intranet, I'm just trying to figure how best to manage altering that exisiting LTM config for these APM requirements. We offload all SSL on the F5 by the way, everything internal is decrypted.
- Kevin_Stewart
Employee
I've been noodling on this one and it occurred to me that:
-
A browser will not send a Kerberos ticket unless the server asks for one (via 401 response).
-
A browser that receives a 401 response, and cannot satisfy it with a Kerberos ticket, will generally prompt the user with a credential dialog box. There's no opportunity to fail over to a form page if Kerberos fails. You could very easily do Basic authentication since you're already getting a logon dialog though.
Another alternative is perhaps to switch client side SSO methods based on an attribute of the client. If external and internal clients have different IP ranges, you could prompt them differently. Of course if an internal user failed to present a Kerberos ticket after 401, they'd get a credential dialog.
-
- Gavin_Connell-O
Nimbostratus
Right. Well that's very interesting. In our case there is no authentication mechanism on the back end web servers, we're trying to get the credential 'pickup' and AD query managed by the APM entirely, I've been running on the assumption that the APM could manage that itself. Is that not a common use case?
- Kevin_Stewart
Employee
I'm not referring to the back end authentication, but rather how the client browser responds to an authentication prompt. Let's say you could determine that a user, given their IP address, was coming from the internal network. You could send them a 401 response, hope for a Kerberos token, pull that Kerberos token apart, do some lookups, whatever you want, and then send the user down the right path. If the user came from an external network, you'd present a logon form, do some lookups, whatever you want, and then send them down the right path. This is all happening on the 443 VIP by the way. So the the question remains:
- Can you differentiate internal from external users?
- And if not, can you use a Basic dialog instead of a form page if Kerberos fails?
- Gavin_Connell-O
Nimbostratus
Oh I see what you mean now sorry. Yes, I can easily differentiate between internal and external users based on their IP address. So my two main access scenarios would be:
1) Domain joined user on internal IP range connects to HTTPS VIP and has a kerberos token in their session. Their token will be interrogated, a query ran, and access granted.
2) Non Domain joined user on external network connects up and is presented with the Forms based F5 login page. they authenticate via AAA, an AD query verifies they meet our access requirement, and they are granted access to the resource.
But there would be this odd case on occasion, when an internal user didn't have a kerberos ticket:
3) User connects on internal network without a kerberos ticket. Users browser is issued with a 401 response, but cannot respond with a ticket, so produces a basic login dialogue box.
In scenario 3, is is easy enough to have the APM accept the credentials supplied via Basic authentication from the browser? We could have this situation for a number of reasons being a university, non standard browsers, Mac or Linux computers not joined to our AD domain, etc...
Also, if a user does have a kerberos ticket, but after our AD query we find they don't have the desired authentication, would it be easy enough to pass the user to the forms based login? I'm assuming it would because at this stage in the access policy we would have moved from the kerberos pickup to an AD Query, and so we would get to decide the outcome?
- Kevin_Stewart
Employee
In scenario 3, is is easy enough to have the APM accept the credentials supplied via Basic authentication from the browser?
Absolutely. It's built into the 401 response agent.
Also, if a user does have a kerberos ticket, but after our AD query we find they don't have the desired authentication, would it be easy enough to pass the user to the forms based login?
Yes, that would be pretty easy. But curious, if the Kerberos ticket they requested from the local KDC wasn't acceptable, what credentials would you expect in the logon form?
- Gavin_Connell-O
Nimbostratus
You're absolutely right, ignore that last comment, that would be a completely pointless configuration. I just wasn't thinking straight :)
I've updated my diagram to show a little more logic in the access policy area. I think it might be starting to come together into something I can test. What do you think?

- Kevin_Stewart
Employee
Looks good.
- Gavin_Connell-O
Nimbostratus
So, I'm going to get building a POC based on that diagram, and when I'm at the point of building the Access Policy (in particular the Kerberos token picket parts) I'll run it by you again to get some advice. Is that OK?
- Kevin_Stewart
Employee
Certainly.
- David_123856
Nimbostratus
Just wondering how you went with this one, I also am fiddling with the Kerberos auth and then needing to do an AD Query for Group membership. Did you manage to figure that bit out?
- Kevin_Stewart
Employee
Just wondering how you went with this one, I also am fiddling with the Kerberos auth and then needing to do an AD Query for Group membership. Did you manage to figure that bit out?
A successful client side Kerberos authentication will produce a session.logon.last.username value in UPN format (ex. bob.user@mydomain.com). To do any form of AD/LDAP query against that value, you may need to break it apart, though it should already be the userPrincipalName value. Example SearchFilter:
userPrincipalName=%{session.logon.last.username}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com