-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 security concerns by only enabling FilterProvider to protect the metrics endpoint with authn/authz when secureMetrics is true #4022
Conversation
Welcome @alex-kattathra-johnson! |
Hi @alex-kattathra-johnson. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
daab89a
to
5e8b24f
Compare
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.
we need to try address the above ones so that we can get this one merged
5e8b24f
to
b2d584f
Compare
b2d584f
to
cd70ceb
Compare
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.
/ok-to-test
// can access the metrics endpoint. The RBAC are configured in 'config/rbac/kustomization.yaml'. More info: | ||
// https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/metrics/filters#WithAuthenticationAndAuthorization | ||
metricsServer.FilterProvider = filters.WithAuthenticationAndAuthorization | ||
} |
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.
👍 I liked it
Great work
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.
@sbueringer wdyt?
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 perfect, thx!
* Enable `filters.WithAuthenticationAndAuthorization` only when `secureMetrics` is true Signed-off-by: Alex Johnson <[email protected]>
cd70ceb
to
59a92f7
Compare
... | ||
if secureMetrics { | ||
... | ||
metricsServerOptions.FilterProvider = filters.WithAuthenticationAndAuthorization | ||
} |
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.
👍
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.
Great work 🥇
Terrific 🚀
I am approving this one
/approve
It would be nice get the input/LGTM from @sbueringer since he was who spot this one
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alex-kattathra-johnson, camilamacedo86 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thank you! /lgtm |
Description
Enable
filters.WithAuthenticationAndAuthorization
only whensecureMetrics
is trueMotivation
Resolve #4020