Skip to content
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

XAuth support for Linux clients #386

Closed
wants to merge 4 commits into from
Closed

Conversation

kshcherban
Copy link

Added support for Aggressive Mode that is being used by vpnc.
Documented Linux client setup on Ubuntu example.

@kshcherban kshcherban changed the title XAuth support for Linux XAuth support for Linux clients May 10, 2018
@hwdsl2 hwdsl2 force-pushed the master branch 2 times, most recently from 39a1f06 to 8e15eb6 Compare May 23, 2018 06:40
@hwdsl2 hwdsl2 force-pushed the master branch 2 times, most recently from a45307b to f838fcf Compare June 5, 2018 08:49
vizv added a commit to vizv/docker-ipsec-vpn-server that referenced this pull request Jun 30, 2018
vizv added a commit to vizv/docker-ipsec-vpn-server that referenced this pull request Jun 30, 2018
Copy link
Owner

@hwdsl2 hwdsl2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you again for contributing. I added a few comments to your pull request, please have a look.

Due to the limit of 16384 bytes for AWS instance user data, I am unable to merge these changes until I can figure out a way to reduce the script size. Also, I would like to do more testing to investigate why xauthby=file is not working, and we had to instead use xauthby=pam.

@@ -245,7 +247,7 @@ conn shared
dpddelay=30
dpdtimeout=120
dpdaction=clear
ike=3des-sha1,3des-sha2,aes-sha1,aes-sha1;modp1024,aes-sha2,aes-sha2;modp1024
ike=3des-sha1,3des-sha1;modp1024,3des-sha2,aes-sha1,aes-sha1;modp1024,aes-sha2,aes-sha2;modp1024
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the 3des-sha1;modp1024 part you added on this line required for vpnc to connect? Or can we use the original version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vpnc doesn't work without those cyphers, don't know if it's the bug of LibreSwan or vpnc.

vpnsetup.sh Outdated
@@ -245,7 +247,7 @@ conn shared
dpddelay=30
dpdtimeout=120
dpdaction=clear
ike=3des-sha1,3des-sha2,aes-sha1,aes-sha1;modp1024,aes-sha2,aes-sha2;modp1024
ike=3des-sha1,3des-sha1;modp1024,3des-sha2,aes-sha1,aes-sha1;modp1024,aes-sha2,aes-sha2;modp1024
phase2alg=3des-sha1,3des-sha2,aes-sha1,aes-sha2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had changed this to phase2alg=3des-sha1,3des-sha2,aes-sha1,aes-sha2,aes256-sha2_512 for better Android compatibility.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should work both with android and vpnc (desktop linux), tested on my server.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, please check.

vpnsetup.sh Outdated
auto=add
leftsubnet=0.0.0.0/0
rightaddresspool=$XAUTH_POOL
modecfgdns="$DNS_SRV1, $DNS_SRV2"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to some issues in Libreswan 3.23 with multiple IPsec/XAuth VPN clients from behind the same NAT (e.g. home router), we now use Libreswan 3.22 and this line had been replaced with these two lines:

  modecfgdns1=$DNS_SRV1
  modecfgdns2=$DNS_SRV2

vizv added a commit to vizv/docker-ipsec-vpn-server that referenced this pull request Jul 4, 2018
@hwdsl2 hwdsl2 force-pushed the master branch 5 times, most recently from 82f614b to 20f5797 Compare September 30, 2018 23:36
vizv added a commit to vizv/docker-ipsec-vpn-server that referenced this pull request Nov 16, 2018
vizv added a commit to vizv/docker-ipsec-vpn-server that referenced this pull request Nov 16, 2018
@hwdsl2
Copy link
Owner

hwdsl2 commented Nov 16, 2018

@kshcherban Thank you again for contributing! I've decided not to merge these changes at this time because:

  1. The limit of 16384 bytes for AWS instance user data, which the script is approaching
  2. Connecting using vpnc from Linux in aggressive mode is not a common use case
  3. The proposed solution requires "pam" authentication (which requires adding a user to the system). I haven't figured out how to instead use authby=file for this.
  4. The VPN_GROUP could be confusing for people using the IPsec/L2TP or IPsec/XAuth main mode.
  5. The IPsec aggressive mode is vulnerable to offline dictionary attacks on the IPsec PSK [1].

However, if the changes work for you, you're welcome to adapt the scripts to your needs.

[1] https://security.stackexchange.com/questions/76444/what-are-the-practical-risks-of-using-ike-aggressive-mode-with-a-pre-shared-key

@hwdsl2 hwdsl2 closed this Nov 16, 2018
@letoams
Copy link

letoams commented Nov 17, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants