This repository has been archived by the owner on Jun 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Control OpenVPN and ocserv access via /etc/allowed_vpn_certs (#1470)
Just because you have a certificate (you can authenticate) doesn't mean that you are *authorized* to use a service. Create `/etc/allowed_vpn_certs`, with the name of one client cert per line. To disable ocserv and OpenVPN access, comment out the cert's line. * ocserv properly uses PAM, and `/etc/pam.d/ocserv` configures it to check the list. * OpenVPN theoretically can use PAM, but in practice does not seem to call it correctly. However, it ships with a script that can authorize certs.
- Loading branch information
Showing
6 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This file lists all the enabled VPN certificate names. Note that | ||
# it does not affect WireGuard. | ||
|
||
{% for client in vpn_client_names.results -%} | ||
{{ client.stdout }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
account required pam_listfile.so \ | ||
sense=allow item=user file=/etc/allowed_vpn_certs | ||
|
||
auth required pam_listfile.so \ | ||
sense=allow item=user file=/etc/allowed_vpn_certs | ||
|
||
password required pam_deny.so | ||
session required pam_deny.so | ||
|
||
other required pam_deny.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,5 @@ tunnel-all-dns = true | |
{% for item in upstream_dns_servers %} | ||
dns = {{ item }} | ||
{% endfor %} | ||
|
||
acct = pam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters