| Summary: | qpid broker-client authentication mechanism auto-selection is unpredictable (when mechanism is not selected manually) | ||
|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Frantisek Reznicek <freznice> |
| Component: | qpid-cpp | Assignee: | mick <mgoulish> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | MRG Quality Engineering <mrgqe-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 1.3 | CC: | esammons, iboverma, jross, tross |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-03-21 12:26:47 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Frantisek Reznicek
2011-02-07 13:48:28 UTC
From the behavior we can see the broker's authentication mechanisms listed in log file have different order: 2011-02-07 13:19:33 info SASL: Mechanism list: ANONYMOUS LOGIN PLAIN or 2011-02-07 13:20:22 info SASL: Mechanism list: LOGIN PLAIN ANONYMOUS or 2011-02-07 14:24:49 info SASL: Mechanism list: PLAIN ANONYMOUS LOGIN and then (if client supports those three as well) the first matching is used, in our case it would be ANONYMOUS / LOGIN / PLAIN resp. See Additional info section for more details. Expected results (from Comment 1 / Additional info sections) are: if both broker and client supports ANONYMOUS and LOGIN and PLAIN, then PLAIN should be selected automatically (as LOGIN and ANONYMOUS are less secure / weaker authentications). An update: "broker without forcing authentication method on client surely depends on set of authentication mechanisms installed on target machine". This is no longer true. As of 2.3, we have an explicit mech list (bug 846465). In general, we recommend users edit the mech list to exclude less secure mechanisms. Frantisek, what remains to fix here? The order of client mech lists? I retested the testing scenario on last stable packages and testing results prove that defect is fixed.
-> VERIFIED
[root@mrg-qe-10 messaging]# echo guest | saslpasswd2 -c -p -f /var/lib/qpidd/qpidd.sasldb -u QPID guest
[root@mrg-qe-10 messaging]# sasldblistusers2 -f /var/lib/qpidd/qpidd.sasldb
guest@QPID: userPassword
------------------------------------- c++ spout
[root@mrg-qe-10 messaging]# ./spout --connection-options '{username:guest, password:guest, sasl-mechanisms:PLAIN}' "ADDR1; {create:sender}"
[root@mrg-qe-10 messaging]# ./spout --connection-options '{username:guest, password:guest}' "ADDR1; {create:sender}"
[root@mrg-qe-10 messaging]# ./spout "ADDR1; {create:sender}"
[root@mrg-qe-10 messaging]# grep SASL ~qpidd/qpidd.log
2013-03-18 11:24:51 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:24:51 [Security] info SASL: Starting authentication with mechanism: PLAIN
2013-03-18 11:24:51 [Security] info 127.0.0.1:5672-127.0.0.1:51712 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:25:31 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:25:31 [Security] info SASL: Starting authentication with mechanism: DIGEST-MD5
2013-03-18 11:25:31 [Security] debug SASL: sending challenge to client
2013-03-18 11:25:31 [Security] debug SASL: sending challenge to client
2013-03-18 11:25:31 [Security] info 127.0.0.1:5672-127.0.0.1:51713 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:31:59 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:31:59 [Security] info SASL: Starting authentication with mechanism: ANONYMOUS
2013-03-18 11:31:59 [Security] info 127.0.0.1:5672-127.0.0.1:51718 SASL: Authentication succeeded for: anonymous@QPID
------------------------------------- c++ qpid-perftest (shortened)
[root@mrg-qe-10 messaging]# qpid-perftest --count 1 -s
25.1315 8.29734 49.1037 0.0479528
[root@mrg-qe-10 messaging]# qpid-perftest --count 1 -s --username guest --password guest
24.9295 22.5437 48.7552 0.0476125
[root@mrg-qe-10 messaging]# qpid-perftest --count 1 -s --username guest --password guest --mechanism PLAIN
25.1362 8.1947 24.9686 0.0243834
[root@mrg-qe-10 messaging]# grep SASL ~qpidd/qpidd.log
2013-03-18 11:39:19 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:19 [Security] info SASL: Starting authentication with mechanism: ANONYMOUS
2013-03-18 11:39:19 [Security] info [::1]:5672-[::1]:56975 SASL: Authentication succeeded for: anonymous@QPID
2013-03-18 11:39:19 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:19 [Security] info SASL: Starting authentication with mechanism: ANONYMOUS
2013-03-18 11:39:19 [Security] info [::1]:5672-[::1]:56976 SASL: Authentication succeeded for: anonymous@QPID
2013-03-18 11:39:19 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:19 [Security] info SASL: Starting authentication with mechanism: ANONYMOUS
2013-03-18 11:39:19 [Security] info [::1]:5672-[::1]:56977 SASL: Authentication succeeded for: anonymous@QPID
2013-03-18 11:39:19 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:19 [Security] info SASL: Starting authentication with mechanism: ANONYMOUS
2013-03-18 11:39:19 [Security] info [::1]:5672-[::1]:56978 SASL: Authentication succeeded for: anonymous@QPID
2013-03-18 11:39:36 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:36 [Security] info SASL: Starting authentication with mechanism: DIGEST-MD5
2013-03-18 11:39:36 [Security] debug SASL: sending challenge to client
2013-03-18 11:39:36 [Security] debug SASL: sending challenge to client
2013-03-18 11:39:36 [Security] info [::1]:5672-[::1]:56979 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:39:36 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:36 [Security] info SASL: Starting authentication with mechanism: DIGEST-MD5
2013-03-18 11:39:36 [Security] debug SASL: sending challenge to client
2013-03-18 11:39:36 [Security] debug SASL: sending challenge to client
2013-03-18 11:39:36 [Security] info [::1]:5672-[::1]:56980 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:39:36 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:36 [Security] info SASL: Starting authentication with mechanism: DIGEST-MD5
2013-03-18 11:39:36 [Security] debug SASL: sending challenge to client
2013-03-18 11:39:36 [Security] debug SASL: sending challenge to client
2013-03-18 11:39:36 [Security] info [::1]:5672-[::1]:56981 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:39:36 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:36 [Security] info SASL: Starting authentication with mechanism: DIGEST-MD5
2013-03-18 11:39:36 [Security] debug SASL: sending challenge to client
2013-03-18 11:39:36 [Security] debug SASL: sending challenge to client
2013-03-18 11:39:36 [Security] info [::1]:5672-[::1]:56982 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:39:47 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:47 [Security] info SASL: Starting authentication with mechanism: PLAIN
2013-03-18 11:39:47 [Security] info [::1]:5672-[::1]:56983 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:39:47 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:47 [Security] info SASL: Starting authentication with mechanism: PLAIN
2013-03-18 11:39:47 [Security] info [::1]:5672-[::1]:56984 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:39:47 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:47 [Security] info SASL: Starting authentication with mechanism: PLAIN
2013-03-18 11:39:47 [Security] info [::1]:5672-[::1]:56985 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:39:47 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:39:47 [Security] info SASL: Starting authentication with mechanism: PLAIN
2013-03-18 11:39:47 [Security] info [::1]:5672-[::1]:56986 SASL: Authentication succeeded for: guest@QPID
------------------------------------- Python spout
[root@mrg-qe-10 messaging]# diff -u /usr/share/doc/python-qpid-0.18/examples/api/spout /usr/share/doc/python-qpid-0.18/examples/api/spout1
--- /usr/share/doc/python-qpid-0.18/examples/api/spout 2012-07-19 11:54:08.000000000 -0400
+++ /usr/share/doc/python-qpid-0.18/examples/api/spout1 2013-03-18 11:29:38.145095468 -0400
@@ -92,6 +92,9 @@
content = text
conn = Connection(opts.broker,
+ username='guest',
+ password='guest',
+ sasl_mechanisms='PLAIN',
reconnect=opts.reconnect,
reconnect_interval=opts.reconnect_interval,
reconnect_limit=opts.reconnect_limit)
[root@mrg-qe-10 messaging]# diff -u /usr/share/doc/python-qpid-0.18/examples/api/spout /usr/share/doc/python-qpid-0.18/examples/api/spout2
--- /usr/share/doc/python-qpid-0.18/examples/api/spout 2012-07-19 11:54:08.000000000 -0400
+++ /usr/share/doc/python-qpid-0.18/examples/api/spout2 2013-03-18 11:29:03.826560831 -0400
@@ -92,6 +92,8 @@
content = text
conn = Connection(opts.broker,
+ username='guest',
+ password='guest',
reconnect=opts.reconnect,
reconnect_interval=opts.reconnect_interval,
reconnect_limit=opts.reconnect_limit)
[root@mrg-qe-10 messaging]#
[root@mrg-qe-10 messaging]#
[root@mrg-qe-10 messaging]# python /usr/share/doc/python-qpid-0.18/examples/api/spout1 "ADDR2; {create:sender}"
Message(properties={'spout-id': 'a6dc4885-87b1-4750-8af9-aa7e4961b528:0'})
[root@mrg-qe-10 messaging]# python /usr/share/doc/python-qpid-0.18/examples/api/spout2 "ADDR2; {create:sender}"
Message(properties={'spout-id': 'db07b2f1-b261-4787-8bcc-d6dd71d5d468:0'})
[root@mrg-qe-10 messaging]# python /usr/share/doc/python-qpid-0.18/examples/api/spout "ADDR2; {create:sender}"
Message(properties={'spout-id': 'dafc56ae-de1d-43b3-bcf0-2a35420c5731:0'})
[root@mrg-qe-10 messaging]# grep SASL ~qpidd/qpidd.log
2013-03-18 11:30:14 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:30:14 [Security] info SASL: Starting authentication with mechanism: PLAIN
2013-03-18 11:30:14 [Security] info [::1]:5672-[::1]:56967 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:30:32 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:30:32 [Security] info SASL: Starting authentication with mechanism: DIGEST-MD5
2013-03-18 11:30:32 [Security] debug SASL: sending challenge to client
2013-03-18 11:30:32 [Security] debug SASL: sending challenge to client
2013-03-18 11:30:32 [Security] info [::1]:5672-[::1]:56968 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:31:05 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:31:05 [Security] info SASL: Starting authentication with mechanism: ANONYMOUS
2013-03-18 11:31:05 [Security] info [::1]:5672-[::1]:56969 SASL: Authentication succeeded for: anonymous@QPID
------------------------------------- python qpid-config
[root@mrg-qe-10 messaging]# qpid-config
Total Exchanges: 8
topic: 3
headers: 1
fanout: 1
direct: 3
Total Queues: 4
durable: 0
non-durable: 4
[root@mrg-qe-10 messaging]# qpid-config -b guest/guest@localhost:5672
Total Exchanges: 8
topic: 3
headers: 1
fanout: 1
direct: 3
Total Queues: 4
durable: 0
non-durable: 4
[root@mrg-qe-10 messaging]# qpid-config -b guest/guest@localhost:5672 --sasl-mechanism=PLAIN
Total Exchanges: 8
topic: 3
headers: 1
fanout: 1
direct: 3
Total Queues: 4
durable: 0
non-durable: 4
[root@mrg-qe-10 messaging]# grep SASL ~qpidd/qpidd.log
2013-03-18 11:35:35 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:35:35 [Security] info SASL: Starting authentication with mechanism: ANONYMOUS
2013-03-18 11:35:35 [Security] info [::1]:5672-[::1]:56972 SASL: Authentication succeeded for: anonymous@QPID
2013-03-18 11:36:04 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:36:04 [Security] info SASL: Starting authentication with mechanism: DIGEST-MD5
2013-03-18 11:36:04 [Security] debug SASL: sending challenge to client
2013-03-18 11:36:04 [Security] debug SASL: sending challenge to client
2013-03-18 11:36:04 [Security] info [::1]:5672-[::1]:56973 SASL: Authentication succeeded for: guest@QPID
2013-03-18 11:36:29 [Security] info SASL: Mechanism list: ANONYMOUS DIGEST-MD5 PLAIN
2013-03-18 11:36:29 [Security] info SASL: Starting authentication with mechanism: PLAIN
2013-03-18 11:36:29 [Security] info [::1]:5672-[::1]:56974 SASL: Authentication succeeded for: guest@QPID
[root@mrg-qe-10 messaging]#
|