You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancement of Authentication and Authorization Filters to Allow Custom Configurations and Stability Improvements #2781
Enhancement Proposal: Authentication and Authorization Filters
Context: Following the implementation introduced in PR #2407, several issues regarding configurability and robustness were identified.
Issues Identified
Configurability: Current settings such as cache TTL, timeouts, and anonymous access are hardcoded and cannot be adjusted.
Certificate Authentication: The implementation disrupts normal certificate authentication processes. See that it shows like to have the same security issue identified by auth-sig which is a breaking change in kube-rbac-proxy over The ability to run kube-rbac-proxy without TLS certificates will be removed. shows be applied here. Users should provide their certificates and/or use solutions as cert-manager to manage them accordingly. It seems that is not a good practice to manage them. More info.
Authorization Flexibility: Lack of support for alwaysAllow configurations for critical paths like /healthz and alwaysAllowGroups like system:masters.
Network Resilience: Heavy dependency on stable connectivity to kube-apiserver can lead to metrics outages under network instability.
These changes would enhance the flexibility and reliability of the authentication and authorization processes in controller-runtime, aligning with the needs of robust Kubernetes deployments.
First of all, thank you very much for your assistance with this issue. Your expertise and deep knowledge are invaluable here, and I/and the community for sure greatly appreciate your involvement. Please feel free to add any additional insights or correct any points I might have missed or misunderstood.
Thx for opening this issue and the feedback. In general makes sense to improve the feature where necessary.
One question. Are the issues identified above from the kube-rbac-proxy audit or from an audit of the current implementation in controller-runtime? I'm not sure if they all apply in CR, as we only implement a subset of the kube-rbac-features and we only use them specifically for the metrics endpoint (e.g. /healthz is entirely out of scope today)
IHMO all seems to apply because the feedback here in my understand is mainly keep the things configurable for properly inform the certs. Regards the Lack of support for alwaysAllow configurations for critical paths like /healthz and alwaysAllowGroups like system:masters. it seems that it could appear to work, but then cause metrics outages when networking to the kube-apiserver is flaky, which is one of the most important times to have metrics.
Activity
camilamacedo86 commentedon Apr 16, 2024
HI @deads2k,
First of all, thank you very much for your assistance with this issue. Your expertise and deep knowledge are invaluable here, and I/and the community for sure greatly appreciate your involvement. Please feel free to add any additional insights or correct any points I might have missed or misunderstood.
sbueringer commentedon Apr 16, 2024
Thx for opening this issue and the feedback. In general makes sense to improve the feature where necessary.
One question. Are the issues identified above from the kube-rbac-proxy audit or from an audit of the current implementation in controller-runtime? I'm not sure if they all apply in CR, as we only implement a subset of the kube-rbac-features and we only use them specifically for the metrics endpoint (e.g.
/healthzis entirely out of scope today)camilamacedo86 commentedon Apr 25, 2024
Hi @sbueringer,
IHMO all seems to apply because the feedback here in my understand is mainly keep the things configurable for properly inform the certs. Regards the
Lack of support for alwaysAllow configurations for critical paths like /healthz and alwaysAllowGroups like system:masters.it seems that it could appear to work, but then cause metrics outages when networking to the kube-apiserver is flaky, which is one of the most important times to have metrics.sbueringer commentedon Apr 25, 2024
We don't even have a /healthz endpoint on the metrics server. But I get the point for metrics
k8s-triage-robot commentedon Jul 24, 2024
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/staleis appliedlifecycle/stalewas applied,lifecycle/rottenis appliedlifecycle/rottenwas applied, the issue is closedYou can:
/remove-lifecycle stale/closePlease send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
camilamacedo86 commentedon Jul 24, 2024
/remove-lifecycle stale
camilamacedo86 commentedon Jul 24, 2024
hi @sbueringer
Could we frozen this one?
Until someone be able to look on it and see if can address the enhancements?
sbueringer commentedon Jul 24, 2024
/lifecycle frozen
mrueg commentedon Sep 5, 2025
It would be nice if we could have also resource-attribute based authorization in the filter, similar to: https://github.com/brancz/kube-rbac-proxy/tree/master/examples/resource-attributes
I believe this would allow more fine grained access than the non-resource URL approach
sbueringer commentedon Sep 5, 2025
If I'm not mistaken filters.WithAuthenticationAndAuthorization is only used to protect the metrics endpoint.
Can you please give an example how that feature would improve the authentication/authorization of the metrics endpoint?
mrueg commentedon Sep 8, 2025
As far as I know, NonResourceURL's are not namespaced, so using a NRU means I give access to all /metrics endpoints int he cluster.
I was hoping that SubResources are namespacable, so we could do:
sbueringer commentedon Sep 8, 2025
I see. But this would allow to proxy to the service via the apiserver as well, right? (In this specific example to all services in the namespace)
Not just allow the /metrics endpoint
mrueg commentedon Sep 8, 2025
In the Role we could also set
resourceNames, I don't know enough yet to answer if this would help limiting it to the service that exposes metrics.sbueringer commentedon Sep 9, 2025
I think it would. But it think it also allows access to all endpoints of the controller, not just metrics.
If we define a role like that it will also be used by the kube-apiserver, not just controller-runtime