Hello Eric,
set authrec objtype(QMGR) principal('anrtest') authadd(connect, inq)
setmqaut -m QMESBMGMA -n US.GOV.DOD.AF.IL.TEST.ANR.QL -t queue -g mqclient +put +get +browse +inq
set authrec profile('US.GOV.DOD.AF.IL.TEST.ANR.QL') objtype(QUEUE) principal('anrtest') authadd(PUT, GET, INQ, BROWSE)
setmqaut -m QMESBMGMA -n QMESBMGMA.ANR.IN -t channel -g anrtest +chg +dlt +dsp +ctrl +ctrlx
setmqaut -m QMESBMGMA -n QMESBMGMA.ANR.IN -t channel -g mqclient +chg +dlt +dsp +ctrl +ctrlx
You can do all of the commands using either 'set authrec' or 'setmqaut'; you don't need to flip back and forth between the 2 different types of commands. Also, as Francois pointed out, you should use 'group' rather than 'principal' on Unix/Linux.
From the MQ Knowledge Center:
{AIX}{Linux} If you specify the -p (principal) option, IBM® MQ authorization uses groups, instead. This means that if you enter setmqaut -p username ..., the primary group of the specified user is the one that is associated with the authorization being updated.
setmqaut -m QMESBMGMA -n QMESBMGMA.ANR.IN -t channel -g anrtest +chg +dlt +dsp +ctrl +ctrlx
setmqaut -m QMESBMGMA -n QMESBMGMA.ANR.IN -t channel -g mqclient +chg +dlt +dsp +ctrl +ctrlx
Why are you giving administration authorization to those 2 groups for channel 'QMESBMGMA.ANR.IN'? The average MQ application does not need administration authorization to use the channel. It seems very strange to me. You already permitted UserId 'anrtest' to connect to the queue manager with this command:
set authrec objtype(QMGR) principal('anrtest') authadd(connect, inq)
Which begs the question, where is the command to give permission for the group 'mqclient' to connect to the queue manager?
setmqaut -m QMESBMGMA -n QMESBMGMA.ANR.IN -t channel -g mqm +chg +dlt +dsp +ctrl +ctrlx (may not be needed, mqm should have rights)
The 'mqm' account/group has 'god' authority, so that command is pointless.
Finally, after you made any security changes (authentication or authorization), did you issue the 'REFRESH SECURITY' MQSC command or restart the queue manager? MQ caches security objects, so unless you issue the 'refresh security' command, the MQ internals will not know about your changes because it uses the cached information.
later
Roger
------------------------------
Roger Lacroix
CTO
Capitalware Inc.
London Canada
https://capitalware.com------------------------------
Original Message:
Sent: Wed September 25, 2024 11:28 AM
From: Eric Wolfe
Subject: Failed Authorization via user/pass from nifi to our MQ server. Steps included prior to fail.
Thank you for all your help!
I have verified the following values on our prod, test and dev MQs.
CHLAUTH(DISABLED) and CHCKCLNT(REQDADM)
This MQ will be replacing our existing Test MQ, patched to 9.3.0.20 LTS
It looks like in addition to the local user 'mqm' there is also a group 'mqclient' used on all MQs.
All users/customers related to the MQ are members of the 'mqclient' group (not mqm).
Here are the steps I've taken as of this morning, so ignore the steps in the original post:
Create SVRCONN channel and QL using MCAUSER()
========================================
# groupadd anrtest
# groupadd mqclient
# useradd -g anrtest anrtest
# usermod -a -G mqclient anrtest
** set the password for user anrtest
DEFINE CHANNEL('QMESBMGMA.ANR.IN') CHLTYPE(SVRCONN) CERTLABL(' ') COMPHDR(NONE) COMPMSG(NONE) DESCR('Test connection from ANR to QMESBMGMA') DISCINT(0) HBINT(300) KAINT(AUTO) MAXINST(999999999) MAXINSTC(999999999) MAXMSGL(4194304) MCAUSER('anrtest') MONCHL(QMGR) RCVDATA(' ') RCVEXIT(' ') SCYDATA(' ') SCYEXIT(' ') SENDDATA(' ') SENDEXIT(' ') SHARECNV(10) TRPTYPE(TCP) REPLACE
DEFINE QLOCAL('US.GOV.DOD.AF.IL.TEST.ANR.QL') ACCTQ(QMGR) BOQNAME(' ') BOTHRESH(0) CLUSNL(' ') CLUSTER(' ') CLCHNAME(' ') CLWLPRTY(0) CLWLRANK(0) CLWLUSEQ(QMGR) CUSTOM(' ') DEFBIND(OPEN) DEFPRTY(0) DEFPSIST(NO) DEFPRESP(SYNC) DEFREADA(NO) DEFSOPT(SHARED) DESCR('Test queue for ANR') DISTL(NO) GET(ENABLED) HARDENBO IMGRCOVQ(QMGR) INITQ(' ') MAXDEPTH(5000) MAXMSGL(4194304) MAXFSIZE(DEFAULT) MONQ(QMGR) MSGDLVSQ(PRIORITY) NOTRIGGER NPMCLASS(NORMAL) PROCESS(' ') PUT(ENABLED) PROPCTL(V6COMPAT) QDEPTHHI(80) QDEPTHLO(20) QDPHIEV(DISABLED) QDPLOEV(DISABLED) QDPMAXEV(ENABLED) QSVCIEV(NONE) QSVCINT(999999999) RETINTVL(999999999) SCOPE(QMGR) SHARE STATQ(QMGR) STREAMQ(' ') STRMQOS(BESTEF) TRIGDATA(' ') TRIGDPTH(1) TRIGMPRI(0) TRIGTYPE(FIRST) USAGE(NORMAL) REPLACE
set authrec objtype(QMGR) principal('anrtest') authadd(connect, inq)
setmqaut -m QMESBMGMA -n US.GOV.DOD.AF.IL.TEST.ANR.QL -t queue -g mqclient +put +get +browse +inq
set authrec profile('US.GOV.DOD.AF.IL.TEST.ANR.QL') objtype(QUEUE) principal('anrtest') authadd(PUT, GET, INQ, BROWSE)
setmqaut -m QMESBMGMA -n QMESBMGMA.ANR.IN -t channel -g anrtest +chg +dlt +dsp +ctrl +ctrlx
setmqaut -m QMESBMGMA -n QMESBMGMA.ANR.IN -t channel -g mqclient +chg +dlt +dsp +ctrl +ctrlx
setmqaut -m QMESBMGMA -n QMESBMGMA.ANR.IN -t channel -g mqm +chg +dlt +dsp +ctrl +ctrlx (may not be needed, mqm should have rights)
AMQERR01.LOG
=============
09/25/24 14:18:14 - Process(14556.501) User(mqm) Program(amqzlaa0)
Host(xxxxxxxxxxxxx) Installation(Installation1)
VRMF(9.3.0.20) QMgr(QMESBMGMA)
Time(2024-09-25T14:18:14.733Z)
CommentInsert1(anrtest)
CommentInsert2(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)
CommentInsert3(CHCKCLNT(REQDADM))
AMQ5542I: The failed authentication check was caused by the queue manager
CONNAUTH CHCKCLNT(REQDADM) configuration.
EXPLANATION:
The user ID 'anrtest' and its password were checked because the queue manager
connection authority (CONNAUTH) configuration refers to an authentication
information (AUTHINFO) object named 'SYSTEM.DEFAULT.AUTHINFO.IDPWOS' with
CHCKCLNT(REQDADM).
This message accompanies a previous error to clarify the reason for the user ID
and password check.
ACTION:
Refer to the previous error for more information.
Ensure that a password is specified by the client application and that the
password is correct for the user ID. The authentication configuration of the
queue manager connection determines the user ID repository. For example, the
local operating system user database or an LDAP server.
Note that if the authentication configuration specifies an LDAP user
repository, a CHCKCLNT value of REQADM is treated as equivalent to a value of
OPTIONAL.
If the CHCKCLNT setting is OPTIONAL, the authentication check can be avoided by
not passing a user ID across the channel. For example, by omitting the MQCSP
structure from the client MQCONNX API call.
09/25/24 14:18:14 - Process(14556.500) User(mqm) Program(amqzlaa0)
Host(xxxxxxxxxxxxx) Installation(Installation1)
VRMF(9.3.0.20) QMgr(QMESBMGMA)
Time(2024-09-25T14:18:14.739Z)
CommentInsert1(anrtest)
CommentInsert2(org.apache.nifi.NiFi)
CommentInsert3(Pipe returned 2035 [FAILED])
AMQ5534E: User ID 'anrtest' authentication failed
EXPLANATION:
The user ID and password supplied by the 'org.apache.nifi.NiFi' program could
not be authenticated.
Additional information: 'Pipe returned 2035 [FAILED]'.
ACTION:
Ensure that the correct user ID and password are provided by the application.
Ensure that the authentication repository is correctly configured. Look at
previous error messages for any additional information.
----- amqzfuca.c : 4906 -------------------------------------------------------
09/25/24 14:18:14 - Process(14556.500) User(mqm) Program(amqzlaa0)
Host(xxxxxxxxxxxxx) Installation(Installation1)
VRMF(9.3.0.20) QMgr(QMESBMGMA)
Time(2024-09-25T14:18:14.739Z)
CommentInsert1(anrtest)
CommentInsert2(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)
CommentInsert3(CHCKCLNT(REQDADM))
------------------------------
Eric Wolfe
Original Message:
Sent: Tue September 24, 2024 07:39 PM
From: Morag Hughson
Subject: Failed Authorization via user/pass from nifi to our MQ server. Steps included prior to fail.
Hi Eric,
If I could only give you one piece of advice in your journey to learn to manage MQ, it would be to remember the location of the AMQERR01.LOG and to always check whenever you have any issue. It will most certainly give you more information than you currently have about your failure, including everything you need to fix the problem. You have not actually shown us an error message in your earlier thread, just a reason code (2035), but application side errors are often paired with much more information on the queue manager side. Hopefully when you look in your AMQERR01.LOG file for this problem you will see what I mean.
As to some resources to help, take a look at some of these:-
Cheers,
Morag
------------------------------
Morag Hughson
MQ Technical Education Specialist
MQGem Software Limited
Website: https://www.mqgem.com
Original Message:
Sent: Tue September 24, 2024 08:33 AM
From: Eric Wolfe
Subject: Failed Authorization via user/pass from nifi to our MQ server. Steps included prior to fail.
Thank you both for your help. I'm a 20+ year Oracle DBA given the task of managing our MQ's in prod, test and dev and I'm trying to understand everything by looking at what already exists and when tasked to create new users/channels/queues/authorizations I'm trying to compare to existing setups but clearly missing things. Is there a set of steps out there that go from user creation all the way to having the user/channel/queue/authorization commands? I'll check the AMQERR01.LOG but it usually just shows the error message I've already described. I'll update here with more info asap.
------------------------------
Eric Wolfe
Original Message:
Sent: Mon September 23, 2024 03:52 PM
From: Eric Wolfe
Subject: Failed Authorization via user/pass from nifi to our MQ server. Steps included prior to fail.
MQ version 9.3.0.20 LTS, on Linux/Ubuntu
Create the user local to the MQ server:
# groupadd usertest
# useradd -g usertest usertest
** set the password for user usertest
Create the channel:
DEFINE CHANNEL('QMName.customer.IN') CHLTYPE(SVRCONN) CERTLABL(' ') COMPHDR(NONE) COMPMSG(NONE) DESCR('Test connection from nifi customer to QMName') DISCINT(0) HBINT(300) KAINT(AUTO) MAXINST(999999999) MAXINSTC(999999999) MAXMSGL(4194304) MCAUSER('usertest') MONCHL(QMGR) RCVDATA(' ') RCVEXIT(' ') SCYDATA(' ') SCYEXIT(' ') SENDDATA(' ') SENDEXIT(' ') SHARECNV(10) TRPTYPE(TCP) REPLACE
(Using existing Queue Local)
set authrec objtype(QMGR) principal('usertest') authadd(connect, inq)
set authrec profile('LocalQueueName.QL') objtype(QUEUE) principal('usertest') authadd(PUT, GET, INQ, BROWSE)
setmqaut -m ourQM -n QMName.customer.IN -t channel -g usertest +chg +dlt +dsp +ctrl +ctrlx
Part of the error message: "IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED')."
The error also says to verify the username/password which we have verified.
Am I missing something like adding the user 'usertest' to group 'mqm'? I didn't think I needed to do that unless I wanted to grant admin to the 'usertest' which I do not. Any help appreciated.
------------------------------
Eric Wolfe
------------------------------