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 →
- Per-namespace ServiceAccounts or IAM-mapped roles with a Role covering only the kinds the chart renders plus Secrets (release storage).
- List needed kinds:
helm template ... | yq '.kind' | sort -u. - Separate platform pipelines (which need cluster-scoped kinds) from app pipelines.
- 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.
More on Secrets & Security
A secret was committed in plaintext in `values-prod.yaml`. What do you do?BeginnerWho can read secrets passed to Helm, and how do you reduce exposure?IntermediateSet up helm-secrets with SOPS and AWS KMS for prod and age for dev.IntermediateA chart from the internet requests cluster-admin. How do you evaluate and contain it?AdvancedYour security team asks you to scan Helm charts for misconfigurations in CI. How?BeginnerHow do you rotate a database password managed through Helm without downtime?Advanced