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

OpenVPN: New policy certificate-otp for RW #6112

Closed
stephdl opened this issue Apr 7, 2020 · 18 comments
Closed

OpenVPN: New policy certificate-otp for RW #6112

stephdl opened this issue Apr 7, 2020 · 18 comments
Labels
verified All test cases were verified successfully
Milestone

Comments

@stephdl
Copy link

stephdl commented Apr 7, 2020

Most of time the password is written in a note close of the screen or the keyboard, this is a bug we could fix by a new policy to openvpn

  • the user must send a login
  • the user must send a certificate
  • the user must install an application to give him a one time based password (valid only 30 seconds)

these three factors are needed to authenticate a system-user.

Proposed solution

we will reuse pam-oath the solution we used with cockpit and ssh

Alternative solutions

google authenticator could be fun also, we could have a 4 factors (login+password+otp+certificate)

See also

https://community.nethserver.org/t/2fa-with-openvpn/15036

@nethbot
Copy link
Member

nethbot commented Apr 10, 2020

in 7.7.1908/testing:

@nethbot
Copy link
Member

nethbot commented Apr 10, 2020

in 7.7.1908/testing:

stephdl added a commit to NethServer/nethserver-vpn-ui that referenced this issue Apr 10, 2020
stephdl added a commit to NethServer/nethserver-cockpit that referenced this issue Apr 10, 2020
@nethbot
Copy link
Member

nethbot commented Apr 10, 2020

in 7.7.1908/testing:

@nethbot
Copy link
Member

nethbot commented Apr 10, 2020

in 7.7.1908/testing:

stephdl added a commit to NethServer/nethserver-vpn-ui that referenced this issue Apr 10, 2020
@nethbot
Copy link
Member

nethbot commented Apr 10, 2020

in 7.7.1908/testing:

@stephdl
Copy link
Author

stephdl commented Apr 10, 2020

QA

We have created a new policy "Login+Certificate+Otp", this policy once enabled force all users to fill an OTP pin instead of their password.

You have to take care that you have no warnings in logs /var/log/messages and /var/log/openvpn/openvpn.log

  1. check the new policy can be enabled from Nethgui and the changes can be seen in cockpit

  2. check the new policy can be enabled from cockpit and the changes can be seen in Nethgui

  3. Once the policy enabled, all users are forced to use otp

  • Enable the new policy
  • Create a user A vpn-user
  • Download the client configuration
  • you must find this inside (obviously with certs and other server directives)
auth-user-pass
auth-nocache
reneg-sec 0

The reneg to 0 is needed to avoid to ask the OTP each hour
The auth-nocache say to the client to not store the otp pin and ask it each time

  1. Go to the settings page of the user A and enable OTP
  • you must find a checked checkbox for openvpn otp in a disabled state
  1. The checkbox must not be seen if
  • the vpn is stopped
  • the vpn mode is not certificate-otp
  • the user is disabled
  • the user is not granted to vpn R2W (does not exist in the vpn DB as vpn-user)
  1. Try to connect the client to the VPN with different OS

With another GH6111 we force to verify that the user A cannot use the certificate of user B, so in the configuration of your client, take care to set the good login, relevant to the CN of the certficate

  • Windows
  • Linux
  • Android
  • IOS

the principle is when you connect to the VPN, the server asks for a password, you need to fill the OTP you can read on the smartphone

For fun you can have it on the terminal of your remote server by ssh:

watch oathtool --totp $(cat /var/lib/nethserver/home/stephane/.2fa.secret)

  • try good OTP
  • try bad OTP
  1. disable the user, try to connect

stephdl added a commit to NethServer/nethserver-openvpn that referenced this issue Apr 10, 2020
@nethbot
Copy link
Member

nethbot commented Apr 10, 2020

in 7.7.1908/testing:

@stephdl stephdl added the testing Packages are available from testing repositories label Apr 10, 2020
@gsanchietti
Copy link
Member

Postponed to NS 7.8 to minimize regressions: VPN are one of the most-used features during COVID-19 emergency.

Of course, this feature can be manually installed also in NS 7.7

@gsanchietti gsanchietti added this to the 7.8.2003 milestone Apr 14, 2020
@DavidePrincipi DavidePrincipi added this to ⚙ Developing in NethServer 7 Apr 20, 2020
@nethbot
Copy link
Member

nethbot commented Apr 21, 2020

in 7.8.2003/testing:

@nethbot
Copy link
Member

nethbot commented Apr 22, 2020

in 7.8.2003/testing:

@gsanchietti gsanchietti self-assigned this Apr 22, 2020
@nethbot
Copy link
Member

nethbot commented Apr 23, 2020

in 7.8.2003/testing:

@gsanchietti
Copy link
Member

Everything verified using a Fedora and a CentOS 7 as a client.

I'd like some more test from a Windows machine.

@gsanchietti gsanchietti removed their assignment Apr 23, 2020
@gsanchietti gsanchietti changed the title Openvpn: New policy certificate-otp for R2W OpenVPN: New policy certificate-otp for RW Apr 23, 2020
@gsanchietti
Copy link
Member

Verified also with Windows.
Users must be aware to not check the "Remember password" option.

Before release, please prepare the doc.

@gsanchietti gsanchietti added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Apr 23, 2020
@nethbot
Copy link
Member

nethbot commented Apr 23, 2020

in 7.8.2003/testing:

@nethbot
Copy link
Member

nethbot commented Apr 28, 2020

in 7.8.2003/testing:

@nethbot
Copy link
Member

nethbot commented Apr 28, 2020

in 7.8.2003/updates:

@nethbot
Copy link
Member

nethbot commented Apr 28, 2020

in 7.8.2003/updates:

@nethbot
Copy link
Member

nethbot commented Apr 28, 2020

in 7.8.2003/updates:

NethServer 7 automation moved this from ⚙ Developing to 🗑 Done Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified All test cases were verified successfully
Projects
No open projects
NethServer 7
🗑 Done
Development

No branches or pull requests

3 participants