Commit Graph

63 Commits (bd7e9c88bf42cce0b28eeb29c9869065369aeff8)

Author SHA1 Message Date
Dustin cdf2869ef1 zabbix-server: Only allow local SMTP relay
The Zabbix server also serves an SMTP relay, to minimize reliance on
external services when sending notifications. Since it inherits
configuration of the relay from the general *smtp-relay* group, it ends
up allowing all hosts to relay off of it. To avoid this, we set
`smtp_rmynetworks` at the *zabbix-server* group level to only allow the
local machine to relay messages.
2018-10-13 11:47:55 -05:00
Dustin 2b43a85c78 Add static leases for proxy/smtp
In order to allow access to these services through the firewall from the
management network, they need to have static addresses.
2018-10-07 21:42:18 -05:00
Dustin a1ca06a3c5 Move VPN server to dedicated VM
The VPN capability of the UniFi Security Gateway is extremely limited.
It does not support road-warrior IPsec/IKEv2 configuration, and its
OpenVPN configuration is inflexible. As with DHCP, the best solution is
to simply move service to another machine.

To that end, I created a new VM, *vpn0.pyrocufflink.blue*, to host both
strongSwan and OpenVPN. For this to work, the necessary TCP/UDP ports
need to be forwarded, of course, and all of the remote subnets need
static routes on the gateway, specifying this machine as the next hop.
Additionally, ICMP redirects need to be disabled, to prevent confusing
the routing tables of devices on the same subnet as the VPN gateway.
2018-10-07 21:42:18 -05:00
Dustin 9f32f94780 Move DHCP service to dns1.p.b
The DHCP server on the UniFi Security Gateway is pretty limited; it
cannot manage static leases (reservations), and does not offer any way
to build dynamic values for e.g. hostname or boot filename. Rather than
give up these features, I decided to just move the DHCP server to one of
the Raspberry Pis; the DNS server made the most sense.

To facilitate this move, I created the *pyrocufflink-dhcp* host group,
and moved the DHCP configuration variables there. Thus, it was a simple
matter of adding *dns1.pyrocufflink.blue* to this group to relocate the
service.

Of course, to serve clients on the other subnets, the gateway needs to
have DHCP relay enabled and pointing to the new server.
2018-10-07 21:42:18 -05:00
Dustin 36675d0523 dch-network: Add more FireMon networks
This commit updates the list of FireMon networks to include the Caverns
Production (172.16.0.0/24) and Caverns Admin (172.24.16.0/20) networks.
This is necessary to ensure OpenVPN routes are created for these
networks.
2018-08-26 17:32:23 -05:00
Dustin 88dd80e6fd aria2: Deploy aria2 download manager
The *aria2* role installs the *aria2* download manager and sets it up to
run as a system service with RPC enabled. It also sets up the web UI,
though that must be installed manually from an archive, for now.
2018-08-19 14:17:48 -05:00
Dustin 59dbe232e3 dch-network: Update DNS servers
All networks should now be using *dns0.pyrocufflink.blue* (4) and
*dns1.pyrocufflink.blue* (3) as the recursive DNS servers.
2018-08-12 17:30:14 -05:00
Dustin d36e0d5a0a pyrocufflink-dns: Split named_zones definition
In order to support adding a second DNS server, the BIND zone
configuration needs to be partially modularized. While the forwarder
definitions for *pyrocufflink.blue*, etc. will remain the same, the
*pyrocufflink.red* zone will be different, as it will be a slave zone on
the second server. This commit breaks up the definition of the
`named_zones` variable into two parts:

* `pyrocufflink_red_zones`: This is a list of zone objects for
  *pyrocufflink.red* and its corresponding reverse zone. On
  *dns1.pyrocufflink.blue*, these are master zones. On the new server,
  these will be slaves.
* `pyrocufflink_common_zones`: This is a list of zone objects for the
  zones that are the same on both servers, since they are all forwarding
  zones.

Similarly, the `named_keys` variable only needs to be defined on the
master, since DHCP will only send updates there.
2018-08-12 17:23:34 -05:00
Dustin 76b7db421c dch-network: Forward syncthing port to file0
*file0.pyrocufflink.blue* hosts syncthing. Forwarding the transport is
not strictly required, as syncthing can use relays to encapsulate
traffic in HTTPS, but allowing direct access improves performance.
2018-08-12 15:22:30 -05:00
Dustin 4e8bd8995b hosts: Add koji0.pyrocufflink.blue
*koji0.pyrocufflink.blue* hosts the Koji ecosystem, including a builder.
2018-08-12 10:27:20 -05:00
Dustin 943cdddc23 dch-gw: dhcpd: Update unifi0 MAC address
The UniFi controller has been moved to a different Raspberry Pi device.
2018-08-12 09:18:42 -05:00
Dustin 7ebc2bdfa2 burp-{client,server}: PBs to deploy BURP
The `burp-client.yml` and `burp-server.yml` playbooks apply the
*burp-client* and *burp-server* roles to BURP clients and servers,
respectively. The server playbook also applies the *postfix* role to
ensure that SMTP is configured and backup notifications can be sent.
2018-08-08 20:14:25 -05:00
Dustin 241f9d6afa all: Set SMTP relay
All machines (except the relay itself of course) should use the
*mail.pyrocufflink.blue* SMTP relay to send email.
2018-08-07 20:04:09 -05:00
Dustin ee6523faf6 pyrocufflink-dns: Correct IPv6 reverse zones
The zone names and forwarder addresses for IPv6 reverse lookups were
incorrect. This caused long timeouts when resolving IPv6 addresses, e.g.
for SSH.
2018-08-07 18:46:43 -05:00
Dustin b415c0403e dch-gw: Forward port 22 to file0 2018-08-03 00:27:44 -05:00
Dustin cff7789862 dch-gw: Add DHCP lease for file0.p.b
It is necessary for the file server to have a static address in order
for port forwarding for SSH to work.
2018-08-02 20:42:33 -05:00
Dustin 4aded1e75c pyrocufflink: Ensure Samba security is correct
Usually, the *samba* role is deployed as a dependency of the *winbind*
role, which explicitly sets `samba_security` to `ads`. The new
*fileserver* role also depends on the *samba* role, but it does NOT sett
that variable. This can cause `smb.conf` to be rewritten with a
different value whenever one or the other role is applied.

Explicitly setting the `samba_security` variable at the group level
ensures that the value is consistent no matter how the *samba* role is
applied. Since all domain member machines need the same value,
regardless of what function they perform, this is safe.
2018-08-01 22:05:18 -05:00
Dustin a8dd2e9ec3 vmhost: PB to set up VM hosts 2018-07-23 17:35:10 -05:00
Dustin 620fcc79b8 dch-network: Use dc0.p.b for NTP on test network 2018-07-23 17:35:10 -05:00
Dustin d6b4e4a098 dch-network: Add NTP servers for Management net 2018-07-15 09:42:22 -05:00
Dustin 5f65864d3a dch-network: Correct Management router interface 2018-07-15 09:41:46 -05:00
Dustin 44552dcd4a dch-gw: Add DHCP reservation for unifi0
The UniFi controller has been moved to a Raspberry Pi on the Management
network. This machine needs a static address to use in the "inform URL"
it sends to managed devices.
2018-07-15 09:19:53 -05:00
Dustin 9f89c4c835 Move APs to Management network
The UniFi access points are now connected to the Management network.
Their IP addresses have thus changed.
2018-07-15 09:19:39 -05:00
Dustin d811a9fe22 dch-gw: Add Management network
The Management network (VLAN 10, 172.30.0.240/28) will be used for
communication with and configuration of network devices including
switches and access points. This keeps configuration separate from
normal traffic, and allows complete isolation of infrastructure devices.
2018-07-15 09:15:26 -05:00
Dustin 6602dd5b4a dch-gw: Allow inbound TCP port 9876
TCP port 9876 is used for the OpenVPN-over-TLS service.
2018-07-01 15:18:19 -05:00
Dustin b809d4294f pyrocufflink: Convert variables file to directory
Converting the *pyrocufflink* group variables definition from a file to
a directory will allow Jenkins jobs to place a Vault-envrypted file
within it that defines the `ansible_become_password` variable. In this
way, a different password can be used for machines that are members of
the *pyrocufflink.blue* domain than for other hosts. The existing
mechanism of specifying the path to the Vault-encrypted file that
defines the variable allows only a single password to be defined, so it
does not work when multiple machines in the same play have different
passwords.
2018-06-22 19:20:22 -05:00
Dustin ddafc09839 dch-gw: Open Zabbix ports in the firewall
Obviously, the Zabbix agent (active and passive) ports need to be open
in order for the gateway device itself to be monitored by Zabbix.
2018-06-19 20:41:45 -05:00
Dustin 974cc3dceb Set Let's Encrypt account email globally 2018-06-13 22:23:27 -05:00
Dustin efc6b62903 dch-gw: Forward HTTP, HTTPS to rprx0.p.b 2018-06-12 22:44:54 -05:00
Dustin 83253cb6d6 dch-gw: Add DHCP reservation for rprx0.p.b
*rprx0.pyrocufflink.blue* needs a DHCP reservation and static address
for port forwarding of HTTP and HTTPS.
2018-06-12 22:44:54 -05:00
Dustin 6396b9fc49 gitea: Restrict SSH configuration
Since Gitea servers may be exposed directly to the Internet, it is
important to prevent SSH tunneling, lest the server become an ingress
point into the network.

Additionally, the *gitea* user should not be allowed to use password
authentication, as this would only work if the user actually has a
password (which it does not) and would result in shell access instead of
Gitea.
2018-06-06 21:45:36 -05:00
Dustin ce75b1567c zabbix-server: Force prefork Apache MPM
The PHP module for Apache, which is required for the Zabbix front end,
is incompatible with the *event* MPM, so the *prefork* MPM must be used.
2018-06-04 20:03:52 -05:00
Dustin 1c130bf840 samba-dc: Configure TLS 2018-05-28 15:24:34 -05:00
Dustin f8641cb912 dch-gw: Host Pyrocufflink VPN locally
This commit adjusts the firewall and networking configuration on dc0 to
host the Pyrocufflink remote access IPsec VPN locally instead of
forwarding it to the internal VPN server.
2018-05-20 13:23:20 -05:00
Dustin ab9bdd447b dhcpd: Add reservation for diddy.pyrocufflink.blue 2018-05-06 20:08:58 -05:00
Dustin 67057fc72e Disable DHCP-DDNS on blue network
DNS updates are only allowed on the blue network from domain members.
2018-05-06 13:39:40 -05:00
Dustin 40e9573f57 Move APs to blue network 2018-05-06 13:12:55 -05:00
Dustin 2cf4e71170 dch-gw: dhcpd: Reduce blue pool size
A few more hosts are going to need static addresses, so the pool needs
to start later in the address space to make room for them.
2018-05-06 13:11:57 -05:00
Dustin aba3fe8e04 hosts: Add DCs to radius group
All domain controllers for the *pyrocufflink.blue* domain are RADIUS
servers as well.
2018-05-06 13:10:31 -05:00
Dustin 94a89d8d78 smtp-relay: PB to deploy Postfix SMTP relay
The `smtp-relay.yml` playbook configures Postfix on the managed node as
an SMTP relay.
2018-04-15 11:38:51 -05:00
Dustin f3739d91ac hosts: Add hosts to zabbix group
Hosts in the *zabbix* group will get the Zabbix agent deployed to them.
2018-04-14 15:47:49 -05:00
Dustin 3bbe5aee6a hosts: Add zbx0.pyrocufflink.blue
The host *zbx0.pyrocufflink.blue* (a Raspberry Pi) runs the Zabbix
server and web UI. It has a reserved IPv4 address to simplify reverse
DNS management for now, since Samba's dynamic DNS client does not
register PTR records.
2018-04-14 15:47:30 -05:00
Dustin 9ace01788a zabbix: Playbooks for Zabbix server, agents 2018-04-14 15:31:17 -05:00
Dustin 0ce0c0f834 pyrocufflink-dns: Add IPv6 reverse DNS zones
These IPv6 reverse DNS zones are managed by the Samba AD DCs for the
*pyrocufflink.blue* domain. These zones correspond to the IPv6 prefixes
used by the "blue" network.
2018-04-14 15:15:02 -05:00
Dustin 54bc5570f1 jenkins-slave: PB to deploy Jenkins slave 2018-04-08 12:04:03 -05:00
Dustin 87b9b0c60d dch-gw: Allow outbound NTP 2018-04-07 09:40:50 -05:00
Dustin ef2b31880b dch-gw: Allow outbound DHCP
Connection Tracking does not work for DHCP messages, since many are
broadcast. As such, the firewall must explicitly allow datagrams
destined for the DHCP client port.
2018-04-07 09:39:22 -05:00
Dustin de5aa114d1 dch-network: Use dns0.pyrocufflink.blue everywhere
All internal networks (except Guest) now use *dns0.pyrocufflink.blue*
for DNS resolution.
2018-04-06 20:40:22 -05:00
Dustin b5620631ff dch-gw: Add IPv6 ULA prefix to pyrocufflink.blue
For internal services, particularly DNS, it is easier to use a ULA
prefix than rely exclusively on routed addresses, since these can change
relatively frequently.
2018-04-06 20:36:30 -05:00
Dustin 2bc6bc69f3 dch-gw: Fix network address for pyrocufflink.red 2018-04-06 20:35:52 -05:00