Security posture
The rule underneath all of this: anyone who can deploy a flow can make the box do things, because that’s what flows are for. So “who can deploy a flow” gets answered by the operator, on purpose, and never by a default.
It won’t start without authentication. Not a warning in a log nobody reads,
not a default you’re trusted to change: a startup error with the fix printed
next to it. Turning it off takes HOTLOOP_FLOW_INSECURE=true in the environment,
on purpose, because a config file can’t do it on its own: the file is where a
copy-paste lands. Do it and the log warns on every boot and the editor wears a
no login badge, so the next person knows the door is open.
Two-factor sign-in is free and built in. Any user turns it on from the
editor’s Two-factor button: scan the QR code (or type the key) into any
authenticator app, type one code back, and from then on signing in takes the
password and the six digits. Nothing changes until that first code proves the
phone has it, so a setup abandoned half way can’t lock anybody out. A code works
once: the step it came from is remembered, so a code read over somebody’s
shoulder is dead the moment they use it, and so is any code older than it.
Thirty seconds of clock skew either way is allowed. Turning it off takes a code
too, so a session left open on a shared screen isn’t enough to strip it off an
account. A lost phone is an account with auth.admin calling
POST /auth/mfa/reset, which lands in the audit trail with who did it to whom.
Enrollments are encrypted with the credential secret, the same way node
credentials are. Nothing about signing in safely is a paid tier here or ever
will be.
Guessing passwords goes nowhere. Five wrong passwords (or right passwords
with wrong codes) for one account from one address lock that account out from
that address for fifteen minutes, and twenty failures from one address across
any accounts lock the address. The account lock is per address on purpose: lock
the account everywhere and anybody who can reach the port can lock the real
operator out from across the plant. Locked attempts get a 429 with
Retry-After before the password is even checked, and the lock and every
attempt it turns away are in the audit trail. Behind a reverse proxy every
request has the proxy’s address, so the per-address limit then applies to
everybody together; that’s the safe way round to be wrong, and the numbers are
in auth.lockout. There’s no setting that turns it off.
Sessions survive a restart. They used to live in memory, so every pod
reschedule and every upgrade signed everybody out, and the person who needed to
change a flow right then went looking for a password instead. They’re in
data/sessions.json now, as SHA-256 hashes only, so the file proves a token
when one is presented and is useless to whoever copies it. A session remembers
who, not what they may do: take a permission or a user out of the config and
the next request knows.
Send the token in a header, not a URL. A browser can’t put an Authorization
header on a WebSocket handshake, so the editor’s event stream used to carry its
token in the query string, which is exactly where access logs, proxies and
browser history keep things. It now offers the token as a second WebSocket
subprotocol beside hotloop-flow, hotloop-flow.bearer.<token>, a header
nothing logs by habit, and the server answers with hotloop-flow. A script that
still sends ?access_token= keeps working, because breaking it for an upgrade
would be worse, and the server logs a warning on every such connection that says
what to send instead. Flow never writes the URL, or the token in it, to its own
log or the audit trail.
Everything that matters leaves a trail. Logins, failed logins (with whether
the name even exists, which a client never gets told but an operator should),
logouts, deploys, refused deploys, rollbacks, injects, MCP tool calls and saves
of the flow tests go to
data/audit.log, one JSON line each, synced to disk before the request is
answered. Each says who, from which address, and what: a deploy points at its
deployment record, an inject names the node. X-Forwarded-For is kept beside
the socket’s address and never instead of it, because anybody can send that
header. GET /audit reads it newest first, filtered by ?event= (login. for
every kind of login), ?user=, ?since= and ?limit=, and it takes its own
audit.read permission, because being allowed to deploy doesn’t mean being
allowed to read who else logged in. It rotates by size (audit.maxBytes,
audit.keep) so a busy instance can’t fill its volume, and a trail that can’t
be written never stops the action it was recording: it’s logged and counted in
hotloop_flow_audit_write_failures_total, which should be zero forever.
The exec node ships disabled. An operator names the commands a flow may
run, and an enabled node with an empty allowlist is a startup error, not a
license to run anything. The allowlist matches the resolved absolute path,
not the string the flow typed. Match on strings and a flow asks for curl and
gets whichever curl sits first on a PATH that a Function node can read and a
sidecar can influence. And there’s no shell. The command line is split on
quoting rules only, and an unquoted shell metacharacter (|, &, ;, $ and
friends) is refused rather than passed through as a literal and hoped about. So
ping -c1 10.0.0.1; rm -rf /data is an error, not two commands.
The file nodes are scoped to the data directory. Symlinks are resolved over
the longest existing prefix of the path, which closes the obvious hole: put a
symlink under the volume that points at /, then read straight through it. A
plain prefix check waves that through without blinking, and now a flow can read
anything the process can.
Secrets get their own scope, and it isn’t the file nodes’. A tls-config reads
its certificate, key and CA through secrets.allowedPaths: the data directory
plus whatever you list. Mount the Secret cert-manager made there and the TLS
config uses the key while no flow can read it, because anything read through
that scope ends up in a handshake, never in a message. Put the same key under
files.allowedPaths instead and any flow with a File In node can pick it up and
mail it to whoever it likes.
A password can live in a Secret instead of the flow. Any node’s credential can name a file instead of holding the value:
{"id": "b1", "type": "mqtt-broker", "broker": "plc-broker", "user": "line3", "ew_credentialFiles": {"password": "/etc/hotloop-flow/secrets/plc-broker/password"}}The file is read through the same secret scope when the node starts. One
trailing newline comes off, because that’s what echo leaves behind and a
password with a newline on the end fails a login with nothing in the log to say
why. The flow file, the deployment log, the diff and a git mirror carry the path
and never the password, so the flow can go in git and the password stays where
whoever runs the cluster already keeps passwords. A file that’s missing or
outside the scope fails that node’s deploy instead of letting it connect with no
password. The chart mounts Secrets for you under secrets.mounts. A rotated
Secret takes effect on the next deploy or restart.
Credentials are AES-256-GCM, keyed with Argon2id. GCM refuses a tampered file outright instead of decrypting it to something an attacker picked, and Argon2id makes every guess at a weak secret cost 64 MiB of memory. The flow file is written temp, fsync, rename, fsync the directory, three backups deep, so a power cut mid-save leaves you the old file or the new one, never half of each. If it ever reads a corrupt one, it falls back to a backup and says so out loud.
The discovery nodes are off by default and bounded by an operator-configured CIDR allowlist. A hostname that resolves to one in-scope address and one out-of-scope address is refused outright, because otherwise DNS is just the way around the allowlist.
The Function node has nothing to reach. It runs on
a JavaScript interpreter in pure Go with
no host bindings unless somebody adds them, and nobody did. No require, no
process, no Buffer, no filesystem, no network, and a test runs the classic
constructor-chain escape to prove it reaches nothing.