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_syncookiesTrace 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-usageRestrict 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.
| Port | Protocol | Scope |
|---|---|---|
| 22 | TCP | Administration sources |
| 80, 443 | TCP | Web ingress |
| 6443 | TCP | K3s nodes |
| 8472 | UDP | Flannel network |
| 10250 | TCP | K3s nodes |
| 2379, 2380 | TCP | etcd 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.
| Setting | Shipped value | Expected in production |
|---|---|---|
INVITE_CODES | empty, so registration is open to anyone | the list of codes you hand out |
ENVIRONMENT | development, which exposes the debug routes | production |
COOKIE_SECURE | false | true behind HTTPS |
BRUME_INTERNAL_SECRET | a shared development value | a 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 recentNext
Security mechanisms
What the application protects on its own: sessions, bcrypt, Fernet, TLS, RBAC, file validation.
Provider keys
Set an OpenAI key (embeddings) and a generation key per workspace, encrypted in the database.
Your data
What stays with you, what goes to the provider, and the external services that can be disabled.
Architecture
The four system layers and the processing pipeline, component by component.
Getting the instance running
From a deployed instance to the first organization: secrets, database, health check, registration, emails, first superadmin, license, handover to the referent.
Security mechanisms
What the application protects on its own: revocable sessions, bcrypt passwords, Fernet-encrypted secrets, TLS, RBAC, and file validation.