'guest' user packets dropped from non localhost addresses on rabbitmq-server 3.3+

Bug #1343354 reported by Scott Moser
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Undecided
Abhishek Chanda

Bug Description

As reported at http://rabbitmq.1065348.n5.nabble.com/RabbitMQ-3-3-0-quot-guest-quot-user-changes-td34491.html
on rabbitmq 3.3.0 and newer (such as in Ubuntu 14.10), the 'guest' user can now only connect via localhost interfaces.

At least in my usage of devstack, the rabbitmq address ends up using a non 127.0.* address. the first thing to hit this is 'glance image-create'. You'd see errors on the g-api screen with:

   2014-07-17 15:36:00.636 ERROR oslo.messaging._drivers.impl_rabbit [-] AMQP server 10.5.0.61:5672 closed the connection. Check login credentials: Socket closed

On Ubuntu 14.10, to fix this, I had to write the following in /etc/rabbitmq/rabbitmq.config:

[
 {rabbit, [{loopback_users, []}]}
].

Then , just
  sudo service rabbitmq-server restart

And everything was dandy.

Revision history for this message
Scott Moser (smoser) wrote :

well, just for some more information, I was hoping i could avoid writing a config file by doing something like:
  sudo rabbitmqctl set_permissions guest ".*" ".*" ".*"

but that doesnt allow the user to then access from non-localhost.

So I see 2 paths here:
a.) modify rabbit config file
  this doesn't seem to be done anywhere else.
b.) use a different rabbit user , and create that user.
  this should be possible and then we'd need to
   * add a RABBIT_USERID variable (default to 'rabbit_stack') or something
   * 'iniset' the 'rabbit_userid' to that value
   * create the user and set the password
   * ideally delete the user on stop

for some of my own reference, i'll include code to "set_user" (ensure the user exists and has the provided password):
error() { echo "$@" 1>&2; }
debug() { error "$@"; }

rabbit_setuser() {
   local user="$1" pass="$2" found="" out=""
   out=$(sudo rabbitmqctl list_users) ||
      { error "failed to list users"; return 1; }
   found=$(echo "$out" | awk '$1 == user { print $1 }' "user=$user")
   if [ "$found" = "$user" ]; then
       debug "updating rabbitmq user '$user'"
       sudo rabbitmqctl change_password "$user" "$pass" ||
          { error "failed changing pass for $user"; return 1; }
   else
       debug "adding new rabbitmq user '$user'"
       sudo rabbitmqctl add_user "$user" "$pass" ||
          { error "failed changing pass for $user"; return 1; }
   fi
}

rabbit_clearuser() {
   sudo rabbitmqctl delete_user "$1"
}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.openstack.org/107779

Changed in devstack:
assignee: nobody → Scott Moser (smoser)
status: New → In Progress
Revision history for this message
Scott Moser (smoser) wrote :

Well, in the review at https://review.openstack.org/107779 I implemented a 'RABBIT_USERID' user and thought that I'd fixed it most everywhere, but failures in the test suites show otherwise.

So options at this point:
 a.) continue using 'guest' user and modify the config file
 b.) fix the fallout

summary: - needs to configure rabbit loopback_users for rabbitmq-server 3.3+
+ 'guest' user packets dropped from non localhost addresses on rabbitmq-
+ server 3.3+
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on devstack (master)

Change abandoned by Sean Dague (<email address hidden>) on branch: master
Review: https://review.openstack.org/107779
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in devstack:
assignee: Scott Moser (smoser) → Abhishek Chanda (abhishek-i)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.openstack.org/141156

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (master)

Reviewed: https://review.openstack.org/141156
Committed: https://git.openstack.org/cgit/openstack-dev/devstack/commit/?id=d5b74c688febfafb69ddc3881d9936e0268daa4c
Submitter: Jenkins
Branch: master

commit d5b74c688febfafb69ddc3881d9936e0268daa4c
Author: Abhishek Chanda <email address hidden>
Date: Fri Dec 12 02:15:55 2014 +0530

    Take an optional rabbit user name as input

    Newer versions of rabbitmq (3.3 and later) do not allow the 'guest'
    user to access on non-local interfaces.

    - Added a new config RABBIT_USERID which defaults to stackrabbit
    - Invoked config scripts using that variable

    Adopted from:
    https://review.openstack.org/#/c/107779/

    Change-Id: I43a231c9611b4cc2e390b603aa3bfb49c915bdc5
    Closes-Bug: #1343354
    Co-Authored-By: Scott Moser <email address hidden>

Changed in devstack:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/164718

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (stable/icehouse)

Reviewed: https://review.openstack.org/164718
Committed: https://git.openstack.org/cgit/openstack-dev/devstack/commit/?id=d795232370b75c4312f312aca370b79b3e0be0ef
Submitter: Jenkins
Branch: stable/icehouse

commit d795232370b75c4312f312aca370b79b3e0be0ef
Author: Abhishek Chanda <email address hidden>
Date: Fri Dec 12 02:15:55 2014 +0530

    Take an optional rabbit user name as input

    Newer versions of rabbitmq (3.3 and later) do not allow the 'guest'
    user to access on non-local interfaces.

    - Added a new config RABBIT_USERID which defaults to stackrabbit
    - Invoked config scripts using that variable

    Adopted from:
    https://review.openstack.org/#/c/107779/

    Backported to stable/icehouse from:
    d5b74c688f Take an optional rabbit user name as input
    https://review.openstack.org/141156

    Conflicts:
     lib/keystone
     lib/rpc_backend
     lib/trove

    Change-Id: I034f3eda09827451b5437c430049aa2ebfd67b2e
    Closes-Bug: #1343354
    Co-Authored-By: Scott Moser <email address hidden>

tags: added: in-stable-icehouse
Revision history for this message
Saifuddin (saifuddin-rangwala) wrote :

Any plan to merge this to juno?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.