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

Add XAuth support #81

Closed
wants to merge 1 commit into from
Closed

Add XAuth support #81

wants to merge 1 commit into from

Conversation

vizv
Copy link

@vizv vizv commented Jun 30, 2018

@vizv
Copy link
Author

vizv commented Jun 30, 2018

I got error

cannot load config '/etc/ipsec.conf': /etc/ipsec.conf:54: syntax error, unexpected STRING [modecfgdns]

for hwdsl2/setup-ipsec-vpn#386 so I changed modecfgdns="$DNS_SRV1, $DNS_SRV2" to

modecfgdns1=$DNS_SRV1
modecfgdns2=$DNS_SRV2

and everything works fine now

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 for contributing! I am glad that these changes work for your use case. You are correct regarding replacing modecfgdns="$DNS_SRV1, $DNS_SRV2". The reason is that we are now using Libreswan 3.22 instead of 3.23 where the latter used to require the above format.

I added comments on a few lines in your pull request. With that said, because connecting using vpnc from Linux is not a common use case, and this proposed solution only supports "pam" authentication, I am still unsure if we should merge these changes at this point.

run.sh Outdated
@@ -56,11 +56,13 @@ if [ -z "$VPN_IPSEC_PSK" ] && [ -z "$VPN_USER" ] && [ -z "$VPN_PASSWORD" ]; then
echo "VPN credentials not set by user. Generating random PSK and password..."
VPN_IPSEC_PSK="$(LC_CTYPE=C tr -dc 'A-HJ-NPR-Za-km-z2-9' < /dev/urandom | head -c 16)"
VPN_USER=vpnuser
VPN_PASSWORD="$(LC_CTYPE=C tr -dc 'A-HJ-NPR-Za-km-z2-9' < /dev/urandom | head -c 16)"
VPN_PASSWORD=group
Copy link
Owner

Choose a reason for hiding this comment

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

This line and the next line are incorrect. VPN password should be auto generated while the group name can have a default value.

Copy link
Author

Choose a reason for hiding this comment

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

Oh, I didn't notice I changed the wrong line of code

run.sh Outdated

if [ -z "$VPN_IPSEC_PSK" ] || [ -z "$VPN_USER" ] || [ -z "$VPN_PASSWORD" ]; then
if [ -z "$VPN_IPSEC_PSK" ] || [ -z "$VPN_USER" ] || [ -z "$VPN_PASSWORD" ] || [ -z "$VPN_GROUP" ]; then
Copy link
Owner

Choose a reason for hiding this comment

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

I doubt if we should make the VPN_GROUP a required variable. Instead of exiting, a default value can be specified in case VPN_GROUP is not defined in vpn.env.

@vizv
Copy link
Author

vizv commented Jul 2, 2018

I'll make these changes on Wednesday, I think I need to test it before submit it

@vizv
Copy link
Author

vizv commented Jul 4, 2018

@hwdsl2 I have fixed the two issues you mentioned, I also create a system user for PAM authentication and it's tested working for my environment.

Could you review these changes. If everything is fine, I'll add documentation for these changes.

@vizv
Copy link
Author

vizv commented Aug 22, 2018

@hwdsl2 any update on this?

@vizv
Copy link
Author

vizv commented Nov 16, 2018

@hwdsl2 Merge conflicts resolved, and tested

@hwdsl2
Copy link
Owner

hwdsl2 commented Nov 16, 2018

@vizv Thank you again for contributing!

Connecting using vpnc from Linux in aggressive mode is not a common use case, and the proposed solution requires "pam" authentication (which requires adding a user to the system). Besides, the $VPN_GROUP may be confusing for people using the IPsec/L2TP or IPsec/XAuth main mode. Lastly, the IPsec aggressive mode is vulnerable to offline dictionary attacks on the IPsec PSK [1].

Therefore I'm not sure if we should merge this at this time. However if it works for you, you're welcome to adapt the project 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
@vizv
Copy link
Author

vizv commented Nov 16, 2018

@hwdsl2 Thanks for your comments

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

2 participants