Brume · Docs
Installation

Secure your instance

Harden a Brume instance: SSH, firewall, audit, secrets, and TLS, then the application settings shipped with development values.

In brief

Apply the procedure to every Ubuntu 24.04 LTS node before it carries traffic, then switch over the application settings shipped with development values. What the application protects on its own is covered separately, in Security mechanisms.

Harden each server

Lock down SSH

Set PermitRootLogin no, PasswordAuthentication no, PubkeyAuthentication yes, and MaxAuthTries 3. Use an SSH key for administration connections, then check the effective configuration:

sudo sshd -T | grep -E '(passwordauth|permitroot|pubkey|maxauth)'

Enable host protections

Enable fail2ban for SSH, unattended-upgrades for security patches, and the rp_filter and tcp_syncookies kernel settings. Check each service after applying the configuration:

sudo fail2ban-client status sshd
apt-config dump APT::Periodic
sudo sysctl net.ipv4.conf.all.rp_filter
sudo sysctl net.ipv4.tcp_syncookies

Trace privileged actions

Configure auditd to record commands run with euid=0 and changes to SSH, passwd, shadow, sudoers, UFW, and K3s. Retain auditd and journald logs for 90 days, then check collection:

sudo ausearch -k sudo_commands --start recent
sudo journalctl --disk-usage

Restrict the firewall

UFW denies inbound connections by default. Expose the web ports required by your ingress and restrict K3s ports to cluster node addresses only.

PortProtocolScope
22TCPAdministration sources
80, 443TCPWeb ingress
6443TCPK3s nodes
8472UDPFlannel network
10250TCPK3s nodes
2379, 2380TCPetcd members

Remove cluster rules open to everyone. Delete global allowances after bootstrap, for example sudo ufw delete allow 6443/tcp.

Allow each peer. For every node IP, apply sudo ufw allow from <peer-ip> to any port 6443 proto tcp, then adapt the port and protocol for 8472, 10250, 2379, and 2380.

Check the rules. sudo ufw status numbered must show cluster ports restricted by source address.

Provision secrets and TLS

Generate durable secrets

Create a JWT signing secret and a Fernet key:

openssl rand -hex 32
python3 -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())'

Inject the secrets

Store the values in your secret manager, then provide JWT_SECRET and APP_ENCRYPTION_KEY to the Kubernetes Secret expected by the backend before the Helm installation. Keep the same values across redeployments. See Configuration variables for the complete list.

Enable HTTPS

Attach a TLS certificate to the Traefik websecure entrypoint and redirect HTTP to HTTPS on the ingress. Then check the public endpoint:

curl -I https://<your-domain>

Harden the application

Hardening the host is not enough: four application settings ship with development values and must change before the instance is exposed.

SettingShipped valueExpected in production
INVITE_CODESempty, so registration is open to anyonethe list of codes you hand out
ENVIRONMENTdevelopment, which exposes the debug routesproduction
COOKIE_SECUREfalsetrue behind HTTPS
BRUME_INTERNAL_SECRETa shared development valuea value specific to the instance, identical on frontend and backend

Add JWT_SECRET to that list: without it, the backend starts and signs sessions with a known default value. Getting the instance running chains these checks in deployment order.

Verify hardening

Run the checks again after each node, firewall, or ingress change:

sudo sshd -T | grep -E '(passwordauth|permitroot|pubkey|maxauth)'
sudo fail2ban-client status sshd
sudo ufw status numbered
sudo sysctl net.ipv4.conf.all.rp_filter
sudo sysctl net.ipv4.tcp_syncookies
sudo ausearch -k sudo_commands --start recent

Next

On this page