You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Marketplace deployers: hardening follow-ups from the mongodb PR review (netpol upsert dedup, container securityContext, stale-Secret reuse) #197
Follow-ups surfaced by the QA and Security reviews of nan-cloud-api#370 (private MongoDB marketplace kind) that are deliberately OUT of that PR's scope. All three apply to the deployer family, not just mongodb.
Follow-ups
Deduplicate upsertNetworkPolicy — deployers/mongodb.go and deployers/postgres.go carry line-for-line copies of the same upsert/converge helper, and it is the security-relevant netpol convergence path: a fix to one copy will not reach the other. Extract one package-level upsertNetworkPolicy(ctx, clientset, desired) used by both, and add a fake-clientset PrependReactor("create", "networkpolicies", AlreadyExists) test covering the create-race branch (currently untested for mongo).
Container hardening for all marketplace deployers — mongodb/qdrant/chromadb StatefulSets set no securityContext (allowPrivilegeEscalation: false, capabilities.drop: [ALL], runAsNonRoot) and no automountServiceAccountToken: false. Pre-existing gap, now visible in three kinds. Note: the official mongo entrypoint starts as root and drops to uid 999 via gosu, so runAsNonRoot needs runAsUser: 999 (and the existing pod fsGroup: 999 stays).
Secret reuse on partial destroy — if Destroy fails after deleting PVCs but before deleting the auth Secret, a re-install with the same app name reuses the old password, which mongod (initdb-only) ignores → member locked out of their own DB (no exposure; same failure shape as qdrant/chromadb). Option: regenerate the Secret when its nan.builders/marketplace-app-id label does not match the installing AppID.
Acceptance
Single shared netpol upsert + race test
securityContext/automountServiceAccountToken applied to all three stateful kinds, tests updated
Stale-Secret regeneration policy decided and implemented or explicitly rejected with rationale
Adding the 7 non-blocking findings from the native 4-lens review of nan-cloud-api#370 (lineage approved 2026-10-17, all informational — none opened a correction). They fold into this issue's follow-up scope:
Reliability
R3-001 (WARNING) deployers/mongodb.go:351-368
R3-002 (SUGGESTION) deployers/mongodb.go:162
R3-003 (SUGGESTION) deployers/mongodb.go:447-455
Resilience
R4-probe-timeout (WARNING) deployers/mongodb.go:421-433 — exec probe has no explicit timeout knob
R4-provision-partial (WARNING) deployers/mongodb.go:118-141 — partial-failure cleanup between ensure* steps
R4-restart-conflict (SUGGESTION) deployers/mongodb.go:199-218 — retry on STS update conflict
Activity
sre-helmcode commentedon Oct 17, 2026
Adding the 7 non-blocking findings from the native 4-lens review of nan-cloud-api#370 (lineage approved 2026-10-17, all informational — none opened a correction). They fold into this issue's follow-up scope:
Reliability
deployers/mongodb.go:351-368deployers/mongodb.go:162deployers/mongodb.go:447-455Resilience
deployers/mongodb.go:421-433— exec probe has no explicit timeout knobdeployers/mongodb.go:118-141— partial-failure cleanup between ensure* stepsdeployers/mongodb.go:199-218— retry on STS update conflictdeployers/mongodb.go:282-292These are per-kind instances of the family-wide concerns in items 1-3 above; batch them into the same hardening pass.