-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Manually mount serviceAccount token #13186
Conversation
…ount to relevant containers Signed-off-by: Aran Shavit <[email protected]>
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.
Thanks @Aransh, this makes sense to me 👍
Could you also implement this for the viz, multicluster and jaeger extensions charts? Note that not all workloads there need to connect to the kube-api so mounting wouldn't always be necessary. Let me know if you need more assistance to figure that out.
Don't worry about the linkerd2-cni chart though, as there currently are other concerns that we need to address (linkerd/linkerd2-proxy-init#416).
@alpeb I can gladly add that, but I don't currently use any of them, so would be difficult to figure out what’s required... Also I need to see if I can figure out what's causing the CI to fail currently, will try and take a look next week |
Thanks again for the help @Aransh ! Here's the info you need:
BTW, CI had one flaky test, but it's looking good now 👍 |
Thanks for the CI clarification 😃 When you say "workload", you mean pod essentially? Keep in mind the token mounting is done per container, or do these workloads all have a single container? If not/you’re not sure, I can just mount it to all containers, I'd just prefer to do it as precise as I can |
Yeah these are all single-container pods (not counting the proxy and init containers, which don't require any changes). |
Got it, will mount on all containers except init and proxy then, probably will handle Tuesday. |
Signed-off-by: Aran Shavit <[email protected]>
…r charts Signed-off-by: Aran Shavit <[email protected]>
Signed-off-by: Aran Shavit <[email protected]>
@alpeb Updated for linkerd-viz, linkerd-jaeger, linkerd-multicluster, and linkerd-multicluster-link as you requested. |
I see it's failing for mismatch with templates again, but running |
Turns out those docs are outdated... the right command is |
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.
This looks good to me, pending the remaining golden files updates 👍
Signed-off-by: Aran Shavit <[email protected]>
@alpeb updated |
Subject
Disables "automountServiceAccountToken", instead manually mounts it as a projected volume where necessary
Problem
By default, kubernetes enables "automountServiceAccountToken" for all pods.
This poses a security risk, as pods might get kube-api permissions unintentionally.
More specifically, this fails security compliance tests:
https://learn.microsoft.com/en-us/azure/governance/policy/samples/built-in-policies
https://www.azadvertizer.net/azpolicyadvertizer/kubernetes_block-automount-token.html
Solution
Disable "automountServiceAccountToken", create projected volume for the token, and mount it on relevant containers
Validation
Linkerd pods are able to access k8s API, work as expected (same as before)
Fixes #13108