Skip to content

sec(#1528): provision tb_meta + tb_ingest service-account Secrets (S1) - #643

Merged
aptracebloc merged 3 commits into
developfrom
sec/1528-service-db-account-secrets
Aug 10, 2026
Merged

sec(#1528): provision tb_meta + tb_ingest service-account Secrets (S1)#643
aptracebloc merged 3 commits into
developfrom
sec/1528-service-db-account-secrets

Conversation

@aptracebloc

@aptraceblocaptracebloc commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What & why

Chart side of backend#1528 S1 (RFC-0003 D10 close-out), paired with tracebloc/client-runtime#290. jobs-manager mints two dedicated, single-database MySQL identities (tb_meta, tb_ingest) to replace the root-equivalent edgeuser; this PR wires the Secrets + env they read.

  • values: serviceDbAccounts (default false) + optional tbMetaPassword / tbIngestPassword operator pins, mirroring perExperimentDbCreds / credmgrPassword. Added to values.schema.json.
  • secrets.yaml: TB_META_PASSWORD / TB_INGEST_PASSWORD via the same generate-once, upgrade-stable 3-tier resolution as TB_CREDMGR_PASSWORD (operator pin → existing Secret value → randAlphaNum), with alphanumeric-pin validation. Emitted only when serviceDbAccounts is on.
  • jobs-manager-deployment: SERVICE_DB_ACCOUNTS=1 + TB_META_USER/TB_INGEST_USER + the two secretKeyRef passwords, rendered only when the flag is on.

Safety

Gated so a default install is byte-identical — verified with helm template: flag off renders none of the new keys; flag on renders the Secret keys (pins decode correctly) and the deployment env. The mirrored node-agents Secret intentionally does not carry the service creds.

Tests

helm unittest ./clientsecrets_test.yaml + jobs_manager_test.yaml extended (49 assertions across the two suites, green). (5 pre-existing failures in other suites are a local helm-unittest 1.1.2 / helm v4 vs CI-pinned 0.5.2 artifact, present on clean develop too — not touched here.)

Merge coordination

Safe in any order with #290: the env only exists when serviceDbAccounts=true, and the runtime mint is inert until the env is present. Neither is enabled by default.

🤖 Generated with Claude Code


Note

Low Risk
Changes are flag-gated and additive; default installs render no new secrets or env. Password handling mirrors the existing credmgr pattern with no runtime consumer switch in this PR alone.

Overview
backend#1528 S1 (RFC-0003 D10 close-out) wires chart support for dedicated MySQL service identities tb_meta and tb_ingest, paired with client-runtime minting. Everything is behind serviceDbAccounts (default false) so a normal install stays byte-identical.

When the flag is on, secrets.yaml adds TB_META_PASSWORD and TB_INGEST_PASSWORD using the same 3-tier resolution as TB_CREDMGR_PASSWORD (operator pin → existing Secret → randAlphaNum), with alphanumeric validation on tbMetaPassword / tbIngestPassword. jobs-manager-deployment gets SERVICE_DB_ACCOUNTS=1, fixed usernames, and secretKeyRef for both passwords.

values.yaml, values.schema.json, and chart version 1.9.28 document the knobs. helm unittest covers default-off rendering and flag-on Secret/env wiring.

Reviewed by Cursor Bugbot for commit 6bdf91f. Bugbot is set up for automated code reviews on this repo. Configure here.

Chart side of backend#1528 S1 (RFC-0003 D10 close-out), paired with
tracebloc/client-runtime's minting PR. jobs-manager mints two dedicated,
single-database MySQL identities to replace the root-equivalent edgeuser;
this wires the Secrets and env they read.
- values: serviceDbAccounts (default false) + optional tbMetaPassword /
tbIngestPassword operator pins, mirroring perExperimentDbCreds /
credmgrPassword. Added to values.schema.json.
- secrets.yaml: TB_META_PASSWORD / TB_INGEST_PASSWORD via the same
generate-once, upgrade-stable 3-tier resolution as TB_CREDMGR_PASSWORD
(operator pin -> existing Secret value -> randAlphaNum), alphanumeric-pin
validation, emitted only when serviceDbAccounts is on.
- jobs-manager-deployment: SERVICE_DB_ACCOUNTS=1 + TB_META_USER/TB_INGEST_USER
+ the two secretKeyRef passwords, rendered only when the flag is on.
Gated so a default install is byte-identical (verified: `helm template` with
the flag off renders none of the new keys). helm-unittest coverage added to
secrets_test.yaml and jobs_manager_test.yaml (49 assertions, green).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aptraceblocaptracebloc self-assigned this Aug 7, 2026
templates/values/schema changed, so the chart-version guard requires a
version: bump — a Helm repo only publishes a new version, and an unbumped
edit ships dark or overwrites a published tarball. Additive feature =>
patch bump. appVersion unchanged (wiring only, no app image change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 37b151b. Configure here.

Comment threadclient/Chart.yaml
.cursor/BUGBOT.md flags a Chart.yaml version bump without the matching
appVersion — app.kubernetes.io/version derives from appVersion, so leaving
it at 1.9.27 would tag upgraded resources as the previous release. Every
prior bump moved the two in lockstep; this restores that.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aptracebloc
aptracebloc merged commit d97708f into developAug 10, 2026
21 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@aptracebloc@saadqbal@LukasWodka