Skip to content

Backup and security

FireHawk keeps all of its state in PostgreSQL. The API and worker containers are stateless. Back up two things:

What Why
The PostgreSQL database Hosts, desired rules, versions, deployments and snapshots, aliases, policies, templates, users and access rules, encrypted credentials, settings, audit log, job queue
SECRET_KEY (your .env, or the Kubernetes Secret) Needed to decrypt the secrets stored in the database. A database backup without the matching SECRET_KEY restores everything except stored passwords, keys and channel secrets

Also keep the files in sshkeys/ if hosts use key files, and your docker-compose.yml and Helm values.

Terminal window
cd firehawk
docker compose exec -T db pg_dump -U firehawk -d firehawk -Fc > firehawk-$(date +%F).dump

Run it from cron or a systemd timer and copy the files off the machine. Use your POSTGRES_USER and POSTGRES_DB if you changed them.

To restore into an empty database (for example on a new server, or to undo an upgrade):

Terminal window
docker compose stop api worker frontend
docker compose exec -T db pg_restore -U firehawk -d firehawk --clean --if-exists < firehawk-2026-12-01.dump
docker compose up -d

Restore with the same SECRET_KEY the dump was taken with.

With the built-in PostgreSQL:

Terminal window
kubectl -n firehawk exec firehawk-postgresql-0 -- \
sh -c 'pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" -Fc' > firehawk-$(date +%F).dump
kubectl -n firehawk get secret firehawk -o jsonpath='{.data.SECRET_KEY}' | base64 -d > secret-key.txt

Check the pod name with kubectl -n firehawk get pods. With an external or operator-run database, use its own backup mechanism.

SECRET_KEY is used for two things:

  • Signing sign-in sessions. Changing it signs every user out.
  • Encrypting stored secrets in the database:
    • host passwords and stored SSH credentials (private keys, passphrases, passwords),
    • notification channel settings (SMTP passwords, webhook URLs and signing secrets),
    • single sign-on settings (client secret) and other application settings.

Personal API tokens are stored as one-way hashes and do not depend on SECRET_KEY.

Rotate it if it may have leaked. There is no automatic re-encryption: after changing the key, stored secrets cannot be decrypted any more and must be entered again.

  1. Generate a new key: openssl rand -hex 32, put it in .env (Helm: secretKey or your existingSecret).
  2. Restart the API and workers (docker compose up -d). Everyone signs in again.
  3. Re-enter the secrets: passwords of password-authenticated hosts, credentials on the Credentials page (import or generate keys again, then install the new public keys), secrets of notification channels, the single sign-on client secret.

Prefer few stored key credentials over many per-host passwords: they are fewer secrets to re-enter, and Rotate on the Credentials page replaces a key on every host that uses it.

The BOOTSTRAP_ADMIN_EMAIL / BOOTSTRAP_ADMIN_PASSWORD account is created only on a start where the database has no user. Change its password at the first sign-in (Users & access, Reset password). Create personal accounts for every administrator (or use single sign-on) rather than sharing the bootstrap account, so the audit log shows who did what.

  • Secrets never leave the server: the API and configuration exports carry only names, public keys and fingerprints, never private keys or passwords.
  • Stored credentials can be generated by FireHawk (ed25519, ECDSA or RSA) or imported, with passphrase support. Rotate installs a new key on every host and jump host that uses the credential, verifies a login with it everywhere, and only then switches and removes the old key; if any host fails, nothing changes.
  • Key files in sshkeys/ are readable by the whole server, so in a multi-workspace installation only FireHawk administrators can point hosts at them. Other users use stored credentials.

See Credentials and jump hosts.

FireHawk pins each host’s SSH host key on the first connection (trust on first use, ed25519 preferred). For zero first-use risk, enter the expected fingerprint on the host form when adding the host. A configuration export carries the pinned public key, so a host imported into another FireHawk is pinned to the same key.

If a host later offers a different key, FireHawk refuses the connection during the key exchange, before any password or command is sent, and shows host key changed with both fingerprints. Check the key on the host’s console:

Terminal window
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub

and only then accept the new key on the host page. Accepting needs the hostkey.accept permission on that host and is audited. Jump hosts are pinned the same way. Changing a host’s address or port clears its pin.

  • Every render keeps the SSH port FireHawk uses reachable before any drop rule or drop policy (an SSH guard rule, and ICMPv6 neighbour discovery for IPv6).
  • Safe deploy (on by default) arms a restore timer on the host before applying and only cancels it after reconnecting over a new SSH connection. If the new rules lock FireHawk out, the host restores its previous rules by itself.
  • Every deploy takes a snapshot first, and any deploy can be rolled back.

See Deploy and rollback.

  • Give users only the permissions they need through roles and grants. See Access control and Permissions.
  • aliases.manage, policies.manage, groups.manage and config.transfer affect many hosts at once; grant them to trusted people only.
  • Every API action is written to the audit log. See Audit log and jobs.