-
Notifications
You must be signed in to change notification settings - Fork 423
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
Configuring default_user and default_pass in rabbitmq.config is insecure #136
Comments
@wenchma those two matter for MQTT users. The right thing to do is to use encrypted data bags. |
@michaelklishin yes, those two matter is stored in encrypted data bags in encrypted text, but the values fetched from data bag are decrypted, the values are also configured in rabbitmq.config with plain text(decrypted text). |
@wenchma the solution should be then to not have these attributes in your data bags. Yes, RabbitMQ can operate without those values but clients that connect w/o credentials often can't use the default user "guest" (because it does not exist on many production systems). Anyway, the point is that if this does not work for you, the cookbook doesn't need to be modified, you should either
Encrypted values are not currently supported by RabbitMQ (technically, Erlang's |
@michaelklishin my concern is that exposing the password in plain text is not secure, but the two attributes have to be specified for clients' connecting. Does not expose the password in plain text in rabbitmq conf file, it will look like better, isn't it ? |
That's not true. Unfortunately, authentication in MQTT is optional. It is a really bad idea if you ask me RabbitMQ has pluggable authentication mechanisms, e.g. you can authenticate using x509 certificates or LDAP. This can be extended to MQTT to a large degree. In the meantime, you can specify random values for |
Would another option be to add an IF check to the template such that when the default_user is nil, these two lines are not added to the conf file? |
Ok, maybe we should step back and re look at what is being asked for here. Based upon this doc: https://www.rabbitmq.com/access-control.html a user named guest will be created. The requirement here is for a "No Guest" configuration. Meaning, this cookbook should be changed as follows:
rabbitmq_user 'remove rabbit guest user' do user 'guest' action :delete not_if { node[rabbit][allow_guest] } end
<% if node['rabbitmq']['default_user'] != 'guest' -%> {default_user, <<"<%= node['rabbitmq']['default_user'] %>">>}, {default_pass, <<"<%= node['rabbitmq']['default_pass'] %>">>} <% end -%> No change in current behavior, but cleanup guest from server and conf if asked for. |
@kramvan1 it looks like a good method to address this problem. |
@wenchma Do you still need a fix for this? |
@cmluciano yes, I still need a fix, these two attributes should be only stored in rabbitmq db, not exposed in the conf file. |
@cmluciano and @wenchma seriously it's a clever fix. works for me ;) |
Fix provided by #237 closing now due to inactivity |
rabbitmq.config template file contains default_user and default_pass which are plain text, it is going to be a security risk.
{default_user, <<"<%= node['rabbitmq']['default_user'] %>">>},
{default_pass, <<"<%= node['rabbitmq']['default_pass'] %>">>}
In my opinion, we should remove the two configuration items.
The text was updated successfully, but these errors were encountered: