Knowledge base · 3TL Bridge

3TL Bridge: Reference: Security

By Donovan Kinney · Updated

Security

3TL Bridge is designed for enterprise deployment without requiring post- deployment security retrofitting. Authentication, encryption at rest, API access control, network isolation, and audit logging are all configured at runtime via environment variables and Helm values.

At a glance:

Area Mechanism
User authentication OIDC with PKCE — the 3T auth broker or your own IdP, no client secrets
Licensing & entitlement Account-level license validated by the License Manager; optional per-user entitlement
Encryption at rest AES-256-GCM for service credentials, AI conversations, and dead-letter payloads
Key management Operator-provided keys or KMS-wrapped data keys (GCP, AWS, Azure), rotation with drain verification
Data in memory Plaintext confined to process memory — never in logs, error text, checkpoints, or crash dumps; keys and decrypted buffers wiped on release
Secrets delivery Kubernetes Secrets or External Secrets Operator — nothing baked into images
Pod identity Dedicated ServiceAccount with cloud workload-identity annotations
Network isolation Default-deny ingress NetworkPolicy, TLS at the ingress
Auditability Structured audit log of every mutating operation, SIEM-forwardable

Authentication

Bridge uses OIDC with PKCE (Proof Key for Code Exchange) for user authentication. The flow:

  1. User accesses Bridge in the browser
  2. The SPA redirects to the configured OIDC provider
  3. User authenticates with the identity provider
  4. Provider returns an authorization code (PKCE)
  5. The SPA exchanges the code for access and ID tokens directly with the OIDC provider (PKCE — no server-side token exchange)
  6. Subsequent API requests carry the access token as a bearer credential

Identity provider options:

  • 3T-hosted — authentication runs through the 3T auth broker (part of the License Manager), so there is nothing to register per tenant.
  • Bring your own IdP — point Bridge at any standards-compliant OIDC provider (Google Workspace, AWS Cognito, or your corporate IdP).

Provider configuration is passed entirely via Helm values — no image rebuilds, no per-customer containers.

Unauthenticated mode

Bridge can run without OIDC for local development — leave bridge.oidc.providers empty so the SPA presents no login. Do not use unauthenticated mode in any environment accessible outside a trusted network.


OIDC Configuration

The bridge.oidc.providers array configures which OIDC providers the SPA offers at login:

Field Required Description
id Yes Unique identifier for this provider (e.g. google, cognito)
name Yes Display name shown on the login screen
authority Yes OIDC issuer URL (e.g. https://accounts.google.com)
clientId Yes OIDC client ID registered with the provider
allowedDomains No Comma-separated list of allowed email domains

Example — Google Workspace directly:

bridge:
  oidc:
    providers:
      - id: google
        name: Google
        authority: https://accounts.google.com
        clientId: "980515905004-example.apps.googleusercontent.com"
        allowedDomains: "yourcompany.com"

No client secret

PKCE does not use a client secret. The SPA handles the token exchange directly with the OIDC provider. If you are migrating from an older auth-proxy setup, remove any client secret configuration.

Request Trust Model

Once a user has authenticated, the SPA sends the access token to the pipeline engine as a bearer credential. The engine trusts the authenticated boundary: it reads the token’s claims to attribute audit entries, but it does not itself re-verify the token signature. Signature verification is the responsibility of the identity layer that issued the token.

  • 3T-hosted — the 3T auth broker issues and validates tokens, and license entitlement is checked by the License Manager (see below).
  • Bring your own IdP — place Bridge behind an ingress or gateway that authenticates the request (validates the OIDC token) before it reaches the engine. The engine assumes the request arriving at its API has already been authenticated at that boundary.

Terminate authentication at a trusted boundary

Because the engine does not re-verify token signatures, an environment that exposes the engine’s API without an authenticating ingress in front of it is effectively unauthenticated. Always front Bridge with your OIDC-aware ingress (or the 3T auth broker) in any network the engine’s API can be reached from.

Licensing and Entitlement

Bridge validates entitlement through the 3T License Manager, configured with mstream.license.url. This is separate from authentication:

  • Account-level license — always enforced. The engine fetches a signed entitlement certificate from the License Manager at boot and refreshes it; the license applies to the whole deployment.
  • Per-user entitlement — an optional finer-grained layer (BRIDGE_ENFORCE_USER_ENTITLEMENT, off by default). When enabled, the engine forwards the caller’s access token to the License Manager, which decides whether that specific user is entitled. This requires the users to be known to the License Manager, so it applies only under 3T-managed authentication. With your own IdP the License Manager cannot see individual users, so the license is enforced at the account level only.

A License Manager is mandatory

The engine refuses to boot without a License Manager configured — mstream.license.url and its license ID must be set, or startup fails with a clear error. There is no configuration that disables license validation. Per-user enforcement likewise cannot be half-configured: BRIDGE_ENFORCE_USER_ENTITLEMENT without a License Manager is a hard startup error.


Encryption at Rest

The pipeline engine encrypts sensitive stored data with AES-256-GCM authenticated encryption before it reaches the system database. Three data categories — concerns — are protected:

Concern Data
credentials Service credentials: MongoDB connection strings, Kafka broker credentials, Pub/Sub service accounts, HTTP auth headers
conversations AI Assistant and AI Agent conversation content
dlq Dead-letter queue payloads (failed events, which may contain live data)

Encrypted records are bound to their owning record’s identity, so ciphertext cannot be lifted out of one record and replayed into another. Credentials are:

  • Never returned through the API after initial entry
  • Never displayed in the UI
  • Decrypted only in memory, within the pipeline engine, at the point of use

Scope: data at rest

Encryption at rest protects stored data. It does not protect data during active processing — records are decrypted in engine memory at the point of use — and it is not a substitute for access control, network isolation, or transport encryption.

Data in Memory

Processing requires plaintext in memory. The engine bounds where that plaintext can end up, so “in memory only” is a property you can verify rather than a promise:

  • Not in logs or error messages. Sink results report byte counts, not returned values. Database driver errors are reported by their outermost context, because driver messages can quote document values. Conversion and schema-validation errors report types and field paths, never values. Transformation-script errors are redacted — a script’s thrown value is treated as data, not as error text.
  • Not in checkpoints. Pipeline checkpoints store cursors only — an opaque resume token, or topic/partition/offset — never document content or keys.
  • Not on disk. No pipeline data is written to the filesystem, logging goes to stdout only, and core dumps are disabled at startup so a crash cannot copy process memory to disk. Inline TLS client keys — which database drivers accept only as files — are written with owner-only permissions and cleared at startup, so they never outlive the process that wrote them.
  • Wiped after use. Encryption keys, decrypted buffers, and the cipher’s internal key material are zeroed in memory when released. The encryption key is also removed from the process environment at startup, so it cannot be read back through an environment lookup or inherited by a child process.

The Encryption Key

The primary key is a hex-encoded 32-byte AES-256 key, provided at runtime as the MSTREAM_ENC_KEY environment variable. The Helm chart injects it from the mstream-encryption-key entry of the credentials Secret — populate that via credentials.existingSecret or External Secrets in production, or with the inline mstream.encryptionKey value for evaluation. Generate one with:

openssl rand -hex 32

The pipeline engine fails to start when persistence is configured and no key is available — it never auto-generates one, so an accidental deployment without a key cannot silently write recoverable-by-nobody data.

Back up the encryption key

The encryption key protects all service credentials, AI conversation data, and dead-letter payloads at rest. If lost, that data cannot be decrypted — services must be re-created and conversations are permanently unrecoverable. Store the key in your secret manager alongside your other production secrets.

Key Rotation

The optional [system.encryption] section of the pipeline engine configuration (mstream.config in Helm values) turns the single key into a key ring: every listed key can open existing records, and active selects the key that seals new data. The id default is reserved for the MSTREAM_ENC_KEY key, which joins the ring automatically whenever it is configured.

[system.encryption]
active = "k2"
[[system.encryption.keys]]
id = "k2"
source = "env:BRIDGE_ENC_KEY_K2"
[[system.encryption.keys]]
id = "k1"
source = "file:/etc/bridge/keys/k1.key"
decrypt_only = true
Field Description
active Id of the key that encrypts new data; must name a listed key or default
keys[].id Ring id recorded alongside encrypted data (1–64 chars of A-Za-z0-9_-)
keys[].source env:VAR_NAME or file:/path/to/key — hex-encoded 32-byte key material
keys[].decrypt_only Marks retired keys: they still decrypt old records but can’t be active

To rotate: add a new key, point active at it, and restart. Existing records keep decrypting under their original key; new writes use the new one. Keep old keys listed (optionally decrypt_only = true) until every record they protect has been re-encrypted — see Verifying Key Drain.

Supplying ring keys per deployment channel

Ring key sources are environment variables or files visible to the pipeline engine container. Docker Compose deployments define additional key variables directly in the env file. The Helm chart injects the primary key as MSTREAM_ENC_KEY (ring id default); exposing additional ring-key sources to the engine container currently requires extending the deployment’s environment, e.g. with a Helm post-render patch.

Per-Concern Keys

By default every concern seals under the active key. The optional concerns table routes each category to its own key, so a single leaked key no longer exposes everything at once, and each category can rotate on its own schedule:

[system.encryption.concerns]
credentials = "k-creds"     # service credentials
conversations = "k-conv"    # AI conversation content
dlq = "k-dlq"               # dead-letter queue payloads

Any concern left unset keeps sealing under active, and every listed ring key opens existing records regardless of which concern wrote them — so introducing a mapping later requires no migration. Each mapped key must name a sealing-capable ring key, and unknown concern names are rejected at startup.

KMS Envelope Encryption (Bring Your Own KMS)

With the optional kms block, the data keys protecting your records are no longer stored in environment variables or files. The engine generates one data key per concern, wraps it under a key-encryption key (KEK) that never leaves your KMS, and persists only the wrapped form. A database dump is useless without an authorized KMS unwrap call — and every unwrap appears in your KMS audit log, giving you an independent record of exactly when your data was accessible.

[system.encryption.kms]
provider = "gcp-kms"
key_uri = "projects/p/locations/l/keyRings/r/cryptoKeys/k"
service_name = "system-db"
Provider key_uri Credentials
gcp-kms Crypto key resource path (as above) GOOGLE_APPLICATION_CREDENTIALS key file when set, otherwise the metadata server — on GKE that is Workload Identity via mstream.serviceAccount (see the worked example; the KMS principal needs encrypt/decrypt on the KEK)
aws-kms Key id or full ARN (an ARN also supplies the region) AWS default chain — environment, profile, IMDS, or EKS IRSA via mstream.serviceAccount annotations; the principal needs kms:Encrypt and kms:Decrypt
azure-kv Key identifier without version, e.g. https://myvault.vault.azure.net/keys/bridge-kek (RSA key) AKS workload identity, client secret, or IMDS managed identity; the principal needs the wrapKey/unwrapKey permissions

With KMS configured, each concern automatically seals under its own data key (explicit concerns entries still win), active becomes optional, and the primary MSTREAM_ENC_KEY — still required by the chart — keeps opening records written before KMS adoption while the re-seal sweep migrates them.

Revocation is fast and observable. Unwrapped data keys are re-verified against the KMS every dek_cache_ttl_secs seconds (default 300, minimum 30). Revoke the KEK grant and a running engine loses the ability to read or write KMS-sealed data within roughly that window — no restart involved — with every attempted unwrap landing in your KMS audit log. If the failure was a transient outage rather than a revocation, the next successful refresh restores access automatically. Lower TTLs tighten revocation latency at the cost of more KMS calls.

Re-Seal After Rotation

Records re-encrypt under the active key in two ways:

  • Organically — whenever a record is rewritten (a service updated through the API, a conversation that receives a new message).
  • Background re-seal sweep — runs shortly after startup, walks every encrypted store, rewrites records still referencing old keys, and skips everything already current. The sweep is rate-limited, idempotent, and race-safe: a record touched concurrently by normal traffic simply wins.

Restart after changing keys to complete a rotation proactively, or drive the sweep on demand through the system API:

Endpoint Effect
POST /system/encryption/resweep Start a sweep (409 when one is already running)
GET /system/encryption/resweep Status: state, current concern, per-concern outcomes
POST /system/encryption/resweep/pause Hold the sweep at its next record boundary
POST /system/encryption/resweep/resume Release a paused sweep

Verifying Key Drain

Every encrypted record stores the id of the key that protects it, so the engine can report exactly when an old key is no longer needed:

  • The mstream_encryption_records{concern,provider,key_id,key_version} gauge on GET /metrics reports record counts per key identity, refreshed every minute — chart it next to your other Prometheus metrics to watch a rotation drain.
  • GET /system/encryption/key-usage returns the same counts on demand.

A key is fully drained — safe to remove from the ring — when its count reaches 0 across all concerns. Records that still reference an unlisted key fail to decrypt, so only unlist keys the counts confirm are drained.

A complete rotation is then:

  1. Add the new key to the ring and set active to it
  2. Restart the pipeline engine (the background sweep starts automatically)
  3. Watch mstream_encryption_records until the old key’s count reaches 0
  4. Mark the old key decrypt_only = true, and remove it once drained
  5. Destroy the old key material in your secret manager

Pod Identity

On Kubernetes, the pipeline engine pod can run under a dedicated ServiceAccount instead of the namespace default:

mstream:
  serviceAccount:
    create: true
    annotations:
      iam.gke.io/gcp-service-account: [email protected]

Annotations are passed through verbatim, so cloud workload-identity bindings work on any provider — iam.gke.io/gcp-service-account for GKE Workload Identity, eks.amazonaws.com/role-arn for EKS IRSA. Platform integrations that support keyless authentication then use the pod’s ambient identity — no long-lived cloud keys to distribute, mount, or rotate. Set serviceAccount.name instead of create to reference a ServiceAccount managed outside the chart.

An annotation grants that cloud’s identity only

Each binding produces credentials for its own cloud: the GKE annotation yields Google tokens from the metadata endpoint, the EKS annotation yields AWS credentials. A GKE annotation gives the pod a Google identity, an EKS annotation an AWS identity — they are not interchangeable.

Example: keyless GCP access on GKE

Suppose a pipeline publishes to a Google Pub/Sub topic and you want it to authenticate with the pod’s identity instead of a mounted key. This takes four pieces — a pipeline-engine config setting, and three on the GCP side.

  1. Tell the service to use workload identity (no key material) in the pipeline engine config:
[[services]]
provider = "pubsub"
name = "gcp-pubsub"
project_id = "YOUR_PROJECT"
auth = { kind = "workload_identity" }
  1. Create the GCP service account and grant it what the pipeline needs:
gcloud iam service-accounts create bridge-pubsub --project YOUR_PROJECT

gcloud pubsub topics add-iam-policy-binding YOUR_TOPIC \
  --project YOUR_PROJECT \
  --member serviceAccount:bridge-pubsub@YOUR_PROJECT.iam.gserviceaccount.com \
  --role roles/pubsub.publisher
  1. Allow the Bridge pod’s Kubernetes ServiceAccount to impersonate it:
gcloud iam service-accounts add-iam-policy-binding \
  bridge-pubsub@YOUR_PROJECT.iam.gserviceaccount.com \
  --project YOUR_PROJECT \
  --role roles/iam.workloadIdentityUser \
  --member "serviceAccount:YOUR_PROJECT.svc.id.goog[YOUR_NAMESPACE/bridge-sa]"
  1. Point the pod’s ServiceAccount at the GCP service account:
mstream:
  serviceAccount:
    create: true
    name: bridge-sa          # explicit name → predictable ServiceAccount for step 3
    annotations:
      iam.gke.io/gcp-service-account: bridge-pubsub@YOUR_PROJECT.iam.gserviceaccount.com

Setting an explicit name keeps the ServiceAccount name deterministic so it matches the [YOUR_NAMESPACE/bridge-sa] principal in step 3. Without it the chart derives the name from the release; read the actual name with kubectl get sa -n YOUR_NAMESPACE.

The binding in step 3 is the half that’s easy to miss

The annotation alone does nothing until the workloadIdentityUser binding authorizes the impersonation. Until it exists, token requests fail closed — the pod logs repeated 403 Forbidden from the metadata endpoint. The binding can also take a minute to propagate after you create it.


Network Isolation

The Helm chart ships an optional default-deny ingress NetworkPolicy (networkPolicy.enabled: true). When enabled, Bridge pods accept traffic only from:

  • Pods of the same release (intra-app traffic)
  • The ingress controller’s namespace (networkPolicy.ingressNamespace)
  • Optionally, a monitoring namespace (networkPolicy.monitoringNamespace) — restricted to the pipeline engine’s HTTP port for metrics scraping

All other cross-namespace ingress is denied. Enforcement requires a CNI that implements NetworkPolicy (Calico, Cilium, or equivalent).

Terminate TLS at the ingress; the chart’s ingress.annotations pass through to your controller, so cert-manager issuance works as usual:

ingress:
  enabled: true
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
  tls:
    - secretName: bridge-tls
      hosts:
        - bridge.yourcompany.com

Secret Management

The Helm chart supports three secret delivery approaches:

Approach Configuration Use
Inline values credentials.* in a values file Evaluation only
Existing Secret credentials.existingSecret names a Secret you create and manage Production
External Secrets Operator externalSecrets.enabled: true Production, with a central secret manager

For production, use an existing Secret or External Secrets Operator, and never commit secret values to a values file in source control. The required Secret data keys are listed in the deployment reference.

External Secrets Operator

With externalSecrets.enabled: true the chart creates an ExternalSecret instead of a chart-managed Secret and syncs values from your secret manager. Two modes:

  • Existing store — set externalSecrets.storeRef.name (and kind: SecretStore or ClusterSecretStore) to point at a store your platform already manages. The chart creates no store of its own.
  • Chart-managed store — leave storeRef.name empty and supply externalSecrets.provider, which is passed through verbatim to ESO. Any ESO provider works (gcpsm, aws, vault, azurekv, …):
externalSecrets:
  enabled: true
  secretPrefix: bridge-prod
  provider:
    gcpsm:
      projectID: "your-project"
      auth:
        workloadIdentity:
          clusterLocation: europe-west3
          clusterName: your-cluster
          serviceAccountRef:
            name: external-secrets

Remote keys are looked up as <keyRefPrefix><secretPrefix>—<suffix>; keyRefVersion selects the version (latest for most providers). Secret values never appear in Helm values or the ArgoCD/CI rendering path — they flow from the secret manager to the cluster Secret via ESO alone.


Data Masking

Masking complements encryption: encryption protects data at rest inside Bridge, masking protects data leaving Bridge through a pipeline. PII can be masked in-flight at the transformation layer — before it reaches a downstream sink — with built-in masking functions or custom logic. See Data Masking.


Audit Logging

Mutating operations are recorded in a structured audit log by the pipeline engine. Read-only operations (listing, querying, metrics) are not audited.

Audited Actions

Category Actions
Pipelines pipeline.create, pipeline.stop, pipeline.restart, pipeline.delete
Services service.create, service.delete, service.activate
Schemas schema.create, schema.delete
Tokens token.create, token.revoke, token.assign, token.unassign
Workspaces workspace.create, workspace.update, workspace.delete

Audit Entry Fields

Field Description
timestamp UTC timestamp of the action
action Action type (e.g. service.create, pipeline.stop)
resource The service, pipeline, or workspace affected
actor Authenticated user identity (sub, email, name, source)
worker_id ID of the pipeline engine worker that handled the request
node_name Hostname of the worker node
status_code HTTP status code of the operation
message Optional detail message (e.g. error description on failure)

Storage and Retention

Audit logs are stored in MongoDB when system.audit is configured in the pipeline engine config (requires a MongoDB service and collection); the retention_days setting bounds how long entries are kept:

[system.audit]
service_name = "system-db"
resource = "audit-log"
retention_days = 90

Without this configuration, audit entries are emitted to the pipeline engine log output only and can be forwarded to a SIEM via standard log aggregation tooling (Fluentd, Logstash, or cloud-native log forwarders).

With your consent, we and third-party providers use cookies and similar technologies on our website to analyse your use of our site for market research or advertising purposes, including personalized advertising (“performance”), to provide you with additional functions (“functional”), and to show content from social media platforms, such as embedded videos (“social media”). This may result in the creation of pseudonymous usage profiles and the transfer of personal data to third countries, including the USA, which may have no adequate level of protection for the processing of personal data. Please choose for which purposes you wish to give us your consent and store your preferences by clicking on “Accept selected”. You can find further information in section 9 of our Privacy Policy.

Manage consent preferences