Interview Prep/Helm/Secrets & Security

Your CI service account for Helm has cluster-admin "because it was easier". How do you fix it?

IntermediateScenarioSecrets & Security
Answer

Situation read → A compromised pipeline would own the cluster.

What I'd do →

  1. Per-namespace ServiceAccounts or IAM-mapped roles with a Role covering only the kinds the chart renders plus Secrets (release storage).
  2. List needed kinds: helm template ... | yq '.kind' | sort -u.
  3. Separate platform pipelines (which need cluster-scoped kinds) from app pipelines.
  4. Audit with kubectl auth can-i --list --as system:serviceaccount:ci:deployer -n shop.

Why → Least privilege limits blast radius of CI compromise.

Interview tip → Mention deriving the permission list from rendered kinds.

All Helm questions Roadmap: Helm

More on Secrets & Security