algo/roles/dns_adblocking/templates/usr.sbin.dnsmasq.j2
Micah R Ledbetter 25810838c3 Configure DNS names for each user
In the dns_adblocking role, assign each Algo user a domain name,
allowing connected users to communicate internally without having to
know each other's VPN IP addresses.
The user can set this in config.cfg as vpn_domain.

This required one potentially breaking change:
disallowing multiple connections from the same Algo user.

The server's ipsec.conf is also modified, with a connection per-user
that sets an IP address based on the order the user appears in the
config.cfg file.

Finally, a new /etc/hosts.ipsecclients file is created, which maps from
the IP addresses assigned in ipsec.conf to $user.$vpn_domain
2018-01-27 14:44:17 -06:00

29 lines
609 B
Django/Jinja

#include <tunables/global>
/usr/sbin/dnsmasq {
#include <abstractions/base>
#include <abstractions/nameservice>
capability net_bind_service,
capability setgid,
capability setuid,
capability dac_override,
network inet raw,
/etc/dnsmasq.conf r,
/etc/dnsmasq.d/ r,
/etc/dnsmasq.d/* r,
/var/lib/dnsmasq/ r,
/var/lib/dnsmasq/block.hosts r,
/etc/dnsmasq.d-available/ r,
/etc/dnsmasq.d-available/* r,
/etc/hosts.ipsecclients r,
/usr/sbin/dnsmasq mr,
/{,var/}run/*dnsmasq*.pid w,
/{,var/}run/dnsmasq-forwarders.conf r,
/{,var/}run/dnsmasq/ r,
/{,var/}run/dnsmasq/* rw,
}