Deployment Guide
For an operator deploying Canopy for a state agency: this page owns topology, profiles, the database inventory and the health contract. Variables and secrets live in Configuration Reference; the deploy and rollback procedure in Rolling deploy & rollback; local development in Local Development.
Topology
Canopy is nineteen services — rules, persons, applications, eligibility, verification, enrollment, renewals, notices, exchange, appeals, reporting, security, web (worker portal), portal (applicant portal), snap, tanf, medicaid, caps, wic (Cargo.toml [workspace] members) — packaged into two container images. Neither image compiles anything (#3273, ADR-040 Amendment 7): the car's own cargo build compiles every binary once per merge-train car, in the CI image (Alpine, musl, rust-toolchain.toml's toolchain) and the car profile, and the Dockerfiles copy its output. The root Dockerfile copies every service binary except the portal from target/car/bin/release/ into one shared image (each compose service selects its binary with command:), and services/canopy-portal/Dockerfile copies the portal's server and public/ bundle from target/car/portal/. Both are alpine:3.24, run as the non-root app user, and declare no HEALTHCHECK of their own — health is the compose-level probe in Health and readiness.
The shared image also carries three non-service binaries at the same /app/ path: canopy-seed (tools/canopy-seed, the seed generator), canopy-manage (tools/canopy-manage, the operator's tool for key material and other work below the API; canopy-manage Reference) and the canopy CLI at /app/canopy ([[bin]] name = "canopy" in tools/canopy-cli/Cargo.toml; the COPY target/car/bin/${BINARY_SET}/… block of the root Dockerfile) — the ADR-007 Consequence that the CLI ships beside the service binaries, so the operator commands shipped docs point at (canopy person redact-ssn, canopy security chain-verify) exist on a container-only host (#2099). Invoke it by overriding the image’s /bin/sh -c entrypoint: docker run --rm --entrypoint /app/canopy <image> --help. A real command reads profiles.toml and the profile’s device store, identity/<profile>/, from dirs::config_dir()/canopy (config::config_dir, tools/canopy-cli/src/config.rs: $XDG_CONFIG_HOME/canopy when that variable is an absolute path, else $HOME/.config/canopy), so mount a directory whose canopy/ subdirectory holds them, writable by the image’s non-root app user, and point XDG_CONFIG_HOME at it (-v <dir>:/cfg -e XDG_CONFIG_HOME=/cfg). Sign in once with canopy login, approving the code it prints at canopy-web’s /device; every command then takes its token from that session (IdP Integration › Device approval). Run the container where the profile’s issuer and service URLs resolve. The command reference is canopy CLI Reference.
docker-compose.yml is the devstack: every canopy service uses build: and carries no image:. A deployment runs the same file with the prebuilt override, docker-compose.prebuilt.yml, which points all eighteen shared-image entries at CANOPY_PREBUILT_SERVICE_IMAGE, the portal at CANOPY_PREBUILT_PORTAL_IMAGE and the configuration fetcher at CANOPY_PREBUILT_CONFIG_FETCH_IMAGE (:? interpolation fails loud when any is unset). It also gives the devstack-only kanidm and canopy-token-broker default image names, so a deployment's commands, which never start them, need no ref for them. The repository ships no Kubernetes manifests or Helm chart, and cargo xtask has no deploy subcommand; the devstack lifecycle (cargo xtask dev …) is for development only.
Every canopy service runs read_only: true with a tmpfs at /tmp, and its config/canopy-<svc> directory is bind-mounted read-only at /app/config/canopy-<svc> (the portal’s config is baked into its image instead). Service-to-service calls use compose DNS names on the canonical container ports (Services); the eligibility orchestrator resolves program services through CANOPY_PROGRAM_URL_<PROGRAM>.
Where the policy lives. A service reads its policy through the configuration layers CANOPY_CONFIG_SOURCE names (Configuration Reference › Configuration source, ADR-051). A git source is read from the tree canopy-config-fetch publishes under CANOPY_POLICY_ROOT (default /app/policy; [config-fetch]); no image bakes a jurisdiction’s or the federal configuration. Both images bake only the fixture layers, under /app/fixtures/config/ (the root Dockerfile, services/canopy-portal/Dockerfile), which load as path: sources with CANOPY_CONFIG_ALLOW_UNVERIFIED, a flag only a list of path: sources may set.
Fetching configuration (canopy-config-fetch, ADR-051). A deployment whose CANOPY_CONFIG_SOURCE names git+ sources runs the fetcher before any service starts. It is its own image ($CI_REGISTRY_IMAGE/config-fetch, tools/canopy-config-fetch/Dockerfile), so git, the signature verifiers and the fetch credentials stay out of every service's container.
-
What it does.
sync(the default command) takes each git source in order: it fetches the tracked branch or tag, checks the commit out into<policy root>/<name>/<sha>/, verifies it, and only then points<name>/currentat it with onerename(2). A reader therefore sees the old tree or the new one, never a mix, and a service resolvescurrentonce at boot. Old trees stay on disk.path:sources and an empty source list are nothing to fetch, and it exits 0. -
Verification. The mode is the source's (
verify=head,tagortag-and-head;headfor a branch andtagfor a tag when unset). The signer must be on the source's trust root, which the deployment mounts atCANOPY_CONFIG_TRUST_DIR(/app/config-trustin the image) and the configuration repository never carries:<name>.allowed_signersfor SSH signatures, or<name>.openpgp(one fingerprint per line) with the public keys in<name>.openpgp.asc. A missing, empty or unparseable trust root trusts nobody. A key in a keyring is never enough; only the list decides. An OpenPGP key that expires refuses every commit it signed, so the fetcher logs aWARNline from 90 days before a listed key's expiry; Security Operations › Configuration trust-root keys is the procedure. -
Refusal. A source that fails any step keeps
currenton the last good commit, writes<name>/status.jsonwithok: falseand the reason, and makes the run exit 1 after the other sources are tried. A service with no good tree for a git source refuses to start; one running on the last good tree reports itself degraded on/readyz. -
Output. One line per event on stderr, led by
INFO,WARNorERROR: each source published or refused with its commit and reason, and the throwaway keyring it used. It installs no logging pipeline of its own (ADR-041): it runs before any pack is on disk, and it reports source names, commits, paths and git's messages, never a household's data. -
Rollouts.
canopy-config-fetch resolveprints the source list with each branch or tag pinned to the commit it names now (&sha=<commit>). Hand every replica that pinned list asCANOPY_CONFIG_SOURCEand they publish the same trees however the branch moves meanwhile. A sync holds a per-source lock, so replicas sharing one volume publish one tree. -
Credentials. A private repository authenticates through git's own environment (
GIT_ASKPASS, or an SSH key andGIT_SSH_COMMAND); a URL carrying userinfo is refused, because the source list is logged and shown onGET /version. -
In compose it is the one-shot service
canopy-config-fetch: every canopy service waits for it withservice_completed_successfullyand mounts its volume,canopy_policy, read-only at/app/policy. Mount the trust directory into it at/app/config-trust. It runsread_onlywith atmpfsat/tmp, where each run keeps its throwaway OpenPGP keyring. -
On Kubernetes run the same image as an init container that shares an
emptyDir(or a volume) with the service container at the policy root, with the trust directory mounted from a ConfigMap.
canopy-security hardening (ADR-049 §9). canopy-security holds canopy-identity’s signing keys in process memory only, so the first line of its main calls prctl(PR_SET_DUMPABLE, 0) (services/canopy-security/src/main.rs): the process writes no core file, and no process without CAP_SYS_PTRACE can ptrace it or read its /proc/<pid>/mem, its own uid included. A kernel that refuses the call fails the boot. Compose also sets ulimits: core: 0 on the service. Production keeps the rest of the posture:
-
a read-only root filesystem (compose’s
read_only: true;readOnlyRootFilesystem: truein a pod security context); -
core dumps off at the runtime (
ulimits: core: 0, or the node’sRLIMIT_CORE), and noCAP_SYS_PTRACEadded to the container; -
no exec: no role holds
pods/execorpods/attachon canopy-security’s pods, and no operator runsdocker execinto its container. A shell there reads the service’s environment, the issuer login’sCANOPY_SECURITY__IDENTITY_DATABASE_URLincluded, which can publish keys every receiver trusts.
The proxy chain (ADR-049 Amendment 22). canopy-web is the only internet-facing service: an ingress terminates TLS for its public origin (CANOPY_WEB__PUBLIC_ORIGIN), under which canopy-identity’s issuer and public routes live (IdP Integration › The issuer identifier). Every hop attributes a request to its client by one rule (canopy_common::http::client_ip): the socket peer, or the leftmost X-Forwarded-For hop only when that peer is listed in CANOPY_TRUSTED_PROXIES (Configuration Reference › Process-wide variables). A production chain is:
-
The ingress overwrites
X-Forwarded-Forwith its own socket peer, never appending to it. The devstack’s ingress does (proxy_set_header X-Forwarded-For $remote_addr;,devstack/ingress/default.conf.template). -
canopy-web trusts the ingress. canopy-web’s
CANOPY_TRUSTED_PROXIESnames the ingress’s addresses, so its per-IP limiter keys on the real client, and its identity edge forwards that one client to canopy-security, overwritingX-Forwarded-Foragain (crates/canopy-auth/src/identity_edge.rs). -
canopy-security trusts canopy-web. canopy-security’s
CANOPY_TRUSTED_PROXIESnames canopy-web’s addresses, so the token routes' per-IP limit (CANOPY_SECURITY__IDENTITY_TOKEN_RATE_LIMIT_RPM) keys on, and the issuance log records aspeer_addr, the client the edge forwarded.
An entry is an exact address or a CIDR range (#2846), so a deployment whose ingress or canopy-web replicas get dynamic addresses names the network they are drawn from, as narrow as it can: every address in a listed range is believed about its clients. An address no entry holds is believed about no one but itself. A proxy that appends rather than overwrites lets its clients choose their own limiter key. The devstack sets no CANOPY_TRUSTED_PROXIES: compose addresses are dynamic, and every devstack client shares one address.
Clock trust. A key’s signing window is a pair of monotonic deadlines taken from the registry’s own times, so a wall-clock step moves neither. Monotonic time can still stop tracking real time: CLOCK_MONOTONIC stands still while the host is suspended, and a VM pause can skew it. So every database answer the key ring reads (an insert’s RETURNING, a read-back that finds its row, the minute’s sample) is also a clock reading: when the database clock’s progress since the previous reading falls more than 5 s outside the monotonic time the two round trips allow, the ring drops every key, logs a WARN, counts canopy_identity_clock_divergence_total and publishes a fresh key. The residual is the time until the first database reading after a resume: at most one sampling interval (60 s), or 30 s when the wall clock moved with real time, since the wall-clock check then samples at once, and longer only while the database stays unreachable. During it, a key can still sign past its registry sign_until.
Prerequisites
Deployment gates (ADR-049 Amendment 25). Two items gate a production deployment, though not a merge to main:
-
The external security review of canopy-identity (#2884; ADR-049 Consequences), since canopy runs its own authorization server.
-
The issuance log’s retention (#1303).
identity_issuance_logtakes one row for every token request and is never purged until #1303 sets its retention or archival ([identity-sizing]).
The versions below are the devstack pins — the floor the code is tested against, not a compatibility matrix.
| Component | Tested | Notes |
|---|---|---|
Docker Engine + Compose v2 |
|
BuildKit is the builder ( |
PostgreSQL |
19 ( |
One instance per program plus a shared instance, or one shared instance (Data tier). WAL archiving for PITR (Backup & Restore). |
RabbitMQ |
4.4 ( |
Topic exchange |
Upstream OIDC provider |
Kanidm 1.12.2, Keycloak 26.8.2 or ZITADEL v4.21.0 (with Login V2) |
The one OpenID Connect provider workers sign in at, which canopy-identity federates. Kanidm is the default, and Keycloak and ZITADEL the tested alternatives (ADR-050, Amendments 5 and 6), each at the version its suite verified. What it must deliver, each one’s setup checklist and canopy-web’s client registration: IdP Integration › What an upstream must deliver and › The supported upstreams. |
Redis |
8 ( |
|
S3-compatible object store |
Garage v2.6.0 in the devstack |
Notice PDFs ( |
ClamAV |
1.5 ( |
clamd sidecar for canopy-applications uploads, |
TLS certificates |
— |
For every public endpoint, the database ( |
Sizing — starting points, not measurements. No load-test baseline is published for the services as a whole; treat these as a first allocation and size from your own metrics. canopy-security’s token plane is measured: [identity-sizing]. Services: 0.5 vCPU / 256 MB, two replicas each; canopy-notices renders Typst PDFs and is CPU-bound, so 1 vCPU / 512 MB; the two BFFs 0.5 vCPU / 512 MB. PostgreSQL: 1 vCPU / 1 GB / 50 GB SSD per instance (the devstack’s shared instance is tuned for shared_buffers=4GB, effective_cache_size=12GB, maintenance_work_mem=256MB — a 2.3 GiB, twenty-database cluster). RabbitMQ: 1 vCPU / 1 GB. Redis: 128 MB maxmemory each.
canopy-security’s connection budget. Each canopy-security replica opens these pools on its own database: the main pool (CANOPY_SECURITYDB_MAX_CONNECTIONS, 10), the canopy-identity issuer pool (CANOPY_SECURITYIDENTITY_DB_MAX_CONNECTIONS, 28, 12 to 64), the issuance-log writer’s own connection (1, on the issuer login), the security-admin pool (4, when its URL is set), the audit-archive worker (2) and the idempotency lease renewal (2): 47 a replica, 49 with the chain-v2 audit verifier (2), so 141 (147) at canopy-identity’s three-replica minimum. Set PostgreSQL’s max_connections above the sum over every replica of every service on the instance, plus the migration and operator sessions (ADR-049 Amendment 10).
canopy-identity’s sizing, measured (ADR-049 Amendment 10, Amendments 12 and 13). The readiness runs of cargo xtask perf identity (commits 6aee9aee6 and 6d71769d5, seed 541770337227324816, the defaults: a 2 ms gather window, a 28-connection issuer pool that pings a connection only once it has idled a second) on one host: an AMD Ryzen AI Max+ PRO 395 with 32 threads and 94 GiB, PostgreSQL 18.6 on btrfs over LUKS, the driver, two release replicas of two worker threads each and the database sharing it with another project’s workloads, a relay before each replica’s issuer pool measured at a 1.15 ms round trip. The load is Amendment 10’s design point, about 600 token requests a second (450 session-form and 135 onward delegations, 10 renewals, 5 opens, 2 revocations, 1 system token), and its peak, twice that. Each figure is the median of three repetitions.
| Measure | Design (603/s, 2 replicas) | Peak (1206/s, 2 replicas) |
|---|---|---|
delegation p99, session and onward |
12.5 ms, 12.5 ms (G1 holds: ≤ 50 ms) |
37.4 ms, 37.3 ms (G3 holds: ≤ 100 ms; repetitions 10–88 ms) |
client credentials, revocation p99 |
11.5 ms, 19.3 ms |
13.2 ms, 35.9 ms |
federation renewal, open p99 |
19.7 ms, 19.5 ms |
62.0 ms, 52.0 ms |
429s, 5xx, unanswered |
none |
none |
CPU a request, each replica |
0.55 ms (0.17 vCPU a replica) |
0.57 ms (0.34 vCPU a replica) |
peak resident memory, each replica |
28 MiB |
29 MiB |
issuer pool (28) |
2.4 in use on average, up to 23 |
5.5 in use on average; never at its ceiling in a one-second sample (G6 holds), though full in short bursts (#2790) |
issuer connection time a request |
8.0 ms |
9.2 ms |
issuance-log writer (its own connection) |
1.9 rows a batch, commit p99 5 ms, queue wait p99 5 ms |
2.7 rows a batch, commit p99 7.5 ms, queue wait p99 7.5 ms |
security database commits |
2 941/s |
5 397/s |
WAL |
0.6 MB/s |
1.1 MB/s |
audit append p99 under the load (G4) |
5.1 ms, against 4.2 ms with the probe alone: holds |
not measured |
-
Replicas. Run at least three (ADR-049 Amendment 13), so that with one down the other two carry the peak, which the peak cell measures: two replicas at 1206 requests a second held with the pool never at its ceiling. Size by
max(3, ⌈peak ÷ 603⌉ + 1), 603 a second being what each of two replicas carried at the design peak. One replica alone is informational: in five single-replica runs its knee ranged from 750 to 1800 requests a second, giving out each time when the issuer pool filled in bursts though it averaged under half its connections. Amendment 13 widens that margin without changing the minimum. Give each replica 0.5 vCPU and 256 MB: at the peak a replica used about 0.35 vCPU (0.58 ms × 600 requests a second) and peaked at 29 MiB. -
Round trip. Each request held an issuer connection about 8–9 ms at a 1.15 ms database round trip, most of it round trips (the jti insert and the session read); before the pool stopped pinging busy connections (Amendment 13) it was 10.5 ms. The latencies above scale with the round trip: at 3 ms (an earlier informational run, before that change, the host disturbed) design delegation p99 was 42 ms and revocation 76 ms, past G1’s 50 ms. Keep canopy-security’s database close to its replicas, and re-run the harness at your own round trip (
--db-rtt-ms, 0 to 10). -
Limits. The per-IP limit
IDENTITY_TOKEN_RATE_LIMIT_RPMis at least 60 × canopy-web’s peak token requests a second ÷ (canopy-web pods × max(replicas − 1, 1)); canopy-web’s registryrate_limit_rpmat least 60 × the same rate ÷ max(replicas − 1, 1), and the busiest onward caller’s likewise from the onward rate. At the design peak (canopy-web 934/s, onward 270/s), two canopy-web pods and two replicas: 30 000, 60 000 and 18 000 (configuration reference). At the three-replica minimum the same peak needs only 14 010, 28 020 and 8 100, so the defaults hold with room (ADR-049 Amendment 13). The run held these with no 429. -
PostgreSQL. About 4.9 commits and 1 KB of WAL a token request on canopy-security’s database; plan the instance’s disk throughput and replication for those at the peak, beside the connection budget above.
-
The issuance log. 376 bytes a row and one row a request, never purged until #1303: at the design point for eight hours a working day about 6.6 GB a day, past the 50 GB disk above in about eight working days and about 5 TB over the 3-year audit floor. Retention or archival (#1303) gates a production deployment ([deployment-gates]); until it lands, size the disk from the expected rows.
-
Signing keys. The registry publishes at most 64 keys (ADR-049 §9). A deployment publishes about 2 × replicas, plus one for each restart in the last 6 h 12 m that followed a replica’s first rotation, plus two for each restart in the last 22 minutes: two replicas use 4 of the 64 at rest, ten use 20, and the rest is headroom for restarts. A replica restarting about every 10 minutes is an incident, not a load;
canopy_identity_published_keysnear 64 says so. -
Reopen trigger 1 (ADR-049 Amendment 10). Issuance load degrades canopy-security’s other work when, in production, canopy-security’s
/v1p99 (the access log’slatency_ms) over hours whose issuance rate (canopy_identity_request_seconds) is at or above the design point exceeds 1.2 × its p99 over hours below it. The run’s G4 is the harness’s form of it, and held. -
Measure your own.
cargo run --release -p xtask — perf identityon a host running nothing else, the devstack up, with the load model’s flags set to the deployment’s figures (--workers,--requests-per-minute,--fanout,--onward,--renew-seconds,--opens,--logouts,--system,--peak) and its limits (--token-rate-limit-rpm,--db-max-connections); the catalog describes every cell and gate. A run is evidence for the host it ran on: scale by its CPU and disk, not by these numbers.
Deployment profiles (ADR-005)
cargo xtask dev start|reload|restart --profile <p> accepts exactly six profiles — VALID_PROFILES in xtask/src/cmd/dev.rs: snap-only, tanf-only, medicaid-chip, caps-only, wic-only, full (default). Membership is the profiles: list on each compose service:
| Profile | Application services (infrastructure — postgres with its postgres-roles one-shot, rabbitmq, kanidm, garage, redis, redis-sessions, clamav, and the ingress and ingress-xsite TLS proxies — is in every profile) |
|---|---|
|
rules, persons, applications, eligibility, verification, security, web, enrollment, renewals, reporting, notices, appeals, snap, portal |
|
rules, persons, applications, eligibility, verification, security, web, notices, appeals, tanf |
|
rules, persons, applications, eligibility, verification, security, web, notices, appeals, exchange, medicaid |
|
rules, persons, applications, eligibility, verification, security, web, caps |
|
rules, persons, applications, eligibility, verification, security, web, wic |
|
all nineteen |
isolated-db is not a deployment profile: it is a compose-internal tag on the postgres-<program> instances, the program services and the four services that follow them (canopy-enrollment, canopy-renewals, canopy-exchange, canopy-reporting), and dev start --profile isolated-db errors with Unknown profile. Other compose profiles are tooling, not deployments: observability (Prometheus, Grafana), devtools (age/sops), e2e (Playwright), integration (in-network test runner), chain-migration-split (dormant migration one-shots), idp-kanidm (the conformance suite’s disposable Kanidm, kanidm-conformance, started only by cargo xtask identity conformance --idp kanidm).
Data tier
The migrator’s inventory (DATABASES in xtask/src/cmd/migrate.rs) is the eighteen logical databases: canopy_appeals, canopy_applications, canopy_caps, canopy_eligibility, canopy_enrollment, canopy_exchange, canopy_medicaid, canopy_notices, canopy_persons, canopy_renewals, canopy_reporting, canopy_rules, canopy_security, canopy_snap, canopy_tanf, canopy_verification, canopy_web, canopy_wic — exactly the CREATE DATABASE set of the two init scripts, pinned by a test in migrate.rs. The applicant portal has no database: it is Postgres-free by design (ADR-026) and keeps its sessions in redis-sessions.
Two topologies, both from the devstack init scripts:
-
Isolated (default; production shape per ADR-001). The shared
postgresinstance runsdevstack/postgres/init.sqland hosts the thirteen non-program databases; five dedicated instancespostgres-snap|tanf|medicaid|caps|wiceach host one program database, on their own named volumes (canopy_postgres_<program>_data). -
Shared (
--shared-db).init-program-dbs.sqlcreates the five program databases on the shared instance too; xtask scales the program instances to zero and rewrites the program URLs throughCANOPY_<PROG>_DB_URL. Development convenience only.
Every service creates its own schema through its services/canopy-<svc>/migrations/ (see Configuration, secrets and migrations at deploy). Two services carry special credentials. canopy-reporting runs as the restricted login canopy_reporting_app on CANOPY_REPORTINGDATABASE_URL and migrates as the owner on CANOPY_REPORTINGMIGRATION_DATABASE_URL (migration 20261111000000 creates the canopy_reporting_owner NOLOGIN and canopy_reporting_app roles; in the devstack the postgres-roles one-shot makes canopy_reporting_app a LOGIN with its in-source dev password on every start, from devstack/postgres/roles.sql, and a deployment provisions the login with a secret-managed password; the cutover procedure is Security Operations › Reporting Credential-Cutover Runbook). canopy-security’s issuer pool logs in as canopy_identity_issuer on CANOPY_SECURITYIDENTITY_DATABASE_URL, a login that owns nothing, may only INSERT and SELECT the canopy-identity key registry, may only INSERT into the token endpoint’s jti store and issuance log and run the jti purge, and may only read the subject and session stores and write them through their owner functions (migration 20261209000000 creates it NOLOGIN, 20261210000000 adds the stores and 20261214000000 the subjects and sessions; the postgres-roles one-shot makes it a LOGIN in the devstack, and a deployment provisions it with a secret-managed password: Security Operations › canopy-identity key registry). Its security-admin pool logs in as canopy_identity_admin on the optional CANOPY_SECURITYIDENTITY_ADMIN_DATABASE_URL, a login that may only run the security-admin functions and read what the admin routes show (migration 20261216000000; provisioned like the issuer). Three guards run at boot outside CANOPY_ENV=development: DATABASE_URL must carry sslmode=verify-ca or verify-full; the database name must match the service, on both the runtime and the migration URL; and the sealing services (persons, reporting, snap, tanf, medicaid, caps, wic) refuse to start without CANOPY_ENCRYPTION_KEY.
Configuration, secrets and migrations at deploy
Variables. Every key is CANOPY_<SVC><KEY>; the complete list, the baseline ServiceSettings, the unprefixed process-wide set and the per-service tables are in Configuration Reference. The identity keys are CANOPY_<SVC>IDENTITY_ISSUER and CANOPY_<SVC>IDENTITY_INTERNAL_URL, on every service; any other spelling fails boot under deny_unknown_fields. Leave CANOPY_ENV unset in production — unset is production, and every fail-closed guard reads it that way. Set CANOPY_CONFIG_SOURCE (or CANOPY_<SVC>CONFIG_SOURCE per service) to the deployment’s configuration layers; the jurisdiction is the one its jurisdiction layer’s canopy-config.toml names. The shipped config/canopy-<svc>/default.yaml files name no source, so a service started without one refuses to boot (#2627; Configuration Reference).
Fail-closed checklist. A production boot needs, beyond the baseline PORT / DATABASE_URL / RABBITMQ_URL / IDENTITY_ISSUER / IDENTITY_INTERNAL_URL / CONFIG_SOURCE:
-
canopy-identity’s inputs.
CANOPY_<SVC>IDENTITY_CLIENT_PRIVATE_KEYon each of the thirteen sending services, canopy-web and canopy-portal (the portal with its ownCANOPY_PORTALIDENTITY_ISSUER/IDENTITY_INTERNAL_URL). On canopy-web,CANOPY_WEBPUBLIC_ORIGIN,CANOPY_WEBUPSTREAM_CLIENT_SECRETand the upstream profileidentity-upstream.yaml, with any trust anchors it names. On canopy-security,CANOPY_SECURITYIDENTITY_DATABASE_URL. canopy-security boots without its client registry (canopy-security/identity-clients.yaml) or the upstream profile, but then mints no token and federates no sign-in, so mount both; setCANOPY_SECURITY__IDENTITY_DEVICE_VERIFICATION_URIfor canopy-cli’s sign-in, andCANOPY_TRUSTED_PROXIESon canopy-web and canopy-security ([proxy-chain]). The identity provider’s side is IdP Integration. -
The rest.
CANOPY_ENCRYPTION_KEY(sealing services),CANOPY_<PROG>SIGNING_KEYandCANOPY_NOTICESSIGNING_KEY,CANOPY_PORTALAPPLICANT_SIGNING_KEYplusCANOPY_<SVC>APPLICANT_VERIFYING_KEYon every service that verifies the portal’s applicant claim,CANOPY_PROGRAM_URL_<PROGRAM>on eligibility,CANOPY_STOREBACKEND=s3with its endpoint and credentials on notices,CANOPY_APPLICATIONSCLAMD_ADDR, and a TLSsslmodeon every database URL.
Each is described in Configuration Reference. Two services also refuse a production boot until their real control ships, so today each needs its accountable override (Security Operations › Startup-Guard Inventory): canopy-verification, whose default image is a noop-adapters build serving fabricated IEVS/SAVE/SSA data, needs real adapters or — until they ship — CANOPY_VERIFICATIONALLOW_FABRICATED_VERIFICATION=true (#1265); and canopy-portal needs a CAPTCHA provider that challenges or — until one ships — CANOPY_PORTALALLOW_NOOP_CAPTCHA=true (#663). Each is the deployment’s accountable choice and logs a WARN at every boot.
Secrets. SOPS + age at rest, cargo xtask secrets for the workflow, CANOPY_<SVC>__SIGNING_KEY with a .keys/ fallback only when CANOPY_ENV=development (Configuration Reference › Secrets; procedures in Secret Management).
Migrations. By default each service applies its own sqlx migrations at boot, over a dedicated single-connection pool, before the application pool exists (crates/canopy-api/src/bootstrap.rs); no separate step is needed. The deploy-time job shape sets CANOPY_<SVC>SKIP_MIGRATIONS=true (with CANOPY_<SVC>MIGRATIONS_JOB_CONFIGURED=true) on the runtime and runs canopy-manage migrate apply --service canopy-<svc> with CANOPY_MIGRATE__DATABASE_URL from the deploy job; it applies the same name guard, TLS gate and KEK preflight. Migrations are forward-only (ADR-016); the production rollback path is point-in-time recovery, not a down migration (Backup & Restore). Authoring rules: Migrations.
Health and readiness
Every canopy-api service mounts two unauthenticated probes, and /version, at the router root (crates/canopy-api/src/lib.rs); there is no /healthz alias on them. canopy-web and the portal mount /version too, the same VersionInfo from canopy-config:
-
GET /livez— always 200 while the process is alive. -
GET /readyz— a JSONHealthResponse; 200 when the database (SELECT 1) and the broker are healthy and no configuration layer is stale, 503 on degraded. Error detail is included only in development. The outbox, worker and subscriber checks, and canopy-web’sredischeck, are reported in the body and never gate: a stalled worker or a parked outbox row reportsdegradedwithout failing readiness. canopy-security’sidentity_keycheck gates only whilepending(below). -
GET /version— what the replica runs, fixed at boot:{ "service": "canopy-snap", "build": "…", "config": [{ "name": "federal", "sha": "…" }, { "name": "georgia", "sha": "…" }], "verified": true }(VersionInfo).buildis the image’sCANOPY_BUILD_DESCRIBEwhen the build set it, else the crate version;shaispathandverifiedisfalsefor apath:working copy (Configuration Reference › Configuration source). It carries no secret.
The config check gates (ADR-051): while any git layer runs on its last good tree because its status.json records a refused sync, it reads degraded, naming the layers (the last sync refused; running on the last good tree of: georgia), and /readyz answers 503, so a replica on stale configuration leaves rotation rather than serving unnoticed. canopy-web's /readyz carries the same check, and canopy-web and the portal serve /version too.
canopy-security’s identity_key check reports its per-replica signing keys (#2499): ok while a key can sign and publication is healthy, pending while no key has reached its signing window and nothing has failed (the first key’s 60 s publish lead after boot), and degraded while publishing fails, whether or not the current key still signs. It carries active_key_age_secs, consecutive_publish_failures and last_publish_failure (cap, database, timeout or key_generation). The first publication is the boot’s last step: one registry call, bounded at 11 s, that never fails the boot, so a replica that cannot publish still serves, with no key able to sign, while the key ring retries.
Only pending fails readiness (503, #2925). A replica whose first key has not reached its signing window, with nothing failed, refuses every mint with temporarily_unavailable (no_active_key), so it stays out of rotation for that roughly 60 s lead. Size a readiness probe’s failure budget to cover it. In the devstack, canopy-security’s healthcheck probes /readyz, so the services that depend on it start only once a mint can succeed. A degraded check does not fail readiness. A replica that cannot publish can still serve every route that needs no signing key of its own, the JWKS among them unless the registry itself is unreachable. Failing it would take those routes down across the fleet along with the mints. The body and the canopy_identity_key_publish_refused_total metric are its signal.
canopy-web mounts the same readyz_check over its session pool (services/canopy-web/src/main.rs, #2117): 200 while SELECT 1 on canopy_web succeeds, 503 with the same HealthResponse body the moment it fails, so a balancer stops sending caseworkers to a replica that can no longer mint a session. Its rabbitmq arm reads n/a — the broker is not a serving dependency of the BFF — and when CANOPY_WEB__RATE_LIMIT_REDIS_URL is set a redis arm reports whether the replica-aware rate limiter is on Redis (ok) or its process-local fallback (degraded), reported and never gating. Its /livez stays the static {"status":"ok"} handler. The portal serves /healthz (liveness) and /readyz (200 only when the applicant routes are mounted and its canopy-identity system token for canopy-applications can be minted) (services/canopy-portal/src/main.rs); it serves no /metrics — metrics are OTLP push like the rest of the fleet (#430).
Worst-case latency. The database arm runs under READYZ_DB_TIMEOUT (1 s, crates/canopy-api/src/lib.rs, #2160), well under the service pool’s 5 s acquire_timeout (DbPool::connect_with, crates/canopy-db/src/lib.rs): a database that is unreachable but not closed makes the arm report degraded with detail timeout (detail in development only) after 1 s instead of waiting out the pool, and the verdict is still 503. The broker arm reads the connection’s in-memory state and the outbox, worker, subscriber, redis and identity-key arms read in-process snapshots, so a /readyz answer takes about 1 s at worst. Give a balancer’s probe timeout headroom above that — Kubernetes' default timeoutSeconds is 1 s, and a probe that times out reads as a dead replica rather than a degraded one with a reason.
Compose probes wget -qO- http://127.0.0.1:<port>/livez every 5 s (10 retries, 30 s start period) on the API services and curl -fsS http://127.0.0.1:8090/readyz on the portal (24 retries, 120 s start period). Point a load balancer’s readiness check at /readyz and its liveness check at /livez (portal: /healthz).
Neither image declares a HEALTHCHECK by design, because the compose healthcheck: blocks (the /livez probes and the portal’s /readyz) are the health contract: an image HEALTHCHECK is overridden by a compose healthcheck: and ignored by Kubernetes, which runs only its own probes, and the shared multi-binary image would need a per-binary port convention that no consumer reads (#2119).
Observability
Metrics are pushed, not scraped. canopy_common::telemetry::init builds an OTLP/HTTP metric exporter when OTEL_EXPORTER_OTLP_METRICS_ENDPOINT (or the global OTEL_EXPORTER_OTLP_ENDPOINT) is set, pushing every OTEL_METRIC_EXPORT_INTERVAL ms (default 60 s); traces go over OTLP/gRPC when OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is set. No canopy-api service serves a Prometheus /metrics route. The devstack observability profile runs Prometheus with --web.enable-otlp-receiver and points every service at http://prometheus:9090/api/v1/otlp/v1/metrics; production targets an OTel Collector or a Prometheus with the receiver enabled. DB pool gauges (canopy_db_pool_size/idle/max, labelled service and pool) and the outbox gauges (canopy_mq_outbox_*) ride the same exporter. Every canopy-mq subscription that wires a dead-letter queue exports that queue’s depth, canopy_mq_dlq_depth, labelled queue with the physical <queue>.dlq name, which names its service. The value comes from a passive declare every 30 s, starting when the subscription attaches (#2579). pool is main for each service’s application pool, and these other pools report under their own value (#2224, #2537): canopy-web’s session store session, canopy-eligibility’s bulk bookkeeping pool bookkeeping, canopy-reporting’s report-run worker run_worker, and canopy-security’s audit-archive worker archive_worker, canopy-identity issuer pool issuer, security-admin pool identity_admin and chain verifier pools verify_audit, verify_tanf and verify_medicaid, and every canopy-api service’s idempotency lease-renewal pool idempotency_renewal (crates/canopy-api/src/idempotency.rs, at most 2 connections, one kept open, #2541).
canopy-security’s key ring (#2499) adds six instruments:
-
canopy_identity_active_key_age_seconds: the age of the key the replica signs with; no data point while no key can sign; -
canopy_identity_published_keys: unrevoked keys the registry publishes across every replica, sampled each minute (the registry refuses a 65th); -
canopy_identity_db_clock_offset_seconds: the database clock minus the replica’s wall clock, at each publication and sample; -
canopy_identity_key_publish_refused_total{reason}: failed publication attempts, bycap,database,timeoutorkey_generation; -
canopy_identity_wall_clock_steps_total: wall-clock steps of more than 5 s. Signing windows run on monotonic time, so a step moves none; the ring logs it and resamples the database clock offset; -
canopy_identity_clock_divergence_total: readings that found monotonic time more than 5 s out of step with the database clock (a suspend, a VM pause or a database clock step), each of which dropped every key ([identity-hardening]).
Its issuance-log writer (#2552) adds five (Security Operations › canopy-identity key registry):
-
canopy_identity_issuance_batch_rows: the rows of each batch the writer attempts (a histogram, up to 32); -
canopy_identity_issuance_commit_seconds: each committed batch’s time from its start, when the writer took it from the queue, through COMMIT (a histogram; a batch fails at 2 s); -
canopy_identity_issuance_queue_wait_seconds: each attempted row’s time from its submission to its batch’s start (a histogram); -
canopy_identity_issuance_queue_depth: rows waiting for the writer (the queue holds 256); -
canopy_identity_issuance_failures_total{cause}: token responses refused because their log row did not commit, byqueue_full,caller_deadline,batch_deadline,write_failedorwriter_stopped.
Its token endpoint (#2554) adds two:
-
canopy_identity_tokens_issued_total{purpose}: system tokens released, by purpose name, each after its issuance-log row committed; -
canopy_identity_token_refusals_total{error}: token requests refused, byinvalid_request,unsupported_grant_type,invalid_client,invalid_target,invalid_scopeortemporarily_unavailable; a 429 from the route’s limiter is not counted.
Its revocation endpoint (#2718) adds one:
-
canopy_identity_revocation_answers_total{answer}: revocation answers, byrevokedorignored, each after its issuance-log row committed, or a refusal’sinvalid_request,invalid_client,unauthorized_clientortemporarily_unavailable; a 429 is not counted.
Its token, revocation and device-flow routes (#2754, ADR-049 Amendment 10) add one:
-
canopy_identity_request_seconds{route, grant, status}: every request, a per-IP limiter’s 429 included, seconds from its arrival at the layer outside both limiters to its response (a histogram, buckets 5 ms, 10 ms, 25 ms, 50 ms, 100 ms, 250 ms, 500 ms, 1 s, 2.5 s, 5 s and 10 s).routeis the matched path;grantthe issuance log’sgrant_typethe request was answered under (client_credentials,token_exchange,delegation,device_code,refresh_token,revocation,device_authorization,device_verification), ornonewhen none was known (a limiter’s 429, a form naming no grant);statusok(2xx),refused(another 4xx),limited(any 429: a limiter’s,grant="none", or the handler’s for a spent client or attempt budget, under its grant) orunavailable(5xx).
Alerting — starting points. Service /readyz failing for more than 30 s, except canopy-security, whose /readyz fails for about 60 s after every boot (the first key’s lead, #2925), so allow it 90 s; pool saturation, per pool (canopy_db_pool_size >= canopy_db_pool_max, matched on service and pool, which covers every reporting pool of a service alike; the canopy-identity issuance-log writer’s one-connection pool, which holds its connection between failures, reports none); canopy_mq_outbox_* pending above CANOPY_MQ_OUTBOX_PENDING_ALERT_THRESHOLD (the /readyz outbox check degrades at the same point); any canopy_mq_dlq_depth above 0 for 5 minutes, since each message is a delivery a subscription dead-lettered, after its retries or at once when it could not be decoded; broker queue depth; HTTP error rate and P99 latency from the access lines below; PostgreSQL disk above 80 %. For canopy-identity: any canopy_identity_key_publish_refused_total{reason="cap"}, or canopy_identity_published_keys near 64 (ADR-049 §9 raises an alert at the cap); canopy_identity_active_key_age_seconds absent from a replica for more than 2 minutes after boot; the absolute canopy_identity_db_clock_offset_seconds above 30 s, half the 60 s skew the registry’s publish window allows; any canopy_identity_clock_divergence_total, since production hosts should never suspend; any sustained canopy_identity_issuance_failures_total, since each is a refused token response, and canopy_identity_issuance_commit_seconds approaching 2 s; canopy_identity_request_seconds p99 by grant above ADR-049 Amendment 10’s G1 bounds (50 ms for delegation, client_credentials and revocation, 100 ms for token_exchange) over 15 minutes, and any sustained status="limited": with grant="none", a caller at its per-IP limit or a CANOPY_SECURITY__IDENTITY_TOKEN_RATE_LIMIT_RPM sized below the load; under a grant, a client at its registry rate_limit_rpm (logged client_rate_limited) or a worker at the device flow’s attempt budget. For canopy-enrollment's held expungements, canopy_enrollment_expungement_held{reason} (canopy-enrollment API › Expungement): any reason="notice_restaged" above 0, since each is an allotment whose earlier advance expungement letter was not dispatched within [shared.timing].expungement_renotice_after_days and was re-staged; it clears when the re-staged letter is dispatched (triage the household's terminally failed canopy-notices work item, canopy_notices_work_item_terminal_failed, usually a recipient with no usable mailing address); reason="notice_past_bound" above 0 for more than a day, since the daily pass re-stages those rows on its next run, so a lasting count means the pass is not running or its re-stage fails (WARN re-staging the advance notice failed); and reason="never_noticed" above 0 for more than a day, a row whose enrollment names no head of household.
Log aggregation
All services emit structured JSON logs to stdout via tracing_subscriber — the applicant portal included, from the same canopy_common::telemetry::init. Collect stdout and forward it to your log platform.
Log level is CANOPY_<SVC>__LOG_LEVEL (default info), overridden by a RUST_LOG directive when present. debug adds the framework’s per-request span and response event plus whatever a handler logs at debug. It adds lines, not fields — see What a log line can carry.
Access lines
Every service emits one INFO line per HTTP request, carrying the method, the matched route template (/v1/applications/{id}, never the requested path or the query string), the status and latency_ms. Filter on the stable tracing target canopy::access (the JSON payload’s target field; the message is access):
cargo xtask dev logs canopy-applications --tail 500 --no-follow | grep canopy::access
Exclusions, by design: the health probes (/livez, /readyz, the portal’s /healthz), which the container probes hit every few seconds; canopy-web’s /static assets; canopy-portal’s Dioxus SSR pages and its assets (served from a framework fallback that carries no route template). Everything else a service routes is logged, Swagger UI and the OpenAPI document included; a request that matched no route is recorded as <unmatched>.
What a log line can carry
This bounds canopy’s own request logging — the span every router installs and the formatter every service runs. Two surfaces sit outside that bound and are reviewed as code: what a handler itself chooses to log, and what a third-party crate emits at trace, a level RUST_LOG accepts for debugging and not one to run a service at.
Within it, two properties hold, each on its own:
-
The request span records the matched route template (
/v1/applications/{id}, or<unmatched>), the method and the HTTP version, and neverrequest.uri().tower-http's stockDefaultMakeSpanrecords the raw URI, query string and all; every canopy mount replaces it withcanopy_common::telemetry::request_span. -
The JSON layer joins no span field onto an event (
with_current_span(false)+with_span_list(false)), so a field recorded on any span is never replicated across every line a request emits. A line’s fields are its own.
So no canopy request-span or formatter field carries a requested path, a query string or a header at info or debug. Raising info to debug widens what is logged, not what a canopy line may contain.
Per-field redaction (ADR-041)
On top of those two properties, both log sinks — the stdout formatter and, when OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is set, the span exporter — apply the jurisdiction’s redaction policy to every field, span attribute and rendered string, handler-chosen and third-party lines included. The policy is [[logging.sensitive_fields]] in the deployment’s jurisdiction.toml, resolved through its configuration layers (Configuration Reference › Configuration source): a pack that declares none gets the canopy default, an unreadable pack or a malformed table stops the service at boot, and a declared list — weaker than the default included — is honored as the deployment’s own accountable choice. Schema, matching, the default classes and the limits of the free-text scan: Rulesets › Logging redaction policy. Each service states the policy in force in one boot line, logging redaction policy installed (ADR-041) with policy.source = canopy-default or pack:<file> — a WARN instead when the policy protects nothing.
The pre-init window. Telemetry is the first thing a service installs after reading its configuration — canopy_api::bootstrap_with / bootstrap_requiring load the configuration snapshot (ServiceSettings::config_snapshot) and then call init_for_pack over it as their first steps, the portal likewise right after PortalConfig::load — and every read through a secret API follows it: the boot requirement (the CANOPY_ENCRYPTION_KEY KEK, which the five program services, canopy-persons and canopy-reporting read through bootstrap_requiring right after telemetry and still before their migrations, so a KEK-premised migration never runs keyless), bootstrap’s audited DATABASE_URL / RABBITMQ_URL and client-key reads, and every signing-key read after them. A per-binary test (every_workspace_binary_is_inventoried_and_covered) fails if a service’s main reads a secret before its bootstrap call; it reads the text of main only, so a secret read moved into a helper called before bootstrap is outside what it sees. What runs before telemetry, exactly: dotenvy; the layered config load (canopy_api::load_config; the portal’s PortalConfig::load), which collects the service’s prefixed environment into its settings — the secret-bearing keys among them, whose values it holds but never logs (the portal’s loader filters its two secrets out); canopy-persons' read of the pack’s [jurisdiction].timezone; and, for bootstrap, the configuration snapshot and the policy load itself. Nothing in that window reaches a log sink unredacted: tracing discards an event emitted while no subscriber exists (the loader’s own events are a debug line of key names and a warning about a non-UTF-8 whole-stack variable such as CANOPY_CONFIG_SOURCE, both lost rather than written). The residual exposure is the boot-failure message itself: a configuration or policy error in the window is printed to stderr by the process’s error exit, outside any subscriber. canopy’s own errors there name keys and pack paths — a malformed pack’s error also quotes the offending line of the pack, which is public configuration — never a configured secret; a type error in a configuration value (a string where a number belongs) is reported by the config crate with the offending value, so do not put a secret under a non-secret key.
Release, rollback, recovery
Build once, release from one job (ADR-040 Amendment 9). A merge-train car pushes nothing. The release job compiles the release binary set once (every shipped binary, no feature, the car profile) and the portal, and cargo xtask dev start packages them into the images the stack runs. A shipped binary carrying /test/clock or /test/fault is refused there, so only a release build is packaged (the devstack token broker, which no release image ships, carries them in either set). It runs the k6 smoke (cargo xtask perf --profile smoke) against that stack, and only then pushes those same images: $CI_REGISTRY_IMAGE:<short-sha>, /portal:<short-sha> and /config-fetch:<short-sha>, then each image's CycloneDX SBOM from the digest it pushed, then :<tag> on a tag pipeline and :latest only from main's current head. release-digests.txt, the three image SBOMs and a source SBOM per shipped binary (sbom/<binary>_bin.cdx.json, from cargo cyclonedx --describe binaries) are job artifacts kept forever. It runs on every tag and every scheduled pipeline on main, after the car, so a release follows a green battery of the same commit; from main's own pipeline it runs by hand. A resource_group serializes releases, and it never runs on a merge request. There is no separate staging environment. The devstack Kanidm and token broker are devstack-only images, never promoted. The release job does push the devstack Kanidm, built with BuildKit's inline cache, as $CI_REGISTRY_IMAGE/devstack/kanidm:<h> when the registry lacks it, <h> being the first twelve hex digits of devstack/kanidm/Dockerfile's sha256. Every stack job builds Kanidm from that cache before dev start, which would otherwise compile it for about 11 minutes.
Before tagging a release, run the identity matrix (ADR-049 Amendment 26). On the release commit, with the devstack up, run cargo xtask identity matrix --all --e2e. It runs every supported upstream’s conformance suite (Kanidm, Keycloak, ZITADEL), each from a fresh graph. It then brings the devstack up on each upstream in turn and runs the Playwright identity-plane project against that upstream’s own login pages, and finally restores the devstack’s upstream. Tag only when it passes. The tag pipeline's car runs the suites again (cargo xtask identity matrix --all, without the browser projects), and the release job runs only after the car passes.
Deploy and roll back with the prebuilt override exports and the per-service docker compose up -d --no-deps --pull always <service> loop in Rolling deploy & rollback; rollback is a redeploy of the previous known-good :<short-sha>, never a cached-image restart.
State. canopy-web keeps worker sessions in PostgreSQL (canopy_web: web_session, web_native_session for the devices workers approved, web_login_flow, web_session_end; ADR-009 Amendment 2, canopy-web Data Model), so its replicas need no sticky sessions; the portal keeps applicant sessions in redis-sessions (ADR-026); every other service is stateless and scales by replica count behind a load balancer. Outbox rows and RabbitMQ durable queues carry events across restarts.
Worker sessions under replication. A sign-out is final, and a refresh token is never presented twice, only if acknowledged commits survive a failover: run canopy_web with synchronous replication (synchronous_commit on, with a synchronous standby named in synchronous_standby_names). The residuals under asynchronous replication: a failover can lose an acknowledged sign-out, so that session — and a copied cookie — works again until its idle deadline; and it can lose a refresh claim or a refresh commit (the refresh single-flight, #2224), which allows one re-presentation of a refresh token, after which a rotating IdP revokes the token family and the worker signs in again.
Worker-session sweep (#2519). Every canopy-web replica runs the session sweeper (Sweeper in services/canopy-web/src/web_session/sweep.rs) on its own task, with nothing to configure:
-
Schedule. The first pass starts at a random point in the first 5 minutes after boot, so replicas started together spread out; each later pass starts 5 minutes after the previous one ends. The task stops on the shutdown signal.
-
What a pass removes. Idle sessions, each logged in
web_session_endwith reasonidle;web_login_flowrows past their 15-minute lifetime; andweb_session_endrows older than 30 days (retention: canopy-web Data Model). -
Several replicas. Each statement removes at most 500 rows, taken
FOR UPDATE SKIP LOCKED, and the sweeper waits at most 2 s for it (STATEMENT_TIMEOUT); a step repeats it until a batch comes back short. Replicas sweeping at the same time split the rows, never wait on each other, and never log one end twice. -
Failures. A failed step is logged at
warnand counted oncanopy_web.session.sweep_failed, labelledstep(idle_sessions,expired_flowsorend_log). The pass goes on to its next step, the next pass retries, and requests are unaffected. A sustained rate means those tables grow until a pass succeeds.
Worker-session store upgrade (#2518). The release that moves canopy-web off tower-sessions cannot roll replica by replica: an old replica would keep writing sessions to the old store. Stop every canopy-web replica, deploy, and start the new build; its migration (20270114000000_web_session_store.sql) creates the new tables. Every worker signs in again: no session carries over. The release that moves canopy-web onto canopy-identity does the same: its migration 20270201000000_identity_web_session.sql drops and recreates the three tables, so stop every replica before it deploys. After the #2518 release, drop the old store’s schema, which holds plaintext refresh tokens, in canopy_web:
DROP SCHEMA IF EXISTS tower_sessions CASCADE;
The new build never touches that schema, and no migration drops it (migrations-lint forbids schema DDL).
Backup and recovery — targets are starting points. Continuous WAL archiving on every PostgreSQL instance and a logical dump per database, with an RTO of one hour and an RPO of the WAL segment interval as the first target; the procedure, the FTI handling for canopy_tanf and canopy_medicaid, and post-recovery chain verification are in Backup & Restore. Notice PDFs: versioning on the bucket; notices are append-only. canopy-identity’s state (subjects and their links, sessions, admin actions, the issuance log) is canopy-security’s database and is recovered with it; its signing keys are never backed up, since each replica holds its own in memory and publishes a fresh one at boot. Back up the upstream IdP by its own documentation.
TLS. Terminate TLS at the load balancer or proxy in front of every public endpoint: the services bind plain HTTP and assume a TLS-terminating proxy (crates/canopy-api/src/lib.rs, the serve path); the images link rustls for their outbound clients and never OpenSSL (deny.toml bans it); sslmode=verify-full on every database URL (below); amqps:// to the broker; in-network service calls are plain HTTP inside the container network, so add mTLS at a mesh or sidecar for defence in depth.
TLS to the database. A service refuses to start outside development unless its database URL sets sslmode=verify-full or verify-ca. Set verify-full: it takes the server only when a trusted root signed its certificate and the certificate names the host in the URL. verify-ca checks the signature and not the name. require is refused with the modes that do not encrypt (#3646): it encrypts and checks nothing about who answers, so it does not stop an attacker placed between the service and the database. CANOPY_DB__ALLOW_UNENCRYPTED_CONNECTION=true boots a service on any mode, require included, with a warning at every start. The client trusts the system's certificate store (the image's CA bundle, or the file SSL_CERT_FILE names) and, beside it, the PEM file the URL's sslrootcert names. A managed database's CA is seldom in the system's store, so mount its bundle and name it: …?sslmode=verify-full&sslrootcert=/etc/canopy/db-ca.pem.
High availability. Two or more replicas per service with /readyz-aware balancing; PostgreSQL primary plus streaming replica with automatic failover (synchronous for canopy_web, above); RabbitMQ clustered with quorum queues; Redis Sentinel or cluster for redis-sessions; canopy-security at three replicas or more ([identity-sizing]); the upstream IdP by its own guidance.