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

[dynsec] Problems with authorizing clients authenticated by certificate #2999

Open
dimabarbul opened this issue Feb 9, 2024 · 0 comments
Open

Comments

@dimabarbul
Copy link

I believe this is a bug, because it leads to inconsistent behavior for authN using username/password and certificate.

I need Mosquitto to allow connections for some clients with valid certificates. In order to implement this I configure mosquitto to require certificate and use dynamic-security plugin to configure ACLs. In dynamic-security I create clients only for the certificate CNs I want to allow, and grant only permissions they should have. Sometimes I need to disable clients.

According to documentation deleting or disabling client should disconnect currently connected clients and forbid future connections.

There are following problems:

  1. When the client does not exist, the connection can still be established. No permissions are granted though: any attempt to subscribe or publish is denied.
  2. When client exists and is disabled, it can perform any granted operations.

I tested such functionality for username/password authN and it works fine - when the client does not exist or is disabled, the connection cannot be established.

mosquitto.conf
listener 8883

require_certificate true
use_identity_as_username true

cafile /mosquitto/certs/ca.crt
keyfile /mosquitto/certs/server.key
certfile /mosquitto/certs/server.crt

plugin /usr/lib/mosquitto_dynamic_security.so
plugin_opt_config_file /tmp/dynamic-security.json

log_type all
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

1 participant