From 062a3c3e707e69778d2bb95e3e861e7bd65114b7 Mon Sep 17 00:00:00 2001 From: Kenneth Giusti Date: Tue, 30 Sep 2014 10:14:08 -0400 Subject: [PATCH] Configure an authorized user for the QPID broker If QPID_USERNAME is set, add the user to the QPID broker's authentication database. Use the value of QPID_PASSWORD as the password for the user, prompting for a password if QPID_PASSWORD is not set. This requires that all clients provide this username and password when connecting to the QPID broker, or the connection will be rejected. If QPID_USERNAME is not set (the default), disable QPID broker authentication. This allows any client to connect to the QPID broker without needing authentication. Change-Id: Ibd79873379740930ce5f598018c1ca1fffda7c31 Closes-Bug: 1272399 --- files/apts/qpid | 1 + files/rpms/qpid | 1 + lib/rpc_backend | 109 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 82 insertions(+), 29 deletions(-) create mode 100644 files/apts/qpid diff --git a/files/apts/qpid b/files/apts/qpid new file mode 100644 index 0000000000..e3bbf0961c --- /dev/null +++ b/files/apts/qpid @@ -0,0 +1 @@ +sasl2-bin # NOPRIME diff --git a/files/rpms/qpid b/files/rpms/qpid index 62148ba231..9e3f10af13 100644 --- a/files/rpms/qpid +++ b/files/rpms/qpid @@ -1,3 +1,4 @@ qpid-proton-c-devel # NOPRIME python-qpid-proton # NOPRIME +cyrus-sasl-lib # NOPRIME diff --git a/lib/rpc_backend b/lib/rpc_backend index de82fe115e..14c78fbf7b 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -132,39 +132,14 @@ function install_rpc_backend { # Install rabbitmq-server install_package rabbitmq-server elif is_service_enabled qpid; then - local qpid_conf_file=/etc/qpid/qpidd.conf if is_fedora; then install_package qpid-cpp-server - if [[ $DISTRO =~ (rhel6) ]]; then - qpid_conf_file=/etc/qpidd.conf - # RHEL6 leaves "auth=yes" in /etc/qpidd.conf, it needs to - # be no or you get GSS authentication errors as it - # attempts to default to this. - sudo sed -i.bak 's/^auth=yes$/auth=no/' $qpid_conf_file - fi elif is_ubuntu; then install_package qpidd - sudo sed -i '/PLAIN/!s/mech_list: /mech_list: PLAIN /' /etc/sasl2/qpidd.conf - sudo chmod o+r /etc/qpid/qpidd.sasldb else exit_distro_not_supported "qpid installation" fi - # If AMQP 1.0 is specified, ensure that the version of the - # broker can support AMQP 1.0 and configure the queue and - # topic address patterns used by oslo.messaging. - if [ "$RPC_MESSAGING_PROTOCOL" == "AMQP1" ]; then - QPIDD=$(type -p qpidd) - if ! $QPIDD --help | grep -q "queue-patterns"; then - exit_distro_not_supported "qpidd with AMQP 1.0 support" - fi - if ! grep -q "queue-patterns=exclusive" $qpid_conf_file; then - cat <