Disable automountServiceAccountToken and support ConfigMap annotations for security hardening - #74
Disable automountServiceAccountToken and support ConfigMap annotations for security hardening#74deepnemesis wants to merge 2 commits into
Conversation
…attack surface Signed-off-by: Subhadeep Maity <322813880+deepnemesis@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…ixes kafbat#72) Signed-off-by: Subhadeep Maity <322813880+deepnemesis@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
AI Summary The GitHub issue addresses two security gaps in a Helm chart: unnecessary Kubernetes API tokens being mounted to pods (due to |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Kafka UI Helm chart adds configurable ServiceAccount token automount behavior and annotations for generated ConfigMaps. The chart defaults token automounting to disabled, documents both settings, and increments the chart version to 1.6.6. ChangesKafka UI chart configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to This patch disables service-account token mounting by default and adds managed annotations for generated ConfigMaps. The supplied implementation shows no material merge-blocking risk, so it is ready for normal Helm checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit hops through charts so neat Comment |
Background
Two small, unrelated gaps found while reviewing this chart's security posture:
Neither the ServiceAccount resource nor the Deployment's pod spec set automountServiceAccountToken, so every kafka-ui pod gets a Kubernetes API token mounted by default — even though kafka-ui never calls the Kubernetes API in normal operation.
Neither ConfigMap this chart creates (configmap.yaml, configmap_fromValues.yaml) supports custom annotations, which blocks integration with tooling that relies on ConfigMap annotations (e.g. HashiCorp Vault Agent), as reported in Add custom annotations support for ConfigMap in Helm chart #72.
Changes
Add serviceAccount.automountServiceAccountToken (default false), wired into the Deployment pod spec.
Add configMap.annotations (default {}), wired into both ConfigMap templates.
Bump chart version 1.6.5 → 1.6.6 (single patch bump covering both changes)
Update CONFIGURATION.md accordingly.
Reference
automountServiceAccountToken#73Summary by CodeRabbit
New Features
Documentation
Chores