Skip to content

When authorizationEnabled=true in proxy.conf the proxy does not appear to perform Authorization check #7385

@frankjkelly

Description

@frankjkelly

Describe the bug
When authorizationEnabled=true in proxy.conf the proxy does not appear to execute the authorization plugin.

To Reproduce
Steps to reproduce the behavior:

  1. GIVEN we enable Authorization on proxy
root@pulsar-proxy-6f798754db-r9gbw:/pulsar/conf# grep -i authorization proxy.conf 
### ---Authorization --- ###
# Whether authorization is enforced by the Pulsar proxy
authorizationEnabled=true
# Authorization provider as a fully qualified class name
authorizationProvider=com.cogito.platform.signal.stream.pulsar.authn.broker.CogitoAuthorizationProvider
# Whether client authorization credentials are forwared to the broker for re-authorization.
forwardAuthorizationCredentials=false
  1. AND GIVEN the Authorization plugin is loaded
[16:02:04] fkelly@Franks-Cogito-Work-Computer:[~/platform2-test]: (feature/sdlc-31257-minikube-integration) klf pulsar-proxy-6f798754db-r9gbw | grep -i authorization
[conf/proxy.conf] Applying config authorizationEnabled = true
[conf/proxy.conf] Applying config authorizationProvider = com.cogito.platform.signal.stream.pulsar.authn.broker.CogitoAuthorizationProvider
19:55:31.069 [main] INFO  com.cogito.platform.signal.stream.pulsar.authn.broker.CogitoAuthorizationProvider - ==> Initialize()
19:55:31.074 [main] INFO  org.apache.pulsar.broker.authorization.AuthorizationService - com.cogito.platform.signal.stream.pulsar.authn.broker.CogitoAuthorizationProvider has been loaded.
  1. WHEN a Pulsar command is picked up by the Proxy
  2. THEN the Authentication Plugin is executed but the Authorization Plugin is not (and the Role token is passed onto the Broker)

I was also able to replicate this without use of Custom AUth*n providers e.g. My proxy.conf

# grep -i auth proxy.conf | grep -v "#"
authorizationEnabled=true
authorizationProvider=org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider
forwardAuthorizationCredentials=false
authenticationEnabled=true
authenticationProviders=org.apache.pulsar.broker.authentication.AuthenticationProviderToken
brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationToken
brokerClientAuthenticationParameters=file:///pulsar/token-proxy/proxy.jwt
tokenAuthClaim=

and on startup

[11:21:23] fkelly@Franks-Cogito-Work-Computer:[~/platform2-test]: (feature/sdlc-31257-minikube-integration) klf pulsar-proxy-6f798754db-5nz4h | grep -i Auth| more
[conf/proxy.conf] Applying config authenticationEnabled = true
[conf/proxy.conf] Applying config authenticationProviders = org.apache.pulsar.broker.authentication.AuthenticationProviderToken
[conf/proxy.conf] Applying config authorizationEnabled = true
[conf/proxy.conf] Applying config brokerClientAuthenticationParameters = file:///pulsar/token-proxy/proxy.jwt
[conf/proxy.conf] Applying config brokerClientAuthenticationPlugin = org.apache.pulsar.client.impl.auth.AuthenticationToken
15:14:20.005 [main] INFO  org.apache.pulsar.broker.authentication.AuthenticationService - org.apache.pulsar.broker.authentication.AuthenticationProviderToken has been loaded.

and again the Authentication provider seems to be executed but not the Authorization Provider

Expected behavior
Unless I am misunderstanding the Auth*n deployment / configuration then I would expect Authorization to occur at the Proxy.

Screenshots
See above

Desktop (please complete the following information):

  • Apache Pulsar: 2.5.2
  • Kubernetes: minikube version: v1.9.0

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions