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

Mix of static authorizer and subjectaccessreviews config deactivates the static authorizer #146

Open
raptorsun opened this issue Sep 24, 2021 · 2 comments

Comments

@raptorsun
Copy link
Contributor

When putting both static authorizer and normal configs using subjectaccessreviews together in the config file, the part of static authorizer is not taken into account.

Here is an example. I would like to config kube-rbac-proxy to allow both using a bearer token and using a static authorizer to get access to the service behind its proxy.

  • For the path "/metrics", I want to use the static authorizer to check the access, using only TLS certificates.
  • For the other API calls, I would like to leave them to other authorizer schemes. I assume a request will be granted access when either authorizer gives authorization.

I have tried 2 configs but neither of them allows both use cases:

  1. This allows query /metrics using certificates, but blocks call to other API
    "authorization":
      "static":
      - "path": "/metrics"
        "resourceRequest": false
        "user":
          "name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
        "verb": "get"
  1. This allows query other API using bearer tokens, blocks querying /metrics using certificates
    "authorization":
      "resourceAttributes":
        "apiGroup": "monitoring.coreos.com"
        "namespace": "{{ .Value }}"
        "resource": "prometheusrules"
      "rewrites":
        "byQueryParameter":
          "name": "namespace"
      "static":
      - "path": "/metrics"
        "resourceRequest": false
        "user":
          "name": "system:serviceaccount:openshift-monitoring:prometheus-k8s" 
        "verb": "get"
@s-urbaniak
Copy link
Collaborator

cc @ibihim can you take a look?

@ibihim
Copy link
Collaborator

ibihim commented Sep 28, 2021

I will try to do so next week. Thanks for the pointer

simonpasquier added a commit to simonpasquier/cluster-monitoring-operator that referenced this issue Feb 14, 2024
Until brancz/kube-rbac-proxy#146 is
implemented, we need a dedicated kube-rbac-proxy for static authz.
Otherwise it will always do a SubjectAccessReview for requests
authenticated using bearer tokens.

Signed-off-by: Simon Pasquier <[email protected]>
simonpasquier added a commit to simonpasquier/cluster-monitoring-operator that referenced this issue Feb 14, 2024
Until brancz/kube-rbac-proxy#146 is
implemented, we need a dedicated kube-rbac-proxy for static authz.
Otherwise it will always do a SubjectAccessReview for requests
authenticated using bearer tokens.

Signed-off-by: Simon Pasquier <[email protected]>
simonpasquier added a commit to simonpasquier/cluster-monitoring-operator that referenced this issue Feb 15, 2024
Until brancz/kube-rbac-proxy#146 is
implemented, we need a dedicated kube-rbac-proxy for static authz.
Otherwise it will always do a SubjectAccessReview for requests
authenticated using bearer tokens.

Signed-off-by: Simon Pasquier <[email protected]>
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