-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(eck-operator): make automountServiceAccountToken configurable #7690
fix(eck-operator): make automountServiceAccountToken configurable #7690
Conversation
Keeps the default behaviour of having automountServiceAccountToken set to true for ServiceAccount/Statefulset Signed-off-by: Stefan Caraiman <stefanc.caraiman@gmail.com>
ada6542
to
05a23bf
Compare
@thbkrkr could you please have a look 👀 thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good overall! I left one question.
Could you please add some unit tests that covers the different cases? Here's a start to get you started:
> cat deploy/eck-operator/templates/tests/statefulset_test.yaml
suite: test operator statefulset
templates:
- statefulset.yaml
- configmap.yaml
tests:
- it: should have automount service account tokens set by default
asserts:
- template: statefulset.yaml
equal:
path: spec.template.spec.automountServiceAccountToken
value: true
- it: should disable automount service account tokens
set:
automountServiceAccountToken: false
asserts:
- template: statefulset.yaml
equal:
path: spec.template.spec.automountServiceAccountToken
value: false
Co-authored-by: Thibault Richard <thbkrkr@users.noreply.github.com>
@thbkrkr added some minimal unit tests, let me know if i should add something else 👍 |
Test automountServiceAccountToken in the SA/Statefulset.
45822f1
to
41ebb57
Compare
buildkite test this |
Thank you Stephan for this contribution! |
Keeps the
automountServiceAccountToken
defaulting totrue
just as before for ServiceAccount/StatefulsetIt makes it configurable though for cases such as with Azure AKS Security policy which scans for any pod/SA that have it set to
true
and instead recommended as part of their security benchmarks to disable automounting and injecting the service account tokens as volumes explicitly for each workload that requires it: Kubernetes clusters should disable automounting API credentialsA similar thread on this from
cert-manager
and hardened values for such setups & rationale behind it.