-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GUACAMOLE-1855: Allow MFA modules to be configured to bypass or enforce for specific hosts. #911
GUACAMOLE-1855: Allow MFA modules to be configured to bypass or enforce for specific hosts. #911
Conversation
Looks pretty neat. What's the intended behavior for the case that an address matches subnets/addresses within both the enforce list and the bypass list? |
That's a good point - probably should give some more intentional thought to that. As it is currently written, as soon as an address is found in the bypass list, the user verification function will return, bypassing MFA authentication, and the enforcement list will never be processed. I'm tempted to re-arrange things a bit where enforcement would actually "take precedence", and that a host in both lists would always be enforced. That seems like the more security-conscious way to go. I'm open to suggestions, opinions, or discussion, though! |
Also figured out that I missed the actual code for host checking on the TOTP side. Oops. |
ceb770c
to
8ef21d3
Compare
Okay, I've restructured things a bit such that having hosts listed in the enforce list should override anything listed in the bypass list. I need to do some testing before it's ready, so I'll mark this as a draft for the moment - in the meantime if you see anything else amiss, please let me know. |
Sounds good! And I agree regarding giving enforcement priority over bypass. Better for a mistake in configuration to result in excessive enforcement of MFA than unexpected bypassing of MFA. |
0b2260c
to
5b04f6b
Compare
Okay, I think I've got the checks working. I'm currently hitting three issues:
|
351cd10
to
850533c
Compare
Alrighty then - this should be ready for review, now. I've tested with the TOTP module and it appears to work as expected, at least with IPv4 addresses. I still have a bit of an issue with the IPv4 + IPv6 config and the client address flipping between a real IPv4 address and IPv6 loopback, but that seems to be more of a Nginx + Tomcat issue than it is anything to do with this. |
I've seen this before, as well - I think it's due to the local OS' networking stack occasionally choosing the IPv6 address for |
Ah, okay - and, now that you mention it, it seems like something we've discussed before. Maybe I'll put in a Jira issue and update the manual page with that information. |
850533c
to
8ffcdac
Compare
.../guacamole-auth-duo/src/main/java/org/apache/guacamole/auth/duo/UserVerificationService.java
Outdated
Show resolved
Hide resolved
8ffcdac
to
360862d
Compare
guacamole-ext/src/main/java/org/apache/guacamole/net/util/IPAddressUtil.java
Outdated
Show resolved
Hide resolved
guacamole-ext/src/main/java/org/apache/guacamole/properties/IPAddressListProperty.java
Outdated
Show resolved
Hide resolved
guacamole-ext/src/main/java/org/apache/guacamole/properties/IPAddressListProperty.java
Show resolved
Hide resolved
.../guacamole-auth-duo/src/main/java/org/apache/guacamole/auth/duo/UserVerificationService.java
Outdated
Show resolved
Hide resolved
...ole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java
Outdated
Show resolved
Hide resolved
10d6aae
to
edc1f03
Compare
4715508
to
f286f09
Compare
9baad08
to
ab78fe2
Compare
ab78fe2
to
41094e4
Compare
I was having a look at this pull request because this functionality will be very useful. But I am hitting two compile errors: [ERROR] ..../guacamole-client/extensions/guacamole-auth-duo/src/main/java/org/apache/guacamole/auth/duo/UserVerificationService.java:[178,20] error: variable credentials is already defined in method verifyAuthenticatedUser(AuthenticatedUser) Im not sure if this is my mishandling of git, but if I look at the file in the pull request I can see the two definitions there too. |
41094e4
to
2ecad02
Compare
It should be fixed, now - apparently I didn't verify that it compiled after the last round of changes I made. Oops. |
This pull request implements the feature proposed in Jira for GUACAMOLE-1855 - the Duo and TOTP modules can be configured to either be bypassed for users logging in from specific hosts, or can be configured to be explicitly required for users logging in from specific hosts, while other hosts are bypassed.
This allows situations where users connecting from the Internet ought to be required to complete MFA, but users logging in from behind a VPN or on a corporate network may not need to perform the extra authentication step.