sethucms
Security and running it

Deployment

Built today: a single container that runs the gateway and serves the admin app on one port, with its state in one volume. How to build, run and operate it is in 15. Deploy to production. This page describes the larger target design (separate api and worker pods, queue, managed control-plane database). The worker, queue and shared control-plane database are not built yet, and the Kubernetes and Terraform files in sethucms-infra follow that larger design.

Environments

EnvironmentPurpose
Localdocker compose up: api, worker, admin, control-plane Postgres, test databases
StagingFull stack, synthetic tenant data
ProductionKubernetes, managed Postgres for the control plane, KMS-backed secrets

Runtime topology

Drawing diagram…

Services

ServiceScalingNotes
apiHorizontal, statelessNever connects to customer databases directly
workerHorizontal, per-connection pool capsOnly component that decrypts secrets
adminStatic assetsTalks only to api
control-plane DBManaged PostgresBackups, point-in-time recovery
queueManagedIntrospection jobs, realtime fan-out

Cloud identity and networking

CloudIdentity (no stored passwords where possible)Private networking
AWSIAM database auth, cross-account role with external ID, Secrets Manager ARNPrivateLink, VPC peering
Google CloudService accounts, Cloud SQL connector, IAM database authPrivate Service Connect
AzureEntra ID tokens, managed identities (refreshed by the vault)Private Link
AnyPasswords in the vault, SSH tunnelsStatic egress IPs for allowlisting

Configuration

Environment variables (names only; never commit values):

DATABASE_URL, KMS_KEY_REF, OIDC_ISSUER, OIDC_CLIENT_ID, SESSION_SECRET_REF, EGRESS_BLOCKLIST_EXTRA, WORKER_MAX_POOL_PER_CONNECTION, LOG_LEVEL.

Secrets come from a secrets manager, not from .env files in production.

Observability

  • Structured logs with request ids; secrets redacted at the logger.
  • Metrics per connection: latency, errors, pool usage, rate-limit hits.
  • Alerts on failed introspection, credential refresh failures, and unusual audit patterns.

CI/CD

Each repository has its own GitHub Actions workflows (see the CI/CD section of the PDF, and sethucms/ci-workflows/). A tag such as v0.1.0 builds and publishes the container image. The target pipeline is:

  1. Lint, type-check, unit tests
  2. Conformance suite per adapter (against containerised databases)
  3. Security suite (injection, SSRF, permission bypass)
  4. Build images, generate SBOM, scan dependencies
  5. Regenerate SDKs from OpenAPI; fail on drift
  6. Deploy to staging, run end-to-end tests, promote

Backup and recovery

  • Control plane: automated backups and point-in-time recovery.
  • The KMS key is backed up separately. Without it, stored secrets cannot be decrypted even from an intact backup.
  • Document a key-rotation drill and run it before launch.