GebSecure Docs v0.1.0

Architecture · All ADRs

ADR 0017 — Private deployment: one artifact set, profiles per deployment model

Architecture decision record — status: Accepted.

Status: Accepted

Context#

EPIC 29 requires GebSecure to run as a multi-tenant cloud service, as dedicated single-customer environments, inside customer VPCs, and fully self-hosted including air-gapped sites. Each model differs in who operates it, where data and keys live, how it is reached over the network and how it is upgraded. Forking images, charts or code per model would multiply the test matrix and let security fixes drift between models.

Decision#

  • One artifact set. Every model runs the same signed images (api, gateway, worker, migrate, console), the same Helm chart (infra/helm/gebsecure) and the same Terraform modules. There is no model-specific code path; multi-tenancy and single-tenancy are the same software (a dedicated environment simply has one organization).
  • Differences are configuration. Each model is a Helm values profile under infra/helm/gebsecure/profiles/ (saas-multitenant, dedicated, customer-vpc, self-hosted, airgapped, plus the orthogonal ha) and, for AWS-hosted models, a Terraform environment (envs/{staging,prod,prod-dr}, envs/dedicated, envs/customer-vpc). The platform module accepts an existing network so customer-VPC deployments create no VPC resources.
  • Private networking for dedicated customers is AWS PrivateLink (modules/privatelink provider side, modules/privatelink-consumer customer side): no peering, no overlapping-CIDR coordination, connection acceptance required.
  • Data residency is enforced in infrastructure code: every environment declares allowed_regions and planning outside them fails.
  • External data stores everywhere. The chart never runs PostgreSQL or Redis; it connects to managed services or customer-operated clusters (Sentinel supported). NetworkPolicies allow egress only to the configured CIDRs/peers.
  • Air-gapped delivery is a release bundle (image tarballs, packaged chart, SHA256SUMS, install.sh) built by scripts/airgap/build-bundle.sh; nothing is fetched at install or run time.
  • Deployment doctor. A preflight/health command (node /app/bin/doctor.js in the migrate image, run as the chart's helm test hook) validates configuration, database role attributes and RLS, migrations, Redis, KMS, clock skew and TLS. Support for customer-operated models starts from its output.
  • Upgrades follow the same N-1, expand/contract policy and pre-upgrade migration hook in every model.

Consequences#

  • (+) One test and security-scanning pipeline covers all models; CI renders every profile and validates every Terraform environment.
  • (+) A customer can move between models (e.g. dedicated → customer VPC) with a backup/restore and a different profile, not a different product.
  • (+) Security-relevant defaults (restricted pod security, default-deny NetworkPolicies, runtime role without BYPASSRLS) are identical everywhere and verified by the doctor.
  • (−) Customer-operated models depend on the customer's operational maturity for data-store HA and backups; the documentation and doctor reduce but do not remove that dependency.
  • (−) Features that need internet access (model-assisted detection, external connectors) are unavailable or limited to internal endpoints in air-gapped sites.