Repository navigation
Harden Helm admin API defaults - #1524
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the Easegress Helm chart defaults so the Admin API is not exposed unintentionally, while adding chart-level tests to prevent regressions. It fits into the codebase by tightening Kubernetes deployment defaults and adding Go-based checks for Helm chart security posture.
Changes:
- Default Admin API to loopback (
127.0.0.1:2381) and disable the admin Service by default; require explicit opt-in + authentication for external exposure. - Reduce default Kubernetes privileges by disabling service account token automount and gating Secrets read RBAC behind a value flag.
- Add Helm chart security tests and ensure CI/
make testruns them when chart files change.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Runs go test for the Helm chart package as part of make test. |
| helm-charts/easegress/values.yaml | Introduces hardened defaults and new knobs for admin exposure/auth, SA token automount, and secrets RBAC. |
| helm-charts/easegress/templates/StatefulSet.yaml | Sets automountServiceAccountToken from values for primary workloads. |
| helm-charts/easegress/templates/Service.yaml | Adds an opt-in admin Service and enforces auth for external exposure. |
| helm-charts/easegress/templates/Deployment.yaml | Sets automountServiceAccountToken from values for secondary workloads. |
| helm-charts/easegress/templates/ConfigMap.yaml | Wires admin.apiAddr and optional basic-auth into generated Easegress config. |
| helm-charts/easegress/templates/ClusterRole.yaml | Gates Secrets permissions behind rbac.readSecrets. |
| helm-charts/easegress/README.md | Documents new secure defaults and how to intentionally expose/administer the Admin API. |
| helm-charts/easegress/chart_security_test.go | Adds Go tests to assert chart defaults and template guardrails. |
| .github/workflows/test.yml | Triggers tests when Helm chart files change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+30
to
+34
| {{- $adminType := default "ClusterIP" .Values.service.admin.type -}} | ||
| {{- $adminExternallyExposed := or (eq $adminType "NodePort") (eq $adminType "LoadBalancer") -}} | ||
| {{- if and .Values.service.admin.enabled $adminExternallyExposed (empty .Values.admin.basicAuth) (not .Values.admin.allowUnsafeNoAuth) -}} | ||
| {{- fail "admin service type NodePort/LoadBalancer requires admin.basicAuth or admin.allowUnsafeNoAuth=true" -}} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address