IBM MQ Connection Authentication
IBM MQ Connection Authentication
Authentication
Morag Hughson
Agenda
Requests for Enhancement
Connection Authentication
Configuration
Application Changes (or not)
Protecting your password across a network
User Repositories
Ne uni
A user repository that knows whether the user ID
m
tw ca t
m
Q1
Authority User
Checks Repository
Ne uni
m
MQRC_NOT_AUTHORIZED (2035)
tw ca t
m
or io
k ns
MQRC_NONE (0)
Configuration – Notes
We’ll start with the basic configuration side of things. How do I turn on this connection
authentication feature on the queue manager.
N On the queue manager object there is a new attribute called CONNAUTH (short for
connection authentication) which points to an object name. The object name it refers to is an
authentication information object – one of two new types. There are two existing types of
authentication information objects from earlier releases of WebSphere MQ, these original two
types cannot be used in the CONNAUTH field.
O The two new types are similar in quite a few of the basic attributes so we will look at those
first. We’ll come back to more of the attributes later. We show here a new authentication
information object which has two fields to turn on user ID and password checking,
CHCKLOCL (Check Local connections) and CHCKCLNT (Check Client connections).
Changes to the configuration of this must be refreshed for the queue manager to pick them
up.
T Both of these fields have the same set of attributes, allowing for a strictness of checking. You
can switch it off entirely with NONE; set it to OPTIONAL to ensure that if a user ID and
password are provided by an application then they must be a valid pair, but that it is not
mandatory to provide them – a useful migration setting perhaps; set it to REQUIRED to
mandate that all applications provide a user ID and password; and, only on Distributed,
E REQDADM which says that privileged users must supply a valid user ID and password, but
non-privileged users are treated as per the OPTIONAL setting.
Any application that does not supply a user ID and password when required to, or supplies an
incorrect combination even when it is optional will be told 2035 (MQRC_NOT_AUTHORIZED).
N.B. When password checking is turned off using NONE – then invalid passwords will not be
detected.
S
MQRC_NOT_AUTHORIZED (2035)
ea un
CHCKCLNT(ASQMGR)
m
r N ica
MQRC_NOT_AUTHORIZED (2035)
et tio
wo ns
rk
User's Digital
Certificate QMgr
Application (User2)
CA Sig
SSL/TLS Network
MQCONNX Communications
User1 + pwd1
MQRC_NONE (0)
Ne uni
m
tw ca t
m
or io
k ns
Authority Records
Application (User2) QMgr
Q1: User1 +put
MQCONNX
User1 + pwd1 Inter process Q1: User2 +none
Communications
MQOPEN
Q1: User3 +get
Q1
Authority Q1: User4 +none
Checks
MCAUSER set on SVRCONN A handy trick to ensure that the client flowed ID is never used
channel definition is to define the MCAUSER as ‘rubbish’ and then anything
that is not set appropriately by one of the next methods
cannot connect.
MCAUSER set by ADOPTCTX(YES) The queue manager wide setting to adopt the password
authenticated user ID as the MCAUSER will over-ride either
of the above.
MCAUSER set by CHLAUTH rule To allow more granular control of MCAUSER setting, rather
than relying on the above queue manager wide setting, you
can of course use CHLAUTH rules
MCAUSER set by Security Exit Although CHLAUTH gets the final say on whether a
connection is blocked (security exit not called in that case),
the security exit does get called with the MCAUSER
CHLAUTH has decided upon, and can change it.
Ne uni
Client side security exit
m
tw ca t
m
or io
Provided
k
WebSphere MQ V8
Acted upon by the queue manager (all platforms)
MQCSP csp = {MQCSP_DEFAULT};
csp.AuthenticationType = MQCSP_AUTH_USER_ID_AND_PWD;
csp.CSPUserIdPtr = "hughson";
csp.CSPUserIdLength = 7; /* Max: MQ_CLIENT_USER_ID_LENGTH */
csp.CSPPasswordPtr = "passw0rd";
csp.CSPPasswordLength = 8; /* Max: MQ_CSP_PASSWORD_LENGTH */
QMgr QM1
Application
Name=QMA
User=user1
Network
password=passw0rd
MQCONN Communications
Exit: mqccred
Exit can be used by
mqccred.ini clients from V7.0.1
AllQueueManagers:
and later (by copying
Tool: runmqccred User=abc from a V8 installation)
OPW=%^&aervrgtsr
QueueManager:
Name=QM1
User=user1
OPW=H&^dbgfh
File
permissions
QMgr QM1
Application
If no SSL/TLS Network
If both ends are V8 MQCONN Communications
MQ Code will protect the password – so not
sent in the clear
If client is < V8
No MQ password protection
Consider SSL/TLS
MQCONNX
User3 + pwd3
Administrator
Error message
MQRC_NOT_AUTHORIZED (2035)
Monitoring Tool
Not Authorized Event message
(Type 1 – Connect)
MQRQ_CONN_NOT_AUTHORIZED (existing)
SYSTEM.ADMIN.QMGR.EVENT Connection not authorized.
MQRQ_CSP_NOT_AUTHORIZED (new)
User ID and password not authorized.
ALTER QMGR AUTHOREV(ENABLED) Additional field to existing connect event
MQCACF_CSP_USER_IDENTIFIER
Missing password
Distributed - AMQ5540: Application 'D:\nttools\q.exe' did not supply a
user ID and password
z/OS MSTR - CSQH045E cpf csect app-identifier did not provide a
password
app-identifier has different contents for locally bound app and client app.
QMgr
Application (User2)
On z/OS passphrases
MQCONNX can be used
User1 + pwd1
O/S User
Repository
(z/OS + Dist)
CA Sig
SSLKEYR
s LDAP Server
rk ion
t wo cat
e i
N un
m
om DISPLAY QMSTATUS
C
LDAPCONN
ALTER QMGR CONNAUTH(USE.LDAP)
SSLFIPS(NO) SUITEB(NONE)
CERTLABL(‘ibmwebspheremqqm1’)
SSLKEYR('var/mqm/qmgrs/QM1/ssl/key')
DEFINE AUTHINFO(USE.LDAP)
AUTHTYPE(IDPWLDAP)
SECCOMM(YES)
CONNAME(‘ldapserver(389)’)
c=UK
objectClass=organization
Application
cn=useradm,ou=users,o=ibm,c=uk
ork
Netw ations
u nic
m
Com
QMgr
Application
LDAP Server
MQCONNX
cn=useradm
MQOPEN Q1
Authority Records
Authority Q1: mqmadm +put
Checks
QMgr
Q1