You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "omarkj (via GitHub)" <gi...@apache.org> on 2026/01/26 20:31:38 UTC

[PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

omarkj opened a new pull request, #25185:
URL: https://github.com/apache/pulsar/pull/25185

   Add a new `strictAuthMethod` configuration option to enforce that clients must specify their authentication method. When enabled, authentication requests without an explicit method will immediately fail with "Authentication method missing" instead of attempting to authenticate with all configured providers.
   
   This improves security by preventing unintended authentication fallback behaviour when operators want to require specific authentication methods for their deployment.
   
   Main Issue: #25184


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25185:
URL: https://github.com/apache/pulsar/pull/25185#issuecomment-3801624575

   @omarkj Please add the following content to your PR description and select a checkbox:
   ```
   - [ ] `doc` <!-- Your PR contains doc changes -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #25185:
URL: https://github.com/apache/pulsar/pull/25185#issuecomment-3848923107

   > I will get a PIP out if relevant.
   > 
   > @lhotari Regarding your questions:
   > 
   > > 1. does this require also a similar change for
   > > 
   > > 
   > > * the Pulsar binary protocol?
   > 
   > I believe the Pulsar Protocol authentication only tries the specified authentication provider unlike the HTTP authentication which iterates through all available providers if none is specified.
   
   Oh yes, you are correct.
   
   > 
   > > * the Pulsar Proxy?
   > 
   > This is a good point, if the proxy is authenticating HTTP requests then yes, might be useful there.
   > 
   > > 2. Since the client can specify the authentication method, how does this improve security?
   > 
   > This should make it harder to probe the system for possibly misconfigured authentication providers.
   
   Makes sense


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #25185:
URL: https://github.com/apache/pulsar/pull/25185#issuecomment-3803924461

   Thanks for the contribution @omarkj. Yes, a PIP would be useful in documenting the change.
   
   Some questions:
   1. does this require also a similar change for 
     - the Pulsar binary protocol?
     - the Pulsar Proxy?
   
   2. Since the client can specify the authentication method, how does this improve security?
   Just wondering if it be useful to limit authentication methods for a particular "advertised listener"?
     - Pulsar broker can bind to multiple addresses/ports and limiting the authentication method for an external port binding could be an useful addition


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #25185:
URL: https://github.com/apache/pulsar/pull/25185#discussion_r2773980126


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1796,6 +1796,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
         doc = "Enable authentication"
     )
     private boolean authenticationEnabled = false;
+

Review Comment:
   I'll merge now so that this makes it to the next set of releases. This could be addressed in a follow up PR.



##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1796,6 +1796,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
         doc = "Enable authentication"
     )
     private boolean authenticationEnabled = false;
+
+    @FieldContext(
+        category = CATEGORY_AUTHENTICATION,
+        doc = "Strictly enforce authentication method. If specified, Pulsar will only attempt to authenticate with "
+                + "the provided method. If no method is provided, authentication fails."

Review Comment:
   I'll merge now so that this makes it to the next set of releases. This could be addressed in a follow up PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #25185:
URL: https://github.com/apache/pulsar/pull/25185#issuecomment-3859948148

   /pulsarbot rerun-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "omarkj (via GitHub)" <gi...@apache.org>.
omarkj commented on PR #25185:
URL: https://github.com/apache/pulsar/pull/25185#issuecomment-3807866936

   I will get a PIP out if relevant.
   
   @lhotari Regarding your questions:
   
   > 1. does this require also a similar change for
   > * the Pulsar binary protocol?
   
   I believe the Pulsar Protocol authentication only tries the specified authentication provider unlike the HTTP authentication which iterates through all available providers if none is specified.
   
   > * the Pulsar Proxy?
   
   This is a good point, if the proxy is authenticating HTTP requests then yes, might be useful there.
   
   > 2. Since the client can specify the authentication method, how does this improve security?
   
   This should make it harder to probe the system for possibly misconfigured authentication providers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #25185:
URL: https://github.com/apache/pulsar/pull/25185


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #25185:
URL: https://github.com/apache/pulsar/pull/25185#discussion_r2773708860


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1796,6 +1796,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
         doc = "Enable authentication"
     )
     private boolean authenticationEnabled = false;
+
+    @FieldContext(
+        category = CATEGORY_AUTHENTICATION,
+        doc = "Strictly enforce authentication method. If specified, Pulsar will only attempt to authenticate with "
+                + "the provided method. If no method is provided, authentication fails."

Review Comment:
   Perhaps this should be more specific about this being applied to HTTP authentication and requiring `X-Pulsar-Auth-Method-Name` header to be set when this setting is enabled.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] Add strictAuthMethod to require explicit authentication method [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #25185:
URL: https://github.com/apache/pulsar/pull/25185#discussion_r2765306705


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1796,6 +1796,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
         doc = "Enable authentication"
     )
     private boolean authenticationEnabled = false;
+

Review Comment:
   Please also add this new configuration key to `conf/broker.conf` and `conf/standalone.conf` files.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org