A Cloudflare Tunnel Connector That Keeps Its Token Off The Command Line
cloudflared from Cloudflare's signed repository (a 2025 key rpm on EL 10 accepts), pinned, run as a hardened unit that reads the tunnel token from a root-only file, not from the unit or ps. Never self-updating. The live test greps the unit and the connector's command lines for the token and expects nothing. Original role, live-tested on Rocky Linux 10.
Verification
Live-testedReally deployed to a container sandbox, proven idempotent (a second run changes nothing), verified against the role’s assertions, then torn down.
Conformance
- Static validation (yamllint · ansible-lint)
Provenance
- SHA-256 checksum
- Signature (pending)
Functional
- Live-tested - applied, verified, destroyed
Last verified 2026-09-19 · podman 4.9.3 · ansible 2.21.4 · how we verify
Documentation
cloudflared-tunnel
cloudflared as a Cloudflare Tunnel connector: installed from Cloudflare's
signed repository at a pinned version, run as a hardened systemd unit that
reads its token from a root-only file. Original role for EL 10, live-tested
with podman on Rocky Linux 10.
The token is a credential; keep it off the command line. The one-liner
in the dashboard is cloudflared service install <token>. This role writes
the token to /etc/cloudflared/token (root, 0600) and runs
tunnel run --token-file from a unit of its own, so the token is not in a
unit file, not in ps, not in the journal. The live test greps every
process command line and the unit file for it and expects nothing.
Signed, and verifiably so on EL 10. Cloudflare's 2025 packaging key
(CC94 B39C 77AE 7342 A68B 8962 8A68 2D30 8D4E 5E73) has no SHA-1
signatures, so rpm on EL 10 imports it and checks every package - unlike
the AWS and Google keys, which it refuses. The role imports it by
fingerprint and the live test asserts it is in rpm's keyring.
Pinned, and never self-updating. --no-autoupdate keeps the connector
from replacing its own binary; a newer version is a variable change and a
run through the package manager.
Without a real token it tries, and keeps trying. The placeholder token
has the right shape and no valid secret, so the edge refuses it, the
connector exits and systemd restarts it - which is what the live test
sees, and reads from the journal. Give it the token from Zero Trust >
Networks > Tunnels and the same unit connects. Set
cloudflared_tunnel_refuse_placeholder_token: true in any real inventory.
License
Commercial - IaC Bazaar EULA. (c) IaC Bazaar.
Usage code & full reference need an account
The complete copy-paste usage, the full input/output reference, and operational notes are free with an account - shown here and bundled in the download. Sign in and this section fills in.
- Variables
- Test