Replies: 5 comments 26 replies
-
@dblas using highly emotional pitches will not work very well in this community. Instead of throwing around words like "insane" and asking questions that seem rhetorical to you but may or may be obvious to others, consider explaining what is it that you would like to see without judgement calls. Or simply contribute a PR that would demonstrate it. Throwing around words like "insane", "not at all how it should work" is great for letting steam out but not so much for improving open source software you very likely get entirely for free. For x.509 certificate-based authentication scenarios, there is a built-in plugin that makes it possible to extract a username from the most common certificate fields. On top of that, you don't have to use the internal database for users. LDAP or any HTTPS-based service with a tiny API allow you to manage bajillions of usernames however you please. |
Beta Was this translation helpful? Give feedback.
-
@dblas I will be very blunt here: if this discussion continues like this, it will not get very far, and we won't let insults towards the core team slide. Please take a few steps back and describe what is it that you're trying to do, why, what authN/authZ backends (and mechanisms) have you considered. How MQTT client information is extracted from x.509 certificates is not a recent development. I don't think 3.13 changes anything. So somehow the current set of options available works for at least some users. There's still about 7-8 weeks before 3.13.0 ships, and months before 4.0 does. Reasonable changes can be introduced if instead of spitting emotions and making bold claims ("That's not at all the way it should work") someone presents are specific set of changes without calling the core team insane. |
Beta Was this translation helpful? Give feedback.
-
Now, to comment on some specific bits that can be deciphered from the original post:
I am not convinced that a lot of MQTT tools do this by default. Client ID extraction instead of
Username extraction from Subject Alternative Name has been supported for years.
We'd need a clarification on what the well known "/c%/ trick" is. We do not guess in this community. On the surface, it looks like the MQTT plugin is missing two things:
Whether the plugin should use separate queues or not is an entirely separate discussion. Queues only offer destructive consumption, so either the plugin would need to support streams somehow (a change way out of scope for 3.13), or the use of separate queues with routing to several of them will be unavoidable in many cases. I don't see how this is relevant to how "insane" is what the plugin does w.r.t. username extraction. |
Beta Was this translation helpful? Give feedback.
-
The MQTT spec differentiates between client ID and user name. The client ID must always be unique. The client ID is used to track the state of an MQTT session. In contrast, the user name is meant to be used for authentication and authorization. I'm not 100% sure as to why the distinction between client ID and user name was made in the MQTT spec, but the most plausible explanation to me is that clients can re-use the same username for authentication and authorization while still having a unique client ID to differentiate the different sessions. When the client authenticates with a certificate, couldn't you use the same user name in the SAN of the different certificates? This is already supported today by the RabbitMQ MQTT plugin and solves your problem to not maintain N different user names. Obviously, the clients will still connect with different client IDs in the CONNECT packet.
Authentication is not enough. You still need a username for RabbitMQ to perform authorization, right? Extracting a client ID from the certificate doesn't make sense to me. The client ID is mandatory (albeit it could be empty) and already sent in the CONNECT packet from client to server. |
Beta Was this translation helpful? Give feedback.
-
#9323 and #9322 are two outcomes of this discussion. #9322 is a no-brainer. #9323 does not make much sense given that
but we may add it anyway. There can be some value in encoding as much information as possible into the certificate. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Authentication is mainly based upon username (at least for MQTT). Ok, fine.
In TLS context you don't need username since you have the certificate to authenticate the device.
Then, AFAIK, MQTT is made for connecting millions of objects.
How can you imagine managing millions of usernames?
And what for? To separate queues?
That's insane!
That's not at all the way it should work, above all in a TLS context where certificate is used AS the main authenticator.
In this case you'll have 3 databases to manage: the usernames' one, the clientIDs' one and the certificates' one (serial number) which is managed by the CA.
10k objects => 30k items to manage! Yes, that's insane.
In MQTT, at least, the id used for managing client is the ... clientID. That the ID used for managing client sessions.
And, as you may know, you can perfectly separate queues through ACLs using %c in order for one client to not be able to see other client's queues.
Describe the solution you'd like
In a TLS context, be able to extract the clientID from the certificate as it's possible to do it with username.
Thus,
CN (for example) => clientID
and SAN (email, DNS, whatever) => username (which is already feasible as of current beta).
This way, it's then possible to separate queues using the /%c/ trick.
No need to manage thousands of usernames, clientIDs are dynamically managed by the Server and we only have to manage serial numbers through the CA. Only one database and every one is happy.
Authentication can still occur against the username but this one can be unique for a pool of hundreds of devices.
Describe alternatives you've considered
Can't see other since managing thousands of usernames is insane if there is an alternative to separate queues.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions