Skip to content
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

Can they be friends --ignore-path and --allow-path? #269

Open
raptorsun opened this issue Nov 10, 2023 · 3 comments
Open

Can they be friends --ignore-path and --allow-path? #269

raptorsun opened this issue Nov 10, 2023 · 3 comments

Comments

@raptorsun
Copy link
Contributor

For now kube-rbac-proxy sees the 2 arguments --ignore-path and --allow-path mutually exclusive.
It is not so practical when we add liveness probe and readiness probes in Kubernetes. We may want the proxy to have a whitelist of the allowed pathes, while omitting the security check on certain paths such as /healthy, /ready.
The current implementation of handler should work if we remove the option check.
The decision logic looks like:

  • If a path exists in allow list and ignore list: pass without authentication or authorization
  • If a path exists in allow list but not in ignore list: pass with authentication and authorization
  • If a path exists not in allow list but in ignore list: reject
  • If a path exists neither in allow list nor in ignore list: reject
allow ignore decision
pass
check
reject
reject

What was the consideration behind why the 2 arguments are exclusive?
If the new logic looks good, I can submit a PR with the proposed logic.

@ibihim
Copy link
Collaborator

ibihim commented Dec 12, 2023

We are currently very busy. I will try to discuss this with other maintainers and do my research, why it was made the way it is.

Most probably (beware, I am in assumption space): the combination of both logical features could introduce a complicated logic that could be misconfigured.

@simonpasquier
Copy link
Contributor

@ibihim I vaguely remember from when kube-rbac-proxy was maintained by the monitoring team that the misconfiguration opportunity was the top concern.

@raptorsun
Copy link
Contributor Author

Thank you for the feedback :)
A risk of misconfiguration is always there.
It seems to me the logic is simple:

  1. if a path is allowed, go to next step, otherwise reject.
  2. if a path is ignored, grant access, otherwise go to next step.
  3. if a path is not ignored, check if the user is authorized to perform the verb on the resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants