Commit Graph

82 Commits (3aad9c1dda213f32bec961b215fae7becaccfc93)

Author SHA1 Message Date
Dustin cf8180a195 bitwarden_rs: Fix path to BURP backup script 2019-09-27 14:07:29 -05:00
Dustin 0dc6a80ea2 taiga: Add playbook for Taiga
The `taiga.yml` playbook deploys all the necessary components to run
*taiga-back*, *taiga-front*, and *taiga-events*.
2019-09-19 19:51:45 -05:00
Dustin fb352cc920 jenkins-slave: Allow Jenkins to connect to Docker
In order to allow Jenkins to connect to the Docker daemon socket, the
socket must be owned by the *docker* group, and the *jenkins* user must
be a member of it.
2019-09-19 19:50:35 -05:00
Dustin 1bb9c28ef4 pyrocufflink-dhcp: Add lease for serial0.p.b
*serial0.pyrocufflink.blue* has a manually-configured IP address now, to
ensure it always has an addresss, even if the DHCP server is
unavailable.  Recording it here to ensure the address does not
accidentally get reused.
2019-09-19 19:27:30 -05:00
Dustin 6e57abfe2e bitwarden_rs: Configure BURP client
This commit configures *bw0.pyrocufflink.blue* as a BURP client, so that
the Bitwarden data can be backed up.  A pre-backup script is used to
take a consistent snapshot of the SQLite database before copying it to
the BURP server.
2019-09-19 19:27:30 -05:00
Dustin 9306252e75 hosts: Add bw0.p.b
*bw0.pyrocufflink.blue* runs Bitwarden_rs via Docker.
2019-09-19 19:27:30 -05:00
Dustin 26e887d0b0 Add new FireMon user network address 2019-08-23 08:48:22 -05:00
Dustin d6a5439057 hosts: Decommission dns1.p.b
*dns1.pyrocufflink.blue* has been decommissioned.  Having a second DNS
server never really worked correctly for some reason, and the
maintenance overhead of the Raspberry Pi is just not worth it right now.
The DHCP service has been moved to *dns0.pyrocufflink.blue*.
2019-05-02 10:29:43 -05:00
Dustin 12b645e574 zabbix-server: Allow SMTP relay from any loopback
The Zabbix server resolves *localhost* to `::1`, but Postfix resolves it
to `127.0.0.1`.  This causes Postfix to reject incoming mail from Zabbix
with "Relay access denied."  Explicitly setting the `mynetworks` setting
to include both the IPv4 and IPv6 loopback addresses will ensure that no
mail is rejected from local processes, regardless of how name resolution
happens.
2019-04-15 10:05:04 -05:00
Dustin 066bc807bd vm-hosts: Add mgmt and hass libvirt networks 2019-03-22 09:29:56 -05:00
Dustin 728657fdd5 pyrocufflink-dhcp: Add options to mgmt network
Specifying the DNS domain and UniFi address on the Management network
helps Ubiquiti devices more quickly locate the UniFi controller.
2019-03-22 09:29:56 -05:00
Dustin 159a42bb70 pyrocufflink-dns: Add FireMon zones 2019-03-22 09:29:56 -05:00
Dustin 417df821a3 pyrocufflink-dns: Remove pyrocufflink.jazz 2019-03-22 09:29:56 -05:00
Dustin 7211028f4d hosts: Add hass0.pyrocufflink.blue
*hass0.pyrocufflink.blue* is a virtual machine that runs Home Assistant.
It is dual-homed on the *pyrocufflink.blue* network and the isolated IoT
network.
2019-03-05 18:31:42 -06:00
Dustin 4ccab4bd40 public-web: Add missing group variables file 2019-01-04 20:52:41 -06:00
Dustin 2b61d80319 zabbix-server: Correctly set smtp_mynetworks
The `smtp_mynetworks` variable expects a list. Setting it to a string
resulted in each character in the string being interpreted as an item in
the list.
2019-01-04 20:52:23 -06:00
Dustin 87c63ae203 fileserver: Configure Apache ~user directories
This commit sets the `apache_userdir` variable, which enables the
per-user directories feature. This allows users to serve content via
HTTP by placing it in the `public_html` directory within their home
directories.

Although Apache is already installed on the file server in order to
serve the Aria2 web UI, it is not explicitly included in the
`fileserver.yml` playbook.
2019-01-04 20:52:23 -06:00
Dustin f9b006c4bd Move dch_networks definition to all group
Defining the `dch_networks` object for the *all* group will allow any
role to use its values.
2018-10-13 12:43:35 -05:00
Dustin 6d467c7b7d dch-vpn: Avoid configuring firewalld
FirewallD cannot be configured to allow traffic to be routed through the
system without NAT. This makes it unsuitable for running on a VPN
concentrator. Thus, any role that would configure FirewallD needs to be
informed that this machine does not use it.
2018-10-13 12:19:25 -05:00
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