Mq90 Secure
Mq90 Secure
Mq90 Secure
Securing IBM MQ
IBM
Note
Before using this information and the product it supports, read the information in “Notices” on page
583.
This edition applies to version 9 release 0 of IBM® MQ and to all subsequent releases and modifications until otherwise
indicated in new editions.
When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it
believes appropriate without incurring any obligation to you.
© Copyright International Business Machines Corporation 2007, 2023.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
Contents
Securing................................................................................................................5
Security updates.......................................................................................................................................... 5
Security overview......................................................................................................................................... 5
Security concepts and mechanisms...................................................................................................... 5
IBM MQ security mechanisms............................................................................................................. 20
Planning for your security requirements...................................................................................................68
Planning identification and authentication..........................................................................................69
Planning authorization......................................................................................................................... 71
Planning confidentiality........................................................................................................................86
Planning data integrity......................................................................................................................... 94
Planning auditing..................................................................................................................................94
Planning security by topology.............................................................................................................. 95
Firewalls and Internet pass-thru....................................................................................................... 109
IBM MQ for z/OS security implementation checklist........................................................................ 109
Setting up security................................................................................................................................... 112
Setting up security on UNIX, Linux, and Windows............................................................................ 112
Special considerations for security on Windows...............................................................................133
Setting up security on IBM i...............................................................................................................140
Setting up security on z/OS................................................................................................................169
Setting up IBM MQ MQI client security............................................................................................. 247
Setting up communications for SSL or TLS on IBM i......................................................................... 250
Setting up communications for SSL or TLS on UNIX, Linux or Windows.......................................... 250
Setting up communications for SSL or TLS on z/OS..........................................................................251
Working with SSL/TLS........................................................................................................................ 252
Identifying and authenticating users...................................................................................................... 305
Privileged users.................................................................................................................................. 308
Identifying and authenticating users using the MQCSP structure....................................................308
Implementing identification and authentication in security exits....................................................309
Identity mapping in message exits....................................................................................................310
Identity mapping in the API exit and API-crossing exit....................................................................310
Working with revoked certificates..................................................................................................... 311
Using the Pluggable Authentication Method (PAM).......................................................................... 322
Authorizing access to objects..................................................................................................................323
Controlling access to objects by using the OAM on UNIX, Linux, and Windows.............................. 323
Granting required access to resources..............................................................................................333
Authority to administer IBM MQ on UNIX, Linux, and Windows.......................................................373
Authority to work with IBM MQ objects on UNIX, Linux, and Windows........................................... 375
Implementing access control in security exits..................................................................................380
Implementing access control in message exits................................................................................ 381
Implementing access control in the API exit and API-crossing exit................................................ 382
LDAP authorization.................................................................................................................................. 382
Setting authorizations........................................................................................................................ 383
Displaying authorizations...................................................................................................................385
Other considerations when using LDAP authorization......................................................................386
Switching between OS and LDAP authorization models...................................................................387
LDAP administration.......................................................................................................................... 387
Confidentiality of messages.................................................................................................................... 389
Enabling CipherSpecs........................................................................................................................ 389
Resetting SSL and TLS secret keys.................................................................................................... 408
Implementing confidentiality in user exit programs.........................................................................410
Data integrity of messages...................................................................................................................... 411
Auditing.................................................................................................................................................... 412
iii
Keeping clusters secure.......................................................................................................................... 412
Stopping unauthorized queue managers sending messages........................................................... 412
Stopping unauthorized queue managers putting messages on your queues.................................. 413
Authorizing putting messages on remote cluster queues................................................................ 414
Preventing queue managers joining a cluster................................................................................... 415
Forcing unwanted queue managers to leave a cluster..................................................................... 416
Preventing queue managers receiving messages............................................................................. 416
SSL/TLS and clusters......................................................................................................................... 417
Publish/subscribe security...................................................................................................................... 419
Example publish/subscribe security setup....................................................................................... 427
Subscription security......................................................................................................................... 439
Publish/subscribe security between queue managers.....................................................................441
IBM MQ Console and REST API security.................................................................................................444
Configuring users and roles............................................................................................................... 445
Using client certificate authentication with the REST API and IBM MQ Console............................ 450
Using HTTP basic authentication with the REST API........................................................................454
Using token-based authentication with the REST API......................................................................456
Configuring CORS for the REST API................................................................................................... 460
Auditing.............................................................................................................................................. 462
Security considerations for the IBM MQ Console and REST API on z/OS ....................................... 462
Configuring MFT REST API security...................................................................................................470
Managing keys and certificates on UNIX, Linux, and Windows..............................................................471
runmqckm, and runmqakm commands............................................................................................ 472
runmqckm and runmqakm options................................................................................................... 481
runmqakm error codes...................................................................................................................... 484
Protection of database authentication details........................................................................................491
Securing AMQP clients............................................................................................................................ 492
Restricting AMQP client takeover...................................................................................................... 494
Configuring JAAS for AMQP channels............................................................................................... 495
Advanced Message Security....................................................................................................................497
AMS overview..................................................................................................................................... 497
Installing Advanced Message Security..............................................................................................524
Auditing on z/OS.................................................................................................................................524
Using keystores and certificates........................................................................................................526
Administering Advanced Message Security security polices............................................................550
Problems and solutions..................................................................................................................... 571
Example configurations on z/OS........................................................................................................572
Notices..............................................................................................................583
Programming interface information........................................................................................................ 584
Trademarks.............................................................................................................................................. 584
iv
Securing IBM MQ
Security is an important consideration for both developers of IBM MQ applications, and for IBM MQ
system administrators.
Security updates
Ensure that all hardware and software inside the secure zone and on operator workstations are within
their support lifecycle, have been upgraded with mandatory software updates and have had security
updates promptly applied.
You can find further information about security updates for:
• All platforms at IBM Security Bulletins
• Security and system integrity APARs on z/OS® at the IBM Z System Integrity portal.
Security overview
This collection of topics introduces the IBM MQ security concepts.
Security concepts and mechanisms, as they apply to any computer system, are presented first, followed
by a discussion of those security mechanisms as they are implemented in IBM MQ.
Non-repudiation
The non-repudiation service can be viewed as an extension to the identification and authentication
service. In general, non-repudiation applies when data is transmitted electronically; for example, an order
to a stock broker to buy or sell stock, or an order to a bank to transfer funds from one account to another.
The overall goal of the non-repudiation service is to be able to prove that a particular message is
associated with a particular individual.
The non-repudiation service can contain more than one component, where each component provides a
different function. If the sender of a message ever denies sending it, the non-repudiation service with
proof of origin can provide the receiver with undeniable evidence that the message was sent by that
particular individual. If the receiver of a message ever denies receiving it, the non-repudiation service with
proof of delivery can provide the sender with undeniable evidence that the message was received by that
particular individual.
In practice, proof with virtually 100% certainty, or undeniable evidence, is a difficult goal. In the real
world, nothing is fully secure. Managing security is more concerned with managing risk to a level that is
acceptable to the business. In such an environment, a more realistic expectation of the non-repudiation
service is to be able to provide evidence that is admissible, and supports your case, in a court of law.
Non-repudiation is a relevant security service in an IBM MQ environment because IBM MQ is a means
of transmitting data electronically. For example, you might require contemporaneous evidence that a
particular message was sent or received by an application associated with a particular individual.
IBM MQ with Advanced Message Security does not provide a non-repudiation service as part of its base
function. However, this product documentation does contain suggestions on how you might provide your
own non-repudiation service within an IBM MQ environment by writing your own exit programs.
Related concepts
“Identification and authentication in IBM MQ” on page 20
In IBM MQ, you can implement identification and authentication using message context information and
mutual authentication.
Authorization
Authorization protects critical resources in a system by limiting access only to authorized users and their
applications. It prevents the unauthorized use of a resource or the use of a resource in an unauthorized
manner.
Related concepts
“Authorization in IBM MQ” on page 21
You can use authorization to limit what particular individuals or applications can do in your IBM MQ
environment.
Auditing
Auditing is the process of recording and checking events to detect whether any unexpected or
unauthorized activity has taken place, or whether any attempt has been made to perform such activity.
For more information on how you set up authorization, see “Planning authorization” on page 71 and the
associated sub-topics.
6 Securing IBM MQ
Related concepts
“Auditing in IBM MQ” on page 21
IBM MQ can issue event messages to record that unusual activity has taken place.
Confidentiality
The confidentiality service protects sensitive information from unauthorized disclosure.
When sensitive data is stored locally, access control mechanisms might be sufficient to protect it on the
assumption that the data cannot be read if it cannot be accessed. If a greater level of security is required,
the data can be encrypted.
Encrypt sensitive data when it is transmitted over a communications network, especially over an insecure
network such as the Internet. In a networking environment, access control mechanisms are not effective
against attempts to intercept the data, such as wiretapping.
Data integrity
The data integrity service detects whether there has been unauthorized modification of data.
There are two ways in which data might be altered: accidentally, through hardware and transmission
errors, or because of a deliberate attack. Many hardware products and transmission protocols have
mechanisms to detect and correct hardware and transmission errors. The purpose of the data integrity
service is to detect a deliberate attack.
The data integrity service aims only to detect whether data has been modified. It does not aim to restore
data to its original state if it has been modified.
Access control mechanisms can contribute to data integrity insofar as data cannot be modified if access
is denied. But, as with confidentiality, access control mechanisms are not effective in a networking
environment.
Cryptographic concepts
This collection of topics describes the concepts of cryptography applicable to IBM MQ.
The term entity is used to refer to a queue manager, an IBM MQ MQI client, an individual user, or any other
system capable of exchanging messages.
Related concepts
“Cryptography in IBM MQ” on page 22
IBM MQ provides cryptography by using the Transport Security Layer (TLS) protocol.
Cryptography
Cryptography is the process of converting between readable text, called plaintext, and an unreadable
form, called ciphertext.
This occurs as follows:
1. The sender converts the plaintext message to ciphertext. This part of the process is called encryption
(sometimes encipherment ).
2. The ciphertext is transmitted to the receiver.
3. The receiver converts the ciphertext message back to its plaintext form. This part of the process is
called decryption (sometimes decipherment ).
The conversion involves a sequence of mathematical operations that change the appearance of the
message during transmission but do not affect the content. Cryptographic techniques can ensure
confidentiality and protect messages against unauthorized viewing (eavesdropping), because an
encrypted message is not understandable. Digital signatures, which provide an assurance of message
integrity, use encryption techniques. See “Digital signatures in SSL/TLS” on page 18 for more
information.
Figure 2 on page 8 shows plaintext encrypted with the receiver's public key and decrypted with the
receiver's private key. Only the intended receiver holds the private key for decrypting the ciphertext.
Note that the sender can also encrypt messages with a private key, which allows anyone that holds the
sender's public key to decrypt the message, with the assurance that the message must have come from
the sender.
With asymmetric algorithms, messages are encrypted with either the public or the private key but can be
decrypted only with the other key. Only the private key is secret, the public key can be known by anyone.
With symmetric algorithms, the shared key must be known only to the two parties. This is called the
key distribution problem. Asymmetric algorithms are slower but have the advantage that there is no key
distribution problem.
Other terminology associated with cryptography is:
8 Securing IBM MQ
Strength
The strength of encryption is determined by the key size. Asymmetric algorithms require large keys,
for example:
Symmetric keys are smaller: 256 bit keys give you strong encryption.
Block cipher algorithm
These algorithms encrypt data by blocks. For example, the RC2 algorithm from RSA Data Security Inc.
uses blocks 8 bytes long. Block algorithms are typically slower than stream algorithms.
Stream cipher algorithm
These algorithms operate on each byte of data. Stream algorithms are typically faster than block
algorithms.
Digital certificates
Digital certificates protect against impersonation, certifying that a public key belongs to a specified entity.
They are issued by a Certificate Authority.
Digital certificates provide protection against impersonation, because a digital certificate binds a public
key to its owner, whether that owner is an individual, a queue manager, or some other entity. Digital
certificates are also known as public key certificates, because they give you assurances about the
ownership of a public key when you use an asymmetric key scheme. A digital certificate contains the
public key for an entity and is a statement that the public key belongs to that entity:
• When the certificate is for an individual entity, the certificate is called a personal certificate or user
certificate.
• When the certificate is for a Certificate Authority, the certificate is called a CA certificate or signer
certificate.
10 Securing IBM MQ
For more information about certificate validation policies in IBM MQ, see “Certificate validation policies in
IBM MQ” on page 40.
Certificate Authorities
A Certificate Authority (CA) is a trusted third party that issues digital certificates to provide you with an
assurance that the public key of an entity truly belongs to that entity.
The roles of a CA are:
• On receiving a request for a digital certificate, to verify the identity of the requestor before building,
signing and returning the personal certificate
• To provide the CA's own public key in its CA certificate
• To publish lists of certificates that are no longer trusted in a Certificate Revocation List (CRL). For more
information, see “Working with revoked certificates” on page 311
• To provide access to certificate revocation status by operating an OCSP responder server
Distinguished Names
The Distinguished Name (DN) uniquely identifies an entity in an X.509 certificate.
Attention: Only the attributes in the following table can be used in an SSLPEER filter. Certificate
DNs can contain other attributes, but filtering is not allowed on these attributes.
Table 1. Attribute types found in the DN that can be used in an SSLPEER filter
Attribute type Description
SERIALNUMBER Certificate serial number
MAIL Email address
E Email address (Deprecated in preference to MAIL)
UID or USERID User identifier
CN Common Name
T Title
OU Organizational Unit name
DC Domain component
O Organization name
STREET Street / First line of address
L Locality name
ST (or SP or S) State or Province name
PC Postal code / zip code
C Country
UNSTRUCTUREDNAME Host name
UNSTRUCTUREDADDRESS IP address
DNQ Distinguished name qualifier
The X.509 standard defines other attributes that do not typically form part of the DN but can provide
optional extensions to the digital certificate.
The X.509 standard provides for a DN to be specified in a string format. For example:
• RACF® on z/OS.
The information contains your Distinguished Name and your public key. When your certificate
management tool generates your certificate request, it also generates your private key, which you must
keep secure. Never distribute your private key.
When the CA receives your request, the authority verifies your identity before building the certificate and
returning it to you as a personal certificate.
Figure 3 on page 12 illustrates the process of obtaining a digital certificate from a CA.
In the diagram:
• User identification includes your Subject Distinguished Name.
• Certification Authority identification includes the Distinguished Name of the CA that is issuing the
certificate.
Digital certificates contain additional fields other than those shown in the diagram. For more information
about the other fields in a digital certificate, see “What is in a digital certificate” on page 10.
12 Securing IBM MQ
signed by the entity identified by the next certificate in the chain. The chain terminates with a root CA
certificate. The root CA certificate is always signed by the certificate authority (CA) itself. The signatures of
all certificates in the chain must be verified until the root CA certificate is reached.
Figure 4 on page 13 illustrates a certification path from the certificate owner to the root CA, where the
chain of trust begins.
Each certificate can contain one or more extensions. A certificate belonging to a CA typically contains a
BasicConstraints extension with the isCA flag set to indicate that it is allowed to sign other certificates.
14 Securing IBM MQ
• Select cryptographic algorithms.
• Authenticate each other by exchanging and validating digital certificates.
• Use asymmetric encryption techniques to generate a shared secret key, which avoids the key
distribution problem. TLS then uses the shared key for the symmetric encryption of messages, which is
faster than asymmetric encryption.
For more information about cryptographic algorithms and digital certificates, refer to the related
information.
In overview, the steps involved in the TLS handshake are as follows:
1. The TLS client sends a "client hello" message that lists cryptographic information such as the TLS
version and, in the client's order of preference, the CipherSuites supported by the client. The message
also contains a random byte string that is used in subsequent computations. The protocol allows for
the "client hello" to include the data compression methods supported by the client.
2. The TLS server responds with a "server hello" message that contains the CipherSuite chosen by the
server from the list provided by the client, the session ID, and another random byte string. The server
also sends its digital certificate. If the server requires a digital certificate for client authentication, the
server sends a "client certificate request" that includes a list of the types of certificates supported and
the Distinguished Names of acceptable Certification Authorities (CAs).
3. The TLS client verifies the server's digital certificate. For more information, see “How TLS provides
identification, authentication, confidentiality, and integrity” on page 16.
4. The TLS client sends the random byte string that enables both the client and the server to compute
the secret key to be used for encrypting subsequent message data. The random byte string itself is
encrypted with the server's public key.
5. If the TLS server sent a "client certificate request", the client sends a random byte string encrypted
with the client's private key, together with the client's digital certificate, or a "no digital certificate
alert". This alert is only a warning, but with some implementations the handshake fails if client
authentication is mandatory.
6. The TLS server verifies the client's certificate. For more information, see “How TLS provides
identification, authentication, confidentiality, and integrity” on page 16.
7. The TLS client sends the server a "finished" message, which is encrypted with the secret key,
indicating that the client part of the handshake is complete.
8. The TLS server sends the client a "finished" message, which is encrypted with the secret key,
indicating that the server part of the handshake is complete.
9. For the duration of the TLS session, the server and client can now exchange messages that are
symmetrically encrypted with the shared secret key.
Figure 5 on page 16 illustrates the TLS handshake.
16 Securing IBM MQ
information. The certificates required are as follows, where CA X issues the certificate to the TLS client,
and CA Y issues the certificate to the TLS server:
For server authentication only, the TLS server needs:
• The personal certificate issued to the server by CA Y
• The server's private key
and the TLS client needs:
• The CA certificate for CA Y
If the TLS server requires client authentication, the server verifies the client's identity by verifying the
client's digital certificate with the public key for the CA that issued the personal certificate to the client, in
this case CA X. For both server and client authentication, the server needs:
• The personal certificate issued to the server by CA Y
• The server's private key
• The CA certificate for CA X
and the client needs:
• The personal certificate issued to the client by CA X
• The client's private key
• The CA certificate for CA Y
Both the TLS server and client might need other CA certificates to form a certificate chain to the root CA
certificate. For more information about certificate chains, refer to the related information.
18 Securing IBM MQ
entity, the two signatures differ, but both signatures can be verified with the same public key, that is, the
public key of the entity that signed the messages.
The steps of the digital signature process are as follows:
1. The sender computes a message digest and then encrypts the digest using the sender's private key,
forming the digital signature.
2. The sender transmits the digital signature with the message.
3. The receiver decrypts the digital signature using the sender's public key, regenerating the sender's
message digest.
4. The receiver computes a message digest from the message data received and verifies that the two
digests are the same.
Figure 6 on page 19 illustrates this process.
20 Securing IBM MQ
The context information in a message allows the receiving application to find out about the originator of
the message. It contains, for example, the name of the application that put the message and the user ID
associated with the application.
• When a message channel starts, it is possible for the message channel agent (MCA) at each end of the
channel to authenticate its partner. This technique is known as mutual authentication. For the sending
MCA, it provides assurance that the partner it is about to send messages to is genuine. For the receiving
MCA, there is a similar assurance that it is about to receive messages from a genuine partner.
Related concepts
“Identification and authentication” on page 6
Identification is the ability to identify uniquely a user of a system or an application that is running in the
system. Authentication is the ability to prove that a user or application is genuinely who that person or
what that application claims to be.
Authorization in IBM MQ
You can use authorization to limit what particular individuals or applications can do in your IBM MQ
environment.
Here are some examples of authorization in an IBM MQ environment:
• Allowing only an authorized administrator to issue commands to manage IBM MQ resources.
• Allowing an application to connect to a queue manager only if the user ID associated with the
application is authorized to do so.
• Allowing an application to open only those queues that are necessary for its function.
• Allowing an application to subscribe only to those topics that are necessary for its function.
• Allowing an application to perform only those operations on a queue that are necessary for its function.
For example, an application might need only to browse messages on a particular queue, and not to put
or get messages.
For more information on how you set up authorization, see “Planning authorization” on page 71 and the
associated sub-topics.
Related concepts
“Authorization” on page 6
Authorization protects critical resources in a system by limiting access only to authorized users and their
applications. It prevents the unauthorized use of a resource or the use of a resource in an unauthorized
manner.
Auditing in IBM MQ
IBM MQ can issue event messages to record that unusual activity has taken place.
Here are some examples of auditing in an IBM MQ environment:
• An application attempts to open a queue that it is not authorized to open. An instrumentation event
message is issued. By inspecting the event message, you discover that this attempt occurred and can
decide what action is necessary.
• An application attempts to open a channel, but the attempt fails because SSL does not allow the
connection. An instrumentation event message is issued. By inspecting the event message, you discover
that this attempt occurred and can decide what action is necessary.
Related concepts
“Auditing” on page 6
Confidentiality in IBM MQ
You can implement confidentiality in IBM MQ by encrypting messages.
Confidentiality can be ensured in an IBM MQ environment as follows:
• After a sending MCA gets a message from a transmission queue, IBM MQ uses TLS to encrypt the
message before it is sent over the network to the receiving MCA. At the other end of the channel, the
message is decrypted before the receiving MCA puts it on its destination queue.
• While messages are stored on a local queue, the access control mechanisms provided by IBM MQ
might be considered sufficient to protect their contents against unauthorized disclosure. However, for a
greater level of security, you can use Advanced Message Security to encrypt the messages stored in the
queues.
Related concepts
“Confidentiality” on page 7
The confidentiality service protects sensitive information from unauthorized disclosure.
Cryptography in IBM MQ
IBM MQ provides cryptography by using the Transport Security Layer (TLS) protocol.
For more information see “TLS security protocols in IBM MQ ” on page 23.
Related concepts
“Cryptographic concepts” on page 7
22 Securing IBM MQ
This collection of topics describes the concepts of cryptography applicable to IBM MQ.
IBM MQ provides support for TLS 1.0 and TLS 1.2 according to the platform you are using. For more
information about the TLS protocol, refer to the information in the subtopics.
IBM i
TLS support is integral to the IBM i operating system.
Java and JMS clients
These clients use the JVM to provide TLS support.
UNIX, Linux, and Windows systems
TLS support is installed with IBM MQ.
z/OS
TLS support is integral to the z/OS operating system. The TLS support on z/OS is known as System
SSL.
For information about any prerequisites for IBM MQ TLS support, see System Requirements for IBM MQ.
Related concepts
“Cryptographic security protocols: TLS” on page 14
• On z/OS: keyring
For more information, see “Digital certificates” on page 9 and “Transport Layer Security (TLS) concepts”
on page 14.
A mutually authenticated TLS connection requires a key repository at each end of the connection. The key
repository can contain the following certificates and requests:
• A number of CA certificates from various Certification Authorities that allow the queue manager or client
to verify certificates that it receives from its partner at the remote end of the connection. Individual
certificates might be in a certificate chain.
• One or more personal certificates received from a Certification Authority. You associate a separate
personal certificate with each queue manager or IBM MQ MQI client. Personal certificates are essential
on a TLS client if mutual authentication is required. If mutual authentication is not required, personal
certificates are not needed on the client. The key repository might also contain the private key
corresponding to each personal certificate.
• Certificate requests which are waiting to be signed by a trusted CA certificate.
For more information about protecting your key repository, see “Protecting IBM MQ key repositories” on
page 25.
The location of the key repository depends on the platform you are using:
IBM i
The key repository is a certificate store. The default system certificate store is located at /QIBM/
UserData/ICSS/Cert/Server/Default in the integrated file system (IFS). IBM MQ stores the
password for the certificate store in a password stash file. For example, the stash file for queue
manager QM1 is /QIBM/UserData/mqm/qmgrs/QM1/ssl/Stash.sth.
Alternatively, you can specify that the IBM i system certificate store is to be used instead. To do this
change the value of the queue manager SSLKEYR attribute to *SYSTEM. This value indicates that the
queue manager must use the system certificate store, and the queue manager is registered for use as
an application with Digital Certificate Manager (DCM).
The certificate store also contains the private key for the queue manager.
24 Securing IBM MQ
directory and have the same file stem as the key database, and must end with the suffix .sth, for
example /var/mqm/qmgrs/QM1/ssl/key.sth
Note: PKCS #11 cryptographic hardware cards can contain the certificates and keys that are
otherwise held in a key database file. When certificates and keys are held on PKCS #11 cards, IBM MQ
still requires access to both a key database file and a password stash file.
On UNIX and Windows systems, the key database also contains the private key for the personal
certificate associated with the queue manager or IBM MQ MQI client.
z/OS
Certificates are held in a keyring in z/OS.
Other external security managers (ESMs) also use keyrings for storing certificates.
Private keys are managed by RACF.
26 Securing IBM MQ
Multiplatforms systems
z/OS systems
IBM MQ Clients are not supported on z/OS. However, a z/OS queue manager can act in the role of a TLS
client when initiating a connection, or a TLS server when accepting a connection request. Certificate label
requirements for z/OS queue managers apply in both of these roles, and differ from the requirements on
Multiplatforms.
For queue managers and clients respectively, the following sources are searched in sequence for a
non-empty value. The first non-empty value determines the certificate label. The certificate label must
exist in the key repository. If no matching certificate in the correct case and format is found that matches
a label, an error occurs and the TLS handshake fails.
1. Channel certificate label attribute, CERTLABL.
2. If shared, the queue sharing group certificate label attribute, CERTQSGL.
If not shared, the queue manager certificate label attribute, CERTLABL.
3. A default, which is in the format: ibmWebSphereMQ with the name of the queue manager or queue
sharing group appended. Note that this string is case-sensitive and must be written as shown. For
example, for a queue manager named QM1, the default certificate label is ibmWebSphereMQQM1.
4. If there is not a certificate found with the format in option “3” on page 27, IBM MQ attempts to use the
certificate marked as default in the key ring.
For information on how to display the key repository, see “Locating the key repository for a queue
manager on z/OS” on page 296.
Refreshing a client's view of the SSL/TLS key repository contents and SSl/TLS settings
To update the client application with the refreshed contents of the key repository, you must stop and
restart the client application.
You cannot refresh security on an IBM MQ client; there is no equivalent of the REFRESH SECURITY
TYPE(SSL) command for clients (see REFRESH SECURITY ) for more information.
You must stop and restart the application, whenever you change the security certificate, to update the
client application with the refreshed contents of the key repository.
If restarting the channel refreshes the configurations, and if your application has reconnection logic, it is
possible for you to refresh security at the client by issuing the STOP CHL STATUS(INACTIVE) command.
Related concepts
“Refreshing the queue manager's key repository” on page 28
When you change the contents of a key repository, the queue manager does not immediately pick up the
new contents. For a queue manager to use the new key repository contents, you must issue the REFRESH
SECURITY TYPE(SSL) command.
28 Securing IBM MQ
If you are concerned precisely what encryption is being used, and how much protection it offers, you need
to use full TLS encryption. In this situation, the algorithms are publicly known, and you can select the
appropriate one for your enterprise by using the SSLCIPH channel attribute.
For more information about the MQCSP structure, see MQCSP structure.
Password protection is used when all of the following conditions are met:
• Both ends of the connection are using IBM MQ 8.0, or later.
• The channel is not using TLS encryption. A channel is not using TLS encryption if the channel has
a blank SSLCIPH attribute, or the SSLCIPH attribute is set to a CipherSpec that does not provide
encryption. Null ciphers, for example, NULL_SHA, do not provide encryption.
• You set MQCSP.AuthenticationType to MQCSP_AUTH_USER_ID_AND_PWD. Setting this value
enables more checks to be evaluated to decide whether password protection is done. The default
value of MQCSP.AuthenticationType is MQCSP_AUTH_NONE. With the default setting, no password
protection is done. For more information, see AuthenticationType.
• If the client is IBM MQ Explorer and user identification compatibility mode is not enabled, which is not
the default. This condition is applicable only to IBM MQ Explorer.
If these conditions are not met, the password is sent in plain text unless prohibited by the
PasswordProtection configuration setting.
30 Securing IBM MQ
For important information about DCM, see the following IBM Redbooks® publications:
• IBM i Wired Network Security: OS/400 V5R1 DCM and Cryptographic Enhancements, SG24-6168.
Specifically, see the appendixes for essential information about setting up your IBM i system as a local
CA.
• AS/400 Internet Security: Developing a Digital Certificate Infrastructure, SG24-5659. Specifically, see
Chapter 5. Digital Certificate Manager for AS/400 , which explains the AS/400 DCM.
The FIPS 140-2 compliance of an IBM MQ TLS connection on z/OS is found here “Federal
Information Processing Standards (FIPS) for z/OS” on page 34.
If cryptographic hardware is present, the cryptographic modules used by IBM MQ can be configured to be
those provided by the hardware manufacturer. If this is done, the configuration is only FIPS-compliant if
those cryptographic modules are FIPS-certified.
Over time, the Federal Information Processing Standards are updated to reflect new attacks against
encryption algorithms and protocols. For example, some CipherSpecs may cease to be FIPS certified.
When such changes occur, IBM MQ is also updated to implement the latest standard. As a result, you
might see changes in behavior after applying maintenance.
Related concepts
“Specifying that only FIPS-certified CipherSpecs are used at run time on the MQI client” on page 248
Create your key repositories using FIPS-compliant software, then specify that the channel must use
FIPS-certified CipherSpecs.
“Using runmqckm, runmqakm, and strmqikm to manage digital certificates” on page 263
On UNIX, Linux, and Windows systems, manage keys and digital certificates with the strmqikm
(iKeyman) GUI, or from the command line using runmqckm (iKeycmd) or runmqakm (GSKCapiCmd).
Related tasks
Enabling TLS in IBM MQ classes for Java
Using Transport Layer Security (TLS) with IBM MQ classes for JMS
Related reference
TLS properties of JMS objects
“Federal Information Processing Standards” on page 19
The US government produces technical advice on IT systems and security, including data encryption.
The National Institute for Standards and Technology (NIST) is an important body concerned with IT
systems and security. NIST produces recommendations and standards, including the Federal Information
Processing Standards (FIPS).
Federal Information Processing Standards (FIPS) for UNIX, Linux, and Windows
When cryptography is required on an SSL/TLS channel on Windows, UNIX and Linux systems, IBM MQ
uses a cryptography package called IBM Crypto for C (ICC). On the Windows, UNIX and Linux platforms,
the ICC software has passed the Federal Information Processing Standards (FIPS) Cryptomodule
Validation Program of the US National Institute of Standards and Technology, at level 140-2.
32 Securing IBM MQ
– All key repositories have been created and manipulated using only FIPS-compliant software, such as
runmqakm with the -fips option.
All supported platforms are FIPS 140-2 certified except as noted in the readme file included with each fix
pack or refresh pack.
For TLS connections using GSKit, the component which is FIPS 140-2 certified is named ICC. It is the
version of this component which determines GSKit FIPS compliance on any given platform. To determine
the ICC version currently installed, run the dspmqver -p 64 -v command.
Here is an example extract of the dspmqver -p 64 -v output relating to ICC:
ICC
============
@(#)CompanyName: IBM Corporation
@(#)LegalTrademarks: IBM
@(#)FileDescription: IBM Crypto for C-language
@(#)FileVersion: 8.0.0.0
@(#)LegalCopyright: Licensed Materials - Property of IBM
@(#) ICC
@(#) (C) Copyright IBM Corp. 2002, 2023.
@(#) All Rights Reserved. US Government Users
@(#) Restricted Rights - Use, duplication or disclosure
@(#) restricted by GSA ADP Schedule Contract with IBM Corp.
@(#)ProductName: icc_8.0 (GoldCoast Build) 100415
@(#)ProductVersion: 8.0.0.0
@(#)ProductInfo: 10/04/15.03:32:19.10/04/15.18:41:51
@(#)CMVCInfo:
The NIST certification statement for GSKit ICC 8 (included in GSKit 8) can be found at the following
address: Cryptographic Module Validation Program.
If cryptographic hardware is present, the cryptographic modules used by IBM MQ can be configured to be
those provided by the hardware manufacturer. If this is done, the configuration is only FIPS-compliant if
those cryptographic modules are FIPS-certified.
Note: 32 bit Solaris x86 SSL and TLS clients configured for FIPS 140-2 compliant operation fail when
running on Intel systems. This failure occurs because the FIPS 140-2 compliant GSKit-Crypto Solaris x86
32-bit library file does not load on the Intel chipset. On affected systems, error AMQ9655 is reported
in the client error log. To resolve this issue, disable FIPS 140-2 compliance or recompile the client
application 64-bit, because 64-bit code is not affected.
Triple DES restrictions enforced when operating in compliance with FIPS 140-2
When IBM MQ is configured to operate in compliance with FIPS 140-2, additional restrictions are
enforced in relation to Triple DES (3DES) CipherSpecs. These restrictions enable compliance with the
US NIST SP800-67 recommendation.
1. All parts of the Triple DES key must be unique.
2. No part of the Triple DES key can be a Weak, Semi-Weak, or Possibly-Weak key according to the
definitions in NIST SP800-67.
3. No more than 32 GB of data can be transmitted over the connection before a secret key reset must
occur. By default, IBM MQ does not reset the secret session key so this reset must be configured.
Failure to enable secret key reset when using a Triple DES CipherSpec and FIPS 140-2 compliance
results in the connection closing with error AMQ9288 after the maximum byte count is exceeded. For
information about how to configure secret key reset, see “Resetting SSL and TLS secret keys” on page
408.
IBM MQ generates Triple DES session keys which already comply with rules 1 and 2. However, to satisfy
the third restriction you must enable secret key reset when using Triple DES CipherSpecs in a FIPS 140-2
configuration. Alternatively, you can avoid using Triple DES.
Related concepts
“Specifying that only FIPS-certified CipherSpecs are used at run time on the MQI client” on page 248
Table 2. Differences between FIPS mode and non-FIPS mode algorithm support.
Non-FIPS FIPS
Algorithm Key sizes Hardware Key sizes Hardware
RC2 40 and 128
RC4 40 and 128
DES 56 x
TDES 168 x 168 x
AES 128 and 256 x 128 and 256 x
MD5 48
SHA-1 160 x 160 x
SHA-2 224, 256, 384 and x 224, 256, 384 and x
512 512
RSA 512-4096 x 1024-4096 x
DSA 512-1024 1024
34 Securing IBM MQ
Table 2. Differences between FIPS mode and non-FIPS mode algorithm support. (continued)
Non-FIPS FIPS
Algorithm Key sizes Hardware Key sizes Hardware
DH 512-2048 2048
In FIPS mode, System SSL can only use certificates that use the algorithms and key sizes shown in Table
1. During X.509 certificate validation if an algorithm that is incompatible with FIPS mode is encountered,
then the certificate cannot be used and is treated as not valid.
For IBM MQ classes applications using client mode within WebSphere® Application Server , refer to
Federal Information Processing Standard support.
For information on System SSL module configuration, see System SSL Module Verification Setup.
Related reference
“Federal Information Processing Standards” on page 19
The US government produces technical advice on IT systems and security, including data encryption.
The National Institute for Standards and Technology (NIST) is an important body concerned with IT
systems and security. NIST produces recommendations and standards, including the Federal Information
Processing Standards (FIPS).
36 Securing IBM MQ
Related concepts
“CipherSpecs and CipherSuites” on page 18
Cryptographic security protocols must agree on the algorithms used by a secure connection. CipherSpecs
and CipherSuites define specific combinations of algorithms.
Table 3. Suite B security levels with allowed CipherSpecs and digital signature algorithms
Allowed digital signature
Security level Allowed CipherSpecs algorithms
128-bit ECDHE_ECDSA_AES_128_GCM_SHA256 ECDSA with SHA-256
ECDHE_ECDSA_AES_256_GCM_SHA384 ECDSA with SHA-384
1. It is possible to configure both the 128-bit and 192-bit security levels concurrently. Since the Suite B
configuration determines the minimum acceptable cryptographic algorithms, configuring both security
levels is equivalent to configuring only the 128-bit security level. The cryptographic algorithms of the
192-bit security level are stronger than the minimum required for the 128-bit security level, so they
are permitted for the 128-bit security level even if the 192-bit security level is not enabled.
Note: The naming conventions used for the Security level do not necessarily represent the elliptic curve
size or the key size of the AES encryption algorithm.
38 Securing IBM MQ
Create your key repositories using FIPS-compliant software, then specify that the channel must use
FIPS-certified CipherSpecs.
Queue manager
For a queue manager, use the command ALTER QMGR with the parameter SUITEB to set the values
appropriate for your required level of security. For further information see ALTER QMGR.
You can also use the PCF MQCMD_CHANGE_Q_MGR command with the MQIA_SUITE_B_STRENGTH
parameter to configure the queue manager for Suite B compliant operation.
Note: If you alter a queue manager's Suite B settings, you must restart the MQXR service for those
settings to take effect.
MQI client
By default, MQI clients do not enforce Suite B compliance. You can enable the MQI client for Suite B
compliance by executing one of the following options:
1. By setting the EncryptionPolicySuiteB field in the MQSCO structure on an MQCONNX call to one
or more of the following values:
• MQ_SUITE_B_NONE
• MQ_SUITE_B_128_BIT
• MQ_SUITE_B_192_BIT
Using MQ_SUITE_B_NONE with any other value is invalid.
2. By setting the MQSUITEB environment variable to one or more of the following values:
• NONE
• 128_BIT
• 192_BIT
You can specify multiple values using a comma separated list. Using the value NONE with any other
value is invalid.
3. By setting the EncryptionPolicySuiteB attribute in the SSL stanza of the MQI client configuration
file to one or more of the following values:
• NONE
• 128_BIT
• 192_BIT
You can specify multiple values using a comma separated list. Using NONE with any other value is
invalid.
Note: The MQI client settings are listed in order of priority. The MSCO structure on the MQCONNX call
overrides the setting on the MQSUITEB environment variable, which overrides the attribute in the SSL
stanza.
For full details of the MQSCO structure, see MQSCO - SSL configuration options.
.NET
For .NET unmanaged clients, the property MQC.ENCRYPTION_POLICY_SUITE_B indicates the type of
Suite B security required.
For information about the using Suite B in IBM MQ classes for .NET, see MQEnvironment .NET class.
AMQP
The Suite B attribute settings for a queue manager apply to AMQP channels on that queue manager. If you
modify the queue manager Suite B settings, you must restart the AMQP service for the changes to take
effect.
40 Securing IBM MQ
1. Using the CertificateValPolicy field in the client MQSCO structure. For more information about using this
field, see MQSCO - SSL configuration options.
2. Using the client environment variable, MQCERTVPOL. For more information about using this variable,
see MQCERTVPOL.
3. Using the client SSL stanza tuning parameter setting, CertificateValPolicy. For more information about
using this setting, see SSL stanza of the client configuration file.
For more information about certificate validation policies, see “Certificate validation policies in IBM MQ”
on page 40.
where cert_label is the certificate label of the digital signature algorithm to to display. See Digital
certificate labels for details.
Note: Although the runmqckm (iKeycmd) and the strmqikm (iKeyman) GUI can be used to view a
selection of digital signature algorithms, the runmqakm tool provides a wider range.
Running the runmqakm command produces output displaying the use of the signature algorithm
specified:
Label : ibmmqexample
Key Size : 1024
Version : X509 V3
Serial : 4e4e93f1
Issuer : CN=Old Certificate Authority,OU=Test,O=Example,C=US
Subject : CN=Example Queue Manager,OU=Test,O=Example,C=US
Not Before : August 19, 2011 5:48:49 PM GMT+01:00
Not After : August 18, 2012 5:48:49 PM GMT+01:00
Public Key
30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01
05 00 03 81 8D 00 30 81 89 02 81 81 00 98 5A 7A
F0 18 21 EE E4 8A 6E DE C8 01 4B 3A 1E 41 90 3D
CE 01 3F E6 32 30 6C 23 59 F0 FE 78 6D C2 80 EF
BC 83 54 7A EB 60 80 62 6B F1 52 FE 51 9D C1 61
80 A5 1C D4 F0 76 C7 15 6D 1F 0D 4D 31 3E DC C6
A9 20 84 6E 14 A1 46 7D 4C F5 79 4D 37 54 0A 3B
A9 74 ED E7 8B 0F 80 31 63 1A 0B 20 A5 99 EE 0A
30 A6 B6 8F 03 97 F6 99 DB 6A 58 89 7F 27 34 DE
55 08 29 D8 A9 6B 46 E6 02 17 C3 13 D3 02 03 01
The Signature Algorithm line shows that the MD5WithRSASignature algorithm is used. This
algorithm is based upon MD5 and so this digital certificate cannot be used with the TLS 1.2 CipherSpecs.
Note: Type 1 and 2 CipherSpecs are not supported by IBM MQ queue managers and MQI clients on the
IBM i platform.
The required public key type column shows the type of public key which the personal certificate must
have when using each type of CipherSpec. The personal certificate is the end-entity certificate which
identifies the queue manager or client to its remote partner.
You could configure a channel with both a CipherSpec that requires an Elliptic Curve (EC) certificate, and a
certificate label for an RSA certificate, or the other way round. You must ensure that the certificate named
in the certificate label is appropriate for the channel CipherSpec.
Assuming that you have correctly configured IBM MQ, you can have:
42 Securing IBM MQ
• A single queue manager with a mixture of RSA and EC certificates.
• Different channels on the same queue manager using either an RSA or EC certificate.
The digital signature encryption algorithm refers to the encryption algorithm used to validate the peer.
The encryption algorithm is used along with a hash algorithm such as MD5, SHA-1 or SHA-256 to
compute the digital signature. There are various digital signature algorithms which can be used, for
example, RSA with MD5 or ECDSA with SHA-256. In the table, ECDSA refers to the set of digital signature
algorithms which use ECDSA; RSA refers to the set of digital signature algorithms which use RSA. Any
supported digital signature algorithm in the set may be used, provided it is based upon the stated
encryption algorithm.
Type 1 CipherSpecs require that the personal certificate must have an Elliptic Curve public key. When
these CipherSpecs are used, Elliptic Curve Diffie Hellman Ephemeral key agreement is used to establish
the secret key for the connection.
Type 2 CipherSpecs require that the personal certificate has an RSA public key. When these CipherSpecs
are used, Elliptic Curve Diffie Hellman Ephemeral key agreement is used to establish the secret key for
the connection.
Type 3 CipherSpecs require that the personal certificate must have an RSA public key. When these
CipherSpecs are used, RSA key exchange is used to establish the secret key for the connection.
This list of restrictions is not exhaustive: depending on the configuration, there might be additional
restrictions which can further affect the ability to interoperate. For example, if IBM MQ is configured to
comply with the FIPS 140-2 or NSA Suite B standards then this will also limit the range of allowable
configurations. Refer to the following section for more information.
If you need to use different types of CipherSpec on the same queue manager or client application,
configure an appropriate certificate label and CipherSpec combination on the client definition.
The three types of CipherSpec do not interoperate directly: this is a limitation of the current TLS
standards. For example, suppose you have chosen to use the ECDHE_ECDSA_AES_128_CBC_SHA256
CipherSpec for a receiver channel named TO.QM1 on a queue manager named QM1.
ECDHE_ECDSA_AES_128_CBC_SHA256 is a Type 1 CipherSpec, so the remote sender end of channel
TO.QM1 must have a personal certificate with an Elliptic Curve key and an ECDSA-based digital signature.
If the remote sender channel does not meet these requirements the channel fails to start.
Other channels connecting to queue manager QM1 can use other CipherSpecs, provided that each
channel uses a certificate of the correct type for the CipherSpec of that channel. For example, suppose
that QM1 uses a sender channel named TO.QM2 to send messages to another queue manager named
QM2. The channel TO.QM2 could use the Type 3 CipherSpec TLS_RSA_WITH_AES_256_CBC_SHA256
provided both ends of the channel use certificates containing RSA public keys. The certificate label
channel attribute can be used to configure a different certificate for each channel.
When planning your IBM MQ networks, consider carefully which channels require TLS, and ensure that the
type of certificates used for each channel are appropriate for use with the CipherSpec on that channel.
To view the digital signature algorithm and public key type for a digital certificate you can use the
runmqakm command:
where cert_label is the label of the certificate whose digital signature algorithm you need to display. See
Digital certificate labels for details.
Running the runmqakm command will produce output displaying the Public Key Type:
Label : ibmmqexample
Key Size : 384
Version : X509 V3
Serial : 9ad5eeef5d756f41
Issuer : CN=Example Certificate Authority,OU=Test,O=Example,C=US
Subject : CN=Example Queue Manager,OU=Test,O=Example,C=US
The Public Key Type line in this case shows that the certificate has an Elliptic Curve public key. The
Signature Algorithm line in this case shows that the EC_ecdsa_with_SHA384 algorithm is in use: this
is based upon the ECDSA algorithm. This certificate is therefore only suitable for use with Type 1
CipherSpecs.
You can also use the runmqckm command with the same parameters. Also the strmqikm GUI can be
used to view digital signature algorithms if you open the key repository and double-click the label of the
certificate. However, you should use the runmqakm tool to view digital certificates because it supports a
wider range of algorithms.
Note: The NIST P-521 elliptic curve cannot be used for Suite B compliant operation.
44 Securing IBM MQ
Related concepts
“Enabling CipherSpecs” on page 389
Enable a CipherSpec by using the SSLCIPH parameter in either the DEFINE CHANNEL MQSC command or
the ALTER CHANNEL MQSC command.
“Specifying that only FIPS-certified CipherSpecs are used at run time on the MQI client” on page 248
Create your key repositories using FIPS-compliant software, then specify that the channel must use
FIPS-certified CipherSpecs.
“NSA Suite B Cryptography in IBM MQ” on page 37
This topic provides information about how to configure IBM MQ on Windows, Linux, and UNIX to conform
to the Suite B compliant TLS 1.2 profile.
“National Security Agency (NSA) Suite B Cryptography” on page 20
The government of the Unites States of America produces technical advice on IT systems and security,
including data encryption. The US National Security Agency (NSA) recommends a set of interoperable
cryptographic algorithms in its Suite B standard.
Table 6. Where CHLAUTH rules are applied for different channel pairs
Channel type MCA where CHLAUTH rules are applied
SDR-RCVR RCVR
RQSTR-SVR (Started at SVR) RQSTR
RQSTR-SVR (Started at RQSTR) SVR
RQSTR-SDR (Started at SDR) RQSTR
RQSTR-SDR (Started at RQSTR) SDR for initial connection. RQSTR for callback
connection.
Blocking IP addresses
It is normally the role of a firewall to prevent access from certain IP addresses. However, there might be
occasions where you experience connection attempts from an IP address that should not have access to
your IBM MQ system and must temporarily block the address before the firewall can be updated. These
connection attempts might not be coming from IBM MQ channels; these connection attempts might be
coming from other socket applications that are misconfigured to target your IBM MQ listener. Block IP
addresses by setting a channel authentication record of type BLOCKADDR. You can specify one or more
single addresses, ranges of addresses, or patterns including wildcards.
Whenever an inbound connection is refused because the IP address is blocked in this manner, an
event message MQRC_CHANNEL_BLOCKED with reason qualifier MQRQ_CHANNEL_BLOCKED_ADDRESS
is issued, provided that channel events are enabled and the queue manager is running. Additionally, the
connection is held open for 30 seconds prior to returning the error to ensure the listener is not flooded
with repeated attempts to connect that are blocked.
To block IP addresses only on specific channels, or to avoid the delay before the error is reported, set a
channel authentication record of type ADDRESSMAP with the USERSRC(NOACCESS) parameter.
Whenever an inbound connection is refused for this reason, an event message
MQRC_CHANNEL_BLOCKED with reason qualifier MQRQ_CHANNEL_BLOCKED_NOACCESS is issued,
provided that channel events are enabled and the queue manager is running.
See “Blocking specific IP addresses” on page 355 for an example.
46 Securing IBM MQ
Whenever an inbound connection is refused for this reason, an event message
MQRC_CHANNEL_BLOCKED with reason qualifier MQRQ_CHANNEL_BLOCKED_NOACCESS is issued,
provided that channel events are enabled and the queue manager is running.
See “Blocking access for a client user ID” on page 360 for an example.
48 Securing IBM MQ
– All channel names
– All IP addresses
– All host names
– All queue manager names
• A pattern with an asterisk at the start of a string is more generic than a defined value at the start of a
string:
– For channels, *.B.C is more generic than A.*
– For IP addresses, *.0.2.6 is more generic than 192.*
– For host names, *.ibm.com is more generic than hursley.*
– For queue manager names, *QUEUEMANAGER is more generic than QUEUEMANAGER*
• A pattern with an asterisk at a specific place in a string is more generic than a defined value at the same
place in a string, and similarly for each subsequent place in a string:
– For channels, A.*.C is more generic than A.B.*
– For IP addresses, 192.*.2.6 is more generic than 192.0.*.
– For host names, hursley.*.com is more generic than hursley.ibm.*
– For queue manager names, Q*MANAGER is more generic than QUEUE*
• Where two or more patterns have an asterisk at a specific place in a string, the one with fewer nodes
following the asterisk is more generic:
– For channels, A.* is more generic than A.*.C
– For IP addresses, 192.* is more generic than 192.*.2.*.
– For host names, hurlsey.* is more generic than hursley.*.com
– For queue manager names, Q* is more generic than Q*MGR
• Additionally, for an IP address:
– A range indicated with a hyphen (-), is more specific than an asterisk. Thus 192.0.2.0-24 is more
specific than 192.0.2.*.
– A range that is a subset of another is more specific than the larger range. Thus 192.0.2.5-15 is more
specific than 192.0.2.0-24.
– Overlapping ranges are not permitted. For example, you cannot have channel authentication records
for both 192.0.2.0-15 and 192.0.2.10-20.
– A pattern cannot have fewer than the required number of parts, unless the pattern ends with a single
trailing asterisk. For example 192.0.2 is invalid, but 192.0.2.* is valid.
– A trailing asterisk must be separated from the rest of the address by the appropriate part separator (a
dot (.) for IPv4, a colon (:) for IPv6). For example, 192.0* is not valid because the asterisk is not in a
part of its own.
– A pattern can contain additional asterisks, provided that no asterisk is adjacent to the trailing
asterisk. For example, 192.*.2.* is valid, but 192.0.*.* is not valid.
– An IPv6 address pattern cannot contain a double colon and a trailing asterisk, because the
resulting address would be ambiguous. For example, 2001::* could expand to 2001:0000:*,
2001:0000:0000:* and so on
• For an SSL or TLS Distinguished Name (DN), the precedence order of substrings is as follows:
Thus, if an SSL or TLS certificate is presented with a DN containing the substrings O=IBM and C=UK,
IBM MQ uses a channel authentication record for O=IBM in preference to one for C=UK, if both are
present.
A DN can contain multiple OUs, which must be specified in hierarchical order with the large
organizational units specified first. If two DNs are equal in all respects except for their OU values,
the more specific DN is determined as follows:
1. If they have different numbers of OU attributes then the DN with the most OU values is more
specific. This is because the DN with more Organizational Units fully qualifies the DN in more detail
and provides more matching criteria. Even if its top-level OU is a wildcard (OU=*), the DN with more
OUs is still regarded as more specific overall.
2. If they have the same number of OU attributes then the corresponding pairs of OU values are
compared in sequence left-to-right, where the left-most OU is the highest-level (least specific),
according to the following rules.
a. An OU with no wildcard values is the most specific because it can only match exactly one string.
b. An OU with a single wildcard at either the beginning or end (for example, OU=ABC* or OU=*ABC)
is next most specific.
c. An OU with two wildcards for example, OU=*ABC*) is next most specific.
d. An OU consisting only of an asterisk (OU=*) is the least specific.
3. If the string comparison is tied between two attribute values of the same specificity then whichever
attribute string is longer is more specific.
4. If the string comparison is tied between two attribute values of the same specificity and length then
the result is determined by a case-insensitive string comparison of the portion of the DN excluding
any wildcards.
50 Securing IBM MQ
If two DNs are equal in all respects except for their DC values, the same matching rules apply as for
OUs except that in DC values the left-most DC is the lowest-level (most specific) and the comparison
ordering differs accordingly.
Primary Conversation
Step 2: Check address is allowed to connect?
(BLOCKADDR)
Security exit
exchange Step 5: Call security exit (if defined)
with exit reason: MQXR_INIT_SEC
52 Securing IBM MQ
Step 1: Receive a connection request
The channel initiator or listener receives a connection request from somewhere on the network.
Step 2: Is the address allowed to connect?
Before any data is read, IBM MQ checks the IP address of the partner against the CHLAUTH rules, to
see if the address is in the BLOCKADDR rule. If the address is not found, and so not blocked, the flow
proceeds to the next step.
Step 3: Read data from the channel
IBM MQ now reads the data into a buffer, and starts to process the sent information.
Step 4: Look up the channel definition
In the first data flow, IBM MQ sends, amongst other things, the name of the channel which the
sending end is trying to start. The receiving queue manager can then look up the channel definition,
which has all the settings that are specified for the channel.
Step 5: Call security exit (if defined)
If the channel has a security exit (SCYEXIT) defined, this is called with the exit reason
(MQCXP.ExitReason) set to MQXR_INIT_SEC.
Step 6: Receive MQCSP
If necessary, construct one, as long as the user ID and password are supplied by the client.
If the client is a Java or JMS application running in compatibility mode, the client does not pass an
MQCSP structure to the queue manager. Instead, if the application supplied a user ID and password,
an MQCSP structure is constructed here.
Step 7: Adopt MQCSP user (if ChlauthEarlyAdopt is Y and ADOPTCTX=YES)
The user Id asserted by the client is authenticated.
If CONNAUTH is using LDAP to map an asserted distinguished name to a short user Id, the mapping
happens in this step.
If authentication is successful, the user Id is adopted by the channel and is used by the CHLAUTH
mapping step.
Note: From IBM MQ 9.0.4 the ChlauthEarlyAdopt= Y parameter is automatically added to the
channels stanza of the qm.ini file for new queue managers.
Step 8: CHLAUTH mapping
The CHLAUTH cache is inspected again to look for the mapping rules SSLPEERMAP, USERMAP,
QMGRMAP, and ADDRESSMAP.
The rule that matches the incoming channel most specifically is used. If the rule has
USERSRC(CHANNEL) or (MAP), the channel continues on binding.
If the CHLAUTH rules evaluate to a rule with USERSRC(NOACCESS), the application is blocked from
connecting to the channel, unless the credentials are subsequently overridden with a valid user ID
and password in Step 9.
Step 9: Call security exit (if defined)
If the channel has a security exit (SCYEXIT) defined, this is called with the exit reason
(MQCXP.ExitReason) set to MQXR_SEC_PARMS.
A pointer to MQCSP will be present in the SecurityParms field of the MQCXP structure.
The MQCSP structure has pointers to the user ID (MQCSP.CSPUserIdPtr) and password
(MQCSP.CSPPasswordPtr).
It is possible to change the user ID and password in the exit. The following example shows how a
security exit would print the user ID and password values to an audit log:
The exit can tell IBM MQ to close the channel, by returning MQXCC_CLOSE_CHANNEL in
the MQCXP.Exitresponse field. Otherwise, channel processing continues to the connection
authentication phase.
Note: If the asserted user is changed by the security exit, CHLAUTH mapping rules will not be
re-applied to the new user.
Step 10: Authenticate the user
The authentication phase happens if CONNAUTH is enabled on the queue manager.
To check this, issue the MQSC command 'DISPLAY QMGR CONNAUTH'.
The following example shows the output of the command DISPLAY QMGR CONNAUTH
from a queue manager running on IBM MQ for z/OS.
The following example shows the output of the command 'DISPLAY QMGR CONNAUTH'
from a queue manager running on IBM MQ for Multiplatforms.
The following example shows the shipped default object for AUTHTYPE(IDPWOS) from a
queue manager running on IBM MQ for z/OS.
The following example shows the shipped default object for AUTHTYPE(IDPWOS) from a
queue manager running on IBM MQ for Multiplatforms.
1 : display authinfo(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)
AMQ8566: Display authentication information details.
AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS)
AUTHTYPE(IDPWOS) ADOPTCTX(NO)
DESCR( ) CHCKCLNT(REQDADM)
CHCKLOCL(OPTIONAL) FAILDLAY(1)
ALTDATE(2015-06-08) ALTTIME(16.35.16)
54 Securing IBM MQ
The AUTHINFO TYPE(IDPWOS) has an attribute called CHCKCLNT. If the value is changed to
REQUIRED all client applications have to supply a valid user ID and password.
If the user was authenticated in Step 7, the user will not be authenticated again unless the user or
password in the SecurityParms field of the MQCXP structure was changed by a security exit in Step 9.
Step 11: Adopt the context of the MQCSP user (If ChlauthEarlyAdopt=N and ADOPTCTX=YES)
You can set the ADOPTCTX attribute, which controls whether the channel runs under MCAUSER, or the
user ID the application has supplied.
If the user ID asserted in the MQCSP, or SecurityParms field of the MQXCP structure, has been
successfully authenticated and ADOPTCTX is YES, then the context of the user resulting from steps
7 and 8 is adopted as the context to use for this application, unless the user or password in the
SecurityParms field of the MQCXP structure was changed by a security exit in step 9.
This asserted user ID is the User ID that is checked for authorization to use IBM MQ resources.
For example, you do not have an MCAUSER set on the SVRCONN channel, and your client is running
under 'johndoe' on your Linux machine. Your application specifies user 'fred' in the MQCSP, so the
channel starts running with 'johndoe' as the active MCAUSER. After the CONNAUTH check, the user
'fred' is adopted, and the channel runs with 'fred' as the active MCAUSER.
Step 12: Check the user is not blocked (BLOCKUSER)
If the CONNAUTH checking is successful, the CHLAUTH cache is then inspected again to check if the
active MCAUSER is blocked by a BLOCKUSER rule. If the user is blocked, the channel ends.
Step13: Validate CHLAUTH CHCKCLNT requirements
If the CHLAUTH rule that was selected in step 8 additionally specifies a CHCKCLNT value of
REQUIRED or REQDADM then validation is done to ensure that a valid CONNAUTH userid was
provided to meet the requirement.
• If CHCKCLNT(REQUIRED) is set a user must have been authenticated in step 7 or 10. Otherwise the
connection is rejected.
• If CHCKCLNT(REQDADM) is set a user must have been authenticated in step 7 or 10 if this
connection is determined to be privileged. Otherwise the connection is rejected.
• If CHCKCLNT(ASQMGR) is set then this step is skipped.
Notes:
1. If CHCKCLNT(REQUIRED) or CHCKCLNT(REQDADM) is set, but CONNAUTH is not enabled on the
queue manager, the connection fails with a MQRC_SECURITY_ERROR (2063) return code due to
the conflict in configuration.
2. The user is not re-authenticated in this step.
Step 14: Validate CONNAUTH CHCKCLNT requirements.
The authentication phase happens if CONNAUTH is enabled on the queue manager.
The CONNAUTH CHCKCLNT value is checked to determine what requirements are set for incoming
connections:
• If CHCKCLNT(NONE) is set then this step is skipped
• If CHCKCLNT(OPTIONAL) is set then this step is skipped.
• If CHCKCLNT(REQUIRED) is set then a user must have been authenticated in step 7 or 10.
Otherwise the connection is rejected.
• If CHCKCLNT(REQDADM) is set a user must have been authenticated in step 7 or 10 if this
connection is determined to be privileged. Otherwise the connection is rejected.
Note: The user is not re-authenticated in this step.
Connection authentication
Connection authentication can be achieved in various ways:
• An application can provide a user ID and password. The application can be either a client, or it can use
local bindings.
• A queue manager can be configured to act on a supplied user ID and password.
• A repository can be used to determine whether a user ID and password combination is valid.
In the diagram, two applications are making connections with a queue manager, one application as a
client and one using local bindings. Applications might use a variety of APIs to connect to the queue
manager, but all have the ability to provide a user ID and a password. The user ID that the application is
running under, User2 and User4 in the diagram, which is the usual operating system user ID presented
to IBM MQ, might be different from the user ID provided by the application, User1 and User3.
The queue manager receives configuration commands (in the diagram, IBM MQ Explorer is being used)
and manages the opening of resources and checks the authority to access those resources. There are
many different resources in IBM MQ that an application might require authority to access. The diagram
illustrates opening a queue for output, but the same principles apply to other resources as well.
See User repositories for details about the repository that is used for checking user IDs and passwords.
56 Securing IBM MQ
Related concepts
“Connection authentication: Configuration” on page 57
A queue manager can be configured to use a supplied user ID and password to check whether a user has
authority to access resources.
“Connection authentication: Application changes” on page 61
“Connection authentication: User repositories” on page 62
For each of your queue managers, you can choose different types of authentication information object for
authenticating user IDs and passwords.
Where USE.PW in the CONNAUTH is a string that matches the AUTHINFO definition.
Both CHCKLOCL and CHCKCLNT have the same set of possible values that allow the strictness of checking
to be varied:
NONE
Switches off checking.
OPTIONAL
Ensures that if a user ID and password are provided by an application, they are a valid pair, but that it
is not mandatory to provide them. This option might be useful during migration, for example.
Important: OPTIONAL is the minimum value you can set, in order to use more stringent CHLAUTH
rules.
If you select NONE and the client connection matches a CHLAUTH record with CHCKCLNT REQUIRED
(or REQDADM on platforms other than z/OS), the connection fails. You receive message AMQ9793 on
platforms other than z/OS, and message CSQX793E on z/OS.
REQUIRED
Requires that all applications provide a valid user ID and password. See also the following note.
Configuration granularity
In addition to CHCKLOCL and CHCKCLNT that are used to turn on user ID and password checking,
there are enhancements to the CHLAUTH rules so that more specific configuration can be made using
CHCKCLNT.
You can set the overall CHCKCLNT value to OPTIONAL, for example, and then upgrade it to be more
stringent for certain channels by setting CHCKCLNT to REQUIRED or REQDADM on the CHLAUTH rule. By
default, CHLAUTH rules will run with CHCKCLNT(ASQMGR) so this granularity does not have to be used.
For example:
58 Securing IBM MQ
Error notification
An error is recorded if an application does not supply a user ID and password when required to, or
supplies an incorrect combination even when it is optional.
Note: When password checking is turned off, by using the NONE option on either CHCKLOCL or CHCKCLNT,
invalid passwords are not detected.
Failed authentications are held for the number of seconds specified by the FAILDLAY attribute before the
error is returned to the application. This provides some protection from an application repeatedly trying to
connect.
The error is recorded in a number of ways:
Application
The application is returned the standard IBM MQ security error, RC2035 - MQRC_NOT_AUTHORIZED.
Administrator
An IBM MQ administrator sees the event reported in the error log and can therefore see that the
application was rejected because the user ID and password failed the check, rather than because, for
example, there was no connection authority .
Monitoring tool
A monitoring tool can also be notified of the failure, if you turn on authority events by sending an event
message to the SYSTEM.ADMIN.QMGR.EVENT queue:
This "Not Authorized" event is a Type 1 connect event, and provides the same fields as other Type
1 events, with an additional field, the MQCSP user ID that was provided. The password is not given
in the event message. This means that there are two user IDs in the event message: the ID that
the application is running under and the ID that the application presented for user ID and password
checking.
You can configure a queue manager to mandate that user IDs and passwords are provided by certain
applications as the user ID that the application is running under might not be the same user ID that was
presented by the application along with a password when the application opens a queue for output, for
example:
How user IDs and passwords are handled is controlled by the ADOPTCTX attribute on the authentication
information object.
ADOPTCTX(YES)
All authorization checks for an application are made with the same user ID that you authenticated by
password, by selecting to adopt the context as the application context for the rest of the life of the
connection.
Attention: When using ADOPTCTX(YES) and OS user Ids you must ensure that the user Id
being adopted does not exceed the maximum length of user IDs. See “User IDs” on page 71
for more information.
ADOPTCTX(NO)
An application provides a user ID and password for the purposes of authenticating them at connection
time, but then continues by using the user ID that the application is running under for future
authorization checks. You might find this option useful when migrating, or if you plan to use other
mechanisms, such as channel authentication records, to assign the message channel agent user
identifier (MCAUSER).
Attention:
When you use the ADOPTCTX(YES) parameter on an authentication information object, another
security context cannot be adopted unless you set the ChlauthEarlyAdopt parameter in the
channels stanza of the qm.ini file.
60 Securing IBM MQ
For example, the default authentication information object is set to ADOPTCTX(YES), and the user
fred is logged in. The following two CHLAUTH rules are configured:
The following command is issued, with the intention of authenticating the command as the
adopted security context of the user bob:
In fact, the queue manager uses the security context of fred, not bob, and the connection fails.
For more information about ChlauthEarlyAdopt, see Attributes of the channels stanza.
Related concepts
“Connection authentication” on page 56
“Connection authentication: Application changes” on page 61
“Connection authentication: User repositories” on page 62
For each of your queue managers, you can choose different types of authentication information object for
authenticating user IDs and passwords.
There are two types of authentication information object, as represented in the diagram:
• IDPWOS is used to indicate that the queue manager uses the local operating system to authentication
the user ID and password. If you choose to use the local operating system, you need to set the common
attributes, as described in the preceding topics.
• IDPWLDAP is used to indicate that the queue manager uses an LDAP server to authenticate the user ID
and password. If you choose to use an LDAP server, more information is provided in this topic.
Only one type of authentication information object can be chosen for each queue manager to use, by
naming the appropriate object in the queue manager's CONNAUTH attribute.
62 Securing IBM MQ
Secure connection to an LDAP Server
Unlike channels, there is no SSLCIPH parameter to turn on the use of TLS for communication with the
LDAP server. In this case IBM MQ is acting as a client to the LDAP server so much of the configuration is
done at the LDAP server. Some existing parameters in IBM MQ are used to configure how that connection
works.
Set the SECCOMM field to control whether connectivity to the LDAP server uses TLS.
In addition to this attribute, the queue manager attributes SSLFIPS and SUITEB restrict the set of cipher
specs that are chosen. The certificate that is used to identify the queue manager to the LDAP server is the
queue manager certificate, either ibmwebspheremq qmgr-name or the value of the CERTLABL attribute.
See Digital certificate labels for details.
Related concepts
“Connection authentication” on page 56
“Connection authentication: Configuration” on page 57
A queue manager can be configured to use a supplied user ID and password to check whether a user has
authority to access resources.
“Connection authentication: Application changes” on page 61
Overview
mqccred is a security exit that runs on the same machine as your client application. It allows user ID
and password information to be supplied on behalf of the client application, where that information is not
being supplied by the application itself. The user ID and password information is supplied in a structure
known as the Connection Security Parameters (MQCSP) and will be authenticated by the queue manager
if connection authentication is configured.
User ID and password information is retrieved from a .ini file on the client machine. The passwords
in the file are protected by obfuscation using the runmqccred command, and also by ensuring the
file permissions on the .ini file are set such that only the user ID running the client application (and
therefore the exit) are able to read it.
Location
mqccred is installed:
Windows platforms
In the installation_directory\Tools\c\Samples\mqccred\ directory
UNIX platforms
In the installation_directory/samp/mqccred directory
Notes: The exit:
1. Acts purely as a security channel exit, and needs to be the only such exit defined on a channel.
2. Is usually named through the Client Channel Definition Table (CCDT), but a Java client can have the
exit mentioned in the JNDI objects directly, or the exit might be configured for applications that
manually construct the MQCD structure.
3. You must copy the mqccred and mqccred_r programs to the var/mqm/exits directory.
For example, on a 64 bit UNIX platform machine, issue the command:
cp installation_directory/samp/mqccred/lib64/* /var/mqm/exits
See A step by step example of how to test mqccred for more information.
4. Is capable of running on previous versions of IBM MQ ; as far back as IBM WebSphere MQ 7.0.1.
64 Securing IBM MQ
Setting up user IDs and passwords
The .ini file contains stanzas for each queue manager, with a global setting for unspecified queue
managers. Each stanza contains the name of the queue manager, a user ID, and either a plain text or
obfuscated password.
You must edit the .ini file by hand, using whichever editor you want, and add the plain text password
attribute to the stanzas. Run the provided, runmqccred program, which takes the .ini file and replaces
the Password attribute with the OPW attribute, an obfuscated form of the password.
See runmqccred for a description of the command and its parameters.
The mqccred.ini file contains your user ID and password information.
A template .ini file is provided in the same directory as the exit to provide a starting point for your
enterprise.
By default, this file will be looked for in $HOME/.mqs/mqccred.ini. If you would like to locate it
elsewhere, you can use the environment variable MQCCRED to point at it:
MQCCRED=C:\mydir\mqccred.ini
If you use MQCCRED, the variable must include the full name of the configuration file, including any .ini
filetype. Since this file contains passwords (even if obfuscated), you are expected to protect the file using
operating system privileges to ensure unauthorized people cannot read it. If you do not have the correct
file permission, the exit will not run successfully.
If the application has already supplied an MQCSP structure, the exit normally respects this and will not
insert any information from the .ini file. However, you can override this by using the Force attribute in
the stanza.
Setting Force to the value TRUE removes the application-supplied user ID and password, and replaces
those with the ini file version.
You can also set the Force attribute in the global section of the file to set the default value of that file.
The default value for Force is FALSE.
You can provide a user ID and password for all queue managers, or for each individual queue manager.
This is an example of an mqccred.ini file:
QueueManager:
Name=QMA
User=user1
OPW=H&^dbgfh
Force=TRUE
QueueManager:
Name=QMB
User=user2
password=passw0rd
Notes:
1. The individual queue manager definitions take precedence over the global setting.
2. Attributes are case insensitive.
Constraints
When this exit is in use, the local user ID of the person running the application does not flow from the
client to the server. The only identity information available is from the ini file contents.
Debugging
The exit writes to the standard IBM MQ trace when that is enabled.
To assist in debugging configuration issues, the exit can also write directly to stdout.
No channel security exit data ( SCYDATA ) configuration is normally required for the channel. However,
you can specify:
ERROR
Only print information abut error conditions, such as not being able to find the configuration file.
DEBUG
Displays these error conditions, and some additional trace statements.
NOCHECKS
Bypasses the constraints on file permissions, and the further constraint that the .ini file should not
contain any unprotected passwords.
You can put one or more of these elements into the SCYDATA field, separated by commas, in any order.
For example, SCYDATA=(NOCHECKS,DEBUG).
Note that the items are case-sensitive, and must be entered in uppercase.
Using mqccred
Once you have your file set up, you can invoke the channel exit by updating your client-connection
channel definition to include the SCYEXIT('mqccred(ChlExit)') attribute:
Related reference
SCYDATA
SCYEXIT
runmqccred
Compatibility mode
Before IBM MQ 8.0, the Java client could send a user ID and password across the client-connection
channel to the server-connection channel, and have them provided to a security exit in the
RemoteUserIdentifier and RemotePassword fields of the MQCD structure. In compatibility mode,
this behavior is retained.
You might use this mode in combination with connection authentication, and migrate away from any
security exits that were previously used to do the same job.
66 Securing IBM MQ
You must use ADOPTCTX(YES) or have another method, for example a CHLAUTH rule based on a TLS
certificate, to set the running MCAUSER when you are using compatibility mode, as in this mode, the
client-side user ID is not sent to the queue manager.
The compatibility mode of operation can be enabled on a connection-by-connection basis or globally:
• In IBM MQ classes for Java, set the property MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY
to false in the properties hashtable that is passed to the com.ibm.mq.MQQueueManager
constructor.
• In IBM MQ classes for JMS, set the property JmsConstants.USER_AUTHENTICATION_MQCSP to false,
on the appropriate connection factory before creating the connection.
• Globally, specify the Java system property -Dcom.ibm.mq.cfg.jmqi.useMQCSPauthentication=false on
the command line when starting your application, as shown in the following example:
From IBM MQ 9.0.4, MQCSP authentication mode is the default. Before IBM MQ 9.0.4,
compatibility mode is the default.
On panels where user identification is provided, there is a check box to enable or disable compatibility
mode:
• From IBM MQ 9.0.4, by default, this check box is not selected. To use compatibility mode,
select this check box.
• Before IBM MQ 9.0.4, by default, this check box is enabled. To use MQCSP authentication, clear the
check box.
Related concepts
“Connection authentication” on page 56
“Connection authentication: Application changes” on page 61
“Connection authentication: User repositories” on page 62
• On Multiplatforms, if you ignore these aspects and do nothing, you cannot use IBM MQ.
• On z/OS, the effect of ignoring these aspects is that your IBM MQ resources are
unprotected. That is, all users can access and change all IBM MQ resources.
68 Securing IBM MQ
• Queues
• Processes
• Namelists
• Topics
Applications can also use Programmable Command Format (PCF) commands to access these IBM MQ
objects, and to access channels and authentication information objects as well. These objects can be
protected by IBM MQ so that the user IDs associated with the applications need authority to access them.
For more information, see “Authorization for applications to use IBM MQ” on page 75.
Channel security
The user IDs associated with message channel agents (MCAs) need authority to access various IBM MQ
resources. For example, an MCA must be able to connect to a queue manager. If it is a sending MCA,
it must be able to open the transmission queue for the channel. If it is a receiving MCA, it must be
able to open destination queues. The user IDs associated with applications which need to administer
channels, channel initiators, and listeners need authority to use the relevant PCF commands. However,
most applications do not need such access.
For more information, see “Channel authorization” on page 95.
Additional considerations
You need to consider the following aspects of security only if you are using certain IBM MQ function or
base product extensions:
• “Security for queue manager clusters” on page 107
• “Security for IBM MQ Publish/Subscribe” on page 108
• “Security for IBM MQ internet pass-thru” on page 109
1. Communications level
See arrow 1. To implement security at the communications level, use TLS. For more information, see
“Cryptographic security protocols: TLS” on page 14
2. Channel authentication records
See arrows 2 & 3. Authentication can be controlled by using the IP address or TLS distinguished names
at the security level. A user ID can also be blocked or an asserted user ID can be mapped to a valid
user ID. A full description is given in “Channel authentication records” on page 45.
3. Connection authentication
See arrow 3. The client sends an ID and a password. For more information, see “Connection
authentication: Configuration” on page 57.
4. Channel security exits
See arrow 2. The channel security exits for client to server communication can work in the same way
as for server to server communication. A protocol independent pair of exits can be written to provide
mutual authentication of both the client and the server. A full description is given in Channel security
exit programs.
5. Identification that is passed to a channel security exit
See arrow 3. In client to server communication, the channel security exits do not have to operate as
a pair. The exit on the IBM MQ client side can be omitted. In this case, the user ID is placed in the
channel descriptor (MQCD) and the server-side security exit can alter it, if required.
Windows clients also send extra information to assist identification.
• The user ID that is passed to the server is the currently logged-on user ID on the client.
• The security ID of the currently logged-on user.
The values of the user ID and, if available, the security ID, can be used by the server security exit to
establish the identity of the IBM MQ MQI client.
From IBM MQ 8.0, you can send passwords that are included in the MQCSP structure.
Warning: In some cases, the password in an MQCSP structure for a client application will be sent across
a network in plain text. To ensure that client application passwords are protected appropriately, see
“MQCSP password protection” on page 28.
70 Securing IBM MQ
User IDs
When you create user IDs for client applications, the user IDs must not be longer than the maximum
permitted length. You must not use the reserved user IDs UNKNOWN and NOBODY. If the server that
the client connects to is an IBM MQ for Windows server, you must escape the use of the at sign, @. The
permitted length of user IDs is dependent on the platform that is used for the server:
• On Windows, if both the IBM MQ MQI client, and the IBM MQ server are on Windows,
and the server has access to the domain on which the client user ID is defined, the maximum length
of a user ID is 20 characters. However, if the IBM MQ server is not a Windows server, the user ID is
truncated to 12 characters.
• If you use the MQCSP structure to pass credentials, the maximum length of a user ID is 1024
characters. The MQCSP structure user ID cannot be used to circumvent the maximum userid length
used by IBM MQ for authorization. For more information about the MQCSP structure, see “Identifying
and authenticating users using the MQCSP structure” on page 308.
On UNIX and Linux systems the default is that user IDs are used to authenticate, and groups are used
for authorization. However, you can configure these systems to authorize against user Ids. For more
information, see “OAM user-based permissions on UNIX and Linux” on page 323. Windows systems can
use both user IDs for both authentication and authorization and groups for authorization.
If you create service accounts, without paying attention to groups, and authorize all the user IDs
differently, every user can access the information of every other user.
An IBM MQ for Windows server does not support the connection of a Windows client if the client is
running under a user ID that contains the @ character, for example, abc@d. The return code to the
MQCONN call at the client is MQRC_NOT_AUTHORIZED.
However, you can specify the user ID using two @ characters, for example, abc@@d. Using the
id@domain format is the preferred practice, to ensure that the user ID is resolved in the correct domain
consistently; thus abc@@d@domain.
Planning authorization
Plan the users who will have administrative authority and plan how to authorize users of applications to
appropriately use IBM MQ objects, including those connecting from an IBM MQ MQI client.
Individuals or applications must be granted access in order to use IBM MQ. What access they require
depend on the roles they undertake and the tasks which they need to perform. Authorization in IBM MQ
can be subdivided into two main categories:
• Authorization to perform administrative operations
• Authorization for applications to use IBM MQ
Both classes of operation are controlled by the same component and an individual can be granted
authority to perform both categories of operation.
The following topics give further information about specific areas of authorization that you must consider:
• For MQSC commands that are processed by the command server on IBM MQ for z/OS, see
“Command security and command resource security” on page 74.
For more information about the authority you need to administer IBM MQ on UNIX and Windows systems,
see the related information.
72 Securing IBM MQ
Authority to administer IBM MQ on IBM i
To be an IBM MQ administrator on IBM i, you must be a member of the QMQMADM group. This group
has properties similar to those of the mqm group on UNIX and Windows systems. In particular, the
QMQMADM group is created when you install IBM MQ for IBM i, and members of the QMQMADM group
have access to all IBM MQ resources on the system. You also have access to all IBM MQ resources if you
have *ALLOBJ authority.
Administrators can use CL commands to administer IBM MQ. One of these commands is GRTMQMAUT,
which is used to grant authorities to other users. Another command, STRMQMMQSC, enables an
administrator to issue MQSC commands to a local queue manager.
There are two groups of CL command provided by IBM MQ for IBM i:
Group 1
To issue a command in this category, a user must be a member of the QMQMADM group or have
*ALLOBJ authority. GRTMQMAUT and STRMQMMQSC belong to this category, for example.
Group 2
To issue a command in this category, a user does not need to be a member of the QMQMADM group or
have *ALLOBJ authority. Instead, two levels of authority are required:
• The user requires IBM i authority to use the command. This authority is granted by using the
GRTOBJAUT command.
• The user requires IBM MQ authority to access any IBM MQ object associated with the command.
This authority is granted by using the GRTMQMAUT command.
The following examples show commands in this group:
• CRTMQMQ, Create MQM Queue
• CHGMQMPRC, Change MQM Process
• DLTMQMNL, Delete MQM Namelist
• DSPMQMAUTI, Display MQM Authentication Information
• CRTMQMCHL, Create MQM channel
For more information about this group of commands, see “Authorization for applications to use IBM
MQ” on page 75.
For a complete list of group 1 and group 2 commands, see “Access authorities for IBM MQ objects on IBM
i” on page 142
For more information about the authority you need to administer IBM MQ on IBM i, see Administering IBM
i.
DEFINE QLOCAL(MOON.EUROPA)
74 Securing IBM MQ
Messages containing MQSC commands are sent to the system command input queue in the following
circumstances:
• The operations and control panels send MQSC commands to the system command input queue of the
target queue manager. The MQSC commands correspond to the actions you choose on the panels. The
UserIdentifier field in each message is set to the TSO user ID of the administrator.
• The COMMAND function of the IBM MQ utility program, CSQUTIL, sends the MQSC commands in the
input data set to the system command input queue of the target queue manager. The COPY and EMPTY
functions send DISPLAY QUEUE and DISPLAY STGCLASS commands. The UserIdentifier field in each
message is set to the job user ID.
• The MQSC commands in the CSQINPX data sets are sent to the system command input queue of the
queue manager to which the channel initiator is connected. The UserIdentifier field in each message is
set to the channel initiator address space user ID.
No authority checks are performed when MQSC commands are issued from the CSQINP1 and CSQINP2
data sets. You can control who is allowed to update these data sets using RACF data set protection.
• Within a queue sharing group, a channel initiator might send START CHANNEL commands to the system
command input queue of the queue manager to which it is connected. A command is sent when an
outbound channel that uses a shared transmission queue is started by triggering. The UserIdentifier
field in each message is set to the channel initiator address space user ID.
• An application can send MQSC commands to a system command input queue. By default, the
UserIdentifier field in each message is set to the user ID associated with the application.
• On UNIX, Linux, and Windows systems, the runmqsc control command can be used in indirect mode
to send MQSC commands to the system command input queue of a queue manager on z/OS. The
UserIdentifier field in each message is set to the user ID of the administrator who issued the runmqsc
command.
76 Securing IBM MQ
can reference a cluster queue explicitly by setting the ObjectName field in the object descriptor to
the name of the cluster queue. The authority checks are performed against the cluster transmission
queue, SYSTEM.CLUSTER.TRANSMIT.QUEUE.
The authority to a dynamic queue is based on the model queue from which it is derived, but is not
necessarily the same; see note 1.
The user ID that the queue manager uses for the authority checks is obtained from the operating
system. The user ID is obtained when the application connects to the queue manager. A suitably
authorized application can issue an MQOPEN call specifying an alternative user ID; access control
checks are then made on the alternative user ID. Using an alternate user ID does not change the user
ID associated with the application, only the one used for access control checks.
When an application subscribes to a topic using an MQSUB call
When an application subscribes to a topic, it specifies the type of operation that it needs to perform. It
is either creating a subscription, altering an existing subscription, or resuming an existing subscription
without changing it. For each type of operation, the queue manager checks that the user ID that is
associated with the application has the authority to perform the operation.
When an application subscribes to a topic, the authority checks are performed against topic objects
that are found in the topic tree. The topic objects are at, or above, the point in the topic tree at which
the application subscribed. The authority checks might involve checks on more than one topic object.
The user ID that the queue manager uses for the authority checks is obtained from the operating
system. The user ID is obtained when the application connects to the queue manager.
The queue manager performs authority checks on subscriber queues but not on managed queues.
When an application deletes a permanent dynamic queue using an MQCLOSE call
The object handle specified on the MQCLOSE call is not necessarily the same one returned by the
MQOPEN call that created the permanent dynamic queue. If it is different, the queue manager checks
the user ID associated with the application that issued the MQCLOSE call. It checks that the user ID is
authorized to delete the queue.
When an application that closes a subscription to remove it did not create it, the appropriate authority
is required to remove it.
When a PCF command that operates on an IBM MQ object is processed by the command server
This rule includes the case where a PCF command operates on an authentication information object.
The user ID that is used for the authority checks is the one found in the UserIdentifier field in
the message descriptor of the PCF command. This user ID must have the required authorities on the
queue manager where the command is processed. The equivalent MQSC command encapsulated
within an Escape PCF command is treated in the same way. For more information about the
UserIdentifier field, and how it is set, see “Message context” on page 78.
Message context
Message context information allows the application that retrieves a message to find out about the
originator of the message. The information is held in fields in the message descriptor and the fields
are divided into three logical parts
These parts are as follows:
identity context
These fields contain information about the user of the application that put the message on the queue.
origin context
These fields contain information about the application itself and when the message was put on the
queue.
user context
These fields contain message properties that applications can use to select messages that the queue
manager should deliver.
When an application puts a message on a queue, the application can ask the queue manager to generate
the context information in the message. This is the default action. Alternatively, it can specify that the
context fields are to contain no information. The user ID associated with an application requires no
special authority to do either of these.
An application can set the identity context fields in a message, allowing the queue manager to generate
the origin context, or it can set all the context fields. An application can also pass the identity context
fields from a message it has retrieved to a message it is putting on a queue, or it can pass all the context
fields. However, the user ID associated with an application requires authority to set or pass context
information. An application specifies that it intends to set or pass context information when it opens the
queue on which it is about to put messages, and its authority is checked at this time.
Here is a brief description of each of the context fields:
Identity context
UserIdentifier
The user ID associated with the application that put the message. If the queue manager sets this
field, it is set to the user ID obtained from the operating system when the application connects to
the queue manager.
AccountingToken
Information that can be used to charge for the work done as a result of the message.
ApplIdentityData
If the user ID associated with an application has authority to set the identity context fields, or to
set all the context fields, the application can set this field to any value related to identity. If the
queue manager sets this field, it is set to blank.
Origin context
PutApplType
The type of the application that put the message; a CICS® transaction, for example.
78 Securing IBM MQ
PutApplName
The name of the application that put the message.
PutDate
The date when the message was put.
PutTime
The time when the message was put.
ApplOriginData
If the user ID associated with an application has authority to set all the context fields, the
application can set this field to any value related to origin. If the queue manager sets this field, it is
set to blank.
User context
The following values are supported for MQINQMP or MQSETMP:
MQPD_USER _CONTEXT
The property is associated with the user context.
No special authorization is required to be able to set a property associated with the user context
using the MQSETMP call.
On a 7.0 or subsequent queue manager, a property associated with the user context is saved as
described for MQOO_SAVE_ALL_CONTEXT. An MQPUT with MQOO_PASS_ALL_CONTEXT specified
causes the property to be copied from the saved context into the new message.
MQPD_NO_CONTEXT
The property is not associated with a message context.
An unrecognized value is rejected with MQRC_PD_ERROR. The initial value of this field is
MQPD_NO_CONTEXT.
For a detailed description of each of the context fields, see MQMD - Message descriptor. For more
information about how to use message context, see Message context.
On IBM i , UNIX, Linux, and Windows systems, the authorization service provides the access
control when an application issues an MQI call to access an IBM MQ object that is a queue manager,
queue, process, topic, or namelist. This includes checks for alternative user authority and the authority to
set or pass context information.
On Windows , the OAM gives members of the Administrators group the authority to access all IBM MQ
objects, even when UAC is enabled.
Additionally, on Windows systems, the SYSTEM account has full access to IBM MQ resources.
The authorization service also provides authority checks when a PCF command operates on one of these
IBM MQ objects or an authentication information object. The equivalent MQSC command encapsulated
within an Escape PCF command is treated in the same way.
On IBM i , unless the user is a member of the QMQMADM group or has *ALLOBJ authority,
the authorization service also provides authority checks when a user issues a CL command in Group 2 that
operates on any of these IBM MQ objects or an authentication information object.
The authorization service is an installable service, which means that it is implemented by one or more
installable service components. Each component is invoked using a documented interface. This enables
users and vendors to provide components to augment or replace those provided by the IBM MQ products.
The authorization service component provided with IBM MQ is called the object authority manager (OAM).
The OAM is automatically enabled for each queue manager you create.
The OAM maintains an access control list (ACL) for each IBM MQ object it is controlling access to. On UNIX
and Linux systems, only group IDs can appear in an ACL. This means that all members of a group have
the same authorities. On IBM i and on Windows systems, both user IDs and group IDs can
appear in an ACL. This means that authorities can be granted to individual users and groups.
A 12 character limitation applies to both the group and the user ID. UNIX platforms generally restrict
the length of a user ID to 12 characters. AIX® and Linux have raised this limit but IBM MQ continues
to observe a 12 character restriction on all UNIX platforms. If you use a user ID of greater than 12
characters, IBM MQ replaces it with the value "UNKNOWN". Do not define a user ID with a value of
"UNKNOWN".
The OAM can authenticate a user and change appropriate identity context fields. You enable this by
specifying a connection security parameters structure (MQCSP) on an MQCONNX call. The structure is
passed to the OAM Authenticate User function (MQZ_AUTHENTICATE_USER), which sets appropriate
identity context fields. If an MQCONNX connection from an IBM MQ client, the information in the MQCSP
is flowed to the queue manager to which the client is connecting over the client-connection and server-
connection channel. If security exits are defined on that channel, the MQCSP is passed into each security
exit and can be altered by the exit. Security exits can also create the MQCSP. For more details of the use of
security exits in this context, see Channel security exit programs.
Warning: In some cases, the password in an MQCSP structure for a client application will be sent across
a network in plain text. To ensure that client application passwords are protected appropriately, see IBM
MQCSP password protection.
On UNIX, Linux and Windows systems, the control command setmqaut grants and revokes authorities
and is used to maintain the ACLs. For example, the command:
allows the members of the group VOYAGER to browse messages on the queue MOON.EUROPA that is
owned by the queue manager JUPITER. It allows the members to get messages from the queue as well.
To revoke these authorities later, enter the following command:
80 Securing IBM MQ
setmqaut -m JUPITER -t queue -n MOON.EUROPA -g VOYAGER -browse -get
The command:
allows the members of the group VOYAGER to put messages on any queue with a name that commences
with the characters MOON.. MOON.* is the name of a generic profile. A generic profile allows you to grant
authorities for a set of objects using a single setmqaut command.
The control command dspmqaut is available to display the current authorities that a user or group has
for a specified object. The control command dmpmqaut is also available to display the current authorities
associated with generic profiles.
On IBM i, an administrator uses the CL command GRTMQMAUT to grant authorities and the
CL command RVKMQMAUT to revoke authorities. Generic profiles can be used as well. For example, the
CL command:
provides the same function as the previous example of a setmqaut command; it allows the members
of the group VOYAGER to put messages on any queue with a name that commences with the characters
MOON.
The CL command DSPMQMAUT displays the current authorities that user or group has for a
specified object. The CL commands WRKMQMAUT and WRKMQMAUTD are also available to work with the
current authorities associated with objects and generic profiles.
If you do not want any authority checks, for example, in a test environment, you can disable the OAM.
The setmqaut and dmpmqaut commands are restricted to members of the mqm group. The equivalent
PCF commands can be executed by users in any group who have been granted dsp and chg authorities on
the queue manager.
For more information about using these commands, see Introduction to Programmable Command
Formats.
82 Securing IBM MQ
• Message channels must be created and controlled by authorized users
• Objects are kept in libraries and access to these libraries can be restricted
The message channel agent at a remote site must check that the message being delivered originated from
a user with authority to do so at this remote site. In addition, as MCAs can be started remotely, it might be
necessary to verify that the remote processes trying to start your MCAs are authorized to do so. There are
four possible ways for you to deal with this:
1. Make appropriate use of the PutAuthority attribute of your RCVR, RQSTR, or CLUSRCVR channel
definition to control which user is used for authorization checks at the time incoming messages are put
to your queues. See the DEFINE CHANNEL command description in the MQSC Command Reference.
2. Implement channel authentication records to reject unwanted connection attempts, or to set an
MCAUSER value based on the following: the remote IP address, the remote user ID, the TLS Subject
Distinguished Name (DN) provided, or the remote queue manager name.
3. Implement user exit security checking to ensure that the corresponding message channel is
authorized. The security of the installation hosting the corresponding channel ensures that all users
are properly authorized, so that you do not need to check individual messages.
4. Implement user exit message processing to ensure that individual messages are vetted for
authorization.
84 Securing IBM MQ
to it on the server to issue MQI calls. Choosing an alternative user ID is preferable to allowing clients to
make MQI calls with the authority of the server-connection MCA.
Because the server-connection MCA makes MQI calls on behalf of remote users, it is important to
consider the security implications of the server-connection MCA issuing MQI calls on behalf of remote
clients and how to administer the access of a potentially large number of users.
• One approach is for the server-connection MCA to issue MQI calls on its own authority. But beware, it is
normally undesirable for the server-connection MCA, with its powerful access capabilities, to issue MQI
calls on behalf of client users.
• Another approach is to use the user ID that flows from the client. The server-connection MCA can
issue MQI calls using the access capabilities of the client user ID. This approach presents a number of
questions to consider:
1. There are different formats for the user ID on different platforms. This sometimes causes problems if
the format of the user ID on the client differs from the acceptable formats on the server.
2. There are potentially many clients, with different, and changing user IDs. The IDs need to be defined
and managed on the server.
3. Is the user ID to be trusted? Any user ID can be flowed from a client, not necessarily the ID of the
logged on user. For example, the client might flow an ID with full mqm authority that was intentionally
only defined on the server for security reasons.
• The preferred approach is to define client identification tokens at the server, and so limit the capabilities
of client connected applications. This is typically done by setting the server-connection channel
property MCAUSER to a special user ID value to be used by clients, and defining few IDs for use by
clients with different level of authorization on the server.
Planning confidentiality
Plan how to keep your data confidential.
You can implement confidentiality at the application level or at link level. You might choose to use TLS,
in which case you must plan your usage of digital certificates. You can also use channel exit programs if
standard facilities do not satisfy your requirements.
Related concepts
“Comparing link level security and application level security” on page 87
This topic contains information about various aspects of link level security and application level security,
and compares the two levels of security.
“Channel exit programs” on page 91
86 Securing IBM MQ
Channel exit programs are programs that are called at defined places in the processing sequence of an
MCA. Users and vendors can write their own channel exit programs. Some are supplied by IBM.
“Protecting channels with SSL/TLS” on page 97
TLS support in IBM MQ uses the queue manager authentication information object, and various MQSC
commands. You must also consider your use of digital certificates.
Availability of components
Generally, in a distributed environment, a security service requires a component on at least two systems.
For example, a message might be encrypted on one system and decrypted on another. This applies to
both link level security and application level security.
In a heterogeneous environment, with different platforms in use, each with different levels of security
function, the required components of a security service might not be available for every platform on which
they are needed and in a form that is easy to use. This is probably more of an issue for application level
security than for link level security, particularly if you intend to provide your own application level security
by buying in components from various sources.
88 Securing IBM MQ
Here are some examples of link level security services:
• The MCA at each end of a message channel can authenticate its partner. This is done when the channel
starts and a communications connection has been established, but before any messages start to flow.
If authentication fails at either end, the channel is closed and no messages are transferred. This is an
example of an identification and authentication service.
• A message can be encrypted at the sending end of a channel and decrypted at the receiving end. This is
an example of a confidentiality service.
• A message can be checked at the receiving end of a channel to determine whether its contents have
been deliberately modified while it was being transmitted over the network. This is an example of a data
integrity service.
90 Securing IBM MQ
• It provides application-level, end-to-end data protection for your point to point messaging
infrastructure, using either encryption or digital signing of messages.
• It provides comprehensive security without writing complex security code or modifying or recompiling
existing applications.
• It uses Public Key Infrastructure (PKI) technology to provide authentication, authorization,
confidentiality, and data integrity services for messages.
• It provides administration of security policies for mainframe and distributed servers.
• It supports both IBM MQ servers and clients.
• It integrates with Managed File Transfer to provide an end-to-end secure messaging solution.
For more information, see “Advanced Message Security” on page 497.
There are several types of channel exit program, but only four have a role in providing link level security:
• Security exit
• Message exit
• Send exit
• Receive exit
These four types of channel exit program are illustrated in Figure 11 on page 92 and are described in the
following topics.
Related concepts
Channel-exit programs for messaging channels
Message exit
Message exits operate only on message channels and normally work in pairs. A message exit can operate
on the whole message and make various changes to it.
Message exits at the sending and receiving ends of a channel normally work in pairs. A message exit at
the sending end of a channel is called after the MCA has got a message from the transmission queue. At
the receiving end of a channel, a message exit is called before the MCA puts a message on its destination
queue.
A message exit has access to both the transmission queue header, MQXQH, which includes the embedded
message descriptor, and the application data in a message. A message exit can modify the contents of the
message and change its length. A change of length might be the result of compressing, decompressing,
encrypting, or decrypting the message. It might also be the result of adding data to the message, or
removing data from it.
92 Securing IBM MQ
Message exits can be used for any purpose that requires access to the whole message, rather than a
portion of it, and not necessarily for security.
A message exit can determine that the message it is currently processing should not proceed any further
towards its destination. The MCA then puts the message on the dead letter queue. A message exit can
also close the channel.
Message exits can be called only on message channels, not on MQI channels. This is because the purpose
of an MQI channel is to enable the input and output parameters of MQI calls to flow between the IBM MQ
MQI client application and the queue manager.
The name of a message exit is specified as a parameter in the channel definition at each end of a channel.
You can also specify a list of message exits to be run in succession.
For more information about message exits, see “Link level security using a message exit” on page 89.
Planning auditing
Decide what data you need to audit, and how you will capture and process audit information. Consider
how to check that your system is correctly configured.
There are several aspects to activity monitoring. The aspects you must consider are often defined by
auditor requirements, and these requirements are often driven by regulatory standards such as HIPAA
(Health Insurance Portability and Accountability Act) or SOX (Sarbanes-Oxley). IBM MQ provides features
intended to help with compliance to such standards.
Consider whether you are interested only in exceptions or whether you are interested in all system
behavior.
Some aspects of auditing can also be considered as operational monitoring; one distinction for auditing is
that you are often looking at historic data, not just looking at real-time alerts. Monitoring is covered in the
section Monitoring and performance.
94 Securing IBM MQ
Application activity within IBM MQ
To audit the actions of applications, for example opening of queues and putting and getting of
messages, configure IBM MQ to issue appropriate events.
Intruder alerts
To audit attempted breaches of security, configure your system to issue authorization events. Channel
events might also be useful to show activity, particularly if a channel ends unexpectedly.
Channel authorization
When you send or receive a message through a channel, you need to provide access to various IBM MQ
resources. Message Channel Agents (MCAs) are essentially IBM MQ applications that move messages
between queue managers, and as such require access to various IBM MQ resources to operate correctly.
To receive messages at PUT time for MCAs, you can use either the user ID associated with the MCA, or the
user ID associated with the message.
At CONNECT time you can map the asserted user ID to an alternative user, by using CHLAUTH channel
authentication records.
In IBM MQ, channels can be protected by TLS support.
The user IDs associated with sending and receiving channels, excluding the sender channel where the
MCAUSER attribute is unused, require access to the following resources:
• The user ID associated with a sending channel requires access to the queue manager, the transmission
queue, the dead-letter queue, and access to any other resources that are required by channel exits.
• The MCAUSER user ID of a receiver channel needs +setall authority. The reason is that the receiver
channel has to create the full MQMD, including all context fields, using the data it received from the
remote sender channel. The queue manager therefore requires that the user performing this activity has
the +setall authority. This +setall authority must be granted to the user for:
– All queues that the receiver channel validly puts messages to.
– The queue manager object. For more information, see Authorizations for context.
• The MCAUSER user ID of a receiver channel where the originator requested a COA report message
needs +passid authority on the transmission queue that returns the report message. Without this
authority, AMQ8077 error messages are logged.
Attention: When a channel reset is needed for message batch confirmation, IBM MQ attempts
to query the channel, which does require +dsp authority.
– The MCAUSER attribute is unused for the SDR channel type.
– If you use the user ID associated with the message, it is likely that the user ID is from a remote
system. This remote system user ID must be recognized by the target system. The following
commands are examples of the type of command that you can issue to grant authority to a user
ID from a remote system:
Attention: Exercise caution when authorizing a user ID to place messages onto the Command
Queue or other sensitive system queues.
The user ID associated with the MCA depends on the type of MCA. There are two types of MCA:
Caller MCA
MCAs that initiate a channel. Caller MCAs can be started as individual processes, as threads of the
channel initiator, or as threads of a process pool. The user ID used is the user ID associated with the
parent process (the channel initiator), or the user ID associated with the process that starts the MCA.
96 Securing IBM MQ
Responder MCA
Responder MCAs are MCAs that are started as a result of a request by a caller MCA. Responder MCAs
can be started as individual processes, as threads of the listener, or as threads of a process pool. The
user ID can be any one of the following types (in this order of preference):
1. On APPC, the caller MCA can indicate the user ID to be used for the responder MCA. This is called
the network user ID and applies only to channels started as individual processes. Set the network
user ID by using the USERID parameter of the channel definition.
2. If the USERID parameter is not used, the channel definition of the responder MCA can specify the
user ID that the MCA must use. Set the user ID by using the MCAUSER parameter of the channel
definition.
3. If the user ID has not been set by either of the previous (two) methods, the user ID of the process
that starts the MCA or the user ID of the parent process (the listener) is used.
Related concepts
“Channel authentication records” on page 45
To exercise more precise control over the access granted to connecting systems at a channel level, you
can use channel authentication records.
Related reference
Channel authentication record properties
Transmission queues
Queue managers automatically put remote messages on a transmission queue; no special authority is
required for this.
However, if you need to put a message directly on a transmission queue, this requires special
authorization; see Table 12 on page 114.
Channel exits
If channel authentication records are not suitable, you can use channel exits for added security. A security
exit forms a secure connection between two security exit programs. One program is for the sending
message channel agent (MCA), and one is for the receiving MCA.
See “Channel exit programs” on page 91 for more information about channel exits.
On Windows, UNIX, and Linux systems, you can use self-signed certificates. See
“Creating a self-signed personal certificate on UNIX, Linux, and Windows” on page 271for
instructions.
On IBM i systems, you can use certificates signed by the local CA. See “Requesting a
server certificate on IBM i” on page 256 for instructions.
On z/OS, you can use either self-signed or local CA-signed certificates. See “Creating a
self-signed personal certificate on z/OS” on page 297 or “Requesting a personal certificate on z/OS”
on page 298 for instructions.
Self-signed certificates are not suitable for production use, for the following reasons:
• Self-signed certificates cannot be revoked, which might allow an attacker to spoof an identity after
a private key has been compromised. CAs can revoke a compromised certificate, which prevents its
further use. CA-signed certificates are therefore safer to use in a production environment, though
self-signed certificates are more convenient for a test system.
• Self-signed certificates never expire. This is both convenient and safe in a test environment, but in a
production environment it leaves them open to eventual security breaches. The risk is compounded by
the fact that self-signed certificates cannot be revoked.
• A self-signed certificate is used both as a personal certificate and as a root (or trust anchor) CA
certificate. A user with a self-signed personal certificate might be able to use it to sign other personal
certificates. In general, this is not true of personal certificates issued by a CA, and represents a
significant exposure.
98 Securing IBM MQ
CipherSpecs and digital certificates
Only a subset of the supported CipherSpecs can be used with all of the supported types of digital
certificate. It is therefore necessary to choose an appropriate CipherSpec for your digital certificates.
Similarly, if your organization's security policy requires that a particular CipherSpec be used, then you
must obtain suitable digital certificates.
For more information on the relationship between CipherSpecs and digital certificates, refer to “Digital
certificates and CipherSpec compatibility in IBM MQ” on page 41
100 Securing IBM MQ
IBM MQ for z/OS server connection channel
The IBM MQ for z/OS SVRCONN channel is not secure without implementing channel authentication, or
adding a security exit using TLS. SVRCONN channels do not have a security exit defined by default.
Security concerns
SVRCONN channels are not secure as initially defined, SYSTEM.DEF.SVRCONN for example. To secure a
SVRCONN channel you must set up channel authentication using the SET CHLAUTH command, or install a
security exit and implement TLS.
You must use a publicly available sample security exit, write a security exit yourself, or purchase a
security exit.
There are several samples available that you can use as a good starting point for writing your own
SVRCONN channel security exit.
In IBM MQ for z/OS, the member CSQ4BCX3 in your hlq.SCSQC37S library is a security exit sample
written in the C language. Sample CSQ4BCX3 is also shipped pre-compiled in your hlq.SCSQAUTH library.
You can implement the CSQ4BCX3 sample exit by copying the compiled member
hlq.SCSQAUTH(CSQ4BCX3) into a load library that is allocated to the CSQXLIB DD in your CHIN Proc.
Note that the CHIN requires the load library to be set as "Program Controlled".
Alter your SVRCONN channel to set CSQ4BCX3 as the security exit.
When a client connects using that SVRCONN channel, CSQ4BCX3 will authenticate using the
RemoteUserIdentifier and RemotePassword pair from MQCD. If authentication is successful it will copy
RemoteUserIdentifier into MCAUserIdentifier, changing the identity context of the thread.
If you are writing an MQ Java client you can use pop-ups to query the user and set
MQEnvironment.userID and MQEnvironment.password. These values will be passed when the connection
is made.
Now that you have a functional security exit, there is the additional concern that the userid and password
are being transmitted in plain text across the network when the connection is made, as are the contents
of any subsequent IBM MQ messages. You can use TLS to encrypt this initial connection information as
well as the contents of any IBM MQ messages.
Example
To secure the IBM MQ Explorer SVRCONN channel SYSTEM.ADMIN.SVRCONN complete the following
steps:
1. Copy hlq.SCSQAUTH(CSQ4BCX3) into a load library that is allocated to the CSQXLIB DD in the CHINIT
Proc.
2. Verify that load library is Program Controlled.
3. Alter the SYSTEM ADMIN.SVRCONN to use security exit CSQ4BCX3.
4. In IBM MQ Explorer, right-click the z/OS Queue Manager name, select Connection Details >
Properties > Userid and enter your z/OS user ID.
5. Connect to the z/OS Queue Manager by entering a password.
Additional information
For exit CSQ4BCX3 to run in a Program Controlled environment, everything loaded into the CHIN address
space must be loaded from a Program Controlled library, for example, all libraries in STEPLIB and any
libraries named on CSQXLIB DD. To set a load library as Program Controlled issue RACF commands. In the
following example the load library name is MY.TEST.LOADLIB.
In the example above, the SVRCONN channel name being used is SYSTEM ADMIN.SVRCONN.
See “Channel exit programs” on page 91 for more information about channel exits.
Related tasks
Writing channel exit programs on z/OS
Logical units (LUs) can provide mandatory (or required) data cryptography, selective data cryptography, or
no data cryptography.
On a mandatory cryptographic session, an LU encrypts all outbound data request units and decrypts all
inbound data request units.
On a selective cryptographic session, an LU encrypts only the data request units specified by the sending
transaction program (TP). The sending LU signals that the data is encrypted by setting an indicator in the
request header. By checking this indicator, the receiving LU can tell which request units to decrypt before
passing them on to the receiving TP.
In an SNA network, IBM MQ MCAs are transaction programs. MCAs do not request encryption for any data
that they send. Selective data cryptography is not an option therefore; only mandatory data cryptography
or no data cryptography is possible on a session.
For information about how to implement mandatory data cryptography, see the documentation for your
SNA subsystem. Refer to the same documentation for information about stronger forms of encryption that
might be available for use on your platform, such as Triple DES 24-byte encryption on z/OS.
For more general information about session level cryptography, see Systems Network Architecture LU 6.2
Reference: Peer Protocols, SC31-6808.
102 Securing IBM MQ
environment, you might be prepared to trust the identities of the remaining components of the remote
system after the LU has been authenticated.
Session level authentication is achieved by each LU verifying its partner's password. The password is
called an LU-LU password because one password is established between each pair of LUs. The way that
an LU-LU password is established is implementation dependent and outside the scope of SNA.
Figure 12 on page 103 illustrates the flows for session level authentication.
The protocol for session level authentication is as follows. The numbers in the procedure correspond to
the numbers in Figure 12 on page 103.
1. The primary LU generates a random data value (RD1) and sends it to the secondary LU in the BIND
request.
2. When the secondary LU receives the BIND request with the random data, it encrypts the data using
the DES algorithm with its copy of the LU-LU password as the key. The secondary LU then generates a
second random data value (RD2) and sends it, with the encrypted data (ERD1), to the primary LU in the
BIND response.
3. When the primary LU receives the BIND response, it computes its own version of the encrypted data
from the random data it generated originally. It does this by using the DES algorithm with its copy of
the LU-LU password as the key. It then compares its version with the encrypted data that it received in
the BIND response. If the two values are the same, the primary LU knows that the secondary LU has
the same password as it does and the secondary LU is authenticated. If the two values do not match,
the primary LU terminates the session.
The primary LU then encrypts the random data that it received in the BIND response and sends the
encrypted data (ERD2) to the secondary LU in a Function Management Header 12 (FMH-12).
104 Securing IBM MQ
Figure 13. IBM MQ support for conversation level authentication
On IBM i, UNIX, and Windows, an MCA uses Common Programming Interface Communications (CPI-C)
calls to communicate with a partner MCA across an SNA network. In the channel definition at the caller
end of a channel, the value of the CONNAME parameter is a symbolic destination name, which identifies a
CPI-C side information entry (1). This entry specifies:
• The name of the partner LU
• The name of the partner TP, which is a responder MCA
• The name of the mode to be used for the conversation
A side information entry can also specify the following security information:
• A security type.
The commonly implemented security types are CM_SECURITY_NONE, CM_SECURITY_PROGRAM, and
CM_SECURITY_SAME, but others are defined in the CPI-C specification.
• A user ID.
• A password.
A caller MCA prepares to allocate a conversation with a responder MCA by issuing the CPI-C call CMINIT,
using the value of CONNAME as one of the parameters on the call. The CMINIT call identifies, for the
benefit of the local LU, the side information entry that the MCA intends to use for the conversation. The
local LU uses the values in this entry to initialize the characteristics of the conversation (2).
The caller MCA then checks the values of the USERID and PASSWORD parameters in the channel
definition (3). If USERID is set, the caller MCA issues the following CPI-C calls (4):
106 Securing IBM MQ
Security for queue manager clusters
Though queue manager clusters can be convenient to use, you must pay special attention to their
security.
A queue manager cluster is a network of queue managers that are logically associated in some way. A
queue manager that is a member of a cluster is called a cluster queue manager.
A queue that belongs to a cluster queue manager can be made known to other queue managers in the
cluster. Such a queue is called a cluster queue. Any queue manager in a cluster can send messages to
cluster queues without needing any of the following:
• An explicit remote queue definition for each cluster queue
• Explicitly defined channels to and from each remote queue manager
• A separate transmission queue for each outbound channel
You can create a cluster in which two or more queue managers are clones. This means that they have
instances of the same local queues, including any local queues declared as cluster queues, and can
support instances of the same server applications.
When an application connected to a cluster queue manager sends a message to a cluster queue that has
an instance on each of the cloned queue managers, IBM MQ decides which queue manager to send it to.
When many applications send messages to the cluster queue, IBM MQ balances the workload across each
of the queue managers that have an instance of the queue. If one of the systems hosting a cloned queue
manager fails, IBM MQ continues to balance the workload across the remaining queue managers until the
system that failed is restarted.
If you are using queue manager clusters, you need to consider the following security issues:
• Allowing only selected queue managers to send messages to your queue manager
• Allowing only selected users of a remote queue manager to send messages to a queue on your queue
manager
• Allowing applications connected to your queue manager to send messages only to selected remote
queues
These considerations are relevant even if you are not using clusters, but they become more important if
you are using clusters.
If an application can send messages to one cluster queue, it can send messages to any other cluster
queue without needing additional remote queue definitions, transmission queues, or channels. It
therefore becomes more important to consider whether you need to restrict access to the cluster queues
on your queue manager, and to restrict the cluster queues to which your applications can send messages.
There are some additional security considerations, which are relevant only if you are using queue
manager clusters:
• Allowing only selected queue managers to join a cluster
• Forcing unwanted queue managers to leave a cluster
For more information about all these considerations, see Keeping clusters secure. For
considerations specific to IBM MQ for z/OS, see “Security in queue manager clusters on z/OS” on page
243.
Related tasks
“Preventing queue managers receiving messages” on page 416
Multicast security
Use this information to understand why security processes might be needed with IBM MQ Multicast.
IBM MQ Multicast does not have in-built security. Security checks are handled in the queue manager at
MQOPEN time and the MQMD field setting is handled by the client. Some applications in the network
might not be IBM MQ applications (For example, LLM applications, see Multicast interoperability with
IBM MQ Low Latency Messaging for more information), therefore you might need to implement your own
security procedures because receiving applications cannot be certain of the validity of context fields.
108 Securing IBM MQ
As mentioned previously in this section, it might be possible for an application on the multicast
group address to publish malicious messages using native communication functions, which are
indistinguishable from MQ messages. Digital signatures provide proof of origin, and only the sender
knows the private key, which provides strong evidence that the sender is the originator of the
message.
For more information on this subject, see “Cryptographic concepts” on page 7.
110 Securing IBM MQ
• No: Define an hlq.NO.TOPIC.CHECKS profile for the required queue manager or queue-sharing
group in the MQADMIN or MXADMIN class.
9. Do any users need to protect the use of the MQOPEN or MQPUT1 options relating to the use of context?
• Yes: Ensure the MQADMIN or MXADMIN class is active. Define hlq.CONTEXT.queuename profiles at
the queue, queue manager, or queue sharing group level in the MQADMIN or MXADMIN class. Then
permit the appropriate users or groups access to these profiles.
• No: Define an hlq.NO.CONTEXT.CHECKS profile for the required queue manager or queue sharing
group in the MQADMIN or MXADMIN class.
10. Do you need to protect the use of alternative user IDs?
• Yes: Ensure the MQADMIN or MXADMIN class is active. Define the appropriate
hlq.ALTERNATE.USER. alternateuserid profiles for the required queue manager or queue
sharing group and permit the required users or groups access to these profiles.
• No: Define the profile hlq.NO.ALTERNATE.USER.CHECKS for the required queue manager or queue
sharing group in the MQADMIN or MXADMIN class.
11. Do you need to tailor which user IDs are to be used for resource security checks through RESLEVEL?
• Yes: Ensure the MQADMIN or MXADMIN class is active. Define an hlq.RESLEVEL profile at either
queue manager level or queue sharing group level in the MQADMIN or MXADMIN class. Then permit
the required users or groups access to the profile.
• No: Ensure that no generic profiles exist in the MQADMIN or MXADMIN class that can apply to
hlq.RESLEVEL. Define an hlq.RESLEVEL profile for the required queue manager or queue-sharing
group and ensure that no users or groups have access to it.
12. Do you need to 'timeout' unused user IDs from IBM MQ ?
• Yes: Determine what timeout values you would like to use and issue the MQSC ALTER SECURITY
command to change the TIMEOUT and INTERVAL parameters.
• No: Issue the MQSC ALTER SECURITY command to set the INTERVAL value to zero.
Note: Update the CSQINP1 initialization input data set used by your subsystem so that the MQSC
ALTER SECURITY command is issued automatically when the queue manager is started.
13. Do you use distributed queuing?
• Yes: Use channel authentication records. For more information, see “Channel authentication
records” on page 45.
• You can also determine the appropriate MCAUSER attribute value for each channel, or provide
suitable channel security exits.
14. Do you want to use Transport Layer Security (TLS)?
• Yes: To specify that any user presenting an TLS personal certificate containing a specified DN is to
use a specific MCAUSER, set a channel authentication record of type SSLPEERMAP. You can specify
a single distinguished name or a pattern including wildcards.
• Plan your TLS infrastructure. Install the System SSL feature of z/OS. In RACF, set up your certificate
name filters (CNFs), if you are using them, and your digital certificates. Set up your SSL key ring.
Ensure that the SSLKEYR queue manager attribute is nonblank and points to your SSL key ring. Also
ensure that the value of SSLTASKS is at least 2.
• No: Ensure that SSLKEYR is blank, and SSLTASKS is zero.
For further details about TLS, see “TLS security protocols in IBM MQ ” on page 23.
15. Do you use clients?
• Yes: Use channel authentication records.
• You can also determine the appropriate MCAUSER attribute value for each server-connection
channel, or provide suitable channel security exits if required.
16. Check your switch settings.
Setting up security
This collection of topics contains information specific to different operating systems, and to the use of
clients.
112 Securing IBM MQ
Access control object
Queue, process, queue manager, namelist, authentication information, channel, client connection
channel, listener, or service.
Authorization required
Expressed as an MQZAO_ constant.
In the tables, the constants prefixed by MQZAO_ correspond to the keywords in the authorization list
for the setmqaut command for the particular entity. For example, MQZAO_BROWSE corresponds to the
keyword +browse, MQZAO_SET_ALL_CONTEXT corresponds to the keyword +setall, and so on. These
constants are defined in the header file cmqzc.h, supplied with the product.
114 Securing IBM MQ
Table 12. Security authorization needed for MQPUT1 calls (continued)
Authorization required Queue object ( “1” on Process object Queue manager object
for: page 115 )
(Transmission queue) MQZAO_SET_ Not applicable MQZAO_SET_
( “8” on page 115 ) ALL_CONTEXT ALL_CONTEXT ( “6” on
page 115 )
MQPMO_ALTERNATE_ ( “12” on page 115 ) Not applicable MQZAO_ALTERNATE_
USER_AUTHORITY USER_AUTHORITY ( “10”
on page 115 )
CLEAR object
116 Securing IBM MQ
Object Authorization required
Service Not applicable
Communication information Not applicable
DELETE object
DISPLAY object
START object
118 Securing IBM MQ
STOP object
Channel Commands
Subscription Commands
Security Commands
Cluster Commands
Note:
1. For DEFINE commands, MQZAO_DISPLAY authority is also needed for the LIKE object if one is
specified, or on the appropriate SYSTEM.DEFAULT.xxx object if LIKE is omitted.
2. The MQZAO_CREATE authority is not specific to a particular object or object type. Create authority is
granted for all objects for a specified queue manager, by specifying an object type of QMGR on the
setmqaut command.
3. This applies if the object to be replaced already exists. If it does not, the check is as for DEFINE object
NOREPLACE.
Related information
Clustering: Using REFRESH CLUSTER best practices
120 Securing IBM MQ
Authorizations for PCF commands
This section summarizes the authorizations needed for each PCF command.
No check means that no authorization checking is carried out; Not applicable means that this operation is
not relevant to this object type.
The user ID under which the program that submits the command is running must also have the following
authorities:
• MQZAO_CONNECT authority to the queue manager
• MQZAO_DISPLAY authority on the queue manager in order to perform PCF commands
The special authorization MQZAO_ALL_ADMIN includes all the authorizations in the following list that are
relevant to the object type, except MQZAO_CREATE, which is not specific to a particular object or object
type.
Change object
Clear object
122 Securing IBM MQ
Object Authorization required
Client connection channel MQZAO_CREATE ( 2 )
Listener MQZAO_CREATE ( 2 )
Service MQZAO_CREATE ( 2 )
Communication information MQZAO_CREATE ( 2 )
Delete object
Inquire object
Start object
124 Securing IBM MQ
Object Authorization required
Communication information Not applicable
Stop object
Channel Commands
Subscription Commands
Security Commands
Status Displays
Cluster Commands
Note:
126 Securing IBM MQ
1. For Copy commands, MQZAO_DISPLAY authority is also needed for the From object.
2. The MQZAO_CREATE authority is not specific to a particular object or object type. Create authority is
granted for all objects for a specified queue manager, by specifying an object type of QMGR on the
setmqaut command.
3. For Create commands, MQZAO_DISPLAY authority is also needed for the appropriate
SYSTEM.DEFAULT.* object.
4. This applies if the object to be replaced already exists. If it does not, the check is as for Copy or Create
without replace.
Procedure
1. From SMITTY, select Security and Users and press Enter.
2. Select Groups and press Enter.
3. Select Add a Group and press Enter.
4. Enter the name of the group and the names of any users that you want to add to the group, separated
by commas.
5. Press Enter to create the group.
Results
You have now created a group.
Procedure
1. From SMITTY, select Security and Users and press Enter.
2. Select Groups and press Enter.
3. Select Change / Show Characteristics of Groups and press Enter.
4. Enter the name of the group to show a list of the members of the group.
5. Add the names of the users that you want to add to the group, separated by commas.
6. Press Enter to add the names to the group.
Procedure
1. From SMITTY, select Security and Users and press Enter.
2. Select Groups and press Enter.
3. Select Change / Show Characteristics of Groups and press Enter.
4. Enter the name of the group to show a list of the members of the group.
Results
The group members are displayed.
Procedure
1. From SMITTY, select Security and Users and press Enter.
2. Select Groups and press Enter.
3. Select Change / Show Characteristics of Groups and press Enter.
4. Enter the name of the group to show a list of the members of the group.
5. Delete the names of the users that you want to remove from the group.
6. Press Enter to remove the names from the group.
Results
You have now removed a user from a group.
Procedure
1. From the System Administration Manager (SAM), double-click Accounts for Users and Groups.
2. Double-click Groups.
3. Select Add from the Actions pull down to display the Add a New Group panel.
4. Enter the name of the group and select the users that you want to add to the group.
5. Click Apply to create the group.
Results
You have now created a group.
Procedure
1. From the System Administration Manager (SAM), double-click Accounts for Users and Groups.
2. Double-click Groups.
3. Highlight the name of the group and select Modify from the Actions pull down to display the Modify an
Existing Group panel.
4. Select a user that you want to add to the group and click Add.
5. If you want to add other users to the group, repeat step 4 for each user.
6. When you have finished adding names to the list, click OK.
Results
You have now added a user to a group.
128 Securing IBM MQ
Displaying who is in a group on HP-UX
Display who is in a group by using the System Administration Manager
Procedure
1. From the System Administration Manager (SAM), double-click Accounts for Users and Groups.
2. Double-click Groups.
3. Highlight the name of the group and select Modify from the Actions pull down to display the Modify an
Existing Group panel, showing a list of the users in the group.
Results
The group members are displayed.
Procedure
1. From the System Administration Manager (SAM), double-click Accounts for Users and Groups.
2. Double-click Groups.
3. Highlight the name of the group and select Modify from the Actions pull down to display the Modify an
Existing Group panel.
4. Select a user that you want to remove from the group and click Remove.
5. If you want to remove other users from the group, repeat step 4 for each user.
6. When you have finished removing names from the list, click OK.
Results
You have now removed a user from a group
Procedure
To create a new group, type the following command: groupadd -g group-ID group-name
, where group-ID is the numeric identifier of the group, and group-name is the name of the group.
Results
The file /etc/group file holds group information.
Procedure
To add a member to a supplementary group, execute the usermod command and list the supplementary
groups that the user is currently a member of, and the supplementary groups that the user is to become a
member of.
Procedure
To display who is a member of a group, type the following command: getent group group-name
, where group-name is the name of the group.
Procedure
To remove a member from a supplementary group, execute the usermod command listing the
supplementary groups that you want the user to remain a member of.
For example, if the user's primary group is users and the user is also a member of the groups mqm,
groupa and groupb, to remove the user from the mqm group, the following command is used: usermod
-G groupa,groupb user-name
, where user-name is the user name.
Procedure
Type the following command: groupadd group-name
where group-name is the name of the group.
Results
The file /etc/group file holds group information.
Procedure
To add a member to a supplementary group, execute the usermod command and list the supplementary
groups that the user is currently a member of, and the supplementary groups that the user is to become a
member of.
For example, if the user is a member of the group groupa, and is to become a member of groupb also,
use the following command: usermod -G groupa,groupb user-name, where user-name is the user
name.
130 Securing IBM MQ
Displaying who is in a group on Solaris
Display who is in a group by looking at the /etc/group file.
Procedure
• To discover who is a member of a group, look at the entry for that group in the /etc/group file.
Procedure
To remove a member from a supplementary group, execute the usermod command listing the
supplementary groups that you want the user to remain a member of.
For example, if the user's primary group is users and the user is also a member of the groups mqm,
groupa and groupb, to remove the user from the mqm group, the following command is used: usermod
-G groupa,groupb user-name, where user-name is the user name.
Procedure
1. Open the control panel
2. Double-click Administrative Tools.
The Administrative Tools panel opens.
3. Double-click Computer Management.
The Computer Management panel opens.
4. Expand Local Users and Groups.
5. Right-click Groups, and select New Group....
The New Group panel is displayed.
6. Type an appropriate name in the Group name field, then click Create.
7. Click Close.
Procedure
1. Open the control panel
2. Double-click Administrative Tools.
The Administrative Tools panel opens.
3. Double-click Computer Management.
The Computer Management panel opens.
4. From the Computer Management panel, expand Local Users and Groups.
5. Select Users
6. Double-click the user that you want to add to a group.
The user properties panel is displayed.
7. Select the Member Of tab.
8. Select the group that you want to add the user to. If the group you want is not visible:
a) Click Add....
The Select Groups panel is displayed.
b) Click Locations....
The Locations panel is displayed.
c) Select the location of the group you want to add the user to from the list and click OK.
d) Type the group name in the field provided.
Alternatively, click Advanced... and then Find Now to list the groups available in the currently
selected location. From here, select the group you want to add the user to and click OK.
e) Click OK.
The user properties panel is displayed, showing the group you added.
f) Select the group.
9. Click OK.
The Computer Management panel is displayed.
Procedure
1. Open the control panel
2. Double-click Administrative Tools.
The Administrative Tools panel opens.
3. Double-click Computer Management.
The Computer Management panel opens.
4. From the Computer Management panel, expand Local Users and Groups.
5. Select Groups.
6. Double-click a group. The group properties panel is displayed.
The group properties panel is displayed.
Results
The group members are displayed.
132 Securing IBM MQ
Removing a user from a group on Windows
Remove a user from a group by using the control panel.
Procedure
1. Open the control panel
2. Double-click Administrative Tools.
The Administrative Tools panel opens.
3. Double-click Computer Management.
The Computer Management panel opens.
4. From the Computer Management panel, expand Local Users and Groups.
5. Select Users.
6. Double-click the user that you want to add to a group.
The user properties panel is displayed.
7. Select the Member Of tab.
8. Select the group that you want to remove the user from, then click Remove.
9. Click OK.
The Computer Management panel is displayed.
Results
You have now removed the user from the group.
Local and domain user accounts for the IBM MQ Windows service
When IBM MQ is running, it must check that only authorized users can access queue managers or queues.
This requires a special user account that IBM MQ can use to query information about the any user
attempting such access.
• “Configuring special user accounts with the Prepare IBM MQ Wizard” on page 133
• “Using IBM MQ with Active Directory” on page 134
• “User rights required for an IBM MQ Windows service” on page 134
134 Securing IBM MQ
Table 14. User rights required for an IBM MQ Windows service (continued)
Permission Description
Shut down the system Allows the IBM MQ Windows service to restart the
server if configured to do so when recovery of a
service fails.
Increase quotas Required for operating system
CreateProcessAsUser call.
Act as part of the operating system Required for operating system LogonUser call.
Bypass traverse checking Required for operating system LogonUser call.
Replace a process level token Required for operating system LogonUser call.
Note: Debug programs rights might be needed in environments running ASP and IIS applications.
Your domain user account must have these Windows user rights set as effective user rights as listed
in the Local Security Policy application. If they are not, set them using either the Local Security Policy
application locally on the server, or by using the Domain Security Application domain wide.
Changing the password of the IBM MQ Windows service local user account
You can change the password of the IBM MQ Windows service local user account by using the Computer
Management panel.
Procedure
1. Identify the user the service is running under.
2. Stop the IBM MQ service from the Computer Management panel.
3. Change the required password in the same way that you would change the password of an individual.
4. Go to the properties for the IBM MQ service from the Computer Management panel.
5. Select the Log On page.
6. Confirm that the account name specified matches the user for which the password was modified.
7. Type the password into the Password and Confirm password fields and click OK.
Procedure
1. Change the password for the domain account on the domain controller. You might need to ask your
domain administrator to do this for you.
2. Complete the following the steps to modify the Log On page for the IBM MQ service.
a) Identify the user that the service is running under.
b) Stop the IBM MQ service from the Computer Management panel.
c) Change the required password in the same way that you would change the password of an
individual.
d) Go to the properties for the IBM MQ service from the Computer Management panel.
e) Select the Log On page.
f) Confirm that the account name specified matches the user for which the password was modified.
g) Type the password into the Password and Confirm password fields and click OK.
The user account that IBM MQ Windows service runs under executes any MQSC commands that are
issued by user interface applications, or performed automatically on system startup, shutdown, or
service recovery. This user account must therefore have IBM MQ administration rights. By default it
136 Securing IBM MQ
is added to the local mqm group on the server. If this membership is removed, the IBM MQ Windows
service does not work. For more information about user rights, see “User rights required for an IBM MQ
Windows service” on page 134.
If a security problem arises with the user account that the IBM MQ Windows service runs under, error
messages and descriptions appear in the system event log.
Related tasks
Configuring IBM MQ with the Prepare IBM MQ Wizard
>crtmqm qm0
AMQ8066:Local mqm group not found.
To remedy this problem, re-create the local mqm group using the standard Windows management tools.
Because all group membership information is lost, you must reinstate privileged IBM MQ users in the
newly-created local mqm group. If the machine is a domain member, you must also add the domain mqm
group to the local mqm group to grant privileged domain IBM MQ user IDs the required level of authority.
Procedure
1. Open the Administrative Tools panel:
Windows Server 2008 and Windows Server 2012
Access this panel using Control Panel > System and Maintenance > Administrative Tools.
Windows 8.1
Access this panel using Administrative Tools > Computer Management
138 Securing IBM MQ
2. Double-click Local Security Policy.
3. Expand Local Policies.
4. Click User Rights Assignment.
5. Add the new user or group to the Create global objects policy.
Procedure
1. Start the Local Security Policy tool, click Security Settings->Local Policies->User Right Assignments,
the click Debug Programs.
2. Double-click Debug Programs, then add your IBM MQ user ID to the list
If the system is in a Windows domain and the effective policy setting is still not set, even though the
local policy setting is set, the user ID must be authorized in the same way at domain level, using the
Domain Security Policy tool.
140 Securing IBM MQ
2. During installation of IBM MQ for IBM i, the following special user profiles are created:
QMQM
Is used primarily for internal product-only functions. However, it can be used to run trusted
applications using MQCNO_FASTPATH_BINDINGS. See Connecting to a queue manager using the
MQCONNX call.
QMQMADM
Is used as a group profile for administrators of IBM MQ. The group profile gives access to CL
commands and IBM MQ resources.
When using SBMJOB to submit programs that call IBM MQ commands, USER must not be set explicitly
to QMQMADM. Instead, set USER to QMQM or another user profile that has QMQMADM specified as a
group.
3. If you are sending channel commands to remote queue managers, ensure that your user profile is a
member of the group QMQMADM on the target system. For a list of PCF and MQSC channel commands,
see IBM MQ for IBM i CL commands.
4. The group set associated with a user is cached when the group authorizations are computed by the
OAM.
Any changes made to a user's group memberships after the group set has been cached are not
recognized until you restart the queue manager or execute RFRMQMAUT to refresh security.
5. Limit the number of users who have authority to work with commands that are particularly sensitive.
These commands include:
• Create Message Queue Manager ( CRTMQM )
• Delete Message Queue Manager ( DLTMQM )
• Start Message Queue Manager ( STRMQM )
• End Message Queue Manager ( ENDMQM )
• Start Command Server ( STRMQMCSVR )
• End Command Server ( ENDMQMCSVR )
6. Channel definitions contain a security exit program specification. Channel creation and modification
requires special considerations. Details of security exits are given in “Security exit overview” on page
92.
7. The channel exit and trigger monitor programs can be substituted. The security of such replacements
is the responsibility of the programmer.
Changes to the authority structure of some of the product's CL commands allows public use of these
commands, if you have the required OAM authority to the IBM MQ objects to make these changes.
To be an IBM MQ administrator on IBM i, you must be a member of the QMQMADM group. This group has
properties like the properties of the mqm group on UNIX, Linux and Windows systems. In particular, the
QMQMADM group is created when you install IBM MQ for IBM i, and members of the QMQMADM group
have access to all IBM MQ resources on the system. You also have access to all IBM MQ resources if you
have *ALLOBJ authority.
Administrators can use CL commands to administer IBM MQ. One of these commands is GRTMQMAUT,
which is used to grant authorities to other users. Another command, STRMQMMQSC, enables an
administrator to issue MQSC commands to a local queue manager.
Related concepts
“Authority to administer IBM MQ on IBM i” on page 73
142 Securing IBM MQ
– STRMQMDLQ, Start IBM MQ Dead-Letter Queue Handler
• Listener Command
– ENDMQMLSR, End IBM MQ listener
– STRMQMLSR, Start non-object listener
• Media Recovery Commands
– RCDMQMIMG, Record IBM MQ Object Image
– RCRMQMOBJ, Re-create IBM MQ Object
– WRKMQMTRN, Work with IBM MQ Q Transactions
• Queue Manager Commands
– CRTMQM, Create Message Queue Manager
– DLTMQM, Delete Message Queue Manager
– ENDMQM, End Message Queue Manager
– STRMQM, Start Message Queue Manager
• Security Commands
– GRTMQMAUT, Grant IBM MQ Object Authority
– RVKMQMAUT, Revoke IBM MQ Object Authority
• Trace Command
– TRCMQM, Trace IBM MQ Job
• Transaction Commands
– RSVMQMTRN, Resolve IBM MQ Transaction
• Trigger Monitor Commands
– STRMQMTRM, Start Trigger Monitor
• IBM MQSC Commands
– RUNMQSC, Run IBM MQSC Commands
– STRMQMMQSC, Start IBM MQSC Commands
Group 2
The rest of the commands, for which two levels of authority are required:
1. IBM i authority to run the command. An IBM MQ administrator sets this using the GRTOBJAUT
command to override the *PUBLIC(*EXCLUDE) restriction for a user or group of users.
For example:
2. IBM MQ authority to manipulate the IBM MQ objects associated with the command, or commands,
given the correct IBM i authority in Step 1.
This authority is controlled by the user having the appropriate OAM authority for the required
action, set by an IBM MQ administrator using the GRTMQMAUT command
For example:
144 Securing IBM MQ
- *admclr for the Clear IBM MQ Channel command.
- *admcrt for the Create and Copy IBM MQ Channel command.
- *admdlt for the Delete IBM MQ Channel command.
- *admdsp for the Display IBM MQ Channel command.
- *ctrl for the Start IBM MQ Channel command.
- *ctrl for the End IBM MQ Channel command.
- *ctrl for the Ping IBM MQ Channel command.
- *ctrlx for the Reset IBM MQ Channel command.
- *ctrlx for the Resolve IBM MQ Channel command.
– WRKMQMCHST, Work with IBM MQ Channel Status
This requires *admdsp authority to the channel.
– WRKMQMCL, Work with IBM MQ Clusters
– WRKMQMCLQ, Work with IBM MQ Cluster Queues
– WRKMQMCLQM, Work with IBM MQ Cluster Queue Manager
– WRKMQMLSR, Work with IBM MQ Listener
– WRKMQMMSG, Work with IBM MQ Messages
This requires *browse authority to the queue
– WRKMQMNL, Work with IBM MQ Namelists
This requires the following authorities:
- *admchg for the Change IBM MQ Namelist command.
- *admcrt for the Create and Copy IBM MQ Namelist command.
- *admdlt for the Delete IBM MQ Namelist command.
- *admdsp for the Display IBM MQ Namelist command.
– WRKMQMPRC, Work with IBM MQ Processes
This requires the following authorities:
- *admchg for the Change IBM MQ Process command.
- *admcrt for the Create and Copy IBM MQ Process command.
- *admdlt for the Delete IBM MQ Process command.
- *admdsp for the Display IBM MQ Process command.
– WRKMQMQ, Work with IBM MQ queues
This requires the following authorities:
- *admchg for the Change IBM MQ Queue command.
- *admclr for the Clear IBM MQ Queue command.
- *admcrt for the Create and Copy IBM MQ Queue command.
- *admdlt for the Delete IBM MQ Queue command.
- *admdsp for the Display IBM MQ Queue command.
– WRKMQMQSTS, Work with IBM MQ Queue Status
– WRKMQMTOP, Work with IBM MQ Topics
This requires the following authorities
- *admchg for the Change IBM MQ Topic command.
- *admcrt for the Create and Copy IBM MQ Topic command.
- *admdlt for the Delete IBM MQ Topic command.
146 Securing IBM MQ
This requires *connect authority to the queue manager and *admdsp authority to the
authentication information object and *admcrt authority to the authentication information object
class.
– CPYMQMNL, Copy IBM MQ Namelist
This requires *connect and *admcrt authority to the queue manager.
– CPYMQMPRC, Copy IBM MQ Process
This requires *connect and *admcrt authority to the queue manager.
– CPYMQMQ, Copy IBM MQ Queue
This requires *connect and *admcrt authority to the queue manager.
– CRTMQMAUTI, Create IBM MQ Authentication Information
This requires *connect authority to the queue manager and *admdsp authority to the
authentication information object and *admcrt authority to the authentication information object
class.
– CRTMQMNL, Create IBM MQ Namelist
This requires *connect and *admcrt authority to the queue manager and *admdsp authority to
the default namelist.
– CRTMQMPRC, Create IBM MQ Process
This requires *connect and *admcrt authority to the queue manager and *admdsp authority to
the default process.
– CRTMQMQ, Create IBM MQ Queue
This requires *connect and *admcrt authority to the queue manager and *admdsp authority to
the default queue.
– CVTMQMDTA, Convert IBM MQ Data Type Command
This requires no IBM MQ object authority.
– DLTMQMAUTI, Delete IBM MQ Authentication Information
This requires *connect authority to the queue manager and *ctrlx authority to the
authentication information object.
– DLTMQMNL, Delete IBM MQ Namelist
This requires *connect authority to the queue manager and *admdlt authority to the namelist.
– DLTMQMPRC, Delete IBM MQ Process
This requires *connect authority to the queue manager and *admdlt authority to the process.
– DLTMQMQ, Delete IBM MQ Queue
This requires *connect authority to the queue manager and *admdlt authority to the queue.
– DSCMQM, Disconnect from Message Queue Manager
This requires no IBM MQ object authority.
– RFRMQMAUT, Refresh Security
This requires *connect authority to the queue manager.
– RFRMQMCL, Refresh Cluster
This requires *connect authority to the queue manager.
– RSMMQMCLQM, Resume Cluster Queue Manager
This requires *connect authority to the queue manager.
– RSTMQMCL, Reset Cluster
This requires *connect authority to the queue manager.
148 Securing IBM MQ
Table 17. Authorizations for MQSC and PCF calls (continued)
AUT Description
*ADMCLR Clear the specified object (PCF Clear object command only).
*ADMCRT Create objects of the specified type.
*ADMDLT Delete the specified object.
*ADMDSP Display the attributes of the specified object.
1.
GRTMQMAUT OBJ(RED.LOCAL.QUEUE) OBJTYPE(*LCLQ) USER(GROUPA) +
AUT(*BROWSE *PUT) MQMNAME('saturn.queue.manager')
In this example:
• RED.LOCAL.QUEUE is the object name.
• *LCLQ (local queue) is the object type.
• GROUPA is the name of a user profile on the system for which authorizations are to change. This
profile can be used as a group profile for other users.
• *BROWSE and *PUT are the authorizations being granted to the specified queue.
*BROWSE adds authorization to browse messages on the queue (to issue MQGET with the browse
option).
*PUT adds authorization to put (MQPUT) messages on the queue.
• saturn.queue.manager is the queue manager name.
2. The following command grants to users JACK and JILL all applicable authorizations, to all process
definitions, for the default queue manager.
1.
RVKMQMAUT OBJ(RED.LOCAL.QUEUE) OBJTYPE(*LCLQ) USER(GROUPA) +
AUT(*PUT) MQMNAME('saturn.queue.manager')
The authority to put messages to the specified queue, that was granted in the previous example, is
removed for GROUPA.
2.
RVKMQMAUT OBJ(PAY*) OBJTYPE(*Q) USER(*PUBLIC) AUT(*GET) +
MQMNAME(PAYROLLQM)
Authority to get messages from any queue with a name starting with the characters PAY, owned by
queue manager PAYROLLQM, is removed from all users of the system unless they, or a group to which
they belong, have been separately authorized.
RFRMQMAUT MQMNAME(ADMINQM)
150 Securing IBM MQ
Action to be performed
MQI option, MQSC command, or PCF command.
Access control object
Queue, process definition, queue manager, namelist, channel, client connection channel, listener,
service, or authentication information object.
Authorization required
Expressed as an MQZAO_ constant.
In the tables, the constants prefixed by MQZAO_ correspond to the keywords in the authorization list
for the GRTMQMAUT and RVKMQMAUT commands for the particular entity. For example, MQZAO_BROWSE
corresponds to the keyword *BROWSE ; similarly, the keyword MQZAO_SET_ALL_CONTEXT corresponds
to the keyword *SETALL, and so on. These constants are defined in the header file cmqzc.h, which is
supplied with the product.
MQI authorizations
An application is allowed to issue specific MQI calls and options only if the user identifier under which it is
running (or whose authorizations it is able to assume) has been granted the relevant authorization.
Four MQI calls require authorization checks: MQCONN, MQOPEN, MQPUT1, and MQCLOSE.
For MQOPEN and MQPUT1, the authority check is made on the name of the object being opened, and
not on the name, or names, resulting after a name has been resolved. For example, an application can
be granted authority to open an alias queue without having authority to open the base queue to which
the alias resolves. The rule is that the check is carried out on the first definition encountered during the
process of name resolution that is not a queue manager alias, unless the queue manager alias definition
is opened directly; that is, its name appears in the ObjectName field of the object descriptor. Authority
is always needed for the particular object being opened; in some cases additional queue-independent
authority, obtained through an authorization for the queue manager object, is required.
Table 19 on page 151, Table 20 on page 151, Table 21 on page 152, and Table 22 on page 153
summarize the authorizations needed for each call.
Note: These tables do not mention namelists, channels, client connection channels, listeners, services,
or authentication information objects. This is because none of the authorizations apply to these objects,
except for MQOO_INQUIRE, for which the same authorizations apply as for the other objects.
152 Securing IBM MQ
Table 21. Security authorization needed for MQPUT1 calls (continued)
Authorization required Queue object ( “1” on Process object Queue manager object
for: page 153 )
MQPMO_ALTERNATE_ ( “13” on page 153 ) Not applicable MQZAO_ALTERNATE_
USER_AUTHORITY USER_AUTHORITY ( “11”
on page 153 )
154 Securing IBM MQ
Object Authorization required
Channel MQZAO_CHANGE
Client connection channel MQZAO_CHANGE
Listener MQZAO_CHANGE
Service MQZAO_CHANGE
CLEAR object
DELETE object
DISPLAY object
PING CHANNEL
156 Securing IBM MQ
Object Authorization required
Process Not applicable
Queue manager Not applicable
Namelist Not applicable
Authentication information Not applicable
Channel MQZAO_CONTROL
Client connection channel Not applicable
Listener Not applicable
Service Not applicable
RESET CHANNEL
RESOLVE CHANNEL
STOP object
Note:
1. For DEFINE commands, MQZAO_DISPLAY authority is also needed for the LIKE object if one is
specified, or on the appropriate SYSTEM.DEFAULT.xxx object if LIKE is omitted.
2. The MQZAO_CREATE authority is not specific to a particular object or object type. Create authority is
granted for all objects for a specified queue manager, by specifying an object type of QMGR on the
GRTMQMAUT command.
3. This option applies if the object to be replaced already exists. If it does not, the check is as for DEFINE
object NOREPLACE.
158 Securing IBM MQ
The user ID under which the program that submits the command is running must also have the following
authorities:
• MQZAO_CONNECT authority to the queue manager
• DISPLAY authority on the queue manager in order to perform PCF commands
The special authorization MQZAO_ALL_ADMIN includes the following authorizations:
• MQZAO_CHANGE
• MQZAO_CLEAR
• MQZAO_DELETE
• MQZAO_DISPLAY
• MQZAO_CONTROL
• MQZAO_CONTROL_EXTENDED
MQZAO_CREATE is not included as it is not specific to a particular object or object type
Change object
Clear object
Copy object (with replace) ( “1” on page 164, “4” on page 164 )
160 Securing IBM MQ
Object Authorization required
Service MQZAO_CHANGE
Create object (with replace) ( “3” on page 164, “4” on page 164 )
Delete object
Inquire object
Ping Channel
Reset Channel
162 Securing IBM MQ
Object Authorization required
Authentication information Not applicable
Channel MQZAO_CONTROL_EXTENDED
Client connection channel Not applicable
Listener Not applicable
Service Not applicable
Resolve Channel
Start Channel
Stop Channel
Note:
1. For Copy commands, MQZAO_DISPLAY authority is also needed for the From object.
2. The MQZAO_CREATE authority is not specific to a particular object or object type. Create authority is
granted for all objects for a specified queue manager, by specifying an object type of QMGR on the
GRTMQMAUT command.
3. For Create commands, MQZAO_DISPLAY authority is also needed for the appropriate
SYSTEM.DEFAULT.* object.
4. This option applies if the object to be replaced already exists. If it does not, the check is as for Copy or
Create without replace.
164 Securing IBM MQ
Using wildcard characters
What makes a profile generic is the use of special characters (wildcard characters) in the profile name.
For example, the question mark (?) wildcard character matches any single character in a name. So, if you
specify ABC.?EF, the authorization you give to that profile applies to any objects created with the names
ABC.DEF, ABC.CEF, ABC.BEF, and so on.
The wildcard characters available are:
?
Use the question mark (?) instead of any single character. For example, AB.?D would apply to the
objects AB.CD, AB.ED, and AB.FD.
*
Use the asterisk (*) as:
• A qualifier in a profile name to match any one qualifier in an object name. A qualifier is the part of an
object name delimited by a period. For example, in ABC.DEF.GHI, the qualifiers are ABC, DEF, and
GHI.
For example, ABC.*.JKL would apply to the objects ABC.DEF.JKL, and ABC.GHI.JKL. (Note that
it would not apply to ABC.JKL ; * used in this context always indicates one qualifier.)
• A character within a qualifier in a profile name to match zero or more characters within the qualifier
in an object name.
For example, ABC.DE*.JKL would apply to the objects ABC.DE.JKL, ABC.DEF.JKL, and
ABC.DEGH.JKL.
**
Use the double asterisk (**) once in a profile name as:
• The entire profile name to match all object names. For example, if you use the keyword OBJTYPE
(*PRC) to identify processes, then use ** as the profile name, you change the authorizations for all
processes.
• As either the beginning, middle, or ending qualifier in a profile name to match zero or more qualifiers
in an object name. For example, **.ABC identifies all objects with the final qualifier ABC.
Profile priorities
An important point to understand when using generic profiles is the priority that profiles are given when
deciding what authorities to apply to an object being created. For example, suppose that you have issued
the commands:
The first gives put authority to all queues for the principal FRED with names that match the profile AB.*;
the second gives get authority to the same types of queue that match the profile AB.C*.
Suppose that you now create a queue called AB.CD. According to the rules for wildcard matching, either
GRTMQMAUT could apply to that queue. So, does it have put or get authority?
To find the answer, you apply the rule that, whenever multiple profiles can apply to an object, only the
most specific applies. The way that you apply this rule is by comparing the profile names from left to
right. Wherever they differ, a non-generic character is more specific than a generic character. So, in the
previous example, the queue AB.CD has get authority (AB.C* is more specific than AB.*).
When you are comparing generic characters, the order of specificity is:
1. ?
2. *
3. **
WRKMQMAUT
This command allows you to work with the authority data held in the authority queue.
Note: To run this command you must have *connect and *admdsp authority to the queue manager.
However, to create or delete a profile, you need QMQMADM authority.
If you output the information to the screen, a list of authority profile names, together with their types, is
displayed. If you print the output, you receive a detailed list of all the authority data, the registered users,
and their authorities.
Entering an object or profile name on this panel, and pressing ENTER takes you to the results panel for
WRKMQMAUT .
If you select 4=Delete, you go to a new panel from which you can confirm that you want to delete all the
user names registered to the generic authority profile name you specify. This option runs RVKMQMAUT with
the option *REMOVE for all the users, and applies only to generic profile names.
If you select 12=Work with profile you go to the WRKMQMAUTD command results panel, as explained
in “WRKMQMAUTD” on page 167.
166 Securing IBM MQ
WRKMQMAUTD
This command allows you to display all the users registered with a particular authority profile name
and object type. To run this command you must have *connect and *admdsp authority to the queue
manager. However, to grant, run, create, or delete a profile you need QMQMADM authority.
Selecting F24=More keys from the initial input panel, followed by option F9=All Parameters displays
the Service Component Name as for GRTMQMAUT and RVKMQMAUT.
Note: The F11=Display Object Authorizations key toggles between the following types of
authorities:
• Object authorizations
• Context authorizations
• MQI authorizations
The options on the screen are:
2=Grant
Takes you to the GRTMQMAUT panel to add to the current authorities.
3=Revoke
Takes you to the RVKMQMAUT panel to remove some of the current definitions
4=Delete
Takes you to a panel that allows you to delete the authority data for specified users. This runs
RVKMQMAUT with the option *REMOVE.
5=Display
Takes you to the existing DSPMQMAUT command
F6=Create
Takes you to the GRTMQMAUT panel that allows you to create a profile authority record.
Queues
The authority to a dynamic queue is based on, but is not necessarily the same as, that of the model queue
from which it is derived.
For alias queues and remote queues, the authorization is that of the object itself, not the queue to which
the alias or remote queue resolves. It is possible to authorize a user profile to access an alias queue that
resolves to a local queue to which the user profile has no access permissions.
Limit the authority to create queues to privileged users. If you do not, users can bypass the normal access
control by creating an alias.
Context authority
Context is information that applies to a particular message and is contained in the message descriptor,
MQMD, which is part of the message.
For descriptions of the message descriptor fields relating to context, see MQMD overview.
For information about the context options, see Message context.
168 Securing IBM MQ
Protecting channels with SSL/TLS
The Transport Layer Security (TLS) protocol provide channel security, with protection against
eavesdropping, tampering, and impersonation. IBM MQ support for TLS enables you to specify, on the
channel definition, that a particular channel uses TLS security. You can also specify details of the security
you want, such as the encryption algorithm you want to use.
TLS support in IBM MQ uses the queue manager authentication information object and various CL and
MQSC commands and queue manager and channel parameters that define the TLS support required in
detail.
The following CL commands support TLS:
WRKMQMAUTI
Work with the attributes of an authentication information object.
CHGMQMAUTI
Modify the attributes of an authentication information object.
CRTMQMAUTI
Create an authentication information object.
CPYMQMAUTI
Create an authentication information object by copying an existing one.
DLTMQMAUTI
Delete an authentication information object.
DSPMQMAUTI
Displays the attributes for a specific authentication information object.
For an overview of channel security using TLS, see
• Protecting channels with TLS
For details of PCF commands associated with TLS, see
• Change, Copy, and Create Authentication Information Object
• Delete Authentication Information Object
• Inquire Authentication Information Object
Some classes have a related group class that enables you to put together groups of resources that have
similar access requirements. For details about the difference between the member and group classes and
when to use a member or group class, see the z/OS Security Server RACF Security Administrator's Guide.
The classes must be activated before security checks can be made. To activate all the IBM MQ classes,
you can use this RACF command:
SETROPTS CLASSACT(MQADMIN,MXADMIN,MQQUEUE,MXQUEUE,MQPROC,MXPROC,
MQNLIST,MXNLIST,MXTOPIC,MQCONN,MQCMDS)
170 Securing IBM MQ
You should also ensure that you set up the classes so that they can accept generic profiles. You also do
this with the RACF command SETROPTS, for example:
SETROPTS GENERIC(MQADMIN,MXADMIN,MQQUEUE,MXQUEUE,MQPROC,MXPROC,
MQNLIST,MXNLIST,MXTOPIC,MQCONN,MQCMDS)
RACF profiles
All RACF profiles used by IBM MQ contain a prefix, which is either the queue manager name or the queue
sharing group name. Be careful when you use the percent sign as a wildcard.
All RACF profiles used by IBM MQ contain a prefix. For queue sharing group level security, this is the
queue sharing group name. For queue manager level security, the prefix is the queue manager name. If
you are using a mixture of queue manager and queue sharing group level security, you will use profiles
with both types of prefix. (Queue sharing group and queue manager level security are described in IBM
MQ for z/OS concepts: security.)
For example, if you want to protect a queue called QUEUE_FOR_SUBSCRIBER_LIST in queue-sharing
group QSG1 at queue sharing group level, the appropriate profile would be defined to RACF as:
If you want to protect a queue called QUEUE_FOR_LOST_CARD_LIST, that belongs to queue manager
STCD at queue manager level, the appropriate profile would be defined to RACF as:
This means that different queue managers and queue sharing groups can share the same RACF database
and yet have different security options.
Do not use generic queue manager names in profiles to avoid unanticipated user access.
IBM MQ allows the use of the percent sign (%) in object names. However, RACF uses the % character as
a single-character wildcard. This means that when you define an object name with a % character in its
name, you must consider this when you define the corresponding profile.
For example, for the queue CREDIT_CARD_%_RATE_INQUIRY, on queue manager CRDP, the profile would
be defined to RACF as follows:
• Uppercase profiles; you can define a profile in the IBM MQ RACF class MQQUEUE
The first example, using mixed case profiles, gives you more granular control over granting authority to
access the resource.
Switch profiles
To control the security checking performed by IBM MQ, you use switch profiles. A switch profile is a
normal RACF profile that has a special meaning to IBM MQ. The access list in switch profiles is not used
by IBM MQ.
IBM MQ maintains an internal switch for each switch type shown in tables Switch profiles for subsystem
level security, Switch profiles for queue sharing group or queue manager level security,and Switch profiles
for resource checking. Switch profiles can be maintained at queue sharing group level, or at queue
manager level, or at a combination of both. Using a single set of queue sharing group security switch
profiles, you can control security on all the queue managers within a queue sharing group.
When a security switch is set on, the security checks associated with the switch are performed. When a
security switch is set off, the security checks associated with the switch are bypassed. The default is that
all security switches are set on.
172 Securing IBM MQ
If both RACF and the MQADMIN or MXADMIN class are active, IBM MQ checks the MQADMIN or
MXADMIN class to see whether any of the switch profiles have been defined. It first checks the profiles
described in “Profiles to control subsystem security” on page 173. If subsystem security is not required,
IBM MQ sets the internal subsystem security switch off, and performs no further checks.
The profiles determine whether the corresponding IBM MQ switch is set on or off.
• If the switch is off, that type of security is deactivated.
• If any IBM MQ switch is set on, IBM MQ checks the status of the RACF class associated with the type
of security corresponding to the IBM MQ switch. If the class is not installed or not active, the IBM MQ
switch is set off. For example, process security checks are not carried out if the MQPROC or MXPROC
class has not been activated. The class not being active is equivalent to defining NO.PROCESS.CHECKS
profile for every queue manager and queue sharing group that uses this RACF database.
If your queue manager is not a member of a queue sharing group, IBM MQ checks for the qmgr-
name.NO.SUBSYS.SECURITY switch profile only.
Table 25. Switch profiles for queue sharing group or queue manager level security
Switch profile name Type of resource or checking that is controlled
qmgr-name.NO.QMGR.CHECKS No queue manager level checks for this queue manager
qsg-name.NO.QMGR.CHECKS No queue manager level checks for this queue sharing group
qmgr-name.YES.QMGR.CHECKS Queue manager level checks override for this queue manager
qmgr-name.NO.QSG.CHECKS No queue sharing group level checks for this queue manager
qsg-name.NO.QSG.CHECKS No queue sharing group level checks for this queue sharing
group
174 Securing IBM MQ
Table 25. Switch profiles for queue sharing group or queue manager level security (continued)
Switch profile name Type of resource or checking that is controlled
qmgr-name.YES.QSG.CHECKS Queue sharing group level checks override for this queue
manager
If subsystem security is active, you cannot switch off both queue sharing group and queue manager level
security. If you try to do so, IBM MQ sets security checking on at both levels.
Table 26. Valid security switch combinations for queue manager level security
Combinations
qmgr-name.NO.QSG.CHECKS
qsg-name.NO.QSG.CHECKS
qmgr-name.NO.QSG.CHECKS
qsg-name.NO.QMGR.CHECKS
qmgr-name.YES.QMGR.CHECKS
qsg-name.NO.QSG.CHECKS
qsg-name.NO.QMGR.CHECKS
qmgr-name.YES.QMGR.CHECKS
Table 27. Valid security switch combinations for queue sharing group level security
Combinations
qmgr-name.NO.QMGR.CHECKS
qsg-name.NO.QMGR.CHECKS
qmgr-name.NO.QMGR.CHECKS
qsg-name.NO.QSG.CHECKS
qmgr-name.YES.QSG.CHECKS
qsg-name.NO.QMGR.CHECKS
qsg-name.NO.QSG.CHECKS
qmgr-name.YES.QSG.CHECKS
Table 28. Valid security switch combinations for queue manager and queue sharing group level security
Combinations
qsg-name.NO.QMGR.CHECKS
qmgr-name.YES.QMGR.CHECKS
No QSG.* profiles defined
qsg-name.NO.QMGR.CHECKS
qmgr-name.YES.QMGR.CHECKS
qsg-name.NO.QSG.CHECKS
qmgr-name.YES.QSG.CHECKS
176 Securing IBM MQ
Table 28. Valid security switch combinations for queue manager and queue sharing group level security
(continued)
Combinations
No profiles for either switch defined
Table 29. Other valid security switch combinations that switch both levels of checking on.
Combinations
qmgr-name.NO.QMGR.CHECKS
qmgr-name.NO.QSG.CHECKS
qsg-name.NO.QMGR.CHECKS
qsg-name.NO.QSG.CHECKS
qmgr-name.NO.QMGR.CHECKS
qsg-name.NO.QSG.CHECKS
qsg-name.NO.QMGR.CHECKS
qmgr-name.NO.QSG.CHECKS
For example, if you want to perform process security checks on queue manager QM01, which is a member
of queue sharing group QSG3 but you do not want to perform process security checks on any of the other
queue managers in the group, define the following switch profiles:
QSG3.NO.PROCESS.CHECKS
QM01.YES.PROCESS.CHECKS
If you want to have queue security checks performed on all the queue managers in the queue sharing
group, except QM02, define the following switch profile:
QM02.NO.QUEUE.CHECKS
(There is no need to define a profile for the queue sharing group because the checks are automatically
enabled if there is no profile defined.)
This sets queue sharing group level checking for all the queue managers in the queue-sharing group.
You do not need to define any other switch profiles for the production queue managers because you
want to check everything for these systems.
• Test queue manager MQT1 also requires full security checking. However, because you might want to
change this later, security can be defined at queue manager level so that you can change the security
settings for this queue manager without affecting the other members of the queue-sharing group.
This is done by defining the NO.QSG.CHECKS profile for MQT1 as follows:
178 Securing IBM MQ
RDEFINE MQADMIN MQT1.NO.QSG.CHECKS
• Development queue manager MQD1 has different security requirements from the rest of the queue
sharing group. It requires only connection and queue security to be active.
This is done by defining a MQD1.YES.QMGR.CHECKS profile for this queue manager, and then defining
the following profiles to switch off security checking for the resources that do not need to be checked:
When the queue manager is active, you can display the current security settings by issuing the DISPLAY
SECURITY MQSC command.
You can also change the switch settings when the queue manager is running by defining or deleting the
appropriate switch profile in the MQADMIN class. To make the changes to the switch settings active, you
must issue the REFRESH SECURITY command for the MQADMIN class.
See “Refreshing queue manager security on z/OS” on page 230 for more details about using the DISPLAY
SECURITY and REFRESH SECURITY commands.
hlq.BATCH
where hlq can be either the qmgr-name (queue manager name) or qsg-name (queue sharing group
name). If you are using both queue manager and queue sharing group level security, IBM MQ checks for
a profile prefixed by the queue manager name. If it does not find one, it looks for a profile prefixed by the
queue sharing group name. If it fails to find either profile, the connection request fails.
For batch or batch-type connection requests, you must permit the user ID associated with the connecting
address space to access the connection profile. For example, the following RACF command allows users
in the CONNTQM1 group to connect to the queue manager TQM1; these user IDs will be permitted to use
any batch or batch-type connection.
Overview
If you want to configure your z/OS queue manager to mandate user ID and password checking for some,
but not all, of your locally bound applications, you need to do some additional configuration.
The reason for this is that once CHCKLOCL (REQUIRED) is configured, legacy batch applications that use
the MQCONN API call can no longer connect to the queue manager.
For z/OS only, a more granular mechanism based on the connection security of an address space can
be used to downgrade the global CHCKLOCL(REQUIRED) configuration to CHCKLOCL(OPTIONAL) for
specifically defined user IDs. The mechanism used, is described in the following text, together with an
example.
In order to allow more granularity on CHCKLOCL ( REQUIRED) than just EVERYONE, you modify CHCKLOCL
in the same manner as you modify the access level of the user ID associated with the connecting address
space to the hlq.batch connection profiles in the MQCONN class.
If the address space user ID only has READ access, which is the minimum you require to be able to
connect at all, the CHCKLOCL configuration applies as written.
If the address space user ID has UPDATE access (or above) then the CHCKLOCL configuration operates in
OPTIONAL mode. That is, you do not have to provide a user ID and password, but if you do, the user ID
and password must be a valid pair.
180 Securing IBM MQ
Connection security already configured for your z/OS queue manager
If you have connection security configured for your z/OS queue manager and you want CHCKLOCL
(REQUIRED) to apply to WAS locally bound applications, and no others, carry out the following steps:
1. Start with CHCKLOCL (OPTIONAL) as your configuration. This means that any user ID and passwords
that are supplied are checked for validity, but not mandated.
2. List all the users that have access to the connection security profiles by issuing the command:
CLASS NAME
----- ----
MQCONN MQ23.BATCH
3. For each user ID listed as having READ access, change the access to
2. Authorize all user IDs that create batch connections to the queue manager, so that they have UPDATE
access to this profile. Doing this bypasses the CHCKLOCL ( REQUIRED) requirement for the user ID and
password at the time of connection.
Do this by issuing the command:
hlq.NO.CONNECT.CHECKS
4. Now, apply the CHCKLOCL (REQUIRED) behavior to one specific user ID, for example WASUSER, so that
all the connections coming from that region must provide a user ID and password.
Do this by reversing the change you made previously, by issuing the command:
hlq.CICS
where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name).
If you are using both queue manager and queue sharing group level security, IBM MQ checks for a profile
prefixed by the queue manager name. If it does not find one, it looks for a profile prefixed by the queue
sharing group name. If it fails to find either profile, the connection request fails
For connection requests by CICS, you need only permit the CICS address space user ID access to the
connection profile.
For example, the following RACF commands allow the CICS address space user ID KCBCICS to connect to
the queue manager TQM1:
hlq.IMS
where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name).
If you are using both queue manager and queue sharing group level security, IBM MQ checks for a profile
prefixed by the queue manager name. If it does not find one, it looks for a profile prefixed by the queue
sharing group name. If it fails to find either profile, the connection request fails
For connection requests by IMS, permit access to the connection profile for the IMS control and
dependent region user IDs.
For example, the following RACF commands allow:
• The IMS region user ID, IMSREG, to connect to the queue manager TQM1.
182 Securing IBM MQ
• Users in group BMPGRP to submit BMP jobs.
hlq.CHIN
where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name).
If you are using both queue manager and queue sharing group level security, IBM MQ checks for a profile
prefixed by the queue manager name. If it does not find one, it looks for a profile prefixed by the queue
sharing group name. If it fails to find either profile, the connection request fails
For connection requests by the channel initiator, define access to the connection profile for the user ID
used by the channel initiator started task address space.
For example, the following RACF commands allow the channel initiator address space running with user
ID DQCTRL to connect to the queue manager TQM1:
hlq.queuename
where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name),
and queuename is the name of the queue being opened, as specified in the object descriptor on the
MQOPEN or MQPUT1 call.
A profile prefixed by the queue manager name controls access to a single queue on that queue manager.
A profile prefixed by the queue sharing group name controls access to access to one or more queues with
that queue name on all queue managers within the queue sharing group, or access to a shared queue by
any queue manager within the group. This access can be overridden on an individual queue manager by
defining a queue manager level profile for that queue on that queue manager.
Table 31. Access levels for queue security using the MQOPEN or MQPUT1 calls
MQOPEN or MQPUT1 option RACF access level required to access hlq.queuename
MQOO_BROWSE READ
MQOO_INQUIRE READ
MQOO_BIND_* UPDATE
MQOO_INPUT_* UPDATE
MQOO_OUTPUT or MQPUT1 UPDATE
MQOO_PASS_ALL_CONTEXT UPDATE
MQPMO_PASS_ALL_CONTEXT
MQOO_PASS_IDENTITY_CONTEXT UPDATE
MQPMO_PASS_IDENTITY_CONTEXT
MQOO_SAVE_ALL_CONTEXT UPDATE
MQOO_SET_IDENTITY_CONTEXT UPDATE
MQPMO_SET_IDENTITY_CONTEXT
MQOO_SET_ALL_CONTEXT UPDATE
MQPMO_SET_ALL_CONTEXT
MQOO_SET ALTER
For example, on IBM MQ queue manager QM77, all user IDs in the RACF group PAYGRP are to be given
access to get messages from or put messages to all queues with names beginning with 'PAY.'. You can do
this using these RACF commands:
Also, all user IDs in the PAYGRP group must have access to put messages on queues that do not follow
the PAY naming convention. For example:
REQUEST_QUEUE_FOR_PAYROLL
SALARY.INCREASE.SERVER
REPLIES.FROM.SALARY.MODEL
You can do this by defining profiles for these queues in the GMQQUEUE class and giving access to that
class as follows:
184 Securing IBM MQ
RDEFINE GMQQUEUE PAYROLL.EXTRAS UACC(NONE)
ADDMEM(QM77.REQUEST_QUEUE_FOR_PAYROLL,
QM77.SALARY.INCREASE.SERVER,
QM77.REPLIES.FROM.SALARY.MODEL)
PERMIT PAYROLL.EXTRAS CLASS(GMQQUEUE) ID(PAYGRP) ACCESS(UPDATE)
Note:
1. If the RACF access level that an application has to a queue security profile is changed, the changes
only take effect for any new object handles obtained (that is, new MQOPEN s) for that queue. Those
handles already in existence at the time of the change retain their existing access to the queue. If
an application is required to use its changed access level to the queue rather than its existing access
level, it must close and reopen the queue for each object handle that requires the change.
2. In the example, the queue manager name QM77 could also be the name of a queue sharing group.
Other types of security checks might also occur at the time the queue is opened depending on the open
options specified and the types of security that are active. See also “Profiles for context
security” on page 199 and “Profiles for alternate user security” on page 198. For a summary table
showing the open options and the security authorization needed when queue, context, and alternate user
security are all active, see Table 36 on page 191.
If you are using publish/subscribe you must consider the following. When an MQSUB request is processed
a security check is performed to ensure that the user ID making the request has the required access to
put messages to the target IBM MQ queue as well as the required access to subscribe to the IBM MQ
topic.
Table 32. Access levels for queue security using the MQSUB call
MQSUB option RACF access level required to access hlq.queuename
MQSO_ALTER, MQSO_CREATE, and UPDATE
MQSO_RESUME
Note:
1. The hlq.queuename is the destination queue for publications. When this is a managed queue, you
need access to the appropriate model queue to be used for the managed queue and the dynamic
queue that are created.
2. You can use a technique like this for the destination queue you provide on an MQSUB API call if
you want to distinguish between the users making the subscriptions, and the users retrieving the
publications from the destination queue.
Then you ensure that no users have access to the queue hlq.MUST_USE_ALIAS_TO_ACCESS, and give the
appropriate users or groups access to the alias. You can do this using the following RACF commands:
This means user ID GETUSER and user IDs in the group GETGRP are only allowed to get messages
on MUST_USE_ALIAS_TO_ACCESS through the alias queue USE_THIS_ONE_FOR_GETS; and user ID
PUTUSER and user IDs in the group PUTGRP are only allowed to put messages through the alias queue
USE_THIS_ONE_FOR_PUTS.
Note:
1. If you want to use a technique like this, you must inform your application developers, so that they can
design their programs appropriately.
2. You can use a technique like this for the destination queue you provide on and MQSUB API request
if you want to distinguish between the users making the subscriptions and the users 'getting' the
publications from the destination queue.
186 Securing IBM MQ
You must also issue the corresponding RACF PERMIT commands to allow the user access to these
profiles.
A typical dynamic queue name created by an MQOPEN is something like
CREDIT.REPLY.A346EF00367849A0. The precise value of the last qualifier is unpredictable; this is why
you should use generic profiles for such queue names.
A number of IBM MQ utilities put messages on dynamic queues. You should define profiles for the
following dynamic queue names, and provide RACF UPDATE access to the relevant user IDs (see “User
IDs for security checking on z/OS” on page 219 for the correct user IDs):
You might also consider defining a profile to control use of the dynamic queue name used by default
in the application programming copy members. The IBM MQ-supplied copybooks contain a default
DynamicQName, which is CSQ.*. This enables an appropriate RACF profile to be established.
Note: Do not allow application programmers to specify a single * for the dynamic queue name. If you
do, you must define an hlq.** profile in the MQQUEUE class, and you would have to give it wide-ranging
access. This means that this profile could also be used for other non-dynamic queues that do not have a
more specific RACF profile. Your users could, therefore, gain access to queues you do not want them to
access.
Table 33. Access levels for close options on permanent dynamic queues
MQCLOSE option RACF access level required to hlq.queuename
MQCO_DELETE ALTER
MQCO_DELETE_PURGE ALTER
DEFINE QREMOTE(BANK7.CREDIT.REFERENCE)
RNAME(CREDIT.SCORING.REQUEST)
RQMNAME(BNK7)
XMITQ(BANK1.TO.BANK7)
In this case, a profile for BANK7.CREDIT.REFERENCE must be defined in the MQQUEUE class.
2. If the ObjectQMgrName for the request does not resolve to the local queue manager, a security check
is carried out against the resolved (remote) queue manager name except in the case of a cluster queue
where the check is made against the cluster queue name.
188 Securing IBM MQ
• Put the message on the real dead-letter queue by issuing an MQPUT against the alias queue.
5. Give the user ID associated with the application RACF UPDATE authority to the alias, but no access
(authority NONE) to the real dead-letter queue. This means that:
• The application can put messages onto the dead-letter queue using the alias queue.
• The application cannot get messages from the dead-letter queue using the alias queue because the
alias queue is disabled for get operations.
The application cannot get any messages from the real dead-letter queue either because it does have
the correct RACF authority.
Table 34 on page 189 summarizes the RACF authority required for the various participants in this
solution.
Table 34. RACF authority to the dead-letter queue and its alias
Associated user IDs Real dead-letter queue Alias dead-letter queue
(hlq.DEAD.QUEUE) (hlq.DEAD.QUEUE.PUT)
MCA or channel initiator address
UPDATE NONE
space and CKTI
'Special' application (for dead-
UPDATE NONE
letter queue processing)
User-written application user IDs NONE UPDATE
If you use this method, the application cannot determine the maximum message length (MAXMSGL) of
the dead-letter queue. This is because the MAXMSGL attribute cannot be retrieved from an alias queue.
Therefore, your application should assume that the maximum message length is 100 MB, the maximum
size IBM MQ for z/OS supports. The real dead-letter queue should also be defined with a MAXMSGL
attribute of 100 MB.
Note: User-written application programs do not normally use alternate user authority to put messages on
the dead-letter queue. This reduces the number of user IDs that have access to the dead-letter queue.
• The mqweb Liberty server, used by the MQ Console and REST API (mqweb server).
The user IDs under which these run must be given RACF access to these queues, as shown in Table 35 on
page 189.
190 Securing IBM MQ
API-resource security access quick reference
A summary of the MQOPEN, MQPUT1, MQSUB, and MQCLOSE options and the access required by the
different resource security types.
Table 36. MQOPEN, MQPUT1, MQSUB, and MQCLOSE options and the security authorization required. Callouts
shown like this (1) refer to the notes following this table.
Minimum RACF access level required
MQQUEUE or
MXQUEUE MQADMIN or MQADMIN or
RACF class: MXTOPIC (1) MXADMIN MXADMIN
RACF profile: ( 15 or 16 ) (2) (3) (4)
MQOPEN option
MQOO_INQUIRE READ ( 5 ) No check No check
MQOO_BROWSE READ No check No check
MQOO_INPUT_* UPDATE No check No check
MQOO_SAVE_ALL_CONTEXT ( 6 ) UPDATE No check No check
MQOO_OUTPUT (USAGE=NORMAL) ( 7 ) UPDATE No check No check
MQOO_PASS_IDENTITY_CONTEXT ( 8 ) UPDATE READ No check
MQOO_PASS_ALL_CONTEXT ( 8 ) ( 9 ) UPDATE READ No check
MQOO_SET_IDENTITY_CONTEXT ( 8 ) ( 9 ) UPDATE UPDATE No check
MQOO_SET_ALL_CONTEXT ( 8 ) ( 10 ) UPDATE CONTROL No check
MQOO_OUTPUT (USAGE (XMITQ) ( 11 ) UPDATE CONTROL No check
MQOO_OUTPUT (topic object) UPDATE ( 16 )
MQOO_OUTPUT (alias queue to topic object) UPDATE ( 16 ) UPDATE
MQOO_SET ALTER No check No check
MQOO_ALTERNATE_USER_AUTHORITY ( 12 ) ( 12 ) UPDATE
MQPUT1 option
Put on a normal queue ( 7 ) UPDATE No check No check
MQPMO_PASS_IDENTITY_CONTEXT UPDATE READ No check
MQPMO_PASS_ALL_CONTEXT UPDATE READ No check
MQPMO_SET_IDENTITY_CONTEXT UPDATE UPDATE No check
MQPMO_SET_ALL_CONTEXT UPDATE CONTROL No check
MQOO_OUTPUT
UPDATE CONTROL No check
Put on a transmission queue ( 11 )
MQOO_OUTPUT (topic object) UPDATE ( 16 )
MQOO_OUTPUT (alias queue to topic object) UPDATE ( 16 ) UPDATE
MQPMO_ALTERNATE_USER_AUTHORITY ( 13 ) ( 13 ) UPDATE
MQCLOSE option
MQCO_DELETE ( 14 ) ALTER No check No check
Note:
1. This option is not restricted to queues. Use the MQNLIST or MXNLIST class for namelists, and the
MQPROC or MXPROC class for processes.
2. Use RACF profile: hlq.resourcename
3. Use RACF profile: hlq.CONTEXT.queuename
4. Use RACF profile: hlq.ALTERNATE.USER. alternateuserid
alternateuserid is the user identifier that is specified in the AlternateUserId field of the
object descriptor. Note that up to 12 characters of the AlternateUserId field are used for this
check, unlike other checks where only the first 8 characters of a user identifier are used.
5. No check is made when opening the queue manager for inquiries.
6. MQOO_INPUT_* must be specified as well. This is valid for a local, model or alias queue.
7. This check is done for a local or model queue that has a Usage queue attribute of MQUS_NORMAL,
and also for an alias or remote queue (that is defined to the connected queue manager.) If
the queue is a remote queue that is opened specifying an ObjectQMgrName (not the name of
the connected queue manager) explicitly, the check is carried out against the queue with the
same name as ObjectQMgrName (which must be a local queue with a Usage queue attribute of
MQUS_TRANSMISSION).
8. MQOO_OUTPUT must be specified as well.
9. MQOO_PASS_IDENTITY_CONTEXT is implied as well by this option.
10. MQOO_PASS_IDENTITY_CONTEXT, MQOO_PASS_ALL_CONTEXT and
MQOO_SET_IDENTITY_CONTEXT are implied as well by this option.
11. This check is done for a local or model queue that has a Usage queue attribute of
MQUS_TRANSMISSION, and is being opened directly for output. It does not apply if a remote queue
is being opened.
12. At least one of MQOO_INQUIRE, MQOO_BROWSE, MQOO_INPUT_*, MQOO_OUTPUT or MQOO_SET
must be specified as well. The check carried out is the same as that for the other options specified.
13. The check carried out is the same as that for the other options specified.
14. This applies only for permanent dynamic queues that have been opened directly, that is, not opened
through a model queue. No security is required to delete a temporary dynamic queue.
192 Securing IBM MQ
15. Use RACF profile hlq.SUBSCRIBE.topicname.
16. Use RACF profile hlq.PUBLISH.topicname.
17. If on the MQSUB request you specified a destination queue for the publications to be sent to, then a
security check is carried out against that queue to ensure that you have put authority to that queue.
18. If on the MQSUB request, with MQSO_CREATE or MQSO_ALTER options specified, you want
to set any of the identity context fields in the MQSD structure, you also need to specify the
MQSO_SET_IDENTITY_CONTEXT option and you also need the appropriate authority to the context
profile for the destination queue.
hlq.SUBSCRIBE.topicname
hlq.PUBLISH.topicname
where
• hlq is either qmgr-name (queue manager name) or qsg-name (queue sharing group name).
• topicname is the name of the topic administration node in the topic tree, associated either with the
topic being subscribed to through an MQSUB call, or being published to through an MQOPEN call.
A profile prefixed by the queue manager name controls access to a single topic on that queue manager.
A profile prefixed by the queue sharing group name controls access to one or more topics with that
topic name on all queue managers within the queue sharing group. This access can be overridden on an
individual queue manager by defining a queue manager level profile for that topic on that queue manager.
If your queue manager is a member of a queue sharing group and you are using both queue manager and
queue sharing group level security, IBM MQ checks for a profile prefixed by the queue manager name first.
If it does not find one, it looks for a profile prefixed by the queue sharing group name.
Subscribe
To subscribe to a topic, you need access to both the topic you are trying to subscribe to, and the target
queue for the publications.
When you issue an MQSUB request, the following security checks take place:
• Whether you have the appropriate level of access to subscribe to that topic, and also that the target
queue (if specified) is opened for output
• Whether you have the appropriate level of access to that target queue.
Table 38. Access level required to profiles for topic security for closure of a subscribe operation
Action Access level required
MQCLOSE (of a subscription) RACF access required to hlq.SUBSCRIBE.topicname
profile in MXTOPIC class
MQCO_REMOVE_SUB ALTER
Publish
To publish on a topic you need access to the topic and, if you are using alias queues, to the alias queue as
well.
194 Securing IBM MQ
Table 39. Access level required to profiles for topic security for a publish operation
Action Access level required
MQOPEN (of a topic) RACF access required to hlq.PUBLISH.topicname
profile in MXTOPIC class
MQOO_OUTPUT or MQPUT1 UPDATE
MQOPEN (Alias queue to topic) RACF access required to hlq.queuename profile in
MQQUEUE or MXQUEUE class for the alias queue
MQOO_OUTPUT or MQPUT1 UPDATE
For details of how topic security operates when an alias queue that resolves to a topic name is opened for
publish, see “Considerations for alias queues that resolve to topics for a publish operation” on page 195.
When you consider alias queues used for destination queues for PUT or GET restrictions, see
“Considerations for alias queues” on page 185.
If the RACF access level that an application has to a topic security profile is changed, the changes take
effect only for any new object handles obtained (that is, a new MQSUB or MQOPEN) for that topic. Those
handles already in existence at the time of the change retain their existing access to the topic. Also,
existing subscribers retain their access to any subscriptions that they have already made.
Considerations for alias queues that resolve to topics for a publish operation
When you issue an MQOPEN or MQPUT1 call for an alias queue that resolves to a topic, IBM MQ makes
two resource checks:
• The first one against the alias queue name specified in the object descriptor (MQOD) on the MQOPEN or
MQPUT1 call.
• The second against the topic to which the alias queue resolves
You must be aware that this behavior is different from the behavior you get when alias queues resolve to
other queues. You need the correct access to both profiles in order for the publish action to proceed.
hlq.processname
where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name),
and processname is the name of the process being opened.
A profile prefixed by the queue manager name controls access to a single process definition on that queue
manager. A profile prefixed by the queue sharing group name controls access to one or more process
definitions with that name on all queue managers within the queue sharing group. This access can be
overridden on an individual queue manager by defining a queue manager level profile for that process
definition on that queue manager.
If your queue manager is a member of a queue sharing group and you are using both queue manager and
queue sharing group level security, IBM MQ checks for a profile prefixed by the queue manager name first.
If it does not find one, it looks for a profile prefixed by the queue sharing group name.
The following table shows the access required for opening a process.
For example, on queue manager MQS9, the RACF group INQVPRC must be able to inquire ( MQINQ ) on all
processes starting with the letter V. The RACF definitions for this would be:
Alternate user security might also be active, depending on the open options specified when a process
definition object is opened.
hlq.namelistname
where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name),
and namelistname is the name of the namelist being opened.
A profile prefixed by the queue manager name controls access to a single namelist on that queue
manager. A profile prefixed by the queue sharing group name controls access to access to one or more
namelists with that name on all queue managers within the queue sharing group. This access can be
196 Securing IBM MQ
overridden on an individual queue manager by defining a queue manager level profile for that namelist on
that queue manager.
If your queue manager is a member of a queue sharing group and you are using both queue manager and
queue sharing group level security, IBM MQ checks for a profile prefixed by the queue manager name first.
If it does not find one, it looks for a profile prefixed by the queue sharing group name.
The following table shows the access required for opening a namelist.
For example, on queue manager (or queue sharing group) PQM3, the RACF group DEPT571 must be able
to inquire ( MQINQ ) on these namelists:
• All namelists starting with "DEPT571".
• PRINTER/DESTINATIONS/DEPT571
• AGENCY/REQUEST/QUEUES
• WAREHOUSE.BROADCAST
The RACF definitions to do this are:
Alternate user security might be active, depending on the options specified when a namelist object is
opened.
hlq.ALTERNATE.USER.alternateuserid
Where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name),
and alternateuserid is the value of the AlternateUserId field in the object descriptor.
A profile prefixed by the queue manager name controls use of an alternative user ID on that queue
manager. A profile prefixed by the queue sharing group name controls use of an alternative user ID on
all queue managers within the queue sharing group. This alternative user ID can be used on any queue
manager within the queue sharing group by a user that has the correct access. This access can be
overridden on an individual queue manager by defining a queue manager level profile for that alternative
user ID on that queue manager.
If your queue manager is a member of a queue sharing group and you are using both queue manager and
queue sharing group level security, IBM MQ checks for a profile prefixed by the queue manager name first.
If it does not find one, it looks for a profile prefixed by the queue sharing group name.
The following table shows the access when specifying an alternative user option.
In addition to alternate user security checks, other security checks for queue, process, namelist, and
context security can also be made. The alternative user ID, if provided, is only used for security checks
on queue, process definition, or namelist resources. For alternate user and context security checks, the
user ID requesting that the check is used. For details about how user IDs are handled, see “User IDs for
security checking on z/OS” on page 219. For a summary table showing the open options and the security
checks required when queue, context and alternate user security are all active, see Table 36 on page 191.
An alternative user profile gives the requesting user ID access to resources associated with the user ID
specified in the alternative user ID. For example, the payroll server running under user ID PAYSERV on
queue manager QMPY processes requests from personnel user IDs, all of which start with PS. To cause
the work performed by the payroll server to be carried out under the user ID of the requesting user,
alternative user authority is used. The payroll server knows which user ID to specify as the alternative
user ID because the requesting programs generate messages using the MQPMO_DEFAULT_CONTEXT put
message option. See “User IDs for security checking on z/OS” on page 219 for more details about from
where alternative user IDs are obtained.
The following example RACF definitions enable the server program to specify alternative user IDs starting
with the characters PS:
198 Securing IBM MQ
RDEFINE MQADMIN QMPY.ALTERNATE.USER.PS* UACC(NONE)
PERMIT QMPY.ALTERNATE.USER.PS* CLASS(MQADMIN) ID(PAYSERV) ACCESS(UPDATE)
Note:
1. The AlternateUserId fields in the object descriptor and subscription descriptor are 12 bytes long.
All 12 bytes are used in the profile checks, but only the first 8 bytes are used as the user ID by IBM
MQ. If this user ID truncation is not desirable, application programs making the request must translate
any alternative user ID over 8 bytes into something more appropriate.
2. If you specify MQOO_ALTERNATE_USER_AUTHORITY, MQSO_ALTERNATE_USER_AUTHORITY, or
MQPMO_ALTERNATE_USER_AUTHORITY and you do not specify an AlternateUserId field in the
object descriptor, a user ID of blanks is used. For the purposes of the alternate user security check
the user ID used for the AlternateUserId qualifier is -BLANK-. For example RDEF MQADMIN
hlq.ALTERNATE.USER.-BLANK-.
If the user is allowed to access this profile, all further checks are made with a user ID of blanks. For
details of blank user IDs, see “Blank user IDs and UACC levels” on page 227.
The administration of alternative user IDs is easier if you have a naming convention for user IDs that
enables you to use generic alternative user profiles. If they do not, you can use the RACF RACVARS
feature. For details about using RACVARS, see the z/OS SecureWay Security Server RACF Security
Administrator's Guide.
When a message is put to a queue that has been opened with alternative user authority and the context of
the message has been generated by the queue manager, the MQMD_USER_IDENTIFIER field is set to the
alternative user ID.
Note:
1. The user IDs used for distributed queuing require CONTROL access to hlq.CONTEXT.queuename to
put messages on the destination queue. See “User IDs used by the channel initiator” on page 222 for
information about the user IDs used.
2. If on the MQSUB request, with MQSO_CREATE or MQSO_ALTER options specified, you want
to set any of the identity context fields in the MQSD structure, you need to specify the
MQSO_SET_IDENTITY_CONTEXT option. You require also, the appropriate authority to the context
profile for the destination queue.
If you put commands on the system-command input queue, use the default context put message option
to associate the correct user ID with the command.
For example, the IBM MQ-supplied utility program CSQUTIL can be used to offload and reload
messages in queues. When offloaded messages are restored to a queue, the CSQUTIL utility uses the
MQOO_SET_ALL_CONTEXT option to return the messages to their original state. In addition to the queue
security required by this open option, context authority is also required. For example, if this authority is
required by the group BACKGRP on queue manager MQS1, this would be defined by:
Depending on the options specified, and the types of security performed, other types of security checks
might also occur when the queue is opened. These include queue security (see “Profiles for queue
security” on page 183 ), and alternate user security (see “Profiles for alternate user security” on page
198 ). For a summary table showing the open options and the security checks required when queue,
context and alternate user security are all active, see Table 36 on page 191.
200 Securing IBM MQ
System queue context security
Many of the system queues are accessed by the ancillary parts of IBM MQ, for example the channel
initiator address space , and the IBM WebSphere Application Server Liberty Profile for IBM
MQ server (WLP for MQ Server) used by the IBM MQ Console and administrative REST API.
The user IDs under which these run under must be given RACF access to these queues, as shown in Table
46 on page 201.
Table 46. Access required to the SYSTEM queues for context operations
SYSTEM queue Channel Initiator for WLP for MQ Server
Distributed queuing
SYSTEM.ADMIN.COMMAND.QUEUE - CONTROL
SYSTEM.BROKER.CONTROL.QUEUE CONTROL -
SYSTEM.BROKER.INTER.BROKER.CO CONTROL -
MMUNICATIONS
SYSTEM.CHANNEL.SYNCQ CONTROL -
SYSTEM.CLUSTER.COMMAND.QUEUE CONTROL -
SYSTEM.CLUSTER.TRANSMIT.QUEUE CONTROL -
hlq.verb.pkw
Where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name),
verb is the verb part of the command name, for example ALTER, and pkw is the object type, for example
QLOCAL for a local queue.
Thus, the profile name for the ALTER QLOCAL command in subsystem CSQ1 is:
CSQ1.ALTER.QLOCAL
You can use generic profiles to protect sets of commands so that you have fewer profiles to maintain
and, therefore, fewer access lists. Consider creating a generic profile that applies to all commands not
protected by a more specific profile. Define this profile with UACC(NONE) and grant ALTER access only
to the RACF groups containing administrators. You might then create a generic profile applicable to all
DISPLAY commands and grant widespread access to it. Between these extremes, you might identify
groups of users needing access to certain sets of commands, in which case you can create profiles for
those sets and grant access to RACF groups representing those classes of user. Avoid giving users access
to commands they do not require: Apply the principle of least privilege, so that users only have access to
the commands that are required for their jobs.
202 Securing IBM MQ
Table 47. MQSC commands, profiles, and their access levels (continued)
Command Command profile for Access Command resource profile Access level
MQCMDS level for for MQADMIN or MXADMIN for
MQCMDS MQADMIN
or
MXADMIN
ALTER TOPIC hlq.ALTER.TOPIC ALTER hlq.TOPIC.topic ALTER
ALTER TRACE hlq.ALTER.TRACE ALTER No check -
ARCHIVE LOG hlq.ARCHIVE.LOG CONTROL No check -
BACKUP CFSTRUCT hlq.BACKUP.CFSTRUCT CONTROL No check -
CLEAR QLOCAL hlq.CLEAR.QLOCAL ALTER hlq.QUEUE.queue ALTER
CLEAR TOPICSTR “3” hlq.CLEAR.TOPICSTR ALTER hlq.TOPIC.topic ALTER
on page 206
DEFINE AUTHINFO hlq.DEFINE.AUTHINFO ALTER hlq.AUTHINFO.resourcenam ALTER
e
DEFINE BUFFPOOL hlq.DEFINE.BUFFPOOL ALTER No check -
DEFINE CFSTRUCT hlq.DEFINE.CFSTRUCT ALTER No check -
DEFINE CHANNEL hlq.DEFINE.CHANNEL ALTER hlq.CHANNEL.channel ALTER
DEFINE LOG hlq.DEFINE.LOG ALTER No check -
DEFINE MAXSMSGS hlq.DEFINE.MAXSMSGS ALTER No check -
DEFINE NAMELIST hlq.DEFINE.NAMELIST ALTER hlq.NAMELIST.namelist ALTER
DEFINE PROCESS hlq.DEFINE.PROCESS ALTER hlq.PROCESS.process ALTER
DEFINE PSID hlq.DEFINE.PSID ALTER No check -
DEFINE QALIAS hlq.DEFINE.QALIAS ALTER hlq.QUEUE.queue ALTER
DEFINE QLOCAL hlq.DEFINE.QLOCAL ALTER hlq.QUEUE.queue ALTER
DEFINE QMODEL hlq.DEFINE.QMODEL ALTER hlq.QUEUE.queue ALTER
DEFINE QREMOTE hlq.DEFINE.QREMOTE ALTER hlq.QUEUE.queue ALTER
DEFINE STGCLASS hlq.DEFINE.STGCLASS ALTER No check -
DEFINE SUB hlq.DEFINE.SUB ALTER No check -
DEFINE TOPIC hlq.DEFINE.TOPIC ALTER hlq.TOPIC.topic ALTER
DELETE AUTHINFO hlq.DELETE.AUTHINFO ALTER hlq.AUTHINFO.resourcenam ALTER
e
DELETE BUFFPOOL hlq.DELETE.BUFFPOOL ALTER No check -
DELETE CFSTRUCT hlq.DELETE.CFSTRUCT ALTER No check -
DELETE CHANNEL hlq.DELETE.CHANNEL ALTER hlq.CHANNEL.channel ALTER
DELETE NAMELIST hlq.DELETE.NAMELIST ALTER hlq.NAMELIST.namelist ALTER
DELETE PROCESS hlq.DELETE.PROCESS ALTER hlq.PROCESS.process ALTER
DELETE PSID hlq.DELETE.PSID ALTER No check -
DELETE QALIAS hlq.DELETE.QALIAS ALTER hlq.QUEUE.queue ALTER
204 Securing IBM MQ
Table 47. MQSC commands, profiles, and their access levels (continued)
Command Command profile for Access Command resource profile Access level
MQCMDS level for for MQADMIN or MXADMIN for
MQCMDS MQADMIN
or
MXADMIN
DISPLAY QUEUE hlq.DISPLAY.QUEUE READ No check -
DISPLAY SBSTATUS hlq.DISPLAY.SBSTATUS READ No check -
DISPLAY SMDS hlq.DISPLAY.SMDS READ No check -
DISPLAY SMDSCONN hlq.DISPLAY.SMDSCONN READ No check -
DISPLAY SUB hlq.DISPLAY.SUB READ No check -
DISPLAY SECURITY hlq.DISPLAY.SECURITY READ No check -
DISPLAY STGCLASS hlq.DISPLAY.STGCLASS READ No check -
DISPLAY SYSTEM “1” hlq.DISPLAY.SYSTEM READ No check -
on page 206
DISPLAY THREAD hlq.DISPLAY.THREAD READ No check -
DISPLAY TPSTATUS hlq.DISPLAY.TPSTATUS READ No check -
DISPLAY TOPIC hlq.DISPLAY.TOPIC READ No check -
DISPLAY TPSTATUS hlq.DISPLAY.TPSTATUS READ No check -
DISPLAY TRACE hlq.DISPLAY.TRACE READ No check -
DISPLAY USAGE “1” hlq.DISPLAY.USAGE READ No check -
on page 206
MOVE QLOCAL hlq.MOVE.QLOCAL ALTER hlq.QUEUE.from-queue ALTER
hlq.QUEUE.to-queue
PING CHANNEL hlq.PING.CHANNEL CONTROL hlq.CHANNEL.channel CONTROL
RECOVER BSDS hlq.RECOVER.BSDS CONTROL No check -
RECOVER CFSTRUCT hlq.RECOVER.CFSTRUCT CONTROL No check -
REFRESH CLUSTER hlq.REFRESH.CLUSTER ALTER No check -
REFRESH QMGR hlq.REFRESH.QMGR ALTER No check -
REFRESH SECURITY hlq.REFRESH.SECURITY ALTER No check -
RESET CFSTRUCT hlq.RESET.CFSTRUCT CONTROL No check -
RESET CHANNEL hlq.RESET.CHANNEL CONTROL hlq.CHANNEL.channel CONTROL
RESET CLUSTER hlq.RESET.CLUSTER CONTROL No check -
RESET QMGR hlq.RESET.QMGR CONTROL No check -
RESET QSTATS hlq.RESET.QSTATS CONTROL hlq.QUEUE.queue CONTROL
RESET SMDS hlq.RESET.SMDS CONTROL No check -
RESET TPIPE hlq.RESET.TPIPE CONTROL No check -
RESOLVE CHANNEL hlq.RESOLVE.CHANNEL CONTROL hlq.CHANNEL.channel CONTROL
RESOLVE INDOUBT hlq.RESOLVE.INDOUBT CONTROL No check -
Notes:
1. These commands might be issued internally by the queue manager; no authority is checked in these
cases.
2. IBM MQ does not check the authority of the user who issues the START QMGR command. However,
you can use RACF, or your alternative security facilities to control access to the START xxxxMSTR
command that is issued as a result of the START QMGR command. This is done by controlling access to
the MVS.START.STC.xxxxMSTR profile in the RACF operator commands (OPERCMDS) class. For details
of this procedure, see the z/OS SecureWay Security Server RACF Security Administrator's Guide. If you
use this technique, and an unauthorized user tries to start the queue manager, it terminates with a
reason code of 00F30216.
3. The hlq.TOPIC.topic resource refers to the Topic object derived from the TOPICSTR. For more
details, see “Publish/subscribe security” on page 419
206 Securing IBM MQ
4. At releases prior to IBM MQ for z/OS V6, the security check was for MVS.START.STC.CSQ1CHIN. At IBM
MQ for z/OS V6 and later, the resource name has an additional JOBNAME qualifier appended to it. This
can cause problems when starting the channel initiator.
To resolve the problem replace MVS.START.STC. ssid CHIN with a profile for a resource named
MVS.START.STC. ssid CHIN .* or MVS.START.STC. ssid CHIN. ssid CHIN where ssid is the subsystem ID
for the queue manager. This requires RACF UPDATE authority. For more details, see the z/OS product
documentation for Operation planning, MVS Commands, RACF Access Authorities, and Resource
Names.
The START for ssid MSTR does not include the JOBNAME= parameter. For consistency, you might want
to update the profile for MVS.START.STC.ssidMSTR to MVS.START.STC.ssidMSTR.*.
208 Securing IBM MQ
Table 48. PCF commands, profiles, and their access levels (continued)
Command Command profile for Access level Command resource profile for Access level
MQCMDS for MQCMDS MQADMIN or MXADMIN for
MQADMIN
or
MXADMIN
Inquire Cluster Queue hlq.DISPLAY.CLUSQMGR READ No check -
Manager
Inquire Connection hlq.DISPLAY.CONNPCF READ No check -
Inquire Group hlq.DISPLAY.GROUP READ No check -
Inquire Log hlq.DISPLAY.LOG READ No check -
Inquire Namelist hlq.DISPLAY.NAMELIST READ No check -
Inquire Namelist Names hlq.DISPLAY.NAMELIST READ No check -
Inquire Process hlq.DISPLAY.PROCESS READ No check -
Inquire Process Names hlq.DISPLAY.PROCESS READ No check -
Inquire Pub/Sub Status hlq.DISPLAY.PUBSUB READ No check -
Inquire Queue hlq.DISPLAY.QUEUE READ No check -
Inquire Queue Manager hlq.DISPLAY.QMGR READ No check -
Inquire Queue Names hlq.DISPLAY.QUEUE READ No check -
Inquire Queue Status hlq.DISPLAY.QSTATUS READ No check -
Inquire Security hlq.DISPLAY.SECURITY READ No check -
Inquire SMDS hlq.DISPLAY.SMDS READ No check -
Inquire SMDSCONN hlq.DISPLAY.SMDSCONN READ No check -
Inquire Storage Class hlq.DISPLAY.STGCLASS READ No check -
Inquire Storage Class hlq.DISPLAY.STGCLASS READ No check -
Names
Inquire Subscription hlq.INQUIRE.SUB READ No check -
Inquire Subscription hlq.INQUIRE.SBSTATUS READ No check -
Status
Inquire System hlq.DISPLAY.SYSTEM READ No check -
Inquire Topic hlq.DISPLAY.TOPIC READ No check -
Inquire Topic Names hlq.DISPLAY.TOPIC READ No check -
Inquire Topic Status hlq.DISPLAY.TPSTATUS READ No check -
Inquire Usage hlq.DISPLAY.USAGE READ No check -
Move Queue hlq.MOVE.QLOCAL ALTER hlq.QUEUE.from-queue ALTER
hlq.QUEUE.to-queue
Ping Channel hlq.PING.CHANNEL CONTROL hlq.CHANNEL.channel CONTROL
Recover CF Structure hlq.RECOVER.CFSTRUCT CONTROL No check -
Refresh Cluster hlq.REFRESH.CLUSTER ALTER No check -
Refresh Queue Manager hlq.REFRESH.QMGR ALTER No check -
Refresh Security hlq.REFRESH.SECURITY ALTER No check -
Reset CF Structure hlq.RESET.CFSTRUCT CONTROL No check -
Notes:
1. The hlq.TOPIC.topic resource refers to the Topic object derived from the TOPICSTR. For more
details, see “Publish/subscribe security” on page 419
See “IBM MQ Console - required command security profiles” on page 211 for details of the
IBM MQ PCF profiles required, when using the IBM MQ Console.
210 Securing IBM MQ
IBM MQ Console - required command security profiles
If you want to use the IBM MQ Console, or the administrative REST API, the WebSphere Application
Server Liberty Profile server address space user ID needs authorization to issue certain PCF commands
Table 49 on page 211 shows, for each IBM MQ PCF command, the profiles required for command security
checking to be carried out, and the corresponding access level for each profile in the MQCMDS class when
using the IBM MQ Console.
Table 49. IBM MQ Console PCF commands, profiles, and their access levels
Command Command profile for Access level Command resource profile for Access level
MQCMDS for MQCMDS MQADMIN or MXADMIN for
MQADMIN
or
MXADMIN
Change Authentication hlq.ALTER.AUTHINFO ALTER hlq.AUTHINFO.resourcename ALTER
Information Object
Change Channel hlq.ALTER.CHANNEL ALTER hlq.CHANNEL.channel ALTER
Change Queue hlq.ALTER.QUEUE ALTER hlq.QUEUE.queue ALTER
Change Queue Manager hlq.ALTER.QMGR ALTER No check -
Change Topic hlq.ALTER.TOPIC ALTER hlq.TOPIC.topic ALTER
Clear Queue hlq.CLEAR.QLOCAL ALTER hlq.QUEUE.queue ALTER
Create Authentication hlq.DEFINE.AUTHINFO ALTER hlq.AUTHINFO.resourcename ALTER
Information Object
Create Channel hlq.DEFINE.CHANNEL ALTER hlq.CHANNEL.channel ALTER
Create Queue hlq.DEFINE.QUEUE ALTER hlq.QUEUE.queue ALTER
Create Subscription hlq.DEFINE.SUB ALTER No check -
Create Topic hlq.DEFINE.TOPIC ALTER hlq.TOPIC.topic ALTER
Delete Authentication hlq.DELETE.AUTHINFO ALTER hlq.AUTHINFO.resourcename ALTER
Information Object
Delete Channel hlq.DELETE.CHANNEL ALTER hlq.CHANNEL.channel ALTER
Delete Queue hlq.DELETE.QUEUE ALTER hlq.QUEUE.queue ALTER
Delete Subscription hlq.DELETE.SUB ALTER No check -
Delete Topic hlq.DELETE.TOPIC ALTER hlq.TOPIC.topic ALTER
Inquire Authentication hlq.DISPLAY.AUTHINFO READ No check -
Information Object
Inquire Authentication hlq.DISPLAY.AUTHINFO READ No check -
Information Object
Names
Inquire Channel hlq.DISPLAY.CHANNEL READ No check -
Inquire Channel hlq.DISPLAY.CHLAUTH READ No check -
Authentication Records
Inquire Channel Initiator hlq.DISPLAY.CHINIT READ No check -
Inquire Channel Names hlq.DISPLAY.CHANNEL READ No check -
Inquire Channel Status hlq.DISPLAY.CHSTATUS READ No check -
Inquire Queue hlq.DISPLAY.QUEUE READ No check -
Inquire Queue Manager hlq.DISPLAY.QMGR READ No check -
hlq.type.resourcename
where hlq can be either qmgr-name (queue manager name) or qsg-name (queue sharing group name).
A profile prefixed by the queue manager name controls access to the resources associated with
commands on that queue manager. A profile prefixed by the queue sharing group name controls access
to the resources associated with commands on all queue managers within the queue sharing group. This
access can be overridden on an individual queue manager by defining a queue manager level profile for
that command resource on that queue manager.
If your queue manager is a member of a queue sharing group and you are using both queue manager and
queue sharing group level security, IBM MQ checks for a profile prefixed by the queue manager name first.
If it does not find one, it looks for a profile prefixed by the queue sharing group name.
212 Securing IBM MQ
For example, the RACF profile name for command resource security checking against the model queue
CREDIT.WORTHY in subsystem CSQ1 is:
CSQ1.QUEUE.CREDIT.WORTHY
Because the profiles for all types of command resource are held in the MQADMIN class, the "type" part
of the profile name is needed in the profile to distinguish between resources of different types that
have the same name. The "type" part of the profile name can be CHANNEL, QUEUE, TOPIC, PROCESS,
or NAMELIST. For example, a user might be authorized to define hlq.QUEUE.PAYROLL.ONE, but not
authorized to define hlq.PROCESS.PAYROLL.ONE
If the resource type is a queue, and the profile is a queue sharing group level profile, it controls access
to one or more local queues within the queue sharing group, or access to a single shared queue from any
queue manager in the queue sharing group.
MQSC commands, profiles, and their access levels shows, for each IBM MQ MQSC
command, the profiles required for command security checking to be carried out, and the corresponding
access level for each profile in the MQCMDS class.
PCF commands, profiles, and their access levels shows, for each IBM MQ PCF command,
the profiles required for command security checking to be carried out, and the corresponding access level
for each profile in the MQCMDS class.
Command resource security checking for alias queues and remote queues
Alias queue and remote queues both provide indirection to another queue. Additional points apply when
you consider security checking for these queues.
Alias queues
When you define an alias queue, command resource security checks are only performed against the name
of the alias queue, not against the name of the target queue to which the alias resolves.
Alias queues can resolve to both local and remote queues. If you do not want to permit users access to
certain local or remote queues, you must do both of the following:
1. Do not allow the users access to these local and remote queues.
2. Restrict the users from being able to define aliases for these queues. That is, prevent them from being
able to issue DEFINE QALIAS and ALTER QALIAS commands.
Remote queues
When you define a remote queue, command resource security checks are performed only against the
name of the remote queue. No checks are performed against the names of the queues specified in the
RNAME or XMITQ attributes in the remote queue object definition.
hlq.RESLEVEL
Where hlq can be either ssid (subsystem ID) or qsg (queue sharing group ID).
The user IDs associated with each connection type are:
214 Securing IBM MQ
RESLEVEL and batch connections
By default, when an IBM MQ resource is being accessed through batch and batch-type connections, the
user must be authorized to access that resource for the particular operation. You can bypass the security
check by setting up an appropriate RESLEVEL definition.
Whether the user is checked or not is based on the user ID used at connect time, the same user ID used
for the connection check.
For example, you can set up RESLEVEL so that when a user you trust accesses certain resources through
a batch connection, no API-resource security checks are done; but when a user you do not trust tries to
access the same resources, security checks are carried out as normal. You should set up RESLEVEL
checking to bypass API-resource security checks only when you sufficiently trust the user and the
programs run by that user.
The following table shows the checks made for batch connections.
Table 50. Checks made at different RACF access levels for batch connections
RACF access level Level of checking
NONE Resource checks performed
READ Resource checks performed
UPDATE Resource checks performed
CONTROL No check.
ALTER No check.
Table 51. Checks made at different RACF access levels for CICS connections
RACF access level Level of checking
NONE IBM MQ checks the CICS address space user ID and the transaction
user ID.
READ IBM MQ checks the CICS address space user ID only.
UPDATE If the transaction is defined to CICS with RESSEC(YES), IBM MQ checks
the CICS address space user ID and the transaction user ID.
UPDATE If the transaction is defined to CICS with RESSEC(NO), IBM MQ checks
the CICS address space user ID only.
CONTROL or ALTER IBM MQ does not check any user IDs.
216 Securing IBM MQ
How RESLEVEL can affect the checks made
Depending on how you set up your RESLEVEL profile, you can change which user IDs are checked when
access to a resource is requested. The possible checks are:
• Check the IMS region address space user ID and the second user ID or alternate user ID.
• Check IMS region address space user ID only.
• Do not check any user IDs.
The following table shows the checks made for IMS connections.
Table 52. Checks made at different RACF access levels for IMS connections
RACF access level Level of checking
NONE Check the IMS address space user ID and the IMS second user ID or
alternate user ID.
READ Check the IMS address space user ID.
UPDATE Check the IMS address space user ID.
CONTROL No check.
ALTER No check.
Table 53. Checks made at different RACF access levels for channel initiator connections
RACF access level Level of checking
NONE Check two user IDs.
READ Check one user ID.
UPDATE Check one user ID.
CONTROL No check.
ALTER No check.
Note: See “User IDs used by the channel initiator” on page 222 for a definition of the user IDs checked
hlq.RESLEVEL
This check is always performed unless the hlq.NO.SUBSYS.SECURITY switch has been set.
If there is no RESLEVEL profile, IBM MQ enables checking for two user IDs. If there is a RESLEVEL profile,
the level of checking depends on the access level granted to the user ID of the queue manager for
the profile. Checks made at different RACF(r) access levels for the intra-group queuing agent shows the
checks made for the intra-group queuing agent.
Table 54. Checks made at different RACF access levels for the intra-group queuing agent
RACF access level Level of checking
NONE Check two user IDs.
READ Check one user ID.
UPDATE Check one user ID.
CONTROL No check.
ALTER No check.
Note: See “User IDs used by the intra-group queuing agent” on page 226 for a definition of the user IDs
checked
If the permissions granted to the RESLEVEL profile for the queue manager's user ID are changed, the
intra-group queuing agent must be stopped and restarted to pick up the new permissions. Because there
is no way to independently stop and restart the intra-group queuing agent, the queue manager must be
stopped and restarted to achieve this.
218 Securing IBM MQ
To define the appropriate RESLEVEL profile, issue the following RACF command:
Then give the users access to this profile, using the following commands:
If you make these changes while the user IDs are connected to queue manager QM66, the users must
disconnect and connect again before the change takes place.
If subsystem security is not active when a user connects but, while this user is still connected, subsystem
security becomes active, full resource security checking is applied to the user. The user must reconnect to
get the correct RESLEVEL processing.
Table 55. User ID checking against profile name for batch connections
Alternate user hlq.ALTERNATE.USER.userid hlq.CONTEXT.queuename hlq.resourcename
ID specified on profile profile profile
open?
No - JOB JOB
Yes JOB JOB ALT
Key:
ALT
Alternate user ID.
JOB
• The user ID of a TSO or USS sign-on.
• The user ID assigned to a batch job.
• The user ID assigned to a started task by the STARTED class or the started procedures table.
• The user ID associated with the executing Db2 stored procedure
A Batch job is performing an MQPUT1 to a queue called Q1 with RESLEVEL set to READ and alternate user
ID checking turned off.
Checks made at different RACF(r) access levels for batch connections and User ID checking against profile
name for batch connections show that the job user ID is checked against profile hlq.Q1.
220 Securing IBM MQ
User IDs checked for CICS connections
The user IDs checked for CICS connections depend on whether one or two checks are to be carried out,
and whether an alternate user ID is specified.
Table 56. User ID checking against profile name for CICS-type user IDs
Alternate user ID hlq.ALTERNATE.USER.userid hlq.CONTEXT.queuename hlq.resourcename
specified on open? profile profile profile
No, 1 check - ADS ADS
No, 2 checks - ADS+TXN ADS+TXN
Yes, 1 check ADS ADS ADS
Yes, 2 checks ADS+TXN ADS+TXN ADS+ALT
Key:
ALT
Alternate user ID
ADS
The user ID associated with the CICS batch job or, if CICS is running as a started task, through the
STARTED class or the started procedures table.
TXN
The user ID associated with the CICS transaction. This is normally the user ID of the terminal user
who started the transaction. It can be the CICS DFLTUSER, a PRESET security terminal, or a manually
signed-on user.
Determine the user IDs checked for the following conditions:
• The RACF access level to the RESLEVEL profile, for a CICS address space user ID, is set to NONE.
• An MQOPEN call is made against a queue with MQOO_OUTPUT and MQOO_PASS_IDENTITY_CONTEXT.
First, see how many CICS user IDs are checked based on the CICS address space user ID access to the
RESLEVEL profile. From Table 51 on page 216 in topic “RESLEVEL and CICS connections” on page 215,
two user IDs are checked if the RESLEVEL profile is set to NONE. Then, from Table 56 on page 221 on,
these checks are carried out:
• The hlq.ALTERNATE.USER.userid profile is not checked.
• The hlq.CONTEXT.queuename profile is checked with both the CICS address space user ID and the CICS
transaction user ID.
• The hlq.resourcename profile is checked with both the CICS address space user ID and the CICS
transaction user ID.
This means that four security checks are made for this MQOPEN call.
Table 57. User ID checking against profile name for IMS-type user IDs
Alternate user ID hlq.ALTERNATE.USER.userid hlq.CONTEXT.queuenam hlq.resourcename
specified on open? profile e profile profile
No, 1 check - REG REG
No, 2 checks - REG+SEC REG+SEC
Yes, 1 check REG REG REG
Key:
ALT
Alternate user ID.
REG
The user ID is normally set through the STARTED class or the started procedures table or, if IMS is
running, from a submitted job, by the USER JCL parameter.
SEC
The second user ID is associated with the work being done in a dependent region. It is determined
according to Table 58 on page 222.
Table 58. How the second user ID is determined for the IMS connection
Types of dependent region Hierarchy for determining the second user ID
• BMP message driven and successful GET User ID associated with the IMS transaction if the
UNIQUE issued. user is signed on.
• IFP and GET UNIQUE issued. LTERM name if available.
• MPP. PSBNAME.
• BMP message driven and successful GET User ID associated with the IMS dependent region
UNIQUE not issued. address space if this is not all blanks or all zeros.
• BMP not message driven. PSBNAME.
• IFP and GET UNIQUE not issued.
Table 59. User IDs checked against profile name for TCP/IP channels
PUTAUT option hlq.ALTERNATE.USER.useri hlq.CONTEXT.queuename hlq.resourcename profile
specified on d profile profile
receiver or
requester channel
DEF, 1 check - CHL CHL
DEF, 2 checks - CHL + MCA CHL + MCA
CTX, 1 check CHL CHL CHL
222 Securing IBM MQ
Table 59. User IDs checked against profile name for TCP/IP channels (continued)
PUTAUT option hlq.ALTERNATE.USER.useri hlq.CONTEXT.queuename hlq.resourcename profile
specified on d profile profile
receiver or
requester channel
CTX, 2 checks CHL + MCA CHL + MCA CHL + ALT
ONLYMCA, 1 check - MCA MCA
ONLYMCA, 2 checks - MCA MCA
ALTMCA, 1 check MCA MCA MCA
ALTMCA, 2 checks MCA MCA MCA + ALT
Key:
MCA (MCA user ID)
The user ID specified for the MCAUSER channel attribute at the receiver; if blank, the channel initiator
address space user ID of the receiver or requester side is used.
CHL (Channel user ID)
On TCP/IP, security is not supported by the communication system for the channel. If Transport Layer
Security (TLS) is being used and a digital certificate has been flowed from the partner, the user ID
associated with this certificate (if installed), or the user ID associated with a matching filter found by
using RACF Certificate Name Filtering (CNF), is used. If no associated user ID is found, or if TLS is not
being used, the user ID of the channel initiator address space of the receiver or requester end is used
as the channel user ID on channels defined with the PUTAUT parameter set to DEF or CTX.
Note: The use of RACF Certificate Name Filtering (CNF) allows you to assign the same RACF user
ID to multiple remote users, for example all the users in the same organization unit, who would
naturally all have the same security authority. This means that the server does not have to have a
copy of the certificate of every possible remote user across the world, and greatly simplifies certificate
management and distribution.
If the PUTAUT parameter is set to ONLYMCA or ALTMCA for the channel, the channel user ID is
ignored and the MCA user ID of the receiver or requester is used. This also applies to TCP/IP channels
using TLS.
ALT (Alternate user ID)
The user ID from the context information (that is, the UserIdentifier field) within the message
descriptor of the message. This user ID is moved into the AlternateUserID field in the object
descriptor before an MQOPEN or MQPUT1 call is issued for the target destination queue.
Table 60. User IDs checked against profile name for LU 6.2 channels
PUTAUT option hlq.ALTERNATE.USER.userid hlq.CONTEXT.queuenam hlq.resourcename
specified on profile e profile profile
receiver or
requester channel
DEF, 1 check - CHL CHL
DEF, 2 checks - CHL + MCA CHL + MCA
CTX, 1 check CHL CHL CHL
CTX, 2 checks CHL + MCA CHL + MCA CHL + ALT
Key:
MCA (MCA user ID)
The user ID specified for the MCAUSER channel attribute at the receiver; if blank, the channel initiator
address space user ID of the receiver or requester side is used.
CHL (Channel user ID)
Requester-server channels
If the channel is started from the requester, there is no opportunity to receive a network user ID
(the channel user ID).
If the PUTAUT parameter is set to DEF or CTX on the requester channel, the channel user ID is
that of the channel initiator address space of the requester because no user ID is received from
the network.
If the PUTAUT parameter is set to ONLYMCA or ALTMCA, the channel user ID is ignored and the
MCA user ID of the requester is used.
Other channel types
If the PUTAUT parameter is set to DEF or CTX on the receiver or requester channel, the channel
user ID is the user ID received from the communications system when the channel is initiated.
• If the sending channel is on z/OS, the channel user ID received is the channel initiator address
space user ID of the sender.
• If the sending channel is on a different platform (for example, AIX or HP-UX), the channel user
ID received is typically provided by the USERID parameter of the channel definition.
If the user ID received is blank, or no user ID is received, a channel user ID of blanks is used.
ALT (Alternate user ID)
The user ID from the context information (that is, the UserIdentifier field) within the message
descriptor of the message. This user ID is moved into the AlternateUserID field in the object
descriptor before an MQOPEN or MQPUT1 call is issued for the target destination queue.
224 Securing IBM MQ
For client MQOPEN, MQSUB, and MQPUT1 requests, use the following rules to determine the profile that is
checked:
• If the request specifies alternate-user authority, a check is made against the hlq.ALTERNATE.USER.
userid profile.
• If the request specifies context authority, a check is made against the hlq.CONTEXT. queuename profile.
• For all MQOPEN, MQSUB, and MQPUT1 requests, a check is made against the hlq.resourcename profile.
When you have determined which profiles are checked, use the following table to determine which user
IDs are checked against these profiles.
Table 61. User IDs checked against profile name for LU 6.2 and TCP/IP server-connection channels
PUTAUT Alternate hlq.ALTERNATE.USER.userid hlq.CONTEXT.queuename hlq.resourcename
option user ID profile profile profile
specified specified on
on server- open?
connection
channel
DEF, 1 No - CHL CHL
check
DEF, 1 Yes CHL CHL CHL
check
DEF, 2 No - CHL + MCA CHL + MCA
checks
DEF, 2 Yes CHL + MCA CHL + MCA CHL + ALT
checks
ONLYMCA, No - MCA MCA
1 check
ONLYMCA, Yes MCA MCA MCA
1 check
ONLYMCA, No - MCA MCA
2 checks
ONLYMCA, Yes MCA MCA MCA + ALT
2 checks
Key:
MCA (MCA user ID)
The user ID specified for the MCAUSER channel attribute at the server-connection; if blank, the
channel initiator address space user ID is used.
CHL (Channel user ID)
On TCP/IP, security is not supported by the communication system for the channel. If Transport Layer
Security (TLS) is being used and a digital certificate has been flowed from the partner, the user ID
associated with this certificate (if installed), or the user ID associated with a matching filter found by
using RACF Certificate Name Filtering (CNF), is used. If no associated user ID is found, or if TLS is
not being used, the user ID of the channel initiator address space is used as the channel user ID on
channels defined with the PUTAUT parameter set to DEF or CTX.
Note: The use of RACF Certificate Name Filtering (CNF) allows you to assign the same RACF user
ID to multiple remote users, for example all the users in the same organization unit, who would
naturally all have the same security authority. This means that the server does not have to have a
copy of the certificate of every possible remote user across the world, and greatly simplifies certificate
management and distribution.
226 Securing IBM MQ
Table 62. User IDs checked against profile name for intra-group queuing
IGQAUT option hlq.ALTERNATE.USER.userid hlq.CONTEXT.queuenam hlq.resourcename profile
specified on profile e profile
receiving queue
manager
DEF, 1 check - SND SND
DEF, 2 checks - SND +IGQ SND +IGQ
CTX, 1 check SND SND SND
CTX, 2 checks SND + IGQ SND +IGQ SND + ALT
ONLYIGQ, 1 check - IGQ IGQ
ONLYIGQ, 2 checks - IGQ IGQ
ALTIGQ, 1 check - IGQ IGQ
ALTIGQ, 2 checks IGQ IGQ IGQ + ALT
Key:
ALT
Alternate user ID.
IGQ
IGQ user ID.
SND
Sending queue manager user ID.
you define a profile that enables both z/OS-defined user IDs (that have not been put in the access list) and
the RACF undefined user ID to put messages on, and get messages from, that queue.
To protect against blank user IDs you must plan your access levels carefully, and limit the number
of people who can use context and alternate-user security. You must prevent people using the RACF
undefined user ID from getting access to resources that they must not access. However, at the same
time, you must allow access to people with defined user IDs. To do this, you can specify a user ID of
asterisk (*) in a RACF command PERMIT, giving access to resources for all defined user IDs. Therefore all
IBM MQ Explorer
The IBM MQ Explorer cannot be used to log on to a z/OS system with a userid for which MFA is enabled
because there is no facility for passing a second authentication factor from the IBM MQ Explorer to z/OS.
Additionally, there are two different mechanisms used by the IBM MQ Explorer to re-use a user ID and
password credential, that need special attention when one time use passwords are in effect:
1. IBM MQ Explorer has the capability to store passwords in an obfuscated format on the local machine
for login at a later time. This capability must be disabled by having explorer prompt for a password
each time a connection is made to the z/OS queue manager.
To do this, use the following procedure:
a. Select Queue Managers.
b. From the list displayed, choose the queue manager you require and right click that queue manager.
c. Select Connection Details from the menu list that appears.
d. Select Properties from the next menu list and choose the Userid tab.
Ensure that you select the prompt for password radio button.
2. Various operations in the IBM MQ Explorer, such as browsing messages on queues, testing
subscriptions, and so on, start a new thread which authenticates to IBM MQ using the credential
first used at logon. Since the password credential cannot be re-used, you cannot use these operations.
There are two possible workarounds at the MFA configuration level for these issues:
• Use the application ID exclusion of MFA to exclude the IBM MQ tasks from MFA processing altogether.
To do this, issue the following commands:
where chinuser is the channel initiator address space level user Id (associated with the channel
initiator through the STC class)
2. PERMIT MFABYPASS.USERID.chinuser CLASS MFADEF ACCESS(READ) ID(explorer user)
228 Securing IBM MQ
For more information on this approach, see Bypassing IBM MFA for applications.
• Use Out-of-band support on MFA, which was introduced with IBM MFA 1.2. With this approach,
you pre-authenticate to the IBM MFA web server, and in addition to your user ID and password,
specify additional authentication as determined through the policy. IBM MFA server generates a cache
token credential that you then specify on the IBM MQ Explorer authentication dialogue. The security
administrator can allow this credential to be replayed for a reasonable period of time, so enabling
normal IBM MQ Explorer use.
For more information on this approach see Introduction to IBM MFA.
User ID reverification
If the RACF definition of a user who is using IBM MQ resources has been changed, for example by
connecting the user to a new group, you can tell the queue manager to sign this user on again the next
time it tries to access an IBM MQ resource. You can do this by using the IBM MQ command RVERIFY
SECURITY.
• User HX0804 is getting and putting messages to the PAYROLL queues on queue manager PRD1.
However HX0804 now requires access to some of the PENSION queues on the same queue manager
(PRD1).
• The data security administrator connects user HX0804 to the RACF group that allows access to the
PENSION queues.
• So that HX0804 can access the PENSION queues immediately (that is, without shutting down queue
manager PRD1 or waiting for HX0804 to time out) you must use the IBM MQ command:
RVERIFY SECURITY(HX0804)
Note: If you turn off user ID timeout for long periods of time (days or even weeks) while the queue
manager is running, you must remember to run the RVERIFY SECURITY command for any users that have
been revoked or deleted in that time.
User ID timeouts
You can make IBM MQ sign a user off a queue manager after a period of inactivity.
When a user accesses an IBM MQ resource, the queue manager tries to sign this user on to the queue
manager (if subsystem security is active). This means that the user is authenticated to the ESM. This user
remains signed on to IBM MQ until either the queue manager is shut down, or until the user ID is timed
out (the authentication lapses) or reverified (reauthenticated).
When a user is timed out, the user ID is signed off within the queue manager and any security-related
information retained for this user is discarded. The signing on and off of the user within the queue
manager is not apparent to the application program or to the user.
Users are eligible for timeout when they have not used any IBM MQ resources for a predetermined
amount of time. This time period is set by the MQSC ALTER SECURITY command.
Two values can be specified in the ALTER SECURITY command:
TIMEOUT
The time period in minutes that an unused user ID and its associated resources can remain within the
IBM MQ queue manager.
230 Securing IBM MQ
CLASS NAME
----- ----
MQQUEUE QP*.SYSTEM.COMMAND.*.** (G)
AUDITING
--------
FAILURES(READ)
This indicates that auditing is set on. For more information, refer to the z/OS Security Server RACF
Auditor's Guide and the z/OS Security Server RACF Command Language Reference.
Figure 17 on page 231 summarizes the situations in which security information is cached and in which
cached information is used.
If you change your security settings by adding or deleting switch profiles in the MQADMIN or MXADMIN
classes, use one of these commands to pick up these changes dynamically:
REFRESH SECURITY(*)
REFRESH SECURITY(MQADMIN)
REFRESH SECURITY(MXADMIN)
This means you can activate new security types, or deactivate them without having to restart the queue
manager.
For performance reasons, these are the only classes affected by the REFRESH SECURITY command. You
do not need to use REFRESH SECURITY if you change a profile in either the MQCONN or MQCMDS classes.
Note: A refresh of the MQADMIN or MXADMIN class is not required if you change a RESLEVEL security
profile.
You must issue the following command to tell RACF to refresh the security information that it holds, for
example:
Because these profiles are generic, you must tell RACF to refresh the generic profiles for MQQUEUE. For
example:
Then you must use this command to tell queue manager PRMQ that the queue profiles have changed:
REFRESH SECURITY(MQQUEUE)
The example shows that the queue manager that replied to the command has subsystem, command,
alternate user, process, namelist, and queue security active at queue manager level but not at queue
sharing group level. Connection, command resource, and context security are not active. It also shows
232 Securing IBM MQ
that user ID timeouts are active, and that every 12 minutes the queue manager checks for user IDs that
have not been used in this queue manager for 54 minutes and removes them.
Note: This command shows the current security status. It does not necessarily reflect the current status
of the switch profiles defined to RACF, or the status of the RACF classes. For example, the switch profiles
might have been changed since the last restart of this queue manager or REFRESH SECURITY command.
Table 63. RACF access to data sets associated with a queue manager
RACF access Data sets
READ • thlqual.SCSQAUTH and thlqual.SCSQANLx (where x is the language
letter for your national language).
• The data sets referred to by CSQINP1, CSQINP2 and CSQXLIB in the queue
manager's started task procedure.
• SMDS data sets owned by other queue managers in the group.
• Log, BSDS and archive log data sets for other queue managers in the group.
UPDATE • All page sets and log and BSDS data sets.
• SMDS data sets owned by a queue manager
Table 64 on page 234 summarizes the RACF access that the started task procedure for distributed
queuing must have to the different data sets.
Table 64. RACF access to data sets associated with distributed queuing
RACF access Data sets
READ • thlqual.SCSQAUTH, thlqual.SCSQANLx (where x is the language letter for your
national language), and thlqual.SCSQMVR1.
• LE library data sets.
• The data sets referred to by CSQXLIB and CSQINPX in the channel initiator
started task procedure.
For more information, see the z/OS Security Server RACF Security Administrator's Guide.
234 Securing IBM MQ
Setting up IBM MQ for z/OS resource security
There are many types of IBM MQ user. Use RACF to control their access to IBM MQ resources.
The possible users of IBM MQ resources, such as queues and channels include the following entities:
• The queue manager itself.
• The channel initiator
• IBM MQ administrators, who need to create IBM MQ data sets, run utility programs, and similar tasks
• Application programmers who need to use the IBM MQ-supplied copybooks, include data sets, macros,
and similar resources.
• Applications involving one or more of:
– Batch jobs
– TSO users
– CICS regions
– IMS regions
• Data sets CSQOUTX and CSQSNAP
• Dynamic queues SYSTEM.CSQXCMD.*
For all these potential users, protect the IBM MQ resources with RACF. In particular, note that the channel
initiator needs access to various resources, as described in “Security considerations for the channel
initiator on z/OS” on page 241, and so the user ID under which it runs must be authorized to access these
resources.
If you are using a queue sharing group, the queue manager might issue various commands internally, so
the user ID it uses must be authorized to issue such commands. The commands are:
• DEFINE, ALTER, and DELETE for every object that has QSGDISP(GROUP)
• START and STOP CHANNEL for every channel used with CHLDISP(SHARED)
The ID must be either the channel initiator address space user ID or the user ID you want to own the
key ring if it is to be a shared key ring.
2. Create a digital certificate for each queue manager, using the RACF RACDCERT command.
The label of the certificate must be either the value of the IBM MQ CERTLABL attribute, if it is set, or
the default ibmWebSphereMQ with the name of the queue manager or queue sharing group appended.
See Digital certificate labels for details. In this example it is ibmWebSphereMQQM1.
For example:
3. Connect the certificate in RACF to the key ring, using the RACF RACDCERT command. For example:
You also need to connect any relevant signer certificates (from a certificate authority) to the key
ring. That is, all certificate authorities for the TLS certificate of this queue manager and all certificate
authorities for all TLS certificates that this queue manager communicates with. For example:
RACDCERT ID(CHINUSER)
CONNECT(CERTAUTH LABEL('My CA') RING(QM1RING) USAGE(CERTAUTH))
4. On each of your queue managers, use the IBM MQ ALTER QMGR command to specify the key
repository that the queue manager needs to point to. For example, if the key ring is owned by the
channel initiator address space:
where userid is the user ID that owns the shared key ring.
5. Certificate Revocation Lists (CRLs) allow the certificate authorities to revoke certificates that can no
longer be trusted. CRLs are stored in LDAP servers. To access this list on the LDAP server, you first
need to create an AUTHINFO object of AUTHTYPE CRLLDAP, using the IBM MQ DEFINE AUTHINFO
command. For example:
DEFINE AUTHINFO(LDAP1)
AUTHTYPE(CRLLDAP)
CONNAME(ldap.server(389))
LDAPUSER('')
LDAPPWD('')
In this example, the certificate revocation list is stored in a public area of the LDAP server, so the
LDAPUSER and LDAPPWD fields are not necessary.
Next, put your AUTHINFO object into a namelist, using the IBM MQ DEFINE NAMELIST command. For
example:
236 Securing IBM MQ
Finally, associate the namelist with each queue manager, using the IBM MQ ALTER QMGR command.
For example:
6. Set up your queue manager to run TLS calls, using the IBM MQ ALTER QMGR command. This defines
server subtasks that handle SSL calls only, which leaves the normal dispatchers to continue processing
as normal without being affected by any SSL calls. You must have at least two of these subtasks. For
example:
This change only takes effect when the channel initiator is restarted.
7. Specify the cipher specification to be used for each channel, using the IBM MQ DEFINE CHANNEL or
ALTER CHANNEL command. For example:
ALTER CHANNEL(LDAPCHL)
CHLTYPE(SDR)
SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA)
Both ends of the channel must specify the same cipher specification.
Auditing RESLEVEL
Use the RESAUDIT system parameter to control the production of RESLEVEL audit records. RACF
GENERAL audit records are produced.
Produce RESLEVEL audit records by setting the RESAUDIT system parameter to YES. If the RESAUDIT
parameter is set to NO, audit records are not produced. For more details about setting this parameter, see
Using CSQ6SYSP.
If RESAUDIT is set to YES, no normal RACF audit records are taken when the RESLEVEL check is made
to see what access an address space user ID has to the hlq.RESLEVEL profile. Instead, IBM MQ requests
that RACF create a GENERAL audit record (event number 27). These checks are only carried out at
connect time, so the performance cost is minimal.
You can report the IBM MQ general audit records using the RACF report writer (RACFRW). You could use
the following RACFRW commands to report the RESLEVEL access:
RACFRW
SELECT PROCESS
EVENT GENERAL
LIST
END
A sample report from RACFRW, excluding the Date, Time, and SYSID fields, is shown in Figure 19 on
page 238.
Figure 19. Sample output from RACFRW showing RESLEVEL general audit records
238 Securing IBM MQ
From checking the LOGSTR data in this sample output, you can see that TSO user WS21B has CONTROL
access to QM66.RESLEVEL. This means that all resource security checks are bypassed when user WS21B
access QM66 resources.
For more information about using RACFRW, see the z/OS Security Server RACF Auditor's Guide.
Customizing security
If you want to change the way IBM MQ security operates, you must do this through the SAF exit
(ICHRFR00), or exits in your external security manager.
To find out more about RACF exits, see the z/OS Security Server RACROUTE Macro Reference manual.
Note: Because IBM MQ optimizes calls to the ESM, RACROUTE requests might not be made on, for
example, every open for a particular queue by a particular user.
• An alternate user has been requested, but the job or task user ID does not have access to the alternate
user ID. For this failure, you get a violation message in the job log of the relevant queue manager.
• A context option has been used or is implied by opening a transmission queue for output, but the job
user ID or, where applicable, the task or alternate user ID does not have access to the context option. In
this case, a violation message is put in the job log of the relevant queue manager.
• An unauthorized user has attempted to access a secured queue manager object, for example, a queue.
In this case, an ICH408I message for the violation is put in the job log of the relevant queue manager.
This violation might be due to the job or, when applicable, the task or alternate user ID.
Violation messages for command security and command resource security can also be found in the job
log of the queue manager.
If the ICH408I violation message shows the queue manager jobname rather than a user ID, this is
normally the result of a blank alternate user ID being specified. For example:
You can find out who is allowed to use blank alternate user IDs by checking the access list of the
MQADMIN profile hlq.ALTERNATE.USER.-BLANK-.
An ICH408I violation message can also be generated by:
240 Securing IBM MQ
• Are you using queue sharing groups?
– If you are using both queue sharing group and queue manager level security, check that you have
defined all the correct profiles. If queue manager profile is not defined, a message is sent to the log
stating that the profile was not found.
– Have you used a combination of switch settings that is not valid so that full security checking has
been set on?
– Do you need to define security switches to override some of the queue sharing group settings for your
queue manager?
– Is a queue manager level profile taking precedence over a queue sharing group level profile?
242 Securing IBM MQ
Automatic restart
If you are using the z/OS Automatic Restart Manager (ARM) to restart the channel initiator, the user
ID associated with the XCFAS address space must be authorized to issue the IBM MQ START CHINIT
command.
IMSXCF.xcfgname.mqxcfmname
Where xcfgname is the XCF group name and mqxcfmname is the XCF member name of IBM MQ.
You must give your IBM MQ queue manager user ID read access to this profile.
Note:
244 Securing IBM MQ
1. If you change the authorities in the FACILITY class, you must issue the RACF command SETROPTS
RACLIST(FACILITY) REFRESH to activate the changes.
2. If profile hlq.NO.SUBSYS.SECURITY exists in the MQADMIN class, no user ID is passed to IMS and the
connection fails unless the /SECURE OTMA setting is NONE.
IMSXCF.xcfgname.imsxcfmname
Where xcfgname is the XCF group name and imsxcfmname is the XCF member name for IMS. (You need
to define a separate profile for each IMS system.)
The access level you allow for the IBM MQ queue manager user ID in this profile is returned to IBM MQ
when the IMS bridge connects to IMS, and indicates the level of security that is required on subsequent
transactions. For subsequent transactions, IBM MQ requests the appropriate services from RACF and,
where the user ID is authorized, passes the message to IMS.
OTMA does not support the IMS /SIGN command; however, IBM MQ allows you to set the access checking
for each message to enable implementation of the necessary level of control.
The following access level information can be returned:
NONE or NO PROFILE FOUND
These values indicate that maximum security is required, that is, authentication is required for every
transaction. A check is made to verify that the user ID specified in the UserIdentifier field of the MQMD
structure, and the password or PassTicket in the Authenticator field of the MQIIH structure are known
to RACF, and are a valid combination. A UTOKEN is created with a password or PassTicket, and passed
to IMS ; the UTOKEN is not cached.
Note: If profile hlq.NO.SUBSYS.SECURITY exists in the MQADMIN class, this level of security
overrides whatever is defined in the profile.
READ
This value indicates that the same authentication is to be performed as for NONE under the following
circumstances:
• The first time that a specific user ID is encountered
• When the user ID has been encountered before but the cached UTOKEN was not created with a
password or PassTicket
IBM MQ requests a UTOKEN if required, and passes it to IMS.
Note: If a request to reverify security has been acted on, all cached information is lost and a UTOKEN
is requested the first time each user ID is later encountered.
UPDATE
A check is made that the user ID in the UserIdentifier field of the MQMD structure is known to RACF.
A UTOKEN is built and passed to IMS ; the UTOKEN is cached.
CONTROL/ALTER
These values indicate that no security UTOKENs need to be provided for any user IDs for this IMS
system. (You would probably only use this option for development and test systems.)
246 Securing IBM MQ
• /MODIFY COMMIT
2. If you do not use /SECURE OTMA PROFILE, any value specified in the SecurityScope field of the MQIIH
structure is ignored.
Specifying that only FIPS-certified CipherSpecs are used at run time on the
MQI client
Create your key repositories using FIPS-compliant software, then specify that the channel must use
FIPS-certified CipherSpecs.
In order to be FIPS-compliant at run time, the key repositories must have been created and managed
using only FIPS-compliant software such as runmqakm with the -fips option.
You can specify that a TLS channel must use only FIPS-certified CipherSpecs in three ways, listed in order
of precedence:
1. Set the FipsRequired field in the MQSCO structure to MQSSL_FIPS_YES.
2. Set the environment variable MQSSLFIPS to YES.
3. Set the SSLFipsRequired attribute in the client configuration file to YES.
By default, FIPS-certified CipherSpecs is not required.
These values have the same meanings as the equivalent parameter values on ALTER QMGR SSLFIPS (see
ALTER QMGR ). If the client process currently has no active TLS connections, and a FipsRequired value is
validly specified on an SSL MQCONNX, all subsequent TLS connections associated with this process must
use only the CipherSpecs associated with this value. This applies until this and all other TLS connections
have stopped, at which stage a subsequent MQCONNX can provide a new value for FipsRequired.
If cryptographic hardware is present, the cryptographic modules used by IBM MQ can be configured to be
those modules provided by the hardware product, and these might be FIPS-certified to a particular level.
The configurable modules and whether they are FIPS-certified depends on the hardware product in use.
248 Securing IBM MQ
Where possible, if FIPS-only CipherSpecs is configured then the MQI client rejects connections which
specify a non-FIPS CipherSpec with MQRC_SSL_INITIALIZATION_ERROR. IBM MQ does not guarantee to
reject all such connections and it is your responsibility to determine whether your IBM MQ configuration is
FIPS-compliant.
Related concepts
“Federal Information Processing Standards (FIPS) for UNIX, Linux, and Windows” on page 31
When cryptography is required on an SSL/TLS channel on Windows, UNIX and Linux systems, IBM MQ
uses a cryptography package called IBM Crypto for C (ICC). On the Windows, UNIX and Linux platforms,
the ICC software has passed the Federal Information Processing Standards (FIPS) Cryptomodule
Validation Program of the US National Institute of Standards and Technology, at level 140-2.
SSL stanza of the client configuration file
Related reference
FipsRequired (MQLONG)
MQSSLFIPS
EXPLANATION:
This message applies to AIX systems. The shared library
'/usr/mqm/gskit8/lib64/libgsk8ssl_64.so' failed
to load correctly due to a problem with the library.
ACTION:
Check the file access permissions and that the file has not been corrupted.
----- amqxufnx.c : 1284 -------------------------------------------------------
09/08/11 11:16:13 - Process(24412.1) User(user) Program(example)
Host(machine.example.ibm.com) Installation(Installation1)
VRMF(7.1.0.0)
AMQ9220: The GSKit communications program could not be loaded.
EXPLANATION:
The attempt to load the GSKit library or procedure
'/usr/mqm/gskit8/lib64/libgsk8ssl_64.so' failed with error code
536895861.
ACTION:
Either the library must be installed on the system or the environment changed
to allow the program to locate it.
----- amqcgska.c : 836 --------------------------------------------------------
. /usr/mqm/bin/setmqenv -s -k
For more information about the use of the setmqenv command, refer to setmqenv (set IBM MQ
environment)
250 Securing IBM MQ
Queue managers using TLS enabled channels must all use RSA-signed certificates, or all use
EC-signed certificates, not a mixture of both.
See “Digital certificates and CipherSpec compatibility in IBM MQ” on page 41 for more
information.
Self-signed certificates cannot be revoked, which could allow an attacker to spoof an identity after a
private key has been compromised. CAs can revoke a compromised certificate, which prevents its further
use. CA-signed certificates are therefore safer to use in a production environment, though self-signed
certificates are more convenient for a test system.
For full information about creating and managing certificates, see “Working with SSL/TLS on UNIX, Linux,
and Windows” on page 263.
This collection of topics introduces some of the tasks involved in setting up SSL communications, and
provides step-by-step guidance on completing those tasks.
You might also want to test SSL oro TLS client authentication, which are an optional part of the protocols.
During the SSL or TLS handshake, the SSL or TLS client always obtains and validates a digital certificate
from the server. With the IBM MQ implementation, the SSL or TLS server always requests a certificate
from the client.
On UNIX, Linux, and Windows, the SSL or TLS client sends a certificate only if it has one labeled in the
correct IBM MQ format:
• For a queue manager, the format is ibmwebspheremq followed by the name of your queue manager
changed to lowercase. For example, for QM1, ibmwebspheremqqm1
• For an IBM MQ client, ibmwebspheremq followed by your logon user ID changed to lowercase, for
example ibmwebspheremqmyuserid.
IBM MQ uses the ibmwebspheremq prefix on a label to avoid confusion with certificates for other
products. Ensure that you specify the entire certificate label in lowercase.
The SSL or TLS server always validates the client certificate if one is sent. If the client does not send a
certificate, authentication fails only if the end of the channel acting as the SSL or TLS server is defined
with either the SSLCAUTH parameter set to REQUIRED or an SSLPEER parameter value set. For more
information, see Connecting two queue managers using SSL or TLS.
Accessing DCM
Follow these instructions to access the DCM interface.
Procedure
1. Go to either http://machine.domain:2001 or https://machine.domain:2010, where
machine is the name of your computer.
2. Type a valid user profile and password when requested to.
Ensure that your user profile has *ALLOBJ and *SECADM special authorities to enable you to create
new certificate stores. If you do not have the special authorities, you can only manage your personal
certificates or view the object signatures for the objects for which you are authorized. If you are
authorized to use an object signing application, you can also sign objects from DCM.
3. On the Internet Configurations page, click Digital Certificate Manager.
The Digital Certificate Manager page is displayed.
252 Securing IBM MQ
Assigning a certificate to a queue manager on IBM i
Use DCM to assign a certificate to a queue manager.
Use traditional IBM i digital certificate management to assign a certificate to a queue manager. This
means that you can specify that a queue manager uses the system certificate store, and that the queue
manager is registered for use as an application with Digital Certificate Manager. To do this, change the
value of the queue manager SSLKEYR attribute to *SYSTEM.
When the SSLKEYR parameter is changed to *SYSTEM, IBM MQ registers the queue manager as a server
application with a unique application label of QIBM_WEBSPHERE_MQ_QMGRNAME and a label with a
description of Qmgrname (WMQ). Note that channel CERTLABL attributes are not used if you use the
*SYSTEM certificate store. The queue manager then appears as a server application in Digital Certificate
Manager, and you can assign to this application any server or client certificate in the system store.
Because the queue manager is registered as an application, advanced features of DCM such as defining
CA trust lists can be carried out.
If the SSLKEYR parameter is changed to a value other than *SYSTEM, IBM MQ deregisters the queue
manager as an application with Digital Certificate Manager. If a queue manager is deleted, it is also
deregistered from DCM. A user with sufficient *SECADM authority can also manually add or remove
applications from DCM.
Procedure
1. Access the DCM interface, as described in “Accessing DCM” on page 252
2. In the navigation panel, click Create New Certificate Store.
The Create New Certificate Store page is displayed in the task frame.
3. In the task frame, select Other System Certificate Store and click Continue.
The Create a Certificate in New Certificate Store page is displayed in the task frame.
4. Select No - Do not create a certificate in the certificate store and click Continue.
The Certificate Store Name and Password page is displayed in the task frame.
5. In the Certificate store path and filename field, type an IFS path and file name, for example /QIBM/
UserData/mqm/qmgrs/qm1/key.kdb
6. Type a password in the Password field and type it again in the Confirm Password field. Click
Continue.
Make a note of the password (which is case sensitive) because you need it when you stash the
repository key.
7. To exit from DCM, close your browser window.
What to do next
When you have created the certificate store using DCM, ensure you stash the password, as described in
“Stashing the certificate store password on IBM i systems” on page 254
Related tasks
“Importing a certificate into a key repository on IBM i” on page 259
Follow this procedure to import a certificate.
STRMQM MQMNAME('queue_manager_name')
CHGMQM MQMNAME('queue_manager_name') SSLKEYRPWD('password')
The password is case sensitive. It must be entered in single quotation marks exactly as you entered it in
step 6 of “Creating a certificate store on IBM i” on page 254.
254 Securing IBM MQ
Note: If you are not using the default system certificate store, and you do not stash the password,
attempts to start TLS channels fail because they cannot obtain the password required to access the
certificate store.
Procedure
1. Display your queue manager's attributes, using the following command:
2. Examine the command output for the path and stem name of the certificate store.
For example: /QIBM/UserData/ICSS/Cert/Server/Default, where /QIBM/UserData/ICSS/
Cert/Server is the path and Default is the stem name.
Procedure
Use either the CHGMQM command or the ALTER QMGR MQSC command to set your queue manager's key
repository attribute.
a) Using CHGMQM: CHGMQM MQMNAME('qm1') SSLKEYR('/QIBM/UserData/ICSS/Cert/Server/
MyKey')
b) Using ALTER QMGR: ALTER QMGR SSLKEYR('/QIBM/UserData/ICSS/Cert/Server/MyKey')
In either case, the certificate store has the fully qualified file name: /QIBM/UserData/ICSS/Cert/
Server/MyKey.kdb
What to do next
When you change the location of a queue manager's certificate store, certificates are not transferred from
the old location. If the CA certificates preinstalled when you create the certificate store are insufficient,
you must populate the new certificate store with certificates, as described in “Importing a certificate
into a key repository on IBM i” on page 259. You must also stash the password for the new location, as
described in “Stashing the certificate store password on IBM i systems” on page 254.
Procedure
1. Access the DCM interface, as described in “Accessing DCM” on page 252.
2. In the navigation panel, click Create a Certificate Authority.
Procedure
1. Access the DCM interface, as described in “Accessing DCM” on page 252.
2. In the navigation panel, click Select a Certificate Store.
The Select a Certificate Store page is displayed in the task frame.
3. Select the certificate store you want to use and click Continue.
256 Securing IBM MQ
4. Optional: If you selected *SYSTEM in step 3, enter the system store password and click Continue.
5. Optional: If you selected Other System Certificate Store in step 3, in the Certificate store path and
filename field, type the IFS path and file name you set when you created your certificate store. Also
type a password in the Certificate Store Password field. Then click Continue
6. In the navigation panel, click Create Certificate.
7. In the task frame, select the Server or client certificate radio button and click Continue.
The Select a Certificate Authority (CA) page is displayed in the task frame.
8. If you have a local CA on your workstation you choose either the local CA or a commercial CA to sign
the certificate. Select the radio button for the CA you want and click Continue.
The Create a Certificate page is displayed in the task frame.
9. Optional: For a queue manager, in the Certificate label field, enter the certificate label.
The label is either the value of the CERTLABL attribute, if it is set, or the default ibmwebspheremq
with the name of the queue manager appended, all in lowercase. See Digital certificate labels for
details.
For example, for queue manager QM1, type ibmwebspheremqqm1 to use the default value.
10. Optional: For an IBM MQ MQI client, in the Certificate label field, type ibmwebspheremq followed
by your logon user ID folded to lowercase.
For example, type ibmwebspheremqmyuserID
11. Type appropriate values in the Common Name and Organization fields, and select a country. For the
remaining optional fields, type the values you require.
Results
If you selected a commercial CA to sign your certificate, DCM creates a certificate request in PEM
(Privacy-Enhanced Mail) format. Forward the request to your chosen CA.
If you selected the local CA to sign your certificate, DCM informs you that the certificate has been created
in the certificate store and can be used.
Procedure
1. Access the DCM interface, as described in “Accessing DCM” on page 252.
2. In the navigation pane, click Create Certificate.
The Create Certificate page is displayed in the task frame.
3. On the Create Certificate panel, select the User certificate radio button and click Continue.
The Create User Certificate page is displayed.
4. On the Create User Certificate panel, complete the required fields under Certificate Information for
Organization name, State or province, Country or region. Optionally, put values in the Organization
unit and Locality or city fields. Click Continue.
The Common name is automatically set to the user ID with which you are logged on to the iSeries
system.
5. On the next Create User Certificate panel, click Install certificate and click Continue.
A message is displayed stating, Your personal certificate has been installed. You
should keep a backup copy of this certificate.
Procedure
1. Access the DCM interface, as described in “Accessing DCM” on page 252.
2. In the Manage Certificates task category in the navigation panel, click Import Certificate.
The Import Certificate page displays in the task frame.
3. Select the radio button for your certificate type and click Continue.
Either the Import Server or Client Certificate page or the Import Certificate Authority (CA) Certificate
page displays in the task frame.
4. In the Import File field, type the file name of the certificate you want to import and click Continue.
DCM automatically determines the format of the file.
5. If the certificate is a Server or client certificate, type the password in the task frame and click
Continue.
DCM informs you that the certificate has been imported.
258 Securing IBM MQ
Exporting a certificate from a key repository on IBM i
Exporting a certificate exports both the public and private key. This action should be taken with extreme
caution, since passing on a private key would completely compromise your security.
Procedure
1. Access the DCM interface, as described in “Accessing DCM” on page 252.
2. In the navigation panel, click Select a Certificate Store.
The Select a Certificate Store page is displayed in the task frame.
3. Select the certificate store you want to use and click Continue.
4. Optional: If you selected *SYSTEM in step 3, enter the system store password and click Continue.
5. Optional: If you selected Other System Certificate Store in step 3, in the Certificate store path and
filename field, type the IFS path and file name you set when you created your certificate store and
type a password in the Certificate Store Password field. Then click Continue
6. In the Manage Certificates task category in the navigation panel, click Export Certificate.
The Export a Certificate page is displayed in the task frame.
7. Select the radio button for your certificate type and click Continue.
Either the Export Server or Client Certificate page or the Export Certificate Authority (CA) Certificate
page is displayed in the task frame.
8. Select the certificate you want to export.
9. Select the radio button to specify whether you want to export the certificate to a file or directly into
another certificate store.
10. If you selected to export a server or client certificate to a file, provide the following information:
• The path and file name of the location where you want to store the exported certificate.
• For a personal certificate, the password that is used to encrypt the exported certificate and the
target release. For CA certificates, you do not need to specify the password.
11. If you selected to export a certificate directly into another certificate store, specify the target
certificate store and its password.
12. Click Continue.
Procedure
1. Access the DCM interface, as described in “Accessing DCM” on page 252.
2. In the navigation panel, click Select a Certificate Store.
The Select a Certificate Store page is displayed in the task frame.
3. Select the Other System Certificate Store check box and click Continue.
The Certificate Store and Password page is displayed.
4. In the Certificate store path and filename field, type the IFS path and file name you set when you
created the certificate store.
5. Type a password in the Certificate Store Password field. Click Continue.
The Current Certificate Store page is displayed in the task frame.
6. In the Manage Certificates task category in the navigation panel, click Delete Certificate.
The Confirm Delete Certificate page is displayed in the task frame.
7. Select the certificate you want to delete. Click Delete.
8. Click Yes to confirm that you want to delete the certificate. Otherwise, click No.
DCM informs you if it has deleted the certificate.
260 Securing IBM MQ
About this task
To use one-way authentication, using a computer running IBM i as the TLS server, set the SSL Key
Repository (SSLKEYR) parameter to *SYSTEM. This setting registers the IBM MQ queue manager as an
application. You can then assign a certificate to the queue manager to enable one-way authentication.
You can also use private keystores to implement one-way authentication by creating a dummy certificate
for the client queue manager in the key repository.
Procedure
1. Perform the following steps on the server and client queue managers:
a) Alter the queue manager to set the SSLKEYR parameter by issuing the command CHGMQM
MQMNAME(SSL) SSLKEYR(*SYSTEM).
b) Stash the password for the default key repository by issuing the command CHGMQM
MQMNAME(SSL) SSLKEYRPWD('xxxxxxx').
The password must be in single quotation marks.
c) Alter the channels to have the correct CipherSpec in the SSLCIPHER parameter.
d) Refresh TLS security by issuing the command RFRMQMAUT QMNAME(QMGRNAME) TYPE(*SSL).
2. Assign the certificate to the server queue manager using DCM, as follows:
a) Access the DCM interface, as described in “Accessing DCM” on page 252.
b) In the navigation panel, click Select a Certificate Store.
The Select a Certificate Store page is displayed in the task frame.
c) Select the *SYSTEM certificate store and click Continue.
d) In the left panel, expand Manage Applications.
e) Select the View Application definition to check that the queue manager has been registered as an
application.
SSL (WMQ) is listed in the table.
f) Select Update Certificate Assignment.
g) Select Server and click Continue.
h) Select QMGRNAME (WMQ) and click Update certificate assignment.
i) Select the certificate and click Assign New Certificate. A window opens stating that the certificate
has been assigned to the application.
Syntax diagram
amqrsslc -s PathOfKeyDatabase
current user
-r
UserProfile
current user
-u
UserProfile
Running this code results in a request for the password of this key database. This password is stashed in a
file with the same name as key database with a .sth extension. This file is stored on the same path as the
key database. The code example generates a stash file of /Path/Of/KeyDatabase/MyKey.sth. QMQM
is the user owner and QMQMADM the group owner for this file. QMQM and QMQMADM have read, write
permission, and other profiles have only read permission.
262 Securing IBM MQ
• When a new inbound TCP/IP single channel process first receives a request to start a TLS channel.
• When the MQSC command REFRESH SECURITY TYPE(SSL) is issued to refresh the IBM MQ TLS
environment.
• For client application processes, when the last TLS connection in the process is closed. The next TLS
connection picks up the certificate changes.
• For channels that run as threads of a process pooling process (amqrmppa), when the process pooling
process is started or restarted and first runs a TLS channel. If the process pooling process has already
run a TLS channel, and you want the change to become effective immediately, run the MQSC command
REFRESH SECURITY TYPE(SSL).
• For channels that run as threads of the channel initiator, when the channel initiator is started or
restarted and first runs a TLS channel. If the channel initiator process has already run a TLS channel,
and you want the change to become effective immediately, run the MQSC command REFRESH
SECURITY TYPE(SSL).
• For channels that run as threads of a TCP/IP listener, when the listener is started or restarted and first
receives a request to start a TLS channel. If the listener has already run a TLS channel, and you want the
change to become effective immediately, run the MQSC command REFRESH SECURITY TYPE(SSL).
Procedure
1. Go to either http://machine.domain:2001 or https://machine.domain:2010, where
machine is the name of your computer.
A dialog box is displayed, requesting a user name and a password.
2. Type a valid IBM i user profile and password.
3. Go to Cryptography and follow the appropriate links for further information.
What to do next
For more specific information about configuring the 4767 Cryptographic Coprocessor, see 4767
Cryptographic Coprocessor.
Attention: Both the runmqckm and strmqikm commands rely on the IBM MQ Java Runtime
Environment (JRE). As of IBM MQ 9.0.2, if the JRE is not installed, you receive message AMQ9183.
• For UNIX and Linux systems:
– Use the strmqikm (iKeyman) command to start the iKeyman GUI.
– Use the runmqckm (iKeycmd) command to perform tasks with the iKeycmd command line interface.
export DISPLAY=mypc:0
– Ensure that your PATH environment variable contains /usr/bin and /bin. This is also required for
the runmqckm and runmqakm commands. For example:
export PATH=$PATH:/usr/bin:/bin
the resultant .sth file does not have read permission enabled for the mqm group.
Only the creator can read the file. After creating a stash file using the runmqakm command, check
the file permissions, and grant permission to the service account running the queue manager, or to a
group such as local mqm.
To request TLS tracing on UNIX, Linux or Windows systems, see strmqtrc.
Related reference
runmqckm, and runmqakm commands
264 Securing IBM MQ
This section describes the runmqckm, and runmqakm commands according to the object of the
command.
Procedure
Create a key database by using the command line.
1. Run either of the following commands:
• Using runmqckm:
runmqckm -keydb -create -db filename -pw password -type cms -stash
• Using runmqakm:
where:
-db filename
Specifies the fully qualified file name of a CMS key database, and must have a file extension
of .kdb.
-pw password
Specifies the password for the CMS key database.
-type cms
Specifies the type of database. (For IBM MQ, it must be cms.)
-stash
Saves the key database password to a file.
-fips
Specifies that the command is run in FIPS mode. When in FIPS mode, the ICC component uses
algorithms that are FIPS 140-2 validated. If the ICC component does not initialize in FIPS mode,
the runmqakm command fails.
-strong
Checks that the password entered satisfies the minimum requirements for password strength.
The minimum requirements for a password are as follows:
• The password must be a minimum length of 14 characters.
• The password must contain a minimum of one lowercase character, one uppercase character,
and one digit or special character. Special characters include the asterisk (*), the dollar sign ($),
the number sign (#), and the percent sign (%). A space is classified as a special character.
• Each character can occur a maximum of three times in a password.
• A maximum of two consecutive characters in the password can be identical.
• All characters are in the standard ASCII printable character set, within the range 0x20 - 0x7E.
Alternatively, create a key database by using the strmqikm (iKeyman) user interface.
2. On UNIX and Linux systems, log in as the root user. On Windows systems, log in as Administrator or
as a member of the MQM group.
3. Start the user interface by running the strmqikm command.
4. From the Key Database File menu, click New.
The New window opens.
266 Securing IBM MQ
5. Click Key database type and select CMS (Certificate Management System).
6. In the File Name field, type a file name.
This field already contains the text key.kdb. If your stem name is key, leave this field unchanged.
If you specified a different stem name, replace key with your stem name. However, you must not
change the .kdb extension.
7. In the Location field, type the path.
For example:
• For a queue manager: /var/mqm/qmgrs/QM1/ssl (on UNIX and Linux systems) or
C:\ProgramData\IBM\MQ\qmgrs\QM1\ssl (on Windows systems).
The path must match the value of the SSLKeyRepository attribute of the queue manager.
• For an IBM MQ client: /var/mqm/ssl (on UNIX and Linux systems) or C:\mqm\ssl (on Windows
systems).
8. Click OK.
The Password Prompt window opens.
9. Type a password in the Password field, and type it again in the Confirm Password field.
10. Select the Stash the password to a file check box.
Note: If you do not stash the password, attempts to start TLS channels fail because they cannot
obtain the password required to access the key database file.
11. Click OK.
The Personal Certificates window opens.
12. Set the access permissions as described in “Accessing and securing your key database files on
Windows” on page 267 or “Accessing and securing your key database files on UNIX and Linux
systems” on page 267.
Accessing and securing your key database files on UNIX and Linux systems
The key database files might not have appropriate access permissions. You must set appropriate access
to these files.
For a queue manager, set permissions on the key database files so that queue manager and channel
processes can read them when necessary, but other users cannot read or modify them. Normally, the
mqm user needs read permissions. If you have created the key database file by logging in as the mqm
user, then the permissions are probably sufficient; if you were not the mqm user, but another user in the
mqm group, you probably need to grant read permissions to other users in the mqm group.
Similarly for a client, set permissions on the key database files so that client application processes can
read them when necessary, but other users cannot read or modify them. Normally, the user under which
the client process runs needs read permissions. If you have created the key database file by logging in as
Adding default CA certificates into an empty key repository on UNIX, Linux, and Windows with
GSKit 8.0
Follow this procedure to add one or more of the default CA certificates to an empty key repository with
GSKit version 8.
In GSKit 7.0, the behavior when creating a new key repository was to automatically add in a set of default
CA certificates for commonly-used Certificate Authorities. For GSKit 8.0, this behavior has changed so
that CA certificates are no longer automatically added to the repository. The user is now required to
manually add CA certificates into the key repository.
Using strmqikm
Perform the following steps on the machine on which you want to add the CA certificate:
1. Start the GUI using the strmqikm command (on UNIX, Linux, and Windows).
2. From the Key Database File menu, click Open. The Open window opens.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file to which you want to add the certificate, for example key.kdb.
6. Click Open. The Password Prompt window opens.
7. Type the password you set when you created the key database and click OK. The name of your key
database file displays in the File Name field.
8. In the Key database content field, select Signer Certificates.
9. Click Populate. The Add CA's Certificate window opens.
10. The CA certificates that are available to be added to the repository are displayed in a hierarchical tree
structure. Select the top level entry for the organization whose CA certificates you want to trust to
view the complete list of valid CA certificates.
11. Select the CA certificates you want to trust from the list and click OK. The certificates are added to
the key repository.
• Issue the following command to add all of the CA certificates for the organization specified in the label
field:
where:
-db filename is the fully qualified path name of the key database.
-pw password is the password for the key database.
268 Securing IBM MQ
-label label is the label attached to the certificate.
Note: Adding a CA certificate to a key repository results in IBM MQ trusting all personal certificates signed
by that CA certificate. Consider carefully which Certificate Authorities you want to trust and only add the
set of CA certificates needed to authenticate your clients and managers. It is not recommended to add
the full set of default CA certificates unless this is a definitive requirement for your security policy.
Locating the key repository for a queue manager on UNIX, Linux, and
Windows
Use this procedure to obtain the location of your queue manager's key database file
Procedure
1. Display your queue manager's attributes, using either of the following MQSC commands:
You can also display your queue manager's attributes using the IBM MQ Explorer or PCF commands.
2. Examine the command output for the path and stem name of the key database file.
For example,
a. on UNIX and Linux: /var/mqm/qmgrs/QM1/ssl/key, where /var/mqm/qmgrs/QM1/ssl is the
path and key is the stem name
b. on Windows: MQ_INSTALLATION_PATH\qmgrs\QM1\ssl\key, where
MQ_INSTALLATION_PATH\qmgrs\QM1\ssl is the path and key is the stem name.
MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.
Changing the key repository location for a queue manager on UNIX, Linux,
and Windows
You can change the location of your queue manager's key database file by various means including the
MQSC command ALTER QMGR.
You can change the location of your queue manager's key database file by using the MQSC command
ALTER QMGR to set your queue manager's key repository attribute. For example, on UNIX and Linux:
The key database file has the fully qualified file name: /var/mqm/qmgrs/QM1/ssl/MyKey.kdb
On Windows:
The key database file has the fully qualified file name: C:\Program
Files\IBM\MQ\Qmgrs\QM1\ssl\Mykey.kdb
Attention: Ensure that you do not include the .kdb extension in the file name on the SSLKEYR
keyword, as the queue manager appends this extension automatically.
You can also alter your queue manager's attributes using the IBM MQ Explorer or PCF commands.
When you change the location of a queue manager's key database file, certificates are not transferred
from the old location. If the key database file you are now accessing is a new key database file, you
must populate it with the CA and personal certificates you need, as described in “Importing a personal
certificate into a key repository on UNIX, Linux, and Windows” on page 284.
echo $MQSSLKEYR
Also check your application, because the key database file name can also be set in an MQCONNX call,
as described in“Specifying the key repository location for an IBM MQ MQI client on UNIX, Linux, and
Windows” on page 270. The value set in an MQCONNX call overrides the value of MQSSLKEYR.
Specifying the key repository location for an IBM MQ MQI client on UNIX,
Linux, and Windows
There is no default key repository for an IBM MQ MQI client. You can specify its location in either of
two ways. Ensure that the key database file can be accessed only by intended users or administrators to
prevent unauthorized copying to other systems.
You can specify the location of the key database file for your IBM MQ MQI client in two ways:
• Setting the MQSSLKEYR environment variable. For example, on UNIX and Linux:
export MQSSLKEYR=/var/mqm/ssl/key
/var/mqm/ssl/key.kdb
On Windows:
C:\Program Files\IBM\MQ\ssl\key.kdb
Note: The .kdb extension is a mandatory part of the file name, but is not included as part of the value of
the environment variable.
• Providing the path and stem name of the key database file in the KeyRepository field of the MQSCO
structure when an application makes an MQCONNX call. For more information about using the MQSCO
structure in MQCONNX, see Overview for MQSCO.
270 Securing IBM MQ
• For channels that run as threads of a process pooling process (amqrmppa), when the process pooling
process is started or restarted and first runs a TLS channel. If the process pooling process has already
run a TLS channel, and you want the change to become effective immediately, run the MQSC command
REFRESH SECURITY TYPE(SSL).
• For channels that run as threads of the channel initiator, when the channel initiator is started or
restarted and first runs a TLS channel. If the channel initiator process has already run a TLS channel,
and you want the change to become effective immediately, run the MQSC command REFRESH
SECURITY TYPE(SSL).
• For channels that run as threads of a TCP/IP listener, when the listener is started or restarted and first
receives a request to start a TLS channel. If the listener has already run a TLS channel, and you want the
change to become effective immediately, run the MQSC command REFRESH SECURITY TYPE(SSL).
You can also refresh the IBM MQ TLS environment using the IBM MQ Explorer or PCF commands.
Procedure
Complete the following steps to create a personal certificate for your queue manager or IBM MQ MQI
client by using the graphical user interface:
1. Start the GUI by using the strmqikm command.
2. From the Key Database File menu, click Open.
The Open window displays.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file from which you want to generate the request; for example, key.kdb.
What to do next
Submit a certificate request to a CA. See “Receiving personal certificates into a key repository on UNIX,
Linux, and Windows” on page 278 for further information.
Procedure
Create a self-signed personal certificate by using either the runmqckm or runmqakm (GSKCapiCmd)
command.
• Using runmqckm on UNIX, Linux, and Windows:
where:
-db filename
Specifies the fully qualified file name of a CMS key database.
272 Securing IBM MQ
-pw password
Specifies the password for the CMS key database.
-label label
Specifies the key label attached to the certificate. The label is either the value of the CERTLABL
attribute, if it is set, or the default ibmwebspheremq with the name of the queue manager or the IBM
MQ MQI client logon user ID appended, all in lowercase. See “Digital certificate labels, understanding
the requirements” on page 25 for details.
-dn distinguished_name
Specifies the X.500 distinguished name enclosed in double quotation marks. At least one attribute is
required. You can supply multiple OU and DC attributes.
Note: The runmqckm and runmqakm tools refer to the postal code attribute as POSTALCODE, not
PC. Always specify POSTALCODE in the -dn parameter when you use these certificate management
commands to request certificates with a postal code.
-size key_size
Specifies the key size. If you are using runmqckm, the value can be 512 or 1024. If you are using
runmqakm, the value can be 512, 1024, or 2048.
x509version version
The version of X.509 certificate to create. The value can be 1, 2, or 3. The default is 3.
-file filename
Specifies the file name for the certificate request.
-expire days
The expiration time in days of the certificate. The default is 365 days for a certificate.
-fips
Specifies that the command is run in FIPS mode. Only the FIPS ICC component is used and this
component must be successfully initialized in FIPS mode. When in FIPS mode, the ICC component
uses algorithms that have been FIPS 140-2 validated. If the ICC component does not initialize in FIPS
mode, the runmqaqm command fails.
-sig_alg
For runmqckm, specifies the asymmetric signature algorithm used for the creation of
the entry's key pair. The value can be, MD2_WITH_RSA, MD2WithRSA, MD5_WITH_RSA,
MD5WithRSA, SHA1WithDSA, SHA1WithECDSA, SHA1WithRSA, SHA2/ECDSA, SHA224WithECDSA,
SHA256_WITH_RSA, SHA256WithECDSA, SHA256WithRSA, SHA2WithECDSA, SHA3/ECDSA,
SHA384_WITH_RSA, SHA384WithECDSA, SHA384WithRSA, SHA3WithECDSA, SHA5/ECDSA,
SHA512_WITH_RSA, SHA512WithECDSA, SHA512WithRSA, SHA5WithECDSA, SHA_WITH_DSA,
SHA_WITH_RSA, SHAWithDSA, SHAWithRSA. The default value is SHA1WithRSA.
-sig_alg
For runmqakm, specifies the hashing algorithm used during the creation
of a certificate request. This hashing algorithm is used to create the
signature associated with the newly created certificate request. The value
can be md5, MD5_WITH_RSA, MD5WithRSA, SHA_WITH_DSA, SHA_WITH_RSA, sha1,
SHA1WithDSA, SHA1WithECDSA, SHA1WithRSA, sha224, SHA224_WITH_RSA, SHA224WithDSA,
SHA224WithECDSA, SHA224WithRSA, sha256, SHA256_WITH_RSA, SHA256WithDSA,
SHA256WithECDSA, SHA256WithRSA, SHA2WithRSA, sha384, SHA384_WITH_RSA,
SHA384WithECDSA, SHA384WithRSA, sha512, SHA512_WITH_RSA, SHA512WithECDSA,
SHA512WithRSA, SHAWithDSA, SHAWithRSA, EC_ecdsa_with_SHA1, EC_ecdsa_with_SHA224,
EC_ecdsa_with_SHA256, EC_ecdsa_with_SHA384, or EC_ecdsa_with_SHA512. The default
value is SHA1WithRSA.
-san_dnsname DNS_names
Specifies a comma-delimited or space-delimited list of DNS names for the entry being created.
-san_emailaddr email_addresses
Specifies a comma-delimited or space-delimited list of email addresses for the entry being created.
-san_ipaddr IP_addresses
Specifies a comma-delimited or space-delimited list of IP addresses for the entry being created.
Procedure
Complete the following steps to apply for a personal certificate, by using the iKeyman user interface:
1. Start the user interface by using the strmqikm command.
2. From the Key Database File menu, click Open.
The Open window opens.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file from which you want to generate the request; for example, key.kdb.
6. Click Open.
274 Securing IBM MQ
The Password Prompt window opens.
7. Type the password you set when you created the key database and click OK.
The name of your key database file is shown in the File Name field.
8. From the Create menu, click New Certificate Request. The Create New Key and Certificate
Request window opens.
9. In the Key Label field, enter the certificate label.
The label is either the value of the CERTLABL attribute, if it is set, or the default ibmwebspheremq
with the name of the queue manager or IBM MQ MQI client logon user ID appended, all in lowercase.
See Digital certificate labels for details.
10. Type or select a value for any field in the Distinguished name field, or any of the Subject alternative
name fields. For the remaining fields, either accept the default values, or type or select new values.
For more information about Distinguished Names, see “Distinguished Names” on page 11.
11. In the Enter the name of a file in which to store the certificate request field, either accept the
default certreq.arm, or type a new value with a full path.
12. Click OK.
A confirmation window is displayed.
13. Click OK.
The Personal Certificate Requests list shows the label of the new personal certificate request you
created. The certificate request is stored in the file you chose in step “11” on page 275.
14. Request the new personal certificate either by sending the file to a certificate authority (CA), or by
copying the file into the request form on the website for the CA.
Procedure
Request a personal certificate by using either the runmqckm or runmqakm (GSKCapiCmd) command.
• Using runmqckm:
where:
-db filename
Specifies the fully qualified file name of a CMS key database.
-pw password
Specifies the password for the CMS key database.
What to do next
Submit a certificate request to a CA. See “Receiving personal certificates into a key repository on UNIX,
Linux, and Windows” on page 278 for further information.
276 Securing IBM MQ
Renewing an existing personal certificate on UNIX, Linux, and Windows
You can renew a personal certificate by using the strmqikm (iKeyman) GUI, or from the command line
using the runmqckm (iKeycmd) or runmqakm (GSKCapiCmd) commands.
Procedure
Complete the following steps to apply for a personal certificate, by using the strmqikm user interface:
1. Start the user interface by using the strmqikm command on UNIX, Linux, and Windows.
2. From the Key Database File menu, click Open.
The Open window opens.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file from which you want to generate the request; for example, key.kdb.
6. Click Open.
The Password Prompt window opens.
7. Type the password you set when you created the key database and click OK.
The name of your key database file is shown in the File Name field.
8. Select Personal Certificates from the drop down selection menu, and select the certificate from the
list that you want to renew.
9. Click the Re-create Request... button.
A window opens for you to enter the file name and file location information.
10. In the file name field, either accept the default certreq.arm, or type a new value, including the full
file path.
11. Click OK. The certificate request is stored in the file you selected in step “9” on page 277.
12. Request the new personal certificate either by sending the file to a certificate authority (CA), or by
copying the file into the request form on the website for the CA.
Procedure
Use the following commands to request a personal certificate by using either the runmqckm or runmqakm
command:
• Using runmqckm on UNIX, Linux, and Windows systems:
• Using runmqakm:
where:
-db filename
Specifies the fully qualified file name of a CMS key database.
-pw password
Specifies the password for the CMS key database.
-target filename
Specifies the file name for the certificate request.
What to do next
Once you have received the signed personal certificate from the certificate authority, you can add it to
your key database using the steps described in “Receiving personal certificates into a key repository on
UNIX, Linux, and Windows” on page 278.
Using strmqikm
If you need to manage TLS certificates in a way that is FIPS compliant, use the runmqakm command.
strmqikm does not provide a FIPS-compliant option.
Ensure that the certificate file to be imported has write permission for the current user, and then use the
following procedure for either a queue manager or an IBM MQ MQI client to receive a personal certificate
into the key database file:
1. Start the GUI using the strmqikm command (on Windows UNIX and Linux ).
2. From the Key Database File menu, click Open. The Open window opens.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file to which you want to add the certificate, for example key.kdb.
6. Click Open, and then click OK. The Password Prompt window opens.
7. Type the password you set when you created the key database and click OK. The name of your key
database file is displayed in the File Name field. Select the Personal Certificates view.
8. Click Receive. The Receive Certificate from a File window opens.
9. Type the certificate file name and location for the new personal certificate, or click Browse to select
the name and location.
10. Click OK. If you already have a personal certificate in your key database, a window opens, asking if
you want to set the key you are adding as the default key in the database.
11. Click Yes or No. The Enter a Label window opens.
278 Securing IBM MQ
12. Click OK. The Personal Certificates field shows the label of the new personal certificate you added.
• Using runmqakm:
runmqakm -cert -receive -file filename -db filename -pw password -fips
where:
-file filename
Specifies the fully qualified file name of the personal certificate.
-db filename
Specifies the fully qualified file name of a CMS key database.
-pw password
Specifies the password for the CMS key database.
-format ascii
Specifies the format of the certificate. The value can be ascii for Base64-encoded ASCII or binary
for Binary DER data. The default is ascii.
-fips
Specifies that the command is run in FIPS mode. When in FIPS mode, the ICC component uses
algorithms that have been FIPS 140-2 validated. If the ICC component does not initialize in FIPS
mode, the runmqakm command fails.
If you are using cryptographic hardware, refer to “Receiving a personal certificate into your PKCS #11
hardware” on page 293.
Using strmqikm
If you need to manage TLS certificates in a way that is FIPS compliant, use the runmqakm command.
strmqikm (iKeyman) does not provide a FIPS-compliant option.
Perform the following steps on the machine from which you want to extract the CA certificate:
1. Start the GUI using the strmqikm command..
2. From the Key Database File menu, click Open. The Open window opens.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file from which you want to extract, for example key.kdb.
6. Click Open. The Password Prompt window opens.
7. Type the password you set when you created the key database and click OK. The name of your key
database file is displayed in the File Name field.
8. In the Key database content field, select Signer Certificates and select the certificate you want to
extract.
9. Click Extract. The Extract a Certificate to a File window opens.
runmqckm -cert -extract -db filename -pw password -label label -target filename
-format ascii
where:
-db filename is the fully qualified path name of a CMS key database.
-pw password is the password for the CMS key database.
-label label is the label attached to the certificate.
-target filename is the name of the destination file.
-format ascii is the format of the certificate. The value can be ascii for Base64-
encoded ASCII or binary for Binary DER data. The default is ascii.
-fips specifies that the command is run in FIPS mode. When in FIPS
mode, the ICC component uses algorithms that have been FIPS 140-2
validated. If the ICC component does not initialize in FIPS mode, the
runmqakm command fails.
Using strmqikm
If you need to manage TLS certificates in a way that is FIPS compliant, use the runmqakm command.
strmqikm (iKeyman) does not provide a FIPS-compliant option.
Perform the following steps on the machine from which you want to extract the public part of a self-
signed certificate:
1. Start the GUI using the strmqikm command (on UNIX, Linux, and Windows ).
2. From the Key Database File menu, click Open. The Open window opens.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file from which you want to extract the certificate, for example key.kdb.
6. Click OK. The Password Prompt window opens.
7. Type the password you set when you created the key database and click OK. The name of your key
database file is displayed in the File Name field.
8. In the Key database content field, select Personal Certificates and select the certificate.
9. Click Extract certificate. The Extract a Certificate to a File window opens.
10. Select the Data type of the certificate, for example Base64-encoded ASCII data for a file with
the .arm extension.
280 Securing IBM MQ
11. Type the certificate file name and location where you want to store the certificate, or click Browse to
select the name and location.
12. Click OK. The certificate is written to the file you specified. Note that when you extract (rather than
export) a certificate, only the public part of the certificate is included, so a password is not required.
runmqckm -cert -extract -db filename -pw password -label label -target filename
-format ascii
• Using runmqakm:
where:
-db filename is the fully qualified path name of a CMS key database.
-pw password is the password for the CMS key database.
-label label is the label attached to the certificate.
-target filename is the name of the destination file.
-format ascii is the format of the certificate. The value can be ascii for Base64-
encoded ASCII or binary for Binary DER data. The default is ascii.
-fips specifies that the command is run in FIPS mode. When in FIPS
mode, the ICC component uses algorithms that have been FIPS 140-2
validated. If the ICC component does not initialize in FIPS mode, the
runmqakm command fails.
Using strmqikm
If you need to manage TLS certificates in a way that is FIPS compliant, use the runmqakm command.
strmqikm does not provide a FIPS-compliant option.
Perform the following steps on the machine on which you want to add the CA certificate:
1. Start the GUI using the strmqikm command (on UNIX, Linux and Windows systems).
2. From the Key Database File menu, click Open. The Open window opens.
• Using runmqakm:
where:
-db filename
Specifies the fully qualified file name of the CMS key database.
-pw password
Specifies the password for the CMS key database.
-label label
Specifies the label attached to the certificate.
-file filename
Specifies the name of the file containing the certificate.
-format ascii
Specifies the format of the certificate. The value can be ascii for Base64-encoded ASCII or binary
for Binary DER data. The default is ascii.
-fips
Specifies that the command is run in FIPS mode. When in FIPS mode, the ICC component uses
algorithms that have been FIPS 140-2 validated. If the ICC component does not initialize in FIPS
mode, the runmqakm command fails.
Using strmqikm
If you need to manage TLS certificates in a way that is FIPS compliant, use the runmqakm command.
strmqikm (iKeyman) does not provide a FIPS-compliant option.
282 Securing IBM MQ
Perform the following steps on the machine from which you want to export the personal certificate:
1. Start the GUI using the strmqikm command (on Windows UNIX and Linux ).
2. From the Key Database File menu, click Open. The Open window opens.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file from which you want to export the certificate, for example key.kdb.
6. Click Open. The Password Prompt window opens.
7. Type the password you set when you created the key database and click OK. The name of your key
database file is displayed in the File Name field.
8. In the Key database content field, select Personal Certificates and select the certificate you want to
export.
9. Click Export/Import. The Export/Import key window opens.
10. Select Export Key.
11. Select the Key file type of the certificate you want to export, for example PKCS12.
12. Type the file name and location to which you want to export the certificate, or click Browse to select
the name and location.
13. Click OK. The Password Prompt window opens. Note that when you export (rather than extract) a
certificate, both the public and private parts of the certificate are included. This is why the exported
file is protected by a password. When you extract a certificate, only the public part of the certificate is
included, so a password is not required.
14. Type a password in the Password field, and type it again in the Confirm Password field.
15. Click OK. The certificate is exported to the file you specified.
runmqckm -cert -export -db filename -pw password -label label -type cms
-target filename -target_pw password -target_type pkcs12
where:
-db filename is the fully qualified path name of the CMS key database.
-fips specifies that the command is run in FIPS mode. When in FIPS
mode, the ICC component uses algorithms that have been FIPS 140-2
validated. If the ICC component does not initialize in FIPS mode, the
runmqakm command fails.
-pw password is the password for the CMS key database.
-label label is the label attached to the certificate.
-type cms is the type of the database.
-target filename is the fully qualified path name of the destination file.
-target_pw password is the password for encrypting the certificate.
-target_type pkcs12 is the type of the certificate.
Using strmqikm
If you need to manage TLS certificates in a way that is FIPS-compliant, use the runmqakm command.
strmqikm does not provide a FIPS-compliant option.
Perform the following steps on the machine to which you want to import the personal certificate:
1. Start the GUI using the strmqikm command .
2. From the Key Database File menu, click Open. The Open window displays.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file to which you want to add the certificate, for example key.kdb.
6. Click Open. The Password Prompt window displays.
7. Type the password you set when you created the key database and click OK. The name of your key
database file displays in the File Name field.
8. In the Key database content field, select Personal Certificates.
9. If there are certificates in the Personal Certificates view, follow these steps:
a. Click Export/Import. The Export/Import key window is displayed.
b. Select Import Key.
10. If there are no certificates in the Personal Certificates view, click Import.
11. Select the Key file type of the certificate you want to import, for example PKCS12.
12. Type the certificate file name and location where the certificate is stored, or click Browse to select
the name and location.
13. Click OK. The Password Prompt window displays.
14. In the Password field, type the password used when the certificate was exported.
15. Click OK. The Change Labels window is displayed. You can change the labels of certificates being
imported if, for example, a certificate with the same label already exists in the target key database.
Changing certificate labels has no effect on certificate chain validation. To associate the certificate
with a particular queue manager or IBM MQ MQI client, IBM MQ uses either the value of the
CERTLABL attribute, if it is set, or the default ibmwebspheremq with the name of the queue manager
or IBM MQ MQI client user logon ID appended, all in lowercase. See Digital certificate labels for
details.
16. To change a label, select the required label from the Select a label to change list. The label is copied
into the Enter a new label entry field. Replace the label text with that of the new label and click
Apply.
17. The text in the Enter a new label entry field is copied back into the Select a label to change field,
replacing the originally selected label and so relabelling the corresponding certificate.
18. When you have changed all the labels that needed to be changed, click OK. The Change Labels
window closes, and the original IBM Key Management window reappears with the Personal
Certificates and Signer Certificates fields updated with the correctly labeled certificates.
19. The certificate is imported to the target key database.
284 Securing IBM MQ
Using the command line
To import a personal certificate using runmqckm, use the following command:
• On UNIX, Linux, and Windows:
runmqckm -cert -import -file filename -pw password -type pkcs12 -target filename
-target_pw password -target_type cms -label label
where:
-file filename is the fully qualified file name of the file containing the PKCS #12
certificate.
-pw password is the password for the PKCS #12 certificate.
-type pkcs12 is the type of the file.
-target filename is the name of the destination CMS key database.
-target_pw password is the password for the CMS key database.
-target_type cms is the type of the database specified by -target
-label label is the label of the certificate to import from the source key database.
-new_label label is the label that the certificate will be assigned in the target database.
If you omit -new_label option, the default is to use the same as the
-label option.
-fips specifies that the command is run in FIPS mode. When in FIPS
mode, the ICC component uses algorithms that have been FIPS 140-2
validated. If the ICC component does not initialize in FIPS mode, the
runmqakm command fails.
runmqckm does not provide a command to change certificate labels directly. Use the following steps to
change a certificate label:
1. Export the certificate to a PKCS #12 file using the -cert -export command. Specify the existing
certificate label for the -label option.
2. Remove the existing copy of the certificate from the original key database using the -cert -delete
command.
3. Import the certificate from the PKCS #12 file using the -cert -import command. Specify the old
label for the -label option and the required new label for the -new_label option. The certificate will
be imported back into the key database with the required label.
runmqckm -cert -import -file filename -pw password -type pkcs12 -target filename
-target_pw password -target_type cms -label label -pfx
286 Securing IBM MQ
To import a personal certificate using runmqakm, use the following command:
runmqakm -cert -import -file filename -pw password -type pkcs12 -target filename
-target_pw password -target_type cms -label label -fips -pfx
where:
-file filename is the fully qualified file name of the file containing the PKCS #12
certificate.
-pw password is the password for the PKCS #12 certificate.
-type pkcs12 is the type of the file.
-target filename is the name of the destination CMS key database.
-target_pw password is the password for the CMS key database.
-target_type cms is the type of the database specified by -target
-label label is the label of the certificate to import from the source key database.
-new_label label is the label that the certificate will be assigned in the target database.
If you omit -new_label option, the default is to use the same as the
-label option.
-fips specifies that the command is run in FIPS mode. When in FIPS
mode, the ICC component uses algorithms that have been FIPS 140-2
validated. If the ICC component does not initialize in FIPS mode, the
runmqakm command fails.
-pfx indicates PFX file format.
runmqckm does not provide a command to change certificate labels directly. Use the following steps to
change a certificate label:
1. Export the certificate to a PKCS #12 file using the -cert -export command. Specify the existing
certificate label for the -label option.
2. Remove the existing copy of the certificate from the original key database using the -cert -delete
command.
3. Import the certificate from the PKCS #12 file using the -cert -import command. Specify the old
label for the -label option and the required new label for the -new_label option. The certificate will
be imported back into the key database with the required label.
runmqckm -cert -add -db filename -pw password -type cms -file filename
-label label
-db filename is the fully qualified file name of the CMS key database.
-pw password is the password for the key database.
-type cms is the type of the key database.
-file filename is the name of the PKCS #7 file.
-label label is the label that the certificate is assigned in the target database. The
first certificate takes the label given. All other certificates, if present, are
labeled with their subject name.
runmqckm -cert -import -db filename -pw password -type pkcs7 -target filename
-target_pw password -target_type cms -label label -new_label label
-db filename is the fully qualified file name of the file containing the PKCS #7
certificate.
-pw password is the password for the PKCS #7 certificate.
-type pkcs7 is the type of the file.
-target filename is the name of the destination key database.
-target_pw password is the password for the destination key database.
-target_type cms is the type of the database specified by -target
-label label is the label of the certificate that is to be imported.
-new_label label is the label that the certificate will be assigned in the target database. If
you omit the -new_label option, the default is to use the same as the
-label option.
Using strmqikm
If you need to manage TLS certificates in a way that is FIPS compliant, use the runmqakm command.
strmqikm (iKeyman) does not provide a FIPS-compliant option.
1. Start the GUI using the strmqikm command (on UNIX, Linux, and Windows).
2. From the Key Database File menu, click Open. The Open window opens.
3. Click Key database type and select CMS (Certificate Management System).
4. Click Browse to navigate to the directory that contains the key database files.
5. Select the key database file from which you want to delete the certificate, for example key.kdb.
6. Click Open. The Password Prompt window opens.
7. Type the password you set when you created the key database and click OK. The name of your key
database file is displayed in the File Name field.
8. From the drop down list, select Personal Certificates or Signer Certificates
9. Select the certificate you want to delete.
10. If you do not already have a copy of the certificate and you want to save it, click Export/Import and
export it (see “Exporting a personal certificate from a key repository on UNIX, Linux, and Windows”
on page 282 ).
11. With the certificate selected, click Delete. The Confirm window opens.
12. Click Yes. The Personal Certificates field no longer shows the label of the certificate you deleted.
where:
288 Securing IBM MQ
-db filename is the fully qualified file name of a CMS key database.
-pw password is the password for the CMS key database.
-label label is the label attached to the personal certificate.
-fips specifies that the command is run in FIPS mode. When in FIPS
mode, the ICC component uses algorithms that have been FIPS 140-2
validated. If the ICC component does not initialize in FIPS mode, the
runmqakm command fails.
When using the generated password on the -pw parameter of subsequent certificate administration
commands, always place double quotation marks around the password. On UNIX and Linux systems, you
must also use a backslash character to escape the following characters if they appear in the password
string:
! \ " '
When entering the password in response to a prompt from runmqckm, runmqakm or the strmqikm GUI
then it is not necessary to quote or escape the password. It is not necessary because the operating
system shell does not affect data entry in these cases.
Procedure
Create a key database by using the command line.
1. Run either of the following commands:
• Using runmqckm:
runmqckm -keydb -create -db filename -pw password -type cms -stash
• Using runmqakm:
where:
-db filename
Specifies the fully qualified file name of a CMS key database, and must have a file extension
of .kdb.
-pw password
Specifies the password for the CMS key database.
-type cms
Specifies the type of database. (For IBM MQ, it must be cms.)
-stash
Saves the key database password to a file.
-fips
Specifies that the command is run in FIPS mode. When in FIPS mode, the ICC component uses
algorithms that are FIPS 140-2 validated. If the ICC component does not initialize in FIPS mode,
the runmqakm command fails.
-strong
Checks that the password entered satisfies the minimum requirements for password strength.
The minimum requirements for a password are as follows:
• The password must be a minimum length of 14 characters.
• The password must contain a minimum of one lowercase character, one uppercase character,
and one digit or special character. Special characters include the asterisk (*), the dollar sign ($),
the number sign (#), and the percent sign (%). A space is classified as a special character.
• Each character can occur a maximum of three times in a password.
• A maximum of two consecutive characters in the password can be identical.
• All characters are in the standard ASCII printable character set, within the range 0x20 - 0x7E.
Alternatively, create a key database by using the strmqikm (iKeyman) user interface.
290 Securing IBM MQ
2. On UNIX and Linux systems, log in as the root user. On Windows systems, log in as Administrator or
as a member of the MQM group.
3. Open the Java security properties file, java.security.
• On UNIX and Linux systems, the Java security properties file is located in the java/
jre64/jre/lib/security subdirectory of the IBM MQ installation directory.
• On Windows systems, the Java security properties file is located in the java\jre\lib\security
subdirectory of the IBM MQ installation directory.
If it's not already present in the file, add the IBMPKCS11Impl security provider. For example, by
adding the following line:
security.provider.12=com.ibm.crypto.pkcs11impl.provider.IBMPKCS11Impl
Procedure
To request a personal certificate from the strmqikm (iKeyman) user interface, complete the following
steps:
1. Complete the steps to work with your cryptographic hardware. See “Managing certificates on PKCS
#11 hardware” on page 290.
2. From the Create menu, click New Certificate Request.
The Create New Key and Certificate Request window opens.
3. In the Key Label field, enter the certificate label.
The label is either the value of the CERTLABL attribute, if it is set, or the default ibmwebspheremq
with the name of the queue manager or IBM MQ MQI client logon user ID appended, all in lowercase.
See Digital certificate labels for details.
4. Select the Key Size and Signature Algorithm that you require.
5. Enter values for Common Name and Organization, and select a Country. For the remaining optional
fields, either accept the default values, or type or select new values.
Note that you can supply only one name in the Organizational Unit field. For more information about
these fields, see “Distinguished Names” on page 11.
6. In the Enter the name of a file in which to store the certificate request field, either accept the
default certreq.arm, or type a new value with a full path.
7. Click OK.
A confirmation window opens.
8. Click OK.
The Personal Certificate Requests list shows the label of the new personal certificate request you
created. The certificate request is stored in the file you chose in step “6” on page 292.
9. Request the new personal certificate either by sending the file to a certificate authority (CA), or by
copying the file into the request form on the website for the CA.
292 Securing IBM MQ
Receiving a personal certificate into your PKCS #11 hardware
Use this procedure for either a queue manager or an IBM MQ MQI client to receive a personal certificate
to your cryptographic hardware.
Procedure
• To receive a personal certificate using the strmqikm (iKeyman) user interface, complete the following
steps:
a) Complete the steps to work with your cryptographic hardware. See “Managing certificates on PKCS
#11 hardware” on page 290.
b) Click Receive. The Receive Certificate from a File window opens.
c) Type the certificate file name and location for the new personal certificate, or click Browse to select
the name and location.
d) Click OK. If you already have a personal certificate in your key database a window opens, asking if
you want to set the key you are adding as the default key in the database.
e) Click Yes or No. The Enter a Label window opens.
f) Click OK. The Personal Certificates list shows the label of the new personal certificate you added.
This label is formed by adding the cryptographic token label before the label you supplied.
• To receive a personal certificate using the runmqakm (GSKCapiCmd) command, complete the following
steps:
a) Open a command window that is configured for your environment.
b) Receive the personal certificate by using the runmqakm (GSKCapiCmd) command:
where:
-file filename
Specifies the fully qualified file name of the file containing the personal certificate.
-crypto module_name
Specifies the fully qualified name of the PKCS #11 library supplied with the cryptographic
hardware.
-tokenlabel hardware_token
Specifies the PKCS #11 cryptographic device token label.
-pw hardware_password
Specifies the password for access to the cryptographic hardware.
-format cert_format
Specifies the format of the certificate. The value can be ascii for Base64-encoded ASCII or
binary for binary DER data. The default is ASCII.
-fips
Specifies that the command is run in FIPS mode. When in FIPS mode, the ICC component
uses algorithms that are FIPS 140-2 validated. If the ICC component does not initialize in FIPS
mode, the runmqakm command fails.
294 Securing IBM MQ
Setting the SSLTASKS parameter on z/OS
Use the ALTER QMGR command to set the number of server subtasks for processing TLS calls
To use TLS channels, ensure that there are at least two server subtasks by setting the SSLTASKS
parameter, using the ALTER QMGR command. For example:
To avoid problems with storage allocation, do not set the SSLTASKS attribute to a value greater than eight
in an environment where there is no Certificate Revocation List (CRL) checking.
If CRL checking is used, an SSLTASK is held by the channel concerned for the duration of that check.
This could be for a significant elapsed time while the relevant LDAP server is contacted, because each
SSLTASK is a z/OS task control block.
You must restart the channel initiator if you change the value of the SSLTASKS attribute.
where:
• userid1 is the user ID of the channel initiator address space, or the user ID that is going to own the
key ring (if the key ring is shared).
• ring-name is the name you want to give to your key ring. The length of this name can be up to
237 characters. This name is case-sensitive. Specify ring-name in uppercase characters to avoid
problems.
RACDCERT ID(userid1)
CONNECT(CERTAUTH LABEL('My CA') RING(ring-name) USAGE(CERTAUTH))
where userid1 is either the channel initiator user ID or the owner of a shared key ring.
For more information about CA certificates, refer to “Digital certificates” on page 9.
2. Examine the command output for the location of the key ring.
if the key ring is owned by the channel initiator address space, or:
if it is a shared key ring, where userid1 is the user ID that owns the key ring.
where csf-resource is the name of the CSF* profile and userid is the user ID of the channel initiator
address space.
Repeat this command for each of the following CSF* profiles:
296 Securing IBM MQ
• CSFDSG
• CSFDSV
• CSFPKD
• CSFPKE
• CSFPKI
Your CHINIT user ID might also need read access to other CSF* profiles. For example, if you are using the
ECDHE_RSA_AES_256_GCM_SHA384 Cipher Spec, your CHINIT user ID also needs read access to the
following CSF* profiles:
• CSF1DVK
• CSF1GAV
• CSF1GKP
• CSF1SKE
• CSF1TRC
• CSF1TRD
For more information, see RACF CSFSERV resource requirements.
If your certificate keys are stored in ICSF and your installation has established access control over keys
stored in ICSF, ensure your CHINIT user ID has read access to the profile in the CSFKEYS class by using
the following command:
RACDCERT ID(userid1)
CONNECT(ID(userid2) LABEL('label-name') RING(ring-name) USAGE(PERSONAL))
where:
• userid1 is the user ID of the channel initiator address space or owner of the shared key ring.
• userid2 is the user ID associated with the certificate and must be the user ID of the channel initiator
address space.
userid1 and userid2 can be the same ID.
• ring-name is the name you gave the key ring in “Setting up a key repository on z/OS” on page 295.
• label-name must be either the value of the IBM MQ CERTLABL attribute, if it is set, or the default
ibmWebSphereMQ with the name of the queue manager appended. See Digital certificate labels for
details.
where
• userid2 is the user ID associated with the certificate and must be the user ID of the channel initiator
address space
• label_name is the label used when creating the self-signed certificate
See “Digital certificate labels, understanding the requirements” on page 25 for details.
3. Send the data set to a Certificate Authority (CA) to request a new personal certificate.
4. When the signed certificate is returned to you by the Certificate Authority, add the certificate back
into the RACF database, using the original label, as described in “Adding personal certificates to a key
repository on z/OS” on page 299.
298 Securing IBM MQ
WITHLABEL('label-name')
SIGNWITH(CERTAUTH LABEL('signer-label'))
2. Connect the certificate to your key ring using the following command:
RACDCERT ID(userid1)
CONNECT(ID(userid2) LABEL('label-name') RING(ring-name) USAGE(PERSONAL))
where:
• userid1 is the user ID of the channel initiator address space or owner of the shared key ring.
• userid2 is the user ID associated with the certificate and must be the user ID of the channel initiator
address space.
userid1 and userid2 can be the same ID.
• ring-name is the name you gave the key ring in “Setting up a key repository on z/OS” on page 295.
• label-name must be either the value of the IBM MQ CERTLABL attribute, if it is set, or the default
ibmWebSphereMQ with the name of the queue manager or queue sharing group appended. See Digital
certificate labels for details.
• signer-label is the label of your own signer certificate.
2. Connect the certificate to your key ring using the following command:
where:
• userid1 is the user ID of the channel initiator address space or owner of the shared key ring.
• userid2 is the user ID associated with the certificate and must be the user ID of the channel initiator
address space.
• ring-name is the name you gave the key ring in “Setting up a key repository on z/OS” on page 295.
• input-data-set-name is the name of the data set containing the CA signed certificate. The data set must
be cataloged and must not be a PDS or a member of a PDS. The record format (RECFM) expected by
RACDCERT is VB. RACDCERT dynamically allocates and opens the data set, and reads the certificate
from it as binary data.
• label-name is the label name that was used when you created the original request. It must be either the
value of the IBM MQ CERTLABL attribute, if it is set, or the default ibmWebSphereMQ with the name of
the queue manager or queue sharing group appended. See Digital certificate labels for details.
where:
• userid2 is the user ID under which the certificate was added to the key ring.
• label-name is the name of the certificate you want to delete.
where:
• userid2 is the user ID under which the certificate was added to the key ring.
• label-name is the name of the certificate you want to rename.
• new-label-name is the new name of the certificate.
This can be useful when testing TLS client authentication.
300 Securing IBM MQ
Associate a user ID with a certificate in either of the following ways:
• Install that certificate into the RACF database under the user ID with which you want to associate it, as
described in “Adding personal certificates to a key repository on z/OS” on page 299.
• Use a Certificate Name Filter (CNF) to map the Distinguished Name of the subject or issuer of the
certificate to the user ID, as described in “Setting up a certificate name filter on z/OS” on page 301.
Note:
1. If the actual certificate is stored in the RACF database, the user ID under which it is installed is used in
preference to the user ID associated with any CNF. If the certificate is not stored in the RACF database,
the user ID associated with the most specific matching CNF is used. Matches of the subject DN are
considered more specific than matches of the issuer DN.
2. Changes to CNFs do not apply until you refresh the CNF mappings.
3. A DN matches the DN filter in a CNF only if the DN filter is identical to the least significant portion of
the DN. The least significant portion of the DN comprises the attributes that are usually listed at the
right-most end of the DN, but which appear at the beginning of the certificate.
For example, consider the SDNFILTER 'O=IBM.C=UK'. A subject DN of 'CN=QM1.O=IBM.C=UK'
matches that filter, but a subject DN of 'CN=QM1.O=IBM.L=Hursley.C=UK' does not match that
filter.
The least significant portion of some certificates can contain fields that do not match the DN filter.
Consider excluding these certificates by specifying a DN pattern in the SSLPEER pattern on the DEFINE
CHANNEL command.
4. If the most specific matching CNF is defined to RACF as NOTRUST, the entity uses the user ID under
which the channel initiator is running.
5. RACF uses the '.' character as a separator. IBM MQ uses either a comma or a semicolon.
You can define CNFs to ensure that the entity never sets the channel user ID to the default, which is the
user ID under which the channel initiator is running. For each CA certificate in the key ring associated with
the entity, define a CNF with an IDNFILTER that exactly matches the subject DN of that CA certificate. This
ensures that all certificates that the entity might use match at least one of these CNFs. This is because all
such certificates must either be connected to the key ring associated with the entity, or must be issued by
a CA for which a certificate is connected to the key ring associated with the entity.
Procedure
On QMA, issue commands like the following example:
Results
A sender channel, TO.QMB, and a transmission queue, QMB, are created.
Procedure
On QMB, issue a command like the following example:
Results
A receiver channel, TO.QMB, is created.
Procedure
1. Optional: If you have not already done so, start a listener program on QMB.
The listener program listens for incoming network requests and starts the receiver channel when it is
needed. For information about how to start a listener, see Starting a channel listener.
2. Optional: If any SSL/TLS channels have run previously, issue the command REFRESH SECURITY
TYPE(SSL).
This ensures that all the changes made to the key repository are available.
3. Start the channel on QMA, using the command START CHANNEL(TO.QMB).
Results
The sender channel is started.
Procedure
Transfer the CA part of the QM1 certificate to the QM2 system and vice versa, for example, by FTP.
302 Securing IBM MQ
If you transfer the certificates using FTP, you must do so in the correct format.
Transfer the following certificate types in binary format:
• DER encoded binary X.509
• PKCS #7 (CA certificates)
• PKCS #12 (personal certificates)
Transfer the following certificate types in ASCII format:
• PEM (privacy-enhanced mail)
• Base64 encoded X.509
Procedure
On QM1, issue commands like the following example:
Results
A sender channel, QM1.TO.QM2, and a transmission queue, QM2, are created.
Procedure
On QM2, issue a command like the following example:
The channel must have the same name as the sender channel you defined in “Defining a sender channel
and transmission queue on QM1 on z/OS” on page 303, and use the same CipherSpec.
Procedure
1. Optional: If you have not already done so, start a listener program on QM2.
The listener program listens for incoming network requests and starts the receiver channel when it is
needed. For information about how to start a listener, see Starting a channel listener
2. Optional: If any SSL/TLS channels have run previously, issue the command REFRESH SECURITY
TYPE(SSL).
Results
The sender channel is started.
Procedure
On QMA, enter the following command:
This ensures that all the changes made to the key repository are available.
Procedure
On QMB, enter the following command:
Procedure
1. Optional: if you have not already done so, start the channel initiator.
2. Optional: If you have not already done so, start a listener program on QM2.
The listener program listens for incoming network requests and starts the receiver channel when it is
needed. For information about how to start a listener, see Starting a channel listener
3. Optional: If the channel initiator was already running or any SSL/TLS channels have run previously,
issue the command REFRESH SECURITY TYPE(SSL).
This ensures that all the changes made to the key repository are available.
4. On QM1, start the channel, using the command START CHANNEL(QM1.TO.QM2).
Results
The sender channel is started.
Procedure
1. Optional: If you have not already done so, start the channel initiator.
2. Optional: If you have not already done so, start a listener program on QMB.
304 Securing IBM MQ
The listener program listens for incoming network requests and starts the receiver channel when it is
needed. For information about how to start a listener, see Starting a channel listener.
3. Optional: If the channel initiator was already running or if any SSL/TLS channels have run previously,
issue the command REFRESH SECURITY TYPE(SSL).
This ensures that all the changes made to the key repository are available.
4. Start the channel on QMA, using the command START CHANNEL(TO.QMB).
Results
The sender channel is started.
306 Securing IBM MQ
and their applications are located, and on the nature of the applications themselves. It is therefore natural
to consider implementing the service at the application level rather than at the link level.
If you consider implementing this service at the link level, you might need to resolve issues such as the
following:
• On a message channel, how do you apply the service only to those messages that require it?
• How do you enable users and their applications to interface, or interact, with the service, if this is a
requirement?
• In a multi-hop situation, where a message is sent over more than one message channel on the way to its
destination, where do you invoke the components of the service?
Here are some examples of how the identification and authentication service can be implemented at the
application level. The term API exit means either an API exit or an API-crossing exit.
• When an application puts a message on a queue, an API exit can acquire an authentication token from a
trusted authentication server such as Kerberos. The API exit can add this token to the application data
in the message. When the message is retrieved by the receiving application, a second API exit can ask
the authentication server to authenticate the sender by checking the token.
• When an application puts a message on a queue, an API exit can append the following items to the
application data in the message:
– The digital certificate of the sender
– The digital signature of the sender
If different algorithms for generating a message digest are available for use, the API exit can include the
name of the algorithm it has used.
When the message is retrieved by the receiving application, a second API exit can perform the following
checks:
– The API exit can validate the digital certificate by working through the certificate chain to the root CA
certificate. To do this, the API exit must have access to a key repository that contains the remaining
certificates in the certificate chain. This check provide assurance that the sender, identified by the
Distinguished Name, is the genuine owner of the public key contained in the certificate.
– The API exit can check the digital signature using the public key contained in the certificate. This
check authenticates the sender.
The Distinguished Name of the sender can be sent instead of the whole digital certificate. In this case,
the key repository must contain the sender's certificate so that the second API exit can find the public
key of the sender. Another possibility is to send all the certificates in the certificate chain.
• When an application puts a message on a queue, the UserIdentifier field in the message descriptor
contains a user ID associated with the application. The user ID can be used to identify the sender.
To enable authentication, an API exit can append some data, such as an encrypted password, to the
application data in the message. When the message is retrieved by the receiving application, a second
API exit can authenticate the user ID by using the data that has travelled with the message.
This technique might be considered sufficient for messages that originate in a controlled and trusted
environment, and in circumstances where a trusted authentication server or PKI support is not
available.
PAM is now common across UNIX and Linux platforms, and provides a general mechanism that hides the
details of user authentication from services.
Different authentication rules can be used for different services, by configuring the rules, without any
change needed to the services themselves.
See “Using the Pluggable Authentication Method (PAM)” on page 322 for further information.
308 Securing IBM MQ
IBM MQ has a limit on the length of user Ids that it can user for authorization checks. These limits are
detailed on “User IDs” on page 71. When adopting a userid passed through the MQCSP structure IBM MQ
behaves differently, depending on other configuration options:
• When using LDAP connection authentication, IBM MQ retrieves the value of the field set in SHORTUSR
from the user’s LDAP record of that user, and adopts that user Id.
For example, if SHORTUSR is set to ‘CN’ and a LDAP record lists a user as
'CN=Test,SN=MQ,O=IBM,C=UK', the user Id Test is used.
• When using OS connection authentication or PAM authentication, if ADOPTCTX is YES, the user Id
passed through the MQCSP structure is truncated in order to meet the 12 character user Id limit of IBM
MQ when adopted as the connection context.
If ChlAuthEarlyAdopt is enabled, the truncation happens after the user credentials have been
authenticated.
If ChlAuthEarlyAdopt is not enabled, the truncation happens before adoption. On Windows, if the
user is supplied in the format user@domain, this means that the truncation can result in a domain
specification that is not valid when the user is less than 12 characters.
For example if a user `ibmmq@windowsdomain` is provided through the MQCSP, it is truncated to
`ibmmq@window` in this scenario. This results in the following error:
AMQ8074W: Authorization failed as the SID 'SID' does not match the entity 'ibmmq@window'
On this basis, if you pass a user ID longer than 12 characters, such as a Windows domain user ID in the
form user@domain, through the MQCSP you should configure ChlAuthEarlyAdopt=Y in the qm.ini
file to avoid this error.
Alternatively, use ADOPTCTX(NO) on the CONNAUTH AUTHINFO configuration, and use an alternate
approach such as a CHLAUTH USERMAP rule, a security exit, or the channel object MCAUSER setting to
set the user Id for the channel.
310 Securing IBM MQ
If you consider implementing this service at the link level, you might need to resolve issues such as the
following:
• On a message channel, how do you apply the service only to those messages that require it?
• How do you enable users and their applications to interface, or interact, with the service, if this is a
requirement?
• In a multi-hop situation, where a message is sent over more than one message channel on the way to its
destination, where do you invoke the components of the service?
Here are some examples of how the identification and authentication service can be implemented at the
application level. The term API exit means either an API exit or an API-crossing exit.
• When an application puts a message on a queue, an API exit can acquire an authentication token from a
trusted authentication server such as Kerberos. The API exit can add this token to the application data
in the message. When the message is retrieved by the receiving application, a second API exit can ask
the authentication server to authenticate the sender by checking the token.
• When an application puts a message on a queue, an API exit can append the following items to the
application data in the message:
– The digital certificate of the sender
– The digital signature of the sender
If different algorithms for generating a message digest are available for use, the API exit can include the
name of the algorithm it has used.
When the message is retrieved by the receiving application, a second API exit can perform the following
checks:
– The API exit can validate the digital certificate by working through the certificate chain to the root CA
certificate. To do this, the API exit must have access to a key repository that contains the remaining
certificates in the certificate chain. This check provide assurance that the sender, identified by the
Distinguished Name, is the genuine owner of the public key contained in the certificate.
– The API exit can check the digital signature using the public key contained in the certificate. This
check authenticates the sender.
The Distinguished Name of the sender can be sent instead of the whole digital certificate. In this case,
the key repository must contain the sender's certificate so that the second API exit can find the public
key of the sender. Another possibility is to send all the certificates in the certificate chain.
• When an application puts a message on a queue, the UserIdentifier field in the message descriptor
contains a user ID associated with the application. The user ID can be used to identify the sender.
To enable authentication, an API exit can append some data, such as an encrypted password, to the
application data in the message. When the message is retrieved by the receiving application, a second
API exit can authenticate the user ID by using the data that has travelled with the message.
This technique might be considered sufficient for messages that originate in a controlled and trusted
environment, and in circumstances where a trusted authentication server or PKI support is not
available.
• Linux
• UNIX
• Windows
IBM MQ classes for Java and IBM MQ classes for JMS cannot use the OCSP information in a client channel
definition table file. However, you can configure OCSP as described in Using Online Certificate Protocol.
On the following platforms, and IBM MQ SSL support checks for revoked certificates using CRLs and ARLs
on LDAP servers only:
• IBM i
• z/OS
For more information about Certificate Authorities, see “Digital certificates” on page 9.
OCSP/CRL checking
Online Certificate Status Protocol (OCSP)/Certificate Revocation List (CRL) checking is performed against
remote incoming certificates. The process checks the whole chain involved from the personal certificate
of the remote system right through to its root certificate.
Attention:
The ALTER AUTHINFO command with AUTHTYPE(OCSP) does not apply for use on IBM i or
z/OS queue managers. However, it can be specified on those platforms to be copied to the client
channel definition table (CCDT) for client use.
The OCSPCheckExtensions and CDPCheckExtensions SSL stanza attributes control whether IBM MQ
will verify a certificate against the OCSP or CRL server detailed inside the AIA extension of the certificate.
If not enabled, the OCSP or CRL server in the certificate extension is not contacted.
312 Securing IBM MQ
If OCSP or CRL servers are detailed through AUTHINFO objects, and referenced using the SSLCRLNL QMGR
attribute then, during certificate revocation processing, IBM MQ attempts to contact these servers.
Important: Only one OCSP AUTHINFO object can be defined in the SSLCRLNL namelist.
If:
OCSPCheckExtensions=NO and CDPCheckExtensions=NO are set, and
No OCSP or CRL servers are defined in AUTHINFO objects
no certificate revocation checking is performed.
When verifying a certificate for its revocation status, IBM MQ contacts the OCSP or CRL servers named in
the following order, if enabled:
1. The OCSP Server detailed in an AUTHTYPE(OCSP) object, and referenced in the SSLCRLNL QMGR
attribute.
2. OCSP servers detailed in the AIA extension of the certificates, if OCSPCheckExtensions=YES.
3. CRL servers detailed in the CRLDistributionPoints extension of the certificates, if
CDPCheckExtensions =YES.
4. Any CRL servers detailed in AUTHINFO(CRLLDAP) objects and referenced in the SSLCRLNL QMGR
attribute.
While verifying a certificate, if a step results in the OCSP server or CRL server returning a definitive
REVOKED or VALID response to a query for the certificate, no further checks are performed and the status
of the certificate as presented is used to determine whether to trust it or not.
If an OCSP server or CRL server returns a result of UNKNOWN, processing continues until an OCSP or CRL
server returns a definitive result, or all options are exhausted.
The behavior of whether a certificate is considered revoked, if its status cannot be determined, is different
for OCSP and CRL servers:
• For CRL servers, if no CRL can be obtained, the certificate is considered NOT_REVOKED
• For OCSP servers, if no revocation status can be obtained from a named OCSP server then the behavior
is controlled through the OCSPAuthentication attribute in the SSL Stanza of the qm.ini file.
You can configure this attribute to either, block a connection, allow a connection, or allow a connection
with a warning message.
You can use the SSLHTTPProxyName=string attribute in the SSL stanza of the qm.ini and mqclient.ini files
for the OCSP checks if needed. The string is either the host name, or network address of the HTTP Proxy
server that is to be used by GSKit for OCSP checks.
314 Securing IBM MQ
• The OCSP response can be digitally signed using another certificate that is not directly related to the
certificate you are checking. In this case, the OCSP response is signed by a certificate issued by the
OCSP responder itself. You must add a copy of the OCSP responder certificate to the key database of
the client or queue manager which performs the OCSP checking . When a CA certificate is added, by
default it is added as a trusted root, which is the required setting in this context. If this certificate is not
added, IBM MQ cannot verify the digital signature on the OCSP response and the OCSP check results
in an Unknown outcome, which might cause IBM MQ to close the channel, depending on the value of
OCSPAuthentication.
Online Certificate Status Protocol (OCSP) in Java and JMS client applications
Due to a limitation of the Java API, IBM MQ can use Online Certificate Status Protocol (OCSP) certificate
revocation checking for TLS secure sockets only when OCSP is enabled for the entire Java virtual machine
(JVM) process. There are two ways to enable OCSP for all secure sockets in the JVM:
• Edit the JRE java.security file to include the OCSP configuration settings that are shown in Table 1 and
restart the application.
• Use the java.security.Security.setProperty() API, subject to any Java Security Manager policy in effect.
As a minimum, you must specify one of the ocsp.enable and ocsp.responderURL values.
Before you enable OCSP in this way, there are a number of considerations:
• Setting the OCSP configuration affects all secure sockets in the JVM process. In some cases this
configuration might have undesirable side-effects when the JVM is shared with other application code
that uses TLS secure sockets. Ensure that the chosen OCSP configuration is suitable for all of the
applications that are running in the same JVM.
• Applying maintenance to your JRE might overwrite the java.security file. Take care when you apply Java
interim fixes and product maintenance to avoid overwriting the java.security file. It might be necessary
to reapply your java.security changes after you apply maintenance. For this reason, you might consider
setting the OCSP configuration by using the java.security.Security.setProperty() API instead.
• Enabling OCSP checking has an effect only if revocation checking is also enabled. Revocation checking
is enabled by the PKIXParameters.setRevocationEnabled() method.
• If you are using the AMS Java Interceptor described in Enabling OCSP checking in native interceptors,
take care to avoid using a java.security OCSP configuration that conflicts with the AMS OCSP
configuration in the keystore configuration file.
316 Securing IBM MQ
with a file that uses the LDAP Data Interchange Format (LDIF). You can also use LDIF files to update a
directory.
LDIF files are ASCII text files that contain the information required to define objects within an LDAP
directory. LDIF files contain one or more entries, each of which comprises a Distinguished Name, at least
one object class definition and, optionally, multiple attribute definitions.
The certificateRevocationList;binary attribute contains a list, in binary form, of revoked user
certificates. The authorityRevocationList;binary attribute contains a binary list of CA certificates
that have been revoked. For use with IBM MQ TLS, the binary data for these attributes must conform to
DER (Definite Encoding Rules) format. For more information about LDIF files, refer to the documentation
provided with your LDAP server.
Figure 20 on page 317 shows a sample LDIF file that you might create as input to your LDAP server to
load the CRLs and ARLs issued by CA1, which is an imaginary Certificate Authority with the Distinguished
Name "CN=CA1, OU=Test, O=IBM, C=GB", set up by the Test organization within IBM.
Figure 20. Sample LDIF file for a Certificate Authority. This might vary from implementation to
implementation.
Figure 21 on page 317 shows the DIT structure that your LDAP server creates when you load the sample
LDIF file shown in Figure 20 on page 317 together with a similar file for CA2, an imaginary Certificate
Authority set up by the PKI organization, also within IBM.
Additionally, on z/OS only, all LDAP servers must be accessed using the same user ID
and password. The user ID and password used are those specified in the first AUTHINFO object in the
namelist.
On all platforms, the user ID and password are sent to the LDAP server unencrypted.
2. Using the DEFINE NAMELIST MQSC command, define a namelist for the names of your authentication
information objects. On z/OS, ensure that the NLTYPE namelist attribute is set to
AUTHINFO.
3. Using the ALTER QMGR MQSC command, supply the namelist to the queue manager. For example:
318 Securing IBM MQ
On IBM i, you can specify authentication information objects, but the queue manager uses
neither authentication information objects nor a namelist of authentication information objects. Only IBM
MQ clients that use a client connection table generated by an IBM i queue manager use the authentication
information specified for that IBM i queue manager. The SSLCRLNL queue manager attribute on IBM i
determines what authentication information such clients use. See “Accessing CRLs and ARLs on IBM i” on
page 319 for information about telling an IBM i queue manager how to access CRLs.
You can add up to 10 connections to alternative LDAP servers to the namelist, to ensure continuity of
service if one or more LDAP servers fail. Note that the LDAP servers must contain identical information.
320 Securing IBM MQ
Using a client channel definition table (ccdt) to access an OCSP responder or LDAP
servers
So that an IBM MQ MQI client can access an OCSP responder or LDAP servers that hold CRLs, include the
attributes of one or more authentication information objects in a client channel definition table.
On a server queue manager, you can define one or more authentication information objects. The
attributes of an authentication object contain all the information that is required to access an OCSP
responder (on platforms where OCSP is supported) or an LDAP server that holds CRLs. One of the
attributes specifies the OCSP responder URL, another specifies the host address, or IP address of a
system on which an LDAP server runs.
An authentication information object with AUTHTYPE(OCSP) does not apply for use on IBM i or z/OS
queue managers, but it can be specified on those platforms to be copied to the client channel definition
table (CCDT) for client use.
To enable an IBM MQ MQI client to access an OCSP responder or LDAP servers that hold CRLs, the
attributes of one or more authentication information objects can be included in a client channel definition
table. You can include such attributes in one of the following ways:
Accessing CRLs and ARLs with IBM MQ classes for Java and IBM MQ classes for JMS
IBM MQ classes for Java and IBM MQ classes for JMS access CRLs differently from other platforms.
For information about working with CRLs and ARLs with IBM MQ classes for Java, see Using certificate
revocation lists
For information about working with CRLs and ARLs with IBM MQ classes for JMS, see SSLCERTSTORES
object property
322 Securing IBM MQ
Important: You cannot set the AUTHENMD attribute until you install IBM MQ 8.0.0 Fix Pack 3, and then
restart the queue manager, using a -e CMDLEVEL=level of 802 (on the strmqm command) to set the
command level you require.
On UNIX, Linux, and Windows systems. you control access to objects by using the object
authority manager (OAM). This collection of topics contains information about using the command
interface to the OAM.
This section also contains a checklist you can use to determine what tasks to perform to apply security
to your system on all platforms, and considerations for granting users the authority to administer IBM MQ
and to work with IBM MQ objects.
If the supplied security mechanisms do not meet your needs, you can develop your own channel exit
programs.
Migration considerations
If you change the model from group to user for an existing queue manager, there is no immediate effect.
The authorizations that have already been made continue to apply. Any user that connects to the queue
manager receives the same privileges as before: the combination of all the groups to which their ID
belongs. When new setmqaut commands are issued for user IDs, they take immediate effect.
If you create a new queue manager with the user policy, this queue manager has permissions only for the
user who creates it (which is normally, but not necessarily, the mqm user ID). There are also permissions
that are automatically granted to the mqm group. However, if you do not have mqm as the primary group,
then the mqm group is not included in the initial set of authorizations.
If you move from a user to group policy, the user-based authorizations are not automatically deleted.
However, they are no longer used during the permissions check. Before reverting the policy, save the
current configuration, change the policy, restart the queue manager, and then replay the script. Because
it is now a group-based queue manager, the effect is that user ID rules are stored based on the primary
group.
Related concepts
Object authority manager (OAM)
Principals and groups on UNIX, Linux and Windows
Service stanza of the qm.ini file
Related reference
crtmqm (create queue manager) command
324 Securing IBM MQ
If a user ID contains spaces, enclose it in quotation marks when you use this command. On Windows
systems, you can qualify a user ID with a domain name. If the actual user ID contains an at sign (@)
symbol, replace it with @@ to show that it is part of the user ID, not the delimiter between the user ID
and the domain name.
• A list of authorizations. Each item in the list specifies a type of access that is to be granted to that object
(or revoked from it). Each authorization in the list is specified as a keyword, prefixed with a plus sign (+)
or a minus sign (-). Use a plus sign to add the specified authorization, and a minus sign to remove the
authorization. There must be no spaces between the + or - sign and the keyword.
You can specify any number of authorizations in a single command. For example, the list of
authorizations to permit a user or group to put messages on a queue and to browse them, but to
revoke access to get messages is:
In this example:
• saturn.queue.manager is the queue manager name
• queue is the object type
• RED.LOCAL.QUEUE is the object name
• groupa is the identifier of the group with authorizations that are to change
• +browse -get +put is the authorization list for the specified queue
– +browse adds authorization to browse messages on the queue (to issue MQGET with the browse
option)
– -get removes authorization to get (MQGET) messages from the queue
– +put adds authorization to put (MQPUT) messages on the queue
The following command revokes put authority on the queue MyQueue from principal fvuser and from
groups groupa and groupb. On UNIX and Linux systems, this command also revokes put authority for all
principals in the same primary group as fvuser.
The exception to this overlap behavior is with the ALL authority. The following command first adds ALL
authorities then removes the SETID authority:
The following command first removes ALL authorities then adds the DSP authority:
Regardless of the order in which they are provided on the command, the ALL are processed first.
326 Securing IBM MQ
• As either the beginning, middle, or ending qualifier in a profile name to match zero or more qualifiers
in an object name. For example, **.ABC identifies all objects with the final qualifier ABC.
Note: When using wildcard characters on UNIX and Linux systems, you must enclose the profile name in
single quotation marks.
Profile priorities
An important point to understand when using generic profiles is the priority that profiles are given when
deciding what authorities to apply to an object being created. For example, suppose that you have issued
the commands:
The first gives put authority to all queues for the principal fred with names that match the profile AB.*; the
second gives get authority to the same types of queue that match the profile AB.C*.
Suppose that you now create a queue called AB.CD. According to the rules for wildcard matching, either
setmqaut could apply to that queue. So, does it have put or get authority?
To find the answer, you apply the rule that, whenever multiple profiles can apply to an object, only the
most specific applies. The way that you apply this rule is by comparing the profile names from left to
right. Wherever they differ, a non-generic character is more specific then a generic character. So, in this
example, the queue AB.CD has get authority (AB.C* is more specific than AB.*).
When you are comparing generic characters, the order of specificity is:
1. ?
2. *
3. **
profile: a.b.*
object type: queue
entity: user1
type: principal
authority: get, browse, put, inq
Note: Although users on UNIX and Linux can use the -p option for the dmpmqaut command, they must
use -g groupname instead when defining authorizations.
2. This example dumps all authority records with a profile that matches queue a.b.c.
profile: a.b.c
object type: queue
entity: Administrator
type: principal
authority: all
- - - - - - - - - - - - - - - - -
profile: a.b.*
object type: queue
entity: user1
type: principal
authority: get, browse, put, inq
- - - - - - - - - - - - - - - - -
profile: a.**
object type: queue
entity: group1
type: group
authority: get
3. This example dumps all authority records for profile a.b.*, of type queue.
profile: a.b.*
object type: queue
entity: user1
type: principal
authority: get, browse, put, inq
4. This example dumps all authority records for queue manager qmX.
dmpmqaut -m qmX
profile: q1
object type: queue
entity: Administrator
type: principal
authority: all
- - - - - - - - - - - - - - - - -
profile: q*
object type: queue
entity: user1
type: principal
authority: get, browse
- - - - - - - - - - - - - - - - -
profile: name.*
object type: namelist
entity: user2
type: principal
authority: get
- - - - - - - - - - - - - - - - -
profile: pr1
object type: process
entity: group1
type: group
authority: get
5. This example dumps all profile names and object types for queue manager qmX.
dmpmqaut -m qmX -l
328 Securing IBM MQ
profile: q1, type: queue
profile: q*, type: queue
profile: name.*, type: namelist
profile: pr1, type: process
Note: For IBM MQ for Windows only, all principals displayed include domain information, for example:
profile: a.b.*
object type: queue
entity: user1@domain1
type: principal
authority: get, browse, put, inq
The first gives put authority to all queues for the principal fred with names that match the profile AB.*; the
second gives get authority to the same types of queue that match the profile AB.C*.
Suppose that you now create a queue called AB.CD. According to the rules for wildcard matching, either
setmqaut could apply to that queue. So, does it have put or get authority?
To find the answer, you apply the rule that, whenever multiple profiles can apply to an object, only the
most specific applies. The way that you apply this rule is by comparing the profile names from left to
right. Wherever they differ, a non-generic character is more specific then a generic character. So, in this
example, the queue AB.CD has get authority (AB.C* is more specific than AB.*).
When you are comparing generic characters, the order of specificity is:
1. ?
2. *
3. **
See SET AUTHREC for the equivalent information when using this MQSC command.
profile: a.b.*
object type: queue
entity: user1
type: principal
authority: get, browse, put, inq
Note: UNIX and Linux users cannot use the -p option; they must use -g groupname instead.
2. This example dumps all authority records with a profile that matches queue a.b.c.
profile: a.b.c
object type: queue
entity: Administrator
type: principal
authority: all
- - - - - - - - - - - - - - - - -
330 Securing IBM MQ
profile: a.b.*
object type: queue
entity: user1
type: principal
authority: get, browse, put, inq
- - - - - - - - - - - - - - - - -
profile: a.**
object type: queue
entity: group1
type: group
authority: get
3. This example dumps all authority records for profile a.b.*, of type queue.
profile: a.b.*
object type: queue
entity: user1
type: principal
authority: get, browse, put, inq
4. This example dumps all authority records for queue manager qmX.
dmpmqaut -m qmX
profile: q1
object type: queue
entity: Administrator
type: principal
authority: all
- - - - - - - - - - - - - - - - -
profile: q*
object type: queue
entity: user1
type: principal
authority: get, browse
- - - - - - - - - - - - - - - - -
profile: name.*
object type: namelist
entity: user2
type: principal
authority: get
- - - - - - - - - - - - - - - - -
profile: pr1
object type: process
entity: group1
type: group
authority: get
5. This example dumps all profile names and object types for queue manager qmX.
dmpmqaut -m qmX -l
Note: For IBM MQ for Windows only, all principals displayed include domain information, for example:
profile: a.b.*
332 Securing IBM MQ
Prior to IBM MQ 8.0, you had to delete the OAM entries corresponding to a particular Windows user
account before deleting the user profile. It was impossible to remove the OAM entries after removing the
user account.
Procedure
1. Do you need to limit access to your queue manager to certain users?
a) No: Take no further action.
b) Yes: Go to the next question.
2. Do these users need partial administrative access on a subset of queue manager resources?
a) No: Go to the next question.
b) Yes: See “Granting partial administrative access on a subset of queue manager resources” on page
334.
Table 66. Granting partial administrative access to a subset of queue manager resources
The users need to administer objects of this type Perform this action
Queues Grant partial administrative access to the required
queues, as described in “Granting limited
administrative access to some queues” on page
335
Topics Grant partial administrative access to the
required topics, as described in “Granting limited
administrative access to some topics” on page 336
Channels Grant partial administrative access to the required
channels, as described in “Granting limited
administrative access to some channels” on page
337
The queue manager Grant partial administrative access to the queue
manager, as described in “Granting limited
administrative access to a queue manager” on
page 339
Processes Grant partial administrative access to the required
processes, as described in “Granting limited
administrative access to some processes” on page
340
Namelists Grant partial administrative access to the required
namelists, as described in “Granting limited
administrative access to some namelists” on page
341
334 Securing IBM MQ
Table 66. Granting partial administrative access to a subset of queue manager resources (continued)
The users need to administer objects of this type Perform this action
Services Grant partial administrative access to the required
services, as described in “Granting limited
administrative access to some services” on page
342
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
For UNIX, Linux, and Windows systems, issue the following command:
•
For IBM i, issue the following command:
• For z/OS, issue the following commands to grant access to a specified queue:
To specify which MQSC commands the user can perform on the queue, issue the following commands
for each MQSC command:
To permit the user to use the DISPLAY QUEUE command, issue the following commands:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
For UNIX, Linux, and Windows systems, issue the following command:
336 Securing IBM MQ
•
For IBM i, issue the following command:
These commands grant access to the specified topic. To determine which MQSC commands the user
can perform on the topic, issue the following commands for each MQSC command:
To permit the user to use the DISPLAY TOPIC command, issue the following commands:
• IBM i
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
• On z/OS:
These commands grant access to the specified channel. To determine which MQSC commands the
user can perform on the channel, issue the following commands for each MQSC command:
To permit the user to use the DISPLAY CHANNEL command, issue the following commands:
338 Securing IBM MQ
– On IBM i, any combination of the following authorizations: *ADMCHG, *ADMCLR,
*ADMCRT, *ADMDLT, *ADMDSP, *CTRL, *CTRLx. The authorization *ALLADM is equivalent to all
these individual authorizations.
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
•
On z/OS:
To determine which MQSC commands you can perform on the queue manager, issue the following
commands for each MQSC command:
To permit the user to use the DISPLAY QMGR command, issue the following commands:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
• On z/OS:
These commands grant access to the specified channel. To determine which MQSC commands the
user can perform on the channel, issue the following commands for each MQSC command:
340 Securing IBM MQ
RDEFINE MQCMDS QMgrName. ReqdAction.PROCESS UACC(NONE)
PERMIT QMgrName. ReqdAction.PROCESS CLASS(MQCMDS) ID(GroupName) ACCESS(ALTER)
To permit the user to use the DISPLAY PROCESS command, issue the following commands:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
• On z/OS:
These commands grant access to the specified namelist. To determine which MQSC commands the
user can perform on the namelist, issue the following commands for each MQSC command:
To permit the user to use the DISPLAY NAMELIST command, issue the following commands:
• IBM i
342 Securing IBM MQ
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
• On IBM i:
• On z/OS:
These commands grant access to the specified service. To determine which MQSC commands the user
can perform on the service, issue the following commands for each MQSC command:
To permit the user to use the DISPLAY SERVICE command, issue the following commands:
Table 67. Granting full administrative access to a subset of queue manager resources
The users need to administer objects of this type Perform this action
Queues Grant full administrative access to the
required queues, as described in “Granting full
administrative access to some queues” on page
344
Topics Grant full administrative access to the required
topics, as described in “Granting full administrative
access to some topics” on page 345
Channels Grant full administrative access to the required
channels, as described in “Granting full
administrative access to some channels” on page
346
The queue manager Grant full administrative access to the queue
manager, as described in “Granting full
administrative access to a queue manager” on
page 347
Processes Grant full administrative access to the required
processes, as described in “Granting full
administrative access to some processes” on page
348
Namelists Grant full administrative access to the required
namelists, as described in “Granting full
administrative access to some namelists” on page
349
Services Grant full administrative access to the required
services, as described in “Granting full
administrative access to some services” on page
350
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
344 Securing IBM MQ
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
•
On z/OS:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On z/OS:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
346 Securing IBM MQ
•
On z/OS:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
•
On z/OS:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
•
On z/OS:
348 Securing IBM MQ
GroupName
The name of the group to be granted access.
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
•
On z/OS:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
•
On z/OS:
350 Securing IBM MQ
On the following platforms, you can also use the SET AUTHREC command:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
After you have changed any authorization details perform a security refresh using the REFRESH
SECURITY command.
Procedure
• Using the wizard:
a) In the IBM MQ Explorer Navigator pane, right-click the queue manager and click Object Authorities
> Add Role Based Authorities
The Add Role Based Authorities wizard opens.
•
For UNIX and Windows systems, issue the following commands:
•
For IBM i, issue the following commands:
•
For z/OS, issue the following commands:
On z/OS, this value can also be the name of a queue sharing group.
GroupName
The name of the group to be granted access.
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Notes:
1. If you are using runmqsc to administer the queue manager instead of the IBM MQ Explorer, you must
grant authority to inquire, get, and browse the SYSTEM.MQSC.REPLY.QUEUE, and you do not need to
grant any authorities on the SYSTEM.MQEXPLORER.REPLY.MODEL queue.
2. When giving a user access to all resources on a queue manager there are some commands that the
user cannot run, unless that user has read access to the qm.ini file. This is due to restrictions on non
mqm users being able to read the qm.ini file.
The user cannot issue the following commands unless you have granted that user read access to the
qm.ini file:
• Defining a channel that is configured to use TLS
• Defining a channel using auto-configuration insertion variables defined in qm.ini
Procedure
• If you are using the wizard, in the IBM MQ Explorer Navigator pane, right-click the queue manager and
click Object Authorities > Add Role Based Authorities.
The Add Role Based Authorities wizard opens.
352 Securing IBM MQ
For UNIX and Linux systems, issue the following commands:
setmqaut -m QMgrName -n '**' -t queue -g GroupName +alladm +browse
setmqaut -m QMgrName -n @class -t queue -g GroupName +crt
setmqaut -m QMgrName -n SYSTEM.ADMIN.COMMAND.QUEUE -t queue -g GroupName +dsp +inq +put
setmqaut -m QMgrName -n SYSTEM.MQEXPLORER.REPLY.MODEL -t queue -g GroupName +dsp +inq +get +put
setmqaut -m QMgrName -n '**' -t topic -g GroupName +alladm
setmqaut -m QMgrName -n @class -t topic -g GroupName +crt
setmqaut -m QMgrName -n '**' -t channel -g GroupName +alladm
setmqaut -m QMgrName -n @class -t channel -g GroupName +crt
setmqaut -m QMgrName -n '**' -t clntconn -g GroupName +alladm
setmqaut -m QMgrName -n @class -t clntconn -g GroupName +crt
setmqaut -m QMgrName -n '**' -t authinfo -g GroupName +alladm
setmqaut -m QMgrName -n @class -t authinfo -g GroupName +crt
setmqaut -m QMgrName -n '**' -t listener -g GroupName +alladm
setmqaut -m QMgrName -n @class -t listener -g GroupName +crt
setmqaut -m QMgrName -n '**' -t namelist -g GroupName +alladm
setmqaut -m QMgrName -n @class -t namelist -g GroupName +crt
setmqaut -m QMgrName -n '**' -t process -g GroupName +alladm
setmqaut -m QMgrName -n @class -t process -g GroupName +crt
setmqaut -m QMgrName -n '**' -t service -g GroupName +alladm
setmqaut -m QMgrName -n @class -t service -g GroupName +crt
setmqaut -m QMgrName -t qmgr -g GroupName +alladm +connect
•
For Windows systems, issue the same commands as for UNIX and Linux systems, but using the profile
name @CLASS instead of @class.
•
For IBM i, issue the following command:
GRTMQMAUT OBJ(*ALL) OBJTYPE(*ALL) USER(' GroupName ') AUT(*ALLADM) MQMNAME(' QMgrName ')
•
For z/OS, issue the following commands:
On z/OS, this value can also be the name of a queue sharing group.
GroupName
The name of the group to be granted access.
Procedure
•
For UNIX, Linux, and Windows systems, issue the following command:
•
For IBM i, issue the following command:
•
For z/OS, issue the following commands:
On z/OS, this value can also be the name of a queue sharing group.
GroupName
The name of the group to be denied access.
354 Securing IBM MQ
Securing remote connectivity to the queue manager
You can secure remote connectivity to the queue manager using TLS, a security exit, channel
authentication records, or a combination of these methods.
Procedure
1. Using TLS with channel authentication records:
a) Prevent any Distinguished Name (DN) from opening a channel, by using an SSLPEERMAP channel
authentication record to map all DNs to USERSRC(NOACCESS).
b) Allow specific DNs or sets of DNs to open a channel by using an SSLPEERMAP channel
authentication record to map them to USERSRC(CHANNEL).
2. Using TLS with a security exit:
a) Set MCAUSER on the server-connection channel to a user identifier with no privileges.
b) Write a security exit to assign an MCAUSER value depending on the value of TLS DN it receives in
the SSLPeerNamePtr and SSLPeerNameLength fields passed to the exit in the MQCD structure.
3. Using TLS with fixed channel definition values:
a) Set SSLPEER on the server-connection channel to a specific value or narrow range of values.
b) Set MCAUSER on the server-connection channel to the user ID the channel should run with.
4. Using channel authentication records on channels that do not use TLS:
a) Prevent any IP address from opening channels, by using an address-mapping channel
authentication record with ADDRESS(*) and USERSRC(NOACCESS).
b) Allow specific IP addresses to open channels, by using address-mapping channel authentication
records for those addresses with USERSRC(CHANNEL).
5. Using a security exit:
a) Write a security exit to authorize connections based on any property you choose, for example, the
originating IP address.
6. It is also possible to use channel authentication records with a security exit, or to use all three
methods, if your particular circumstances require it.
356 Securing IBM MQ
Procedure
1. Open the blockaddr.ini file in a text editor.
The file is located in the data directory of the queue manager.
2. Add IP addresses as simple keyword-value pairs, where the keyword is Addr.
For information about filtering IP addresses with patterns, see Generic IP addresses.
For example:
Addr = 192.0.2.0
Addr = 192.0.*
Addr = 192.0.2.1-8
Related tasks
“Blocking specific IP addresses” on page 355
You can prevent a specific channel accepting an inbound connection from an IP address, or prevent the
whole queue manager from allowing access from an IP address, by using a channel authentication record.
Related reference
SET CHLAUTH
Procedure
Set a channel authentication record using the MQSC command SET CHLAUTH, or the PCF command Set
Channel Authentication Record. For example, you can issue the MQSC command:
generic-channel-name is either the name of a channel to which you want to control access, or a pattern
including the asterisk (*) symbol as a wildcard that matches the channel name.
The user list provided on a TYPE(BLOCKUSER) only applies to SVRCONN channels and not queue
manager to queue manager channels.
userID1 and userID2 are each the ID of a user that is to be prevented from using the channel. You
can also specify the special value *MQADMIN to refer to privileged administrative users. For more
information about privileged users, see “Privileged users” on page 308. For more information about
*MQADMIN, see SET CHLAUTH.
Related reference
SET CHLAUTH
Procedure
• Set a channel authentication record using the MQSC command SET CHLAUTH, or the PCF command
Set Channel Authentication Record. For example, you can issue the MQSC command:
generic-channel-name is either the name of a channel to which you want to control access, or a
pattern including the asterisk (*) symbol as a wildcard that matches the channel name.
generic-partner-qmgr-name is either the name of the queue manager, or a pattern including the
asterisk (*) symbol as a wildcard that matches the queue manager name.
user is the user ID to be used for all connections from the specified queue manager.
• To restrict this command to certain IP addresses, include the ADDRESS parameter, as follows:
generic-channel-name is either the name of a channel to which you want to control access, or a
pattern including the asterisk (*) symbol as a wildcard that matches the channel name.
generic-ip-address is either a single address, or a pattern including the asterisk (*) symbol as a
wildcard or the hyphen (-) to indicate a range, that matches the address. For more information
about generic IP addresses, see Generic IP addresses.
Related reference
SET CHLAUTH
Procedure
Set a channel authentication record using the MQSC command SET CHLAUTH, or the PCF command Set
Channel Authentication Record . For example, you can issue the MQSC command:
358 Securing IBM MQ
SET CHLAUTH(' generic-channel-name ') TYPE (USERMAP) CLNTUSER(client-user-name) USERSRC(MAP)
MCAUSER(
user)
generic-channel-name is either the name of a channel to which you want to control access, or a pattern
including the asterisk (*) symbol as a wildcard that matches the channel name.
client-user-name is the user ID associated with the clients connection, the value could be asserted by
the client application, altered by connection authentication using early adopt or set via a channel exit.
user is the user ID to be used instead of the client user name.
Related concepts
Attributes of the channels stanza (ChlauthEarlyAdopt)
Related reference
SET CHLAUTH
Procedure
Set a channel authentication record using the MQSC command SET CHLAUTH, or the PCF command Set
Channel Authentication Record. For example, you can issue the MQSC command:
generic-channel-name is either the name of a channel to which you want to control access, or a pattern
including the asterisk (*) symbol as a wildcard that matches the channel name.
generic-ssl-peer-name is a string following the standard IBM MQ rules for SSLPEER values. See IBM
MQ rules for SSLPEER values.
user is the user ID to be used for all connections using the specified DN.
generic-issuer-name refers to the Issuer DN of the certificate to match. This parameter is optional but
you should use it, to avoid spuriously matching the wrong certificate, if multiple certificate authorities
are in use.
Related reference
SET CHLAUTH
Procedure
Set a channel authentication record using the MQSC command SET CHLAUTH, or the PCF command Set
Channel Authentication Record. For example, you can issue the MQSC command:
generic-channel-name is either the name of a channel to which you want to control access, or a pattern
including the asterisk (*) symbol as a wildcard that matches the channel name.
generic-partner-qmgr-name is either the name of the queue manager, or a pattern including the
asterisk (*) symbol as a wildcard that matches the queue manager name.
Related reference
SET CHLAUTH
Procedure
Set a channel authentication record using the MQSC command SET CHLAUTH, or the PCF command Set
Channel Authentication Record. For example, you can issue the MQSC command:
generic-channel-name is either the name of a channel to which you want to control access, or a pattern
including the asterisk (*) symbol as a wildcard that matches the channel name.
client-user-name is the user ID associated with the clients connection, the value could be asserted by
the client application, altered by connection authentication using early adopt or set via a channel exit.
Related reference
SET CHLAUTH
360 Securing IBM MQ
ALTER QMGR CHLAUTH(ENABLED)
Procedure
Set a channel authentication record using the MQSC command SET CHLAUTH, or the PCF command Set
Channel Authentication Record. For example, you can issue the MQSC command:
generic-channel-name is either the name of a channel to which you want to control access, or a pattern
including the asterisk (*) symbol as a wildcard that matches the channel name.
generic-ssl-peer-name is a string following the standard IBM MQ rules for SSLPEER values. See IBM
MQ rules for SSLPEER values.
generic-issuer-name refers to the Issuer DN of the certificate to match. This parameter is optional but
you should use it, to avoid spuriously matching the wrong certificate, if multiple certificate authorities
are in use.
Related reference
SET CHLAUTH
Procedure
Set a channel authentication record using the MQSC command SET CHLAUTH, or the PCF command Set
Channel Authentication Record. For example, you can issue the MQSC command:
generic-channel-name is either the name of a channel to which you want to control access, or a pattern
including the asterisk (*) symbol as a wildcard that matches the channel name.
user is the user ID to be used for all connections using the specified DN.
generic-ip-address is either the address from which the connection is being made, or a pattern
including the asterisk (*) as a wildcard or the hyphen (-) to indicate a range, that matches the address.
Related reference
SET CHLAUTH
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
•
On UNIX, Linux, and Windows:
•
On IBM i:
•
On z/OS:
These commands give authority to connect for batch, CICS, IMS and the channel initiator (CHIN). If
you do not use a particular type of connection, omit the relevant commands.
The variable names have the following meanings:
QMgrName
The name of the queue manager. On z/OS, this value can also be the name of a queue sharing
group.
ObjectProfile
The name of the object or generic profile for which to change authorizations.
362 Securing IBM MQ
GroupName
The name of the group to be granted access.
Related concepts
Connection security profiles for the channel initiator
Statement Action
The application gets messages from a queue See “Granting authority to get messages from
queues” on page 363
The application sets context See “Granting authority to set context” on page
364
The application passes context See “Granting authority to pass context” on page
365
The application puts messages on a clustered See “Authorizing putting messages on remote
queue cluster queues” on page 414
The application puts messages on a local queue See “Granting authority to put messages to a local
queue” on page 366
The application puts messages on a model queue See “Granting authority to put messages to a
model queue” on page 367
The application puts messages on a remote queue See “Granting authority to put messages to a
remote cluster queue” on page 368
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue the following command:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue one of the following commands:
• To set identity context only:
Note: To use setid or setall authority, authorizations must be granted on both the appropriate
queue object and also on the queue manager object.
• For IBM i, issue one of the following commands:
• To set identity context only:
364 Securing IBM MQ
• To set all context:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue one of the following commands:
• To pass identity context only:
• For z/OS, issue the following commands to pass identity context or all context:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue the following command:
GRTMQMAUT OBJ(' ObjectProfile ') OBJTYPE(*Q) USER(GroupName) AUT(*PUT) MQMNAME(' QMgrName ')
366 Securing IBM MQ
RDEFINE MQQUEUE QMgrName.ObjectProfile UACC(NONE)
PERMIT QMgrName.ObjectProfile CLASS(MQQUEUE) ID(GroupName) ACCESS(UPDATE)
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue the following commands:
GRTMQMAUT OBJ(' ModelQueueName ') OBJTYPE(*Q) USER(GroupName) AUT(*PUT) MQMNAME(' QMgrName ')
GRTMQMAUT OBJ(' ObjectProfile ') OBJTYPE(*Q) USER(GroupName) AUT(*PUT) MQMNAME(' QMgrName ')
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue the following command:
Note that you can use the rqmname object for remote cluster queues only.
• For IBM i, issue the following command:
Note that you can use the RMTMQMNAME object for remote cluster queues only.
• For z/OS, issue the following commands:
368 Securing IBM MQ
Note that you can use the name of the remote queue manager (or queue sharing group) for remote
cluster queues only.
The variable names have the following meanings:
QMgrName
The name of the queue manager. On z/OS, this value can also be the name of a queue sharing
group.
ObjectProfile
The name of the remote queue manager or generic profile for which to change authorizations.
GroupName
The name of the group to be granted access.
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue the following command:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue the following command:
370 Securing IBM MQ
Granting authority to inquire on a queue manager
Grant the authority to inquire on a queue manager, to each group of users with a business need for it.
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue the following command:
These commands grant access to the specified queue manager. To permit the user to use the MQINQ
command, issue the following commands:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
Procedure
• For UNIX, Linux, and Windows systems, issue the following command:
• IBM i
• Linux
• UNIX
• Windows
Note: On IBM MQ Appliance you can use only the SET AUTHREC command.
372 Securing IBM MQ
Procedure
• For UNIX, Linux, and Windows systems, issue the following command:
setmqaut -m QMgrName -n
ObjectProfile -t namelist -g GroupName
+all
GRTMQMAUT OBJ('ObjectProfile
') OBJTYPE(*NMLIST) USER(GroupName) AUT(*ALL) MQMNAME('
QMgrName')
RDEFINE MQNLIST
QMgrName.ObjectProfile UACC(NONE)
PERMIT QMgrName.ObjectProfile
CLASS(MQNLIST) ID(GroupName) ACCESS(READ)
• For MQSC commands that are processed by the command server on IBM MQ for z/OS, see
Command security and command resource security on z/OS .
Additionally, on Windows systems, the SYSTEM account has full access to IBM MQ resources.
On UNIX and Linux platforms, a special user ID of mqm is also created, for use by the product only. It must
never be available to non-privileged users. All IBM MQ objects are owned by user ID mqm.
On Windows systems, members of the Administrators group can also administer any queue manager, as
can the SYSTEM account. You can also create a domain mqm group on the domain controller that contains
all privileged user IDs active within the domain, and add it to the local mqm group. Some commands, for
example crtmqm, manipulate authorities on IBM MQ objects and so need authority to work with these
objects (as described in the following sections). Members of the mqm group have authority to work with
all objects, but there might be circumstances on Windows systems when authority is denied if you have
a local user and a domain-authenticated user with the same name. This is described in “Principals and
groups on UNIX, Linux, and Windows” on page 377.
Windows versions with a User Account Control (UAC) feature restricts the actions users can perform on
certain operating system facilities, even if they are members of the Administrators group. If your userid is
in the Administrators group but not the mqm group you must use an elevated command prompt to issue
IBM MQ admin commands such as crtmqm, otherwise the error AMQ7077: You are not authorized
to perform the requested operation is generated. To open an elevated command prompt,
right-click the start menu item, or icon, for the command prompt, and select Run as administrator.
You do not need to be a member of the mqm group to take the following actions:
• Issue commands from an application program that issues PCF commands, or MQSC commands within
an Escape PCF command, unless the commands manipulate channel initiators. (These commands are
described in “Protecting channel initiator definitions” on page 97 ).
• Issue MQI calls from an application program (unless you want to use the fast path bindings on the
MQCONNX call).
• Use the crtmqcvx command to create a fragment of code that performs data conversion on data type
structures.
• Use the dspmq command to display queue managers.
• Use the dspmqtrc command to display IBM MQ formatted trace output.
A 12 character limitation applies to both group and user IDs.
UNIX and Linux platforms generally restrict the length of a user ID to 12 characters. AIX 5.3 has raised
this limit but IBM MQ continues to observe a 12 character restriction on all UNIX and Linux platforms.
If you use a user ID of greater than 12 characters, IBM MQ replaces it with the value UNKNOWN . Do not
define a user ID with a value of UNKNOWN .
374 Securing IBM MQ
Managing the mqm group on UNIX, Linux, and Windows
Users in the mqm group are granted full administrative privileges over IBM MQ. For this reason, you
should not enroll applications and ordinary users in the mqm group. The mqm group should contain the
accounts of the IBM MQ administrators only.
These tasks are described in:
If your domain controller runs on Windows 2000 or Windows 2003, your domain
administrator might have to set up a special account for IBM MQ to use. For more information, see
Configuring IBM MQ with the Prepare IBM MQ Wizard and Creating and setting up Windows domain
accounts for IBM MQ.
376 Securing IBM MQ
How access control is implemented by IBM MQ on UNIX, Linux, and
Windows
IBM MQ uses the security services provided by the underlying operating system, using the object
authority manager. IBM MQ supplies commands to create and maintain access control lists.
An access control interface called the Authorization Service Interface is part of IBM MQ. IBM MQ supplies
an implementation of an access control manager (conforming to the Authorization Service Interface)
known as the object authority manager (OAM). This is automatically installed and enabled for each queue
manager you create, unless you specify otherwise (as described in “Preventing security access checks
on UNIX, Linux, and Windows systems” on page 333 ). The OAM can be replaced by any user or vendor
written component that conforms to the Authorization Service Interface.
The OAM exploits the security features of the underlying operating system, using operating system user
and group IDs. Users can access IBM MQ objects only if they have the correct authority. “Controlling
access to objects by using the OAM on UNIX, Linux, and Windows” on page 323 describes how to grant
and revoke this authority.
The OAM maintains an access control list (ACL) for each resource that it controls. Authorization data is
stored on a local queue called SYSTEM.AUTH.DATA.QUEUE. Access to this queue is restricted to users in
the mqm group, and additionally on Windows, to users in the Administrators group, and users logged in
with the SYSTEM ID. User access to the queue cannot be changed.
IBM MQ supplies commands to create and maintain access control lists. For more information on these
commands, see “Controlling access to objects by using the OAM on UNIX, Linux, and Windows” on page
323.
IBM MQ passes the OAM a request containing a principal, a resource name, and an access type. The OAM
grants or rejects access based on the ACL that it maintains. IBM MQ follows the decision of the OAM; if the
OAM cannot make a decision, IBM MQ does not allow access.
Windows systems
ACLs are based on both user IDs and groups. Checks are the same as for UNIX. You can have different
users on different domains with the same user ID. IBM MQ permits user IDs to be qualified by a
domain name so that these users can be given different levels of access.
The group name can optionally include a domain name, specified in the following formats:
GroupName@domain domain_name\group_name
378 Securing IBM MQ
Some control commands (for example, crtmqm) change authorities on IBM MQ objects using the
object authority manager (OAM). The OAM searches the security databases in the order given in
the preceding paragraph to determine the authority rights for a particular user ID. As a result, the
authority determined by the OAM might override the fact that a user ID is a member of the local mqm
group. For example, if you issue the crtmqm command from a user ID authenticated by a domain
controller that has membership of the local mqm group through a global group, the command fails if
the system has a local user with the same name who is not in the local mqm group.
For more information about setting the SecurityPolicy attribute on Windows, see Installable
services and Configuring authorization service stanzas on Windows.
MCAUserIdentifier
Every instance of a channel that is current has an associated channel definition structure, MQCD. The
initial values of the fields in MQCD are determined by the channel definition that is created by an IBM MQ
administrator. In particular, the initial value of one of the fields, MCAUserIdentifier, is determined by the
value of the MCAUSER parameter on the DEFINE CHANNEL command, or by the equivalent to MCAUSER if
the channel definition is created in another way.
The MQCD structure is passed to a channel exit program when it is called by an MCA. When a security exit
is called by an MCA, the security exit can change the value of MCAUserIdentifier, replacing any value that
was specified in the channel definition.
On Multiplatforms, unless the value of MCAUserIdentifier is blank, the queue manager uses
the value of MCAUserIdentifier as the user ID for authority checks when an MCA attempts to access the
queue manager's resources after it has connected to the queue manager. If the value of MCAUserIdentifier
is blank, the queue manager uses the default user ID of the MCA instead. This applies to RCVR, RQSTR,
CLUSRCVR and SVRCONN channels. For sending MCAs, the default user ID is always used for authority
checks, even if the value of MCAUserIdentifier is not blank.
On z/OS, the queue manager might use the value of MCAUserIdentifier for authority checks,
provided it is not blank. For receiving MCAs and server connection MCAs, whether the queue manager
uses the value of MCAUserIdentifier for authority checks depends on:
• The value of the PUTAUT parameter in the channel definition
• The RACF profile used for the checks
• The access level of the channel initiator address space user ID to the RESLEVEL profile
For sending MCAs, it depends on:
• Whether the sending MCA is a caller or a responder
• The access level of the channel initiator address space user ID to the RESLEVEL profile
The user ID that a security exit stores in MCAUserIdentifier can be acquired in various ways. Here are
some examples:
• Provided there is no security exit at the client end of an MQI channel, a user ID associated with the
IBM MQ client application flows from the client connection MCA to the server connection MCA when
380 Securing IBM MQ
the client application issues an MQCONN call. The server connection MCA stores this user ID in the
RemoteUserIdentifier field in the channel definition structure, MQCD. If the value of MCAUserIdentifier is
blank at this time, the MCA stores the same user ID in MCAUserIdentifier. If the MCA does not store the
user ID in MCAUserIdentifier, a security exit can do it later by setting MCAUserIdentifier to the value of
RemoteUserIdentifier.
If the user ID that flows from the client system is entering a new security domain and is not valid on the
server system, the security exit can substitute the user ID for one that is valid and store the substituted
user ID in MCAUserIdentifier.
• The user ID can be sent by the partner security exit in a security message.
On a message channel, a security exit called by the sending MCA can send the user ID under which
the sending MCA is running. A security exit called by the receiving MCA can then store the user ID in
MCAUserIdentifier. Similarly, on an MQI channel, a security exit at the client end of the channel can send
the user ID associated with the IBM MQ MQI client application. A security exit at the server end of the
channel can then store the user ID in MCAUserIdentifier. As in the previous example, if the user ID is not
valid on the target system, the security exit can substitute the user ID for one that is valid and store the
substituted user ID in MCAUserIdentifier.
If a digital certificate is received as part of the identification and authentication service, a security exit
can map the Distinguished Name in the certificate to a user ID that is valid on the target system. It can
then store the user ID in MCAUserIdentifier.
• If TLS is used on the channel, the partner's Distinguished Name (DN) is passed to the exit in the
SSLPeerNamePtr field of the MQCD, and the DN of the issuer of that certificate is passed to the exit in
the SSLRemCertIssNamePtr field of the MQCXP.
For more information about the MCAUserIdentifier field, the channel definition structure, MQCD, and
the channel exit parameter structure, MQCXP, see Channel-exit calls and data structures. For more
information about the user ID that flows from a client system on an MQI channel, see Access control.
Note: Security exit applications constructed prior to the release of IBM WebSphere MQ 7.1 might require
updating. For more information see Channel security exit programs.
LDAP authorization
You can use LDAP authorization to remove the need for a local user ID.
• UNIX
• IBM i
• Windows
Attention:
From IBM MQ 9.0 general availability, this functionality is available on all queue managers,
whether new or migrated from an earlier release.
382 Securing IBM MQ
When LDAP authorization is in place, the queue manager always uses the user model of security on UNIX
platforms, regardless of the SecurityPolicy attribute in the qm.ini file. So, setting permissions for an
individual user affects only that user, and not anyone else who belongs to any of that user's groups.
As with the OS model, a user still has the combined authority that has been assigned to both the
individual and to all of the groups (if any) to which the user belongs.
For example, assume that the following records have been defined in an LDAP repository.
• In the inetOrgPerson class:
For authentication purposes, a queue manager using this LDAP server must have been defined so that its
CONNAUTH value points at an AUTHINFO object of type IDPWLDAP, and whose relevant name-resolution
attributes are probably set as follows:
USRFIELD(email) SHORTUSR(shortu)
BASEDNU(ou=users,o=yourcompany,c=yourcountry) CLASSUSR(inetOrgPerson)
Given this configuration for authentication, an application can complete the CSPUserID field, used within
the MQCNO call, with either of the following sets of values:
or
In either case, the system can use the supplied values to authenticate the OS context of " jodoe".
Setting authorizations
How you use the short name or USRFIELD to set authorizations.
The approach of working with multiple formats, described in “LDAP authorization” on page 382, continues
into the authorization commands, with a further extension that either the shortname or the USRFIELD
can be used in an unadorned fashion.
The character string specifies a particular attribute in the LDAP record when naming users (principals) for
authorization.
Important: The character string must not contain the = character, because this character cannot be used
in an operating system user ID.
If you pass a principal name to the OAM for authorization that is potentially a shortname, the character
string must fit into 12 characters. The mapping algorithm first tries to resolve it to a DN using the
SHORTUSR attribute in its LDAP query.
If that fails with an UNKNOWN_ENTITY error, or if the given string cannot possibly be a shortname, a
further attempt is made using the USRFIELD attribute to construct the LDAP query.
You can use the SET AUTHREC MQSC command as an alternative to the setmqaut command:
"cn=JohnDoe,ou=users,o=yourcompany,c=yourcountry"
When processing groups, there is no ambiguity about shortname processing, as there is no requirement
to fit any form of a group name into 12-characters. Therefore, there is no equivalent of the SHORTUSR
attribute for groups.
That means that the syntax examples described in Table 70 on page 384 are valid, assuming that you
have configured the AUTHINFO object with the extended attributes, and set to:
GRPFIELD(longname)
BASEDNG(ou=groups,o=yourcompany,c=yourcountry ) CLASSGRP(groupOfNames)
384 Securing IBM MQ
You can use the SET AUTHREC MQSC command as an alternative to the preceding setmqaut command:
"ApplicationGroupA"
Important:
Whichever format you use to refer to a name, whether for user or group, it must be possible to derive a
unique DN.
So, for example, you must not have two distinct records that both have "shortu=jodoe".
If a single unique DN cannot be determined, the OAM returns MQRC_UNKNOWN_ENTITY.
Displaying authorizations
Various methods of displaying authorization of users or groups.
dspmqaut command
The simplest method for displaying the authorizations available for a user or group is to use the dspmqaut
command.
You can use a query on any of the syntax variations for identifying a user or group. Note that the command
output repeats the identity in the format given on the command line. The output does not report on the
full resolved DN.
For example:
or
dmpmqcfg -m QM -x authrec
------------------------------------
SET AUTHREC PROFILE(SELF) +
PRINCIPAL('cn=JohnDoe, ou=users, o=yourcompany, c=yourcountry') +
OBJTYPE(QMGR)
AUTHADD(CONNECT)
ADOPTCTX
There is no requirement for applications to provide authentication information, or for the ADOPTCTX
attribute to be set to YES.
If an application does not explicitly authenticate, or if ADOPTCTX is set to NO for the active CONNAUTH
object, the identity context associated with the application is taken from the operating system user ID.
When authorizations need to be applied, that context is mapped to an LDAP identity using the same rules
as for the setmqaut commands.
386 Securing IBM MQ
For example:
Then DISPLAY CHSTATUS(*) ALL shows the SHORTUSR value, MCAUSER(jodoe) for all connections.
The queue manager can be switched at any time between OS and LDAP models. You can change the
configuration and make that configuration active by using the REFRESH SECURITY TYPE (CONNAUTH)
command.
For example, if this object has already been configured with the connection information for
authentication:
Windows
If an authority configuration change involves switching between OS and LDAP models, the queue manager
must be restarted for the change to take effect. Otherwise, you can make the change active by using the
REFRESH SECURITY TYPE (CONNAUTH) command.
Processing rules
When switching from OS to LDAP authorization, any existing OS authority rules that have been set,
become inactive and invisible.
Commands such as dmpmqaut do not display those OS rules. Similarly, when switching back from LDAP to
OS, any defined LDAP authorizations become inactive and invisible, restoring the original OS rules.
If you want to back up the definitions of a queue manager for any reason, using the dmpmqcfg command,
then that backup will contain only the rules that are defined for the authorization method in effect at the
time of the back up.
LDAP administration
An overview of how each platform administers LDAP.
When using LDAP authorization, membership of the mqm group (or equivalent) in the operating system is
not that important. Being a member of that group only controls whether certain command-line commands
can be processed.
UNIX platforms
Once the queue manager is running, the only automatically fully-privileged account is the real user who
started the queue manager.
The mqm ID still exists and is used as the owner of OS resources, such as files, because mqm is the
effective ID under which the queue manager is running. However, the mqm user will not automatically be
able to do administrative tasks controlled by the OAM.
IBM i
On IBM i, the automatically-privileged accounts are the one that starts the queue manager and the QMQM
ID.
You need both IDs, because the user ID that starts the queue manager is required only to start the
system. Once running, the queue manager processes have QMQM authority only.
Windows platforms
On Windows, the automatically fully-privileged accounts are the OS user that started the queue manager,
and also the user running the core queue manager processes, such as MUSR_MQADMIN if the queue
manager was started as a Windows service.
When running in LDAP authorization mode, Windows behaves very similarly to the UNIX platforms. It
deals with 12 character short names, and full DNs.
Sample script
As it is useful to have a group able to do full administration on a queue manager, a sample script is
shipped on UNIX platforms as:
MQ_INSTALLATION_PATH/samp/bin/amqauthg.sh
388 Securing IBM MQ
Confidentiality of messages
To maintain confidentiality, encrypt your messages. There are various methods of encrypting messages in
IBM MQ depending on your needs.
Your choice of CipherSpec determines what level of confidentiality you have.
If you need application-level, end-to-end data protection for your point to point messaging infrastructure,
you can use Advanced Message Security to encrypt the messages, or write your own API exit or API-
crossing exit.
If you need to encrypt messages only while they are being transported through a channel, because you
have adequate security on your queue managers, you can use TLS, or you can write your own security exit,
message exit, or send and receive exit programs.
For more information about Advanced Message Security, see “Planning for Advanced Message Security”
on page 90. The use of TLS with IBM MQ is described at “TLS security protocols in IBM MQ ” on page 23.
The use of exit programs in message encryption is described at “Implementing confidentiality in user exit
programs” on page 410.
Related tasks
Connecting two queue managers using TLS
Connecting a client to a queue manager securely
Enabling CipherSpecs
Enable a CipherSpec by using the SSLCIPH parameter in either the DEFINE CHANNEL MQSC command or
the ALTER CHANNEL MQSC command.
Some of the CipherSpecs that you can use with IBM MQ are FIPS compliant. Some of the FIPS compliant
CipherSpecs are also Suite B compliant although others, such as TLS_RSA_WITH_AES_256_CBC_SHA,
are not.
All Suite B compliant CipherSpecs are also FIPS compliant. All Suite B compliant CipherSpecs fall into
two groups: 128 bit (for example, ECDHE_ECDSA_AES_128_GCM_SHA256) and 192 bit (for example,
ECDHE_ECDSA_AES_256_GCM_SHA384),
The following diagram illustrates the relationship between these subsets:
From IBM MQ 8.0.0 Fix Pack 3 the number of supported CipherSpecs has been reduced.
For information about enabling the deprecated CipherSpecs, see “Enabling deprecated CipherSpecs on
Multiplatforms” on page 391 or “Enabling deprecated CipherSpecs on z/OS” on page 393. For a list of
CipherSpecs that you can re-enable to use with IBM MQ, see “Deprecated CipherSpecs” on page 393.
Cipher specifications that you can use with the IBM MQ queue manager automatically are listed in the
following table. When you request a personal certificate, you specify a key size for the public and private
key pair. The key size that is used during the TLS handshake is the size stored in the certificate unless it is
determined by the CipherSpec, as noted in the table.
390 Securing IBM MQ
Platfor CipherSpec name Protoco Data Encryptio Encrypt FIPS Suite
m l used integrity n ion bits “2” on B
support algorithm page
“1” on 391
page 391
Notes:
1. If no specific platform is noted, the CipherSpec is available on all platforms. For a list of platforms covered
by each platform icon, see Release and platform icons in the product documentation.
2. Specifies whether the CipherSpec is FIPS-certified on a FIPS-certified platform. See Federal Information
Processing Standards (FIPS) for an explanation of FIPS.
3. This CipherSpec cannot be used to secure a connection from the IBM MQ Explorer to a queue manager
unless the appropriate unrestricted policy files are applied to the JRE used by the Explorer.
4. Following a recommendation by GSKit, GCM CipherSpecs have a restriction which means that after 2ˆ24.5
TLS records are sent, using the same session key, the connection is terminated with message AMQ9288.
To prevent this error from happening: avoid using GCM Ciphers, enable
secret key reset, or start your IBM MQ queue manager or client with the environment variable
GSK_ENFORCE_GCM_RESTRICTION=GSK_FALSE set.
Notes:
• You must set this environment variable on both sides of the connection, and applies to both client to
queue manager connections and queue manager to queue manager connections.
• This statement applies to GSKit libraries only, so affects unmanaged .NET clients as well but not Java or
managed .NET clients.
This restriction does not apply to IBM MQ for z/OS.
Important: The GCM restriction is active, regardless of the FIPS mode being used.
5. The CipherSpecs listed as supported on IBM i, apply to Versions 7.2 and 7.3 of IBM i.
AMQ_SSL_WEAK_CIPHER_ENABLE=ECDHE_RSA_RC4_128_SHA256
or, alternatively change the SSL stanza in the qm.ini file, by setting:
SSL
AllowWeakCipherSpec=ECDHE_RSA_RC4_128_SHA256
AMQ_SSL_V3_ENABLE=1
AMQ_SSL_WEAK_CIPHER_ENABLE=RC4_MD5_US
or, alternatively, change the SSL stanza in the qm.ini file, by setting:
SSL
AllowSSLV3=Y
AllowWeakCipherSpec=RC4_MD5_US
Attention: The following information concerning TLS_V1 applies from IBM MQ 9.0.0 Fix Pack 3 or
IBM MQ 9.0.5 only.
In addition to issuing AMQ_TLS_WEAK_CIPHER_ENABLE, or AllowWeakCipherSpec, you must set the
environment variable AMQ_TLS_V1_ENABLE=1 or set AllowTLSV1=Y, to continue using deprecated
TLSv1 CipherSpecs.
For example, if you want to re-enable TLS_RSA_WITH_AES_128_CBC_SHA, set the following
environment variables:
AMQ_TLS_V1_ENABLE=1
AMQ_TLS_WEAK_CIPHER_ENABLE=TLS_RSA_WITH_AES_128_CBC_SHA
or, alternatively, change the SSL stanza in the qm.ini file, by setting:
SSL
392 Securing IBM MQ
AllowTLSV1=Y
AllowWeakCipherSpec=TLS_RSA_WITH_AES_128_CBC_SHA
By default, you are not allowed to specify a deprecated CipherSpec on a channel definition. If you attempt
to specify a deprecated CipherSpec on z/OS, you receive message CSQM102E or message CSQX674E.
To enable weak (deprecated) cipherspecs, you need to define the following DD statement in the CHINIT
JCL:
To enable the deprecated SSLv3 protocol, you also need to define the following DD statement in the
CHINIT JCL:
If you do not want to negotiate with the listener using weak or broken cipher specifications, you need to
define the following DD statement in the CHINIT JCL:
If you want to only negotiate with the listener using the cipher specifications listed on the System SSL
default cipher specification list, you need to define the following DD statement in the CHINIT JCL:
Related concepts
“Digital certificates and CipherSpec compatibility in IBM MQ” on page 41
This topic provides information on how to choose appropriate CipherSpecs and digital certificates for your
security policy, by outlining the relationship between CipherSpecs and digital certificates in IBM MQ.
Related reference
DEFINE CHANNEL
ALTER CHANNEL
Deprecated CipherSpecs
A list of deprecated CipherSpecs that you are able to use with IBM MQ if necessary.
For information about enabling the deprecated CipherSpecs, see “Enabling deprecated CipherSpecs on
Multiplatforms” on page 391 or “Enabling deprecated CipherSpecs on z/OS” on page 393.
Deprecated CipherSpecs that you can use with IBM MQ TLS support are listed in the following table.
Platfor CipherSpec name Protoc Data Encrypti Encryp FIPS Suit Updat
m ol used integrity on tion “2” on e B e when
suppor algorith bits page deprec
t “1” on m 396 ated
page 396
All DES_SHA_EXPORT“3” on page 396 “8” on SSL 3.0 SHA-1 DES 56 No No 9.0.0.0
page 396
All TRIPLE_DES_SHA_US “8” on page 396 SSL 3.0 SHA-1 3DES 168 No No 9.0.0.1
and
9.0.1
TLS_RSA_EXPORT_WITH_RC2_40_ TLS 1.0 MD5 RC2 40 No No 9.0.0.0
MD5
TLS_RSA_EXPORT_WITH_RC4_40_ TLS 1.0 MD5 RC4 40 No No 9.0.0.0
MD5“3” on page 396
All TLS_RSA_WITH_DES_CBC_SHA TLS 1.0 SHA-1 DES 56 No“5 No 9.0.0.0
” on
page
396
394 Securing IBM MQ
Platfor CipherSpec name Protoc Data Encrypti Encryp FIPS Suit Updat
m ol used integrity on tion “2” on e B e when
suppor algorith bits page deprec
t “1” on m 396 ated
page 396
Notes:
1. If no specific platform is noted, the CipherSpec is available on all platforms.
2. Specifies whether the CipherSpec is FIPS-certified on a FIPS-certified platform. See Federal Information
Processing Standards (FIPS) for an explanation of FIPS.
3. The maximum handshake key size is 512 bits. If either of the certificates exchanged during the SSL
handshake has a key size greater than 512 bits, a temporary 512-bit key is generated for use during the
handshake.
4. The handshake key size is 1024 bits.
5. This CipherSpec was FIPS 140-2 certified before 19 May 2007.
6. This CipherSpec was FIPS 140-2 certified before 19 May 2007. The name FIPS_WITH_DES_CBC_SHA is
historical and reflects the fact that this CipherSpec was previously (but is no longer) FIPS-compliant. This
CipherSpec is deprecated and its use is not recommended.
7. The name FIPS_WITH_3DES_EDE_CBC_SHA is historical and reflects the fact that this CipherSpec was
previously (but is no longer) FIPS-compliant. The use of this CipherSpec is deprecated.
8. These CipherSpecs are no longer supported by IBM MQ classes for Java or IBM MQ classes for JMS.
For more information, see SSL/TLS CipherSpecs and CipherSuites in IBM MQ classes for Java or SSL/TLS
CipherSpecs and CipherSuites in IBM MQ classes for JMS.
9. This CipherSpec can be used to transfer up to 32 GB of data before the connection is terminated with error
AMQ9288. To avoid this error, either avoid using triple DES, or enable secret key reset when using this
CipherSpec.
Related concepts
“Digital certificates and CipherSpec compatibility in IBM MQ” on page 41
This topic provides information on how to choose appropriate CipherSpecs and digital certificates for your
security policy, by outlining the relationship between CipherSpecs and digital certificates in IBM MQ.
Related reference
DEFINE CHANNEL
ALTER CHANNEL
396 Securing IBM MQ
Alternatives for specifying CipherSpecs
For those platforms where the operating system provides the TLS support, your system might support
new CipherSpecs. You can specify a new CipherSpec with the SSLCIPH parameter, but the value you
supply depends on your platform.
Note: This section does not apply to UNIX, Linux or Windows systems, because the CipherSpecs are
provided with the IBM MQ product, so new CipherSpecs do not become available after shipment.
For those platforms where the operating system provides the TLS support, your system might support
new CipherSpecs that are not included in “Enabling CipherSpecs” on page 389. You can specify a new
CipherSpec with the SSLCIPH parameter, but the value you supply depends on your platform. In all cases
the specification must correspond to an TLS CipherSpec that is both valid and supported by the version of
TLS your system is running.
IBM i
A two-character string representing a hexadecimal value.
For more information about the permitted values, see point three in the Usage Notes section of Set
character information for a secure session.
Attention: You should not specify hexadecimal cipher values in SSLCIPH, because it is unclear
from the value which cipher will be used, and the choice of which protocol to be used is
indeterminate. Using hexadecimal cipher values can lead to CipherSpec mismatch errors.
You can use either the CHGMQMCHL or the CRTMQMCHL command to specify the value, for example:
You can also use the ALTER QMGR MQSC command to set the SSLCIPH parameter.
z/OS
A four-character string representing a hexadecimal value. The hexadecimal codes correspond to the
values defined in the TLS protocol.
For more information, refer to Cipher Suite Definitions where there is a list of all the supported TLS
1.0, TLS 1.2, and TLS 1.3 cipher specifications in the form of 4-digit hexadecimal codes.
Specifying a CipherSuite with IBM MQ classes for Java and IBM MQ classes
for JMS
IBM MQ classes for Java and IBM MQ classes for JMS specify CipherSuites differently from other
platforms.
For information about specifying a CipherSuite with IBM MQ classes for Java, see Transport Layer Security
(TLS) support for Java
Scenarios
Use of AT-TLS with IBM MQ is supported in the following scenarios:
Scenario 1
Between two IBM MQ for z/OS queue managers where both sides of the channel use AT-TLS. That is,
neither channel specifies the SSLCIPH attribute. This approach can be used with any message channel.
Implementation of this scenario consists of defining two AT-TLS policies, one for each side of the channel.
These policies are the same as those used with Scenario 3.
For example, if the channel was being changed from using a single, named CipherSpec to using AT-TLS,
the outbound channel would use the policy from “Configuring AT-TLS on an outbound channel to an IBM
398 Securing IBM MQ
MQ for Multiplatforms queue manager using a single, named CipherSpec” on page 401 and the inbound
channel would use the policy from “Configuring AT-TLS on an inbound channel from an IBM MQ for
Multiplatforms queue manager using a single, named CipherSpec” on page 404.
Scenario 2
Between an IBM MQ for z/OS queue manager and an IBM MQ Java client application running on z/OS
where both sides of the channel use AT-TLS. That is, neither the server-connection channel, nor the
client-connection channel specify the SSLCIPH attribute.
Implementation of this scenario consists of defining two AT-TLS policies, one for each side of the channel.
These policies are the same as those used with Scenario 3.
For example, if the channel was being changed from using a single, named CipherSpec to using AT-TLS
the client-connection channel would use the policy from “Configuring AT-TLS on an outbound channel to
an IBM MQ for Multiplatforms queue manager using a single, named CipherSpec” on page 401 and the
server-connection channel would use the policy from “Configuring AT-TLS on an inbound channel from an
IBM MQ for Multiplatforms queue manager using a single, named CipherSpec” on page 404.
Scenario 3
Between an IBM MQ for z/OS queue manager and a queue manager running on IBM MQ for
Multiplatforms, where the IBM MQ for z/OS queue manager uses AT-TLS and the IBM MQ for
Multiplatforms queue manager uses IBM MQ TLS. This applies to all message channel types other than
cluster-sender and cluster-receiver.
See “Configuring AT-TLS on an outbound channel to an IBM MQ for Multiplatforms queue manager using a
single, named CipherSpec” on page 401 for an example AT-TLS configuration for outbound channels from
the IBM MQ for z/OS queue manager to the IBM MQ for Multiplatforms queue manager, and “Configuring
AT-TLS on an inbound channel from an IBM MQ for Multiplatforms queue manager using a single, named
CipherSpec” on page 404 for an example AT-TLS configuration for inbound channels from the IBM MQ for
Multiplatforms queue manager to the IBM MQ for z/OS queue manager.
The same AT-TLS configuration can be used when both queue managers are on z/OS, but the queue
manager on the right hand side has not been configured to use AT-TLS.
Scenario 4
This scenario requires a single AT-TLS policy which meets the same requirements as those used by
an inbound message channel; see “Configuring AT-TLS on an inbound channel from an IBM MQ for
Multiplatforms queue manager using a single, named CipherSpec” on page 404.
The same AT-TLS configuration can be used when the client application is a Java application, and is also
running on z/OS, but has not been configured to use AT-TLS.
Restrictions
IBM MQ for z/OS is not AT-TLS aware, therefore there are several restrictions that apply with the
preceding scenarios:
• AT-TLS in combination with IBM MQ TLS does not work with cluster-sender and cluster-receiver
channels.
• IBM MQ for z/OS queue managers are not aware that they are using AT-TLS and do not receive any
certificate information from their partner queue manager or client. Therefore, the following attributes
have no effect on the z/OS side of a channel using AT-TLS:
– The SSLCAUTH, and SSLPEER channel attributes
– The SSLRKEYC queue manager attribute
– The SSLPEERMAP attributes of CHLAUTH rules
• Use of TLS secret key renegotiation requires that both sides of the channel use IBM MQ TLS. Therefore,
an IBM MQ for Multiplatforms queue manager, or client, should not have TLS secret key renegotiation
enabled if connecting to an IBM MQ for z/OS queue manager using AT-TLS.
To disable TLS secret key renegotiation for a queue manager set the queue manager SSLRKEYC
parameter to 0. For a client, set the relevant parameter to 0 depending on client type. For details
on how to do this, see “Resetting SSL and TLS secret keys” on page 408.
400 Securing IBM MQ
TTLSKeyringParms
References the key-ring that is to be used by AT-TLS.
TTLSCipherParms
Defines the cipher suites that are to be used.
TTLSEnvironmentAdvancedParms
Defines which TLS or SSL protocols are enabled.
Attention: There are other AT-TLS policy statements with AT-TLS which are not documented here,
and could be used with IBM MQ depending on need. However, IBM MQ has only been tested with
the policies described in this topic.
In this example an existing sender – receiver channel pair, which uses the TLS 1.2
TLS_RSA_WITH_AES_256_GCM_SHA384 CipherSpec is going to be adjusted so that the sender channel
uses AT-TLS instead of IBM MQ TLS.
Other TLS protocols and CipherSpecs can be used by making minor adjustments to the configuration.
Other message channel types, apart from cluster-sender and cluster-receiver channels, could be used
with no change to the AT-TLS configuration.
Procedure
You need to create the following AT-TLS statements for this scenario:
1. A TTLSRule statement to match outbound connections from the channel initiator address space to the
IP address and port number of the target receiver channel. These values should match the information
used in the CONNAME of the sender channel. Here, further filtering has been included to match a
specific channel initiator job name.
TTLSRule CSQ1-TO-REMOTE
{
LocalAddr ALL
RemoteAddr 123.456.78.9
RemotePortRange 1414
Jobname CSQ1CHIN
Direction OUTBOUND
TTLSGroupActionRef CSQ1-GROUP-ACTION
TTLSEnvironmentActionRef CSQ1-OUTBOUND-ENVIRONMENT-ACTION
}
TTLSGroupAction CSQ1-GROUP-ACTION
{
TTLSEnabled ON
}
TTLSEnvironmentAction CSQ1-OUTBOUND-ENVIRONMENT-ACTION
{
HandshakeRole CLIENT
TTLSKeyringParmsRef CSQ1-KEYRING
TTLSCipherParmsRef CSQ1-CIPHERPARM
TTLSEnvironmentAdvancedParmsRef CSQ1-ENVIRONMENT-ADVANCED
}
TTLSKeyringParms CSQ1-KEYRING
{
Keyring MQCHIN/CSQ1RING
}
402 Securing IBM MQ
Table 71. Convert from four-character codes to CipherSpec names (continued)
Four-character Protocol Enabled by CipherSpec name
code default
0008 SSL 3.0 No DES_SHA_EXPORT
0009 TLS 1.0 Yes TLS_RSA_WITH_DES_CBC_SHA
000A SSL 3.0 No TRIPLE_DES_SHA_US
000A TLS 1.0 Yes TLS_RSA_WITH_3DES_EDE_CBC_SHA
002F TLS 1.0 Yes TLS_RSA_WITH_AES_128_CBC_SHA
0035 TLS 1.0 Yes TLS_RSA_WITH_AES_256_CBC_SHA
003B TLS 1.2 Yes TLS_RSA_WITH_NULL_SHA256
003C TLS 1.2 Yes TLS_RSA_WITH_AES_128_CBC_SHA256
003D TLS 1.2 Yes TLS_RSA_WITH_AES_256_CBC_SHA256
C023 TLS 1.2 Yes ECDHE_ECDSA_AES_128_CBC_SHA256
C024 TLS 1.2 Yes ECDHE_ECDSA_AES_256_CBC_SHA384
C027 TLS 1.2 Yes ECDHE_RSA_AES_128_CBC_SHA256
C028 TLS 1.2 Yes ECDHE_RSA_AES_256_CBC_SHA384
TTLSCipherParms CSQ1-CIPHERPARM
{
V3CipherSuites TLS_RSA_WITH_AES_256_GCM_SHA384
}
TTLSEnvironmentAdvancedParms CSQ1-ENVIRONMENT-ADVANCED
{
SSLv3 OFF
TLSv1 OFF
TLSv1.1 OFF
SecondaryMap OFF
TLSv1.2 ON
TLSv1.3 OFF
}
The complete set of statements are as follows and should be applied to the policy agent:
TTLSGroupAction CSQ1-GROUP-ACTION
{
TTLSEnabled ON
}
TTLSEnvironmentAction CSQ1-OUTBOUND-ENVIRONMENT-ACTION
{
HandshakeRole CLIENT
TTLSKeyringParmsRef CSQ1-KEYRING
TTLSCipherParmsRef CSQ1-CIPHERPARM
TTLSEnvironmentAdvancedParmsRef CSQ1-ENVIRONMENT-ADVANCED
}
TTLSKeyringParms CSQ1-KEYRING
{
Keyring MQCHIN/CSQ1RING
}
TTLSCipherParms CSQ1-CIPHERPARM
{
V3CipherSuites TLS_RSA_WITH_AES_256_GCM_SHA384
}
TTLSEnvironmentAdvancedParms CSQ1-ENVIRONMENT-ADVANCED
{
SSLv3 OFF
TLSv1 OFF
TLSv1.1 OFF
SecondaryMap OFF
TLSv1.2 ON
TLSv1.3 OFF
}
Remove the CipherSpec from the z/OS channel using the following command:
Once the channel has started it will be using a combination of AT-TLS and IBM MQ TLS.
Attention: The preceding AT-TLS statements are only a minimal configuration. There are other
AT-TLS policy statements with AT-TLS which are not documented here, and could be used with
IBM MQ depending on need. However, IBM MQ has only been tested with the policies described.
404 Securing IBM MQ
In this example an existing sender – receiver channel pair, which uses the TLS 1.2
TLS_RSA_WITH_AES_256_GCM_SHA384 CipherSpec is going to be adjusted so that the receiver channel
uses AT-TLS instead of IBM MQ TLS.
Other TLS protocols and CipherSpecs can be used by making minor adjustments to the configuration.
Other message channel types, apart from cluster-sender and cluster-receiver channels, could be used
with no change to the AT-TLS configuration.
Procedure
You need to create the following AT-TLS statements for this scenario:
1. A TTLSRule statement to match inbound connections to the channel initiator address space from the
IP address of the sender channel. Here, further filtering has been included to match a specific channel
initiator job name.
TTLSRule REMOTE-TO-CSQ1
{
LocalAddr ALL
LocalPortRange 1414
RemoteAddr 123.456.78.9
Jobname CSQ1CHIN
Direction INBOUND
TTLSGroupActionRef CSQ1-GROUP-ACTION
TTLSEnvironmentActionRef CSQ1-INBOUND-ENVIRONMENT-ACTION
}
The preceding rule matches against connections coming into the CSQ1CHIN job on local port 1414
from remote IP address 123.456.78.9.
More advanced filtering options are described at TTLSRule.
2. A TTLSGroupAction statement enabling the rule. The TTLSRule references the TTLSGroupAction
using the TTLSGroupActionRef property.
TTLSGroupAction CSQ1-GROUP-ACTION
{
TTLSEnabled ON
}
AT-TLS provides the capability to provide mutual authentication, which is the equivalent of using
the SSLCAUTH channel attribute. This is done by having an TTLSEnvironmentAction statement
with a HandshakeRole value of ServerWithClientAuth for the inbound TTLSEnvironmentAction
statement.
4. A TTLSKeyringParms statement is associated with the TTLSEnvironmentAction by the
TTLSKeyringParmsRef property and defines the key ring used by AT-TLS.
The key ring should contain certificates trusted by the remote non-z/OS queue manager. This key ring
can be defined in the same way as a key ring used by the channel initiator; see “Configuring your z/OS
system to use TLS” on page 235.
TTLSKeyringParms CSQ1-KEYRING
{
Keyring MQCHIN/CSQ1RING
}
406 Securing IBM MQ
Table 72. Convert from four-character codes to CipherSpec names (continued)
Four-character Protocol Enabled by CipherSpec name
code default
003C TLS 1.2 Yes TLS_RSA_WITH_AES_128_CBC_SHA256
003D TLS 1.2 Yes TLS_RSA_WITH_AES_256_CBC_SHA256
C023 TLS 1.2 Yes ECDHE_ECDSA_AES_128_CBC_SHA256
C024 TLS 1.2 Yes ECDHE_ECDSA_AES_256_CBC_SHA384
C027 TLS 1.2 Yes ECDHE_RSA_AES_128_CBC_SHA256
C028 TLS 1.2 Yes ECDHE_RSA_AES_256_CBC_SHA384
TTLSCipherParms CSQ1-CIPHERPARM
{
V3CipherSuites TLS_RSA_WITH_AES_256_GCM_SHA384
}
TTLSEnvironmentAdvancedParms CSQ1-ENVIRONMENT-ADVANCED
{
SSLv3 OFF
TLSv1 OFF
TLSv1.1 OFF
SecondaryMap OFF
TLSv1.2 ON
TLSv1.3 OFF
}
The complete set of statements are as follows and should be applied to the policy agent :
TTLSGroupAction CSQ1-GROUP-ACTION
{
TTLSEnabled ON
}
TTLSEnvironmentAction CSQ1-INBOUND-ENVIRONMENT-ACTION
{
HandshakeRole CLIENT
TTLSKeyringParmsRef CSQ1-KEYRING
TTLSCipherParmsRef CSQ1-CIPHERPARM
TTLSEnvironmentAdvancedParmsRef CSQ1-ENVIRONMENT-ADVANCED
}
TTLSKeyringParms CSQ1-KEYRING
{
Keyring MQCHIN/CSQ1RING
}
TTLSCipherParms CSQ1-CIPHERPARM
{
V3CipherSuites TLS_RSA_WITH_AES_256_GCM_SHA384
}
TTLSEnvironmentAdvancedParms CSQ1-ENVIRONMENT-ADVANCED
{
SSLv3 OFF
TLSv1 OFF
TLSv1.1 OFF
SecondaryMap OFF
TLSv1.2 OFF
TLSv1.3 ON
}
Remove the CipherSpec from the z/OS channel using the following command:
Once the channel has started it will be using a combination of AT-TLS and IBM MQ TLS.
Attention: The preceding AT-TLS statements are only a minimal configuration. There are other
AT-TLS policy statements with AT-TLS which are not documented here, and could be used with
IBM MQ depending on need. However, IBM MQ has only been tested with the policies described.
408 Securing IBM MQ
Queue manager
For a queue manager, use the command ALTER QMGR with the parameter SSLRKEYC to set the values
used during key renegotiation.
MQI client
By default, MQI clients do not renegotiate the secret key. You can make an MQI client renegotiate the
key in any of three ways. In the following list, the methods are shown in order of priority. If you specify
multiple values, the highest priority value is used.
1. By using the KeyResetCount field in the MQSCO structure on an MQCONNX call
2. By using the environment variable MQSSLRESET
3. By setting the SSLKeyResetCount attribute in the MQI client configuration file
These variables can be set to an integer in the range 0 through 999 999 999, representing the number of
unencrypted bytes sent and received within a TLS conversation before the TLS secret key is renegotiated.
Specifying a value of 0 indicates that TLS secret keys are never renegotiated. If you specify a TLS secret
key reset count in the range 1 byte through 32 KB, TLS channels will use a secret key reset count of 32
KB. This is to avoid excessive key resets which would occur for small TLS secret key reset values.
If a value greater than zero is specified and channel heartbeats are enabled for the channel, the secret
key is also renegotiated before message data is sent or received following a channel heartbeat.
The count of bytes until the next secret key renegotiation is reset after each successful renegotiation.
For full details of the MQSCO structure, see KeyResetCount (MQLONG). For full details of MQSSLRESET,
see MQSSLRESET. For more information about the use of TLS in the client configuration file, see SSL
stanza of the client configuration file.
Java
For IBM MQ classes for Java, an application can reset the secret key in either of the following ways:
• By setting the sslResetCount field in the MQEnvironment class.
• By setting the environment property MQC.SSL_RESET_COUNT_PROPERTY in a Hashtable object. The
application then assigns the hashtable to the properties field in the MQEnvironment class, or passes
the hashtable to an MQQueueManager object on its constructor.
If the application uses more than one of these ways, the usual precedence rules apply. See Class
com.ibm.mq.MQEnvironment for the precedence rules.
The value of the sslResetCount field or environment property MQC.SSL_RESET_COUNT_PROPERTY
represents the total number of bytes sent and received by the IBM MQ classes for Java client code
before the secret key is renegotiated. The number of bytes sent is the number before encryption, and
the number of bytes received is the number after decryption. The number of bytes also includes control
information sent and received by the IBM MQ classes for Java client.
If the reset count is zero, which is the default value, the secret key is never renegotiated. The reset count
is ignored if no CipherSuite is specified.
JMS
For IBM MQ classes for JMS, the SSLRESETCOUNT property represents the total number of bytes sent and
received by a connection before the secret key that is used for encryption is renegotiated. The number
of bytes sent is the number before encryption, and the number of bytes received is the number after
decryption. The number of bytes also includes control information sent and received by IBM MQ classes
for JMS. For example, to configure a ConnectionFactory object that can be used to create a connection
If the value of SSLRESETCOUNT is zero, which is the default value, the secret key is never renegotiated.
The SSLRESETCOUNT property is ignored if SSLCIPHERSUITE is not set.
.NET
For .NET unmanaged clients, the integer property SSLKeyResetCount indicates the number of
unencrypted bytes sent and received within a TLS conversation before the secret key is renegotiated.
For information about the use of object properties in IBM MQ classes for .NET, see Getting and setting
attribute values.
For .NET managed clients, the SSLStream class does not support secret key reset/renegotiation. However,
to be consistent with other IBM MQ clients, the IBM MQ managed .NET client allows applications to set
SSLKeyResetCount. For more information, see Secret key reset or renegotiation.
XMS .NET
For XMS .NET unmanaged clients, see Secure connections to an IBM MQ queue manager.
Related reference
ALTER QMGR
DISPLAY QMGR
Change Message Queue Manager (CHGMQM)
Display Message Queue Manager (DSPMQM)
410 Securing IBM MQ
the symmetric key can be generated and distributed, see “Implementing confidentiality in user exit
programs” on page 410.
Headers in a message, such as the transmission queue header, MQXQH, which includes the embedded
message descriptor, must not be encrypted by a message exit. This is because data conversion of the
message headers takes place either after a message exit is called at the sending end or before a message
exit is called at the receiving end. If the headers are encrypted, data conversion fails and the channel
stops.
Data integrity
Implementing data integrity in messages
When you use TLS, your choice of CipherSpec determines the level of data integrity in the enterprise.
If you use the IBM MQ Advanced Message Service (AMS) you can specify the integrity for a unique
message.
Implementing data integrity in message exits
A message can be digitally signed by a message exit at the sending end of a channel. The digital
signature can then be checked by a message exit at the receiving end of a channel to detect whether
the message has been deliberately modified.
Further information
See the section on “Enabling CipherSpecs” on page 389 for more information on ensuring data integrity.
Related tasks
Connecting two queue managers using TLS
Connecting a client to a queue manager securely
Auditing
You can check for security intrusions, or attempted intrusions, by using event messages. You can also
check the security of your system by using the IBM MQ Explorer.
To detect attempts to perform unauthorized actions such as connecting to a queue manager or put
a message on a queue, inspect the event messages produced by your queue managers, particularly
authority event messages. For more information about queue manager event messages, see Queue
manager events, and for more information about event monitoring in general, see Event monitoring.
412 Securing IBM MQ
About this task
Prevent selected queue managers from sending messages to your queue manager:
Procedure
1. Define a channel security exit program on the CLUSRCVR channel definition.
2. Write a program that authenticates queue managers trying to send messages on your cluster-receiver
channel and denies them access if they are not authorized.
What to do next
Channel security exit programs are called at MCA initiation and termination.
Procedure
1. To prevent certain queue managers from putting messages on a queue, use the security facilities
available on your platform.
For example:
• RACF or other external security managers on IBM MQ for z/OS
• The object authority manager (OAM) on other platforms.
2. Use the put authority, PUTAUT, attribute on the CLUSRCVR channel definition.
The PUTAUT attribute allows you to specify what user identifiers are to be used to establish authority
to put a message to a queue.
The options on the PUTAUT attribute are:
DEF
Use the default user ID. On z/OS, the check might involve using both the user ID received from the
network and that derived from MCAUSER.
CTX
Use the user ID in the context information associated with the message. On z/OS the check might
involve using either the user ID received from the network, or that derived from MCAUSER, or both.
Use this option if the link is trusted and authenticated.
ONLYMCA ( z/OS only)
As for DEF, but any user ID received from the network is not used. Use this option if the link is not
trusted. You want to allow only a specific set of actions on it, which are defined for the MCAUSER.
ALTMCA ( z/OS only)
As for CTX, but any user ID received from the network is not used.
Procedure
• For z/OS, issue the following commands:
• For UNIX, Linux, and Windows systems, issue the following commands:
The user can put messages only to the specified cluster queue, and no other cluster queues.
The variable names have the following meanings:
QMgrName
The name of the queue manager. On z/OS, this value can also be the name of a queue sharing
group.
GroupName
The name of the group to be granted access.
QueueName
Name of the queue or generic profile for which to change authorizations.
What to do next
If you specify a reply-to queue when you put a message on a cluster queue, the consuming application
must have authority to send the reply. Set this authority by following the instructions in “Granting
authority to put messages to a remote cluster queue” on page 368.
Related concepts
Security stanza in qm.ini
414 Securing IBM MQ
Preventing queue managers joining a cluster
If a rogue queue manager joins a cluster it is difficult to prevent it receiving messages you do not want it
to receive.
Procedure
If you want to ensure that only certain authorized queue managers join a cluster you have a choice of
three techniques:
• Using channel authentication records you can block the cluster channel connection based on: the
remote IP address, the remote queue manager name, or the TLS Distinguished Name provided by the
remote system.
• Write an exit program to prevent unauthorized queue managers from writing to
SYSTEM.CLUSTER.COMMAND.QUEUE. Do not restrict access to SYSTEM.CLUSTER.COMMAND.QUEUE
such that no queue manager can write to it, or you would prevent any queue manager from joining the
cluster.
• A security exit program on the CLUSRCVR channel definition.
Procedure
1. You must define a security exit on both the cluster-sender end and the cluster-receiver end of a
channel.
The initial connection must be made with a security-exit handshake, even though the security exit
name is sent over from the cluster-receiver definition.
2. Validate the PartnerName in the MQCXP structure in the security exit.
The exit must allow the channel to start only if the partner queue manager is authorized
3. Design the security exit on the cluster-receiver definition to be receiver initiated.
4. If you design it as sender initiated, an unauthorized queue manager without a security exit can join the
cluster because no security checks are performed.
Not until the channel is stopped and restarted can the SCYEXIT name be sent over from the cluster-
receiver definition and full security checks made.
5. To view the cluster-sender channel definition that is currently in use, use the command:
The command displays the attributes that have been sent across from the cluster-receiver definition.
6. To view the original definition, use the command:
7. You might need to define a channel auto-definition exit, CHADEXIT, on the cluster-sender queue
manager, if the queue managers are on different platforms.
z/OS
The security-exit load module must be in the data set specified in the CSQXLIB DD statement of
the channel-initiator address-space procedure.
Procedure
1. On a full repository queue manager, issue the command:
Results
The queue manager that is force removed does not change; its local cluster definitions show it to be in the
cluster. The definitions at all other queue managers do not show it in the cluster.
416 Securing IBM MQ
the cluster. It can now receive messages that it is not authorized to receive. To prevent a queue manager
receiving messages, use one of the following options given in the procedure.
Procedure
• A channel exit program on each cluster-sender channel. The exit program uses the connection name to
determine the suitability of the destination queue manager to be sent the messages.
• A cluster workload exit program, which uses the destination records to determine the suitability of the
destination queue and queue manager to be sent the messages.
Procedure
1. Switch the CLUSRCVR channels to TLS in any order you like, changing one CLUSRCVR at a time, and
allow the changes to flow through the cluster before changing the next.
Important: Make sure that you do not change the reverse path until the changes for the current
channel have been distributed throughout the cluster.
2. Optional: Switch all manual CLUSSDR channels to TLS.
This does not have any effect on the operation of the cluster, unless you use the REFRESH CLUSTER
command with the REPOS(YES) option.
Note: For large clusters, use of the REFRESH CLUSTER command can be disruptive to the cluster
while it is in progress, and again at 27 day intervals thereafter when the cluster objects automatically
send status updates to all interested queue managers. See Refreshing in a large cluster can affect
performance and availability of the cluster.
3. Use the DISPLAY CLUSQMGR command to ensure that the new security configuration has been
propagated throughout the cluster.
4. Restart the channels to use TLS and run REFRESH SECURITY (SSL).
Related concepts
“Enabling CipherSpecs” on page 389
Enable a CipherSpec by using the SSLCIPH parameter in either the DEFINE CHANNEL MQSC command or
the ALTER CHANNEL MQSC command.
“Digital certificates and CipherSpec compatibility in IBM MQ” on page 41
418 Securing IBM MQ
This topic provides information on how to choose appropriate CipherSpecs and digital certificates for your
security policy, by outlining the relationship between CipherSpecs and digital certificates in IBM MQ.
Related information
Clustering: Using REFRESH CLUSTER best practices
Procedure
1. Set the value of the SSLCIPH parameter to ' ', an empty string in a single quotation mark
, or *NONE on IBM i .
You can turn off TLS on the cluster receiver channels in any order you like.
Note that the changes flow in the opposite direction over channels on which you leave TLS active.
2. Check that the new value is reflected in all the other queue managers by using the command DISPLAY
CLUSQMGR(*) ALL.
3. Turn off TLS on all manual cluster sender channels.
This does not have any effect on the operation of the cluster, unless you use the REFRESH CLUSTER
command with the REPOS(YES) option.
For large clusters, use of the REFRESH CLUSTER command can be disruptive to the cluster while
it is in progress, and again at regular intervals thereafter, when the cluster objects automatically
send status updates to all interested queue managers. See Refreshing in a large cluster can affect
performance and availability of the cluster for more information.
4. Stop and restart the cluster sender channels.
Publish/subscribe security
The components and interactions that are involved in publish/subscribe are described as an introduction
to the more detailed explanations and examples that follow.
There are a number of components involved in publishing and subscribing to a topic. Some of the security
relationships between them are illustrated in Figure 22 on page 420 and described in the following
example.
Topics
Topics are identified by topic strings, and are typically organized into trees, see Topic trees. You need
to associate a topic with a topic object to control access to the topic. “Topic security model” on page
422 explains how you secure topics using topic objects.
Administrative topic objects
You can control who has access to a topic, and for what purpose, by using the command setmqaut
with a list of administrative topic objects. See the examples, “Grant access to a user to subscribe to a
topic” on page 427 and “Grant access to a user to publish to a topic” on page 434. For
controlling access to topic objects on z/OS, see Profiles for topic security.
Subscriptions
Subscribe to one or more topics by creating a subscription supplying a topic string, which can include
wildcards, to match against the topic strings of publications. For further details, see:
Subscribe using a topic object
“Subscribing using the topic object name” on page 423
Subscribe using a topic
“Subscribing using a topic string where the topic node does not exist” on page 424
Subscribe using a topic with wildcards
“Subscribing using a topic string that contains wildcard characters” on page 424
420 Securing IBM MQ
A subscription contains information about the identity of the subscriber and the identity of the
destination queue on to which the publications are to be placed. It also contains information about
how the publication is to be placed on the destination queue.
As well as defining which subscribers have the authority to subscribe to certain topics, you can restrict
subscriptions to being used by an individual subscriber. You can also control what information about
the subscriber is used by the queue manager when publications are placed on to the destination
queue. See “Subscription security” on page 439.
Queues
The destination queue is an important queue to secure. It is local to the subscriber, and publications
that matched the subscription are placed onto it. You need to consider access to the destination
queue from two perspectives:
1. Putting a publication on to the destination queue.
2. Getting the publication off the destination queue.
The queue manager puts a publication onto the destination queue using an identity provided by the
subscriber. The subscriber, or a program that has been delegated the task of getting publications,
takes messages off the queue. See “Authority to destination queues” on page 424.
There are no topic object aliases, but you can use an alias queue as the alias for a topic object. If
you do so, as well as checking authority to use the topic for publish or subscribe, the queue manager
checks authority to use the queue.
“Publish/subscribe security between queue managers” on page 441
Your permission to publish or subscribe to a topic is checked on the local queue manager using
local identities and authorizations. Authorization does not depend on whether the topic is defined or
not, nor where it is defined. Consequently, you need to perform topic authorization on every queue
manager in a cluster when clustered topics are used.
Note: The security model for topics differs from the security model for queues. You can achieve the
same result for queues by defining a queue alias locally for every clustered queue.
Queue managers exchange subscriptions in a cluster. In most IBM MQ cluster configurations,
channels are configured with PUTAUT=DEF to place messages onto target queues using the authority
of the channel process. You can modify the channel configuration to use PUTAUT=CTX to require
the subscribing user to have authority to propagate a subscription onto another queue manager in a
cluster.
“Publish/subscribe security between queue managers” on page 441 describes how to change your
channel definitions to control who is allowed to propagate subscriptions onto other servers in the
cluster.
Authorization
You can apply authorization to topic objects, just like queues and other objects. There are three
authorization operations, pub, sub, and resume that you can apply only to topics. The details are
described in Specifying authorities for different object types.
Function calls
In publish and subscribe programs, like in queued programs, authorization checks are made when
objects are opened, created, changed, or deleted. Checks are not made when MQPUT or MQGET MQI
calls are made to put and get publications.
To publish a topic, perform an MQOPEN on the topic, which performs the authorization checks. Publish
messages to the topic handle using the MQPUT command, which performs no authorization checks.
To subscribe to a topic, typically you perform an MQSUB command to create or resume the
subscription, and also to open the destination queue to receive publications. Alternatively, perform a
separate MQOPEN to open the destination queue, and then perform the MQSUB to create or resume the
subscription.
422 Securing IBM MQ
Table 73. Example topic object authorities (continued)
Authorities - not
Topic name Topic string z/OS z/OS authorities
SECCOMBN SEC/COMB/BAD None None
HLQ.SUBSCRIBE.SECCOMBN
The topic tree with the associated security attributes at each node can be represented as follows:
Subscribing using a topic string where the topic node does not exist
Consider the case of an application subscribing, specifying a topic string representing a topic node that
does not currently exist in the topic tree. The authority check is performed as outlined in the previous
section. The check starts with the parent node of that which is represented by the topic string. If the
authority is granted, a new node representing the topic string is created in the topic tree.
For example, usr1 tries to subscribe to a topic SEC/GOOD/NEW. Authority is granted as usr1 has access
to the parent node SEC/GOOD. A new topic node is created in the tree as the following diagram shows.
The new topic node is not a topic object it does not have any security attributes associated with it directly;
the attributes are inherited from its parent.
424 Securing IBM MQ
• The subscription does not exist.
• Create is specified.
If hobj is blank, and you are altering or resuming an existing subscription, the previously provided
destination queue could be either managed or unmanaged.
The application or user making the MQSUB request must have the authority to put messages to the
destination queue it has provided; in effect authority to have published messages put on that queue. The
authority check follows the existing rules for queue security checking.
The security checking includes alternate user ID and context security checks where required. To be able
to set any of the Identity context fields you must specify the MQSO_SET_IDENTITY_CONTEXT option as
well as the MQSO_CREATE or MQSO_ALTER option. You cannot set any of the Identity context fields on an
MQSO_RESUME request.
If the destination is a managed queue, no security checks are performed against the managed
destination. If you are allowed to subscribe to a topic it is assumed that you can use managed
destinations.
Publishing using the topic name or topic string where the topic node exists
The security model for publishing is the same as that for subscribing, with the exception of wildcards.
Publications do not contain wildcards; so there is no case of a topic string containing wildcards to
consider.
The authorities to publish and subscribe are distinct. A user or group can have the authority to do one
without necessarily being able to do the other.
When publishing to a topic object by specifying either the MQCHAR48 name or the topic string, the
corresponding node in the topic tree is located. If the security attributes associated with the topic node
indicates that the user has authority to publish, then access is granted.
If access is not granted, the parent node in the tree determines if the user has authority to publish at that
level. If so, then access is granted. If not, the recursion continues until a node is located which grants
publish authority to the user. The recursion stops when the root node is considered without authority
having been granted. In the latter case, access is denied.
In short, if any node in the path grants authority to publish to that user or application, the publisher is
allowed to publish at that node or anywhere below that node in the topic tree.
Publishing using the topic name or topic string where the topic node does not exist
As with the subscribe operation, when an application publishes, specifying a topic string representing
a topic node that does not currently exist in the topic tree, the authority check is performed starting
with the parent of the node represented by the topic string. If the authority is granted, a new node
representing the topic string is created in the topic tree.
Closing a subscription
There is additional security checking if you close a subscription using the MQCO_REMOVE_SUB option if
you did not create the subscription under this handle.
Table 74. User IDs used for security checks for commands
Command SUBUSER SUBUSER SUBUSER
specified specified not
and blank and specified
completed
Use the Use the user
administrato ID from the
r ID LIKE
subscription
Use the Use the.DEFAULT.SU
administrato user IDB
r ID from thesubscription
SYSTEM- if blank,
use the
administrato
r ID
Use the Use the user
administrato ID from the
r ID existing
subscription
The only security check performed when deleting subscriptions using the DELETE SUB command is the
command security check.
426 Securing IBM MQ
Example publish/subscribe security setup
This section describes a scenario that has access control set up on topics in a way that allows the security
control to be applied as required.
Procedure
1. Issue the MQSC command DEF TOPIC(FRUIT) TOPICSTR('Price/Fruit').
2. Grant access as follows:
• z/OS :
Grant access to USER1 to subscribe to topic "Price/Fruit" by granting the user access to the
hlq.SUBSCRIBE.FRUIT profile. Do this, using the following RACF commands:
• Other platforms:
Grant access to USER1 to subscribe to topic "Price/Fruit" by granting the user access to the
FRUIT object. Do this, using the authorization command for the platform:
IBM i
Results
When USER1 attempts to subscribe to topic "Price/Fruit" the result is success.
When USER2 attempts to subscribe to topic "Price/Fruit" the result is failure with an
MQRC_NOT_AUTHORIZED message, together with:
• On z/OS, the following messages seen on the console that show the full security path
through the topic tree that has been attempted:
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_SUB_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit"
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_SUB_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit"
Note that this is an illustration of what you see; not all the fields.
428 Securing IBM MQ
Figure 24. Example of granting access to a topic within a topic tree
Table 76. Access requirements for example topics and topic objects
Topic Subscribe Topic object
access required
Price No user None
Price/Fruit USER1 FRUIT
Price/Fruit/ USER1
Apples
Price/Fruit/ USER1
Oranges
In the previous task USER1 was granted access to subscribe to topic "Price/Fruit" by granting it
access to the hlq.SUBSCRIBE.FRUIT profile on z/OS and subscribe access to the FRUIT profile on
other platforms. This single profile also grants USER1 access to subscribe to "Price/Fruit/Apples",
"Price/Fruit/Oranges" and "Price/Fruit/#".
When USER1 attempts to subscribe to topic "Price/Fruit/Apples" the result is success.
When USER2 attempts to subscribe to topic "Price/Fruit/Apples" the result is failure with an
MQRC_NOT_AUTHORIZED message, together with:
• On z/OS, the following messages seen on the console that show the full security path through the topic
tree that has been attempted:
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_SUB_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit/Apples"
Grant another user access to subscribe to only the topic deeper within the
tree
This topic is the third in a list of tasks that tells you how to grant access to subscribe to topics by more
than one user.
Table 77. Access requirements for example topics and topic objects
Topic Subscribe Topic object
access required
Price No user None
Price/Fruit USER1 FRUIT
Price/Fruit/ USER1 and APPLE
Apples USER2
Price/Fruit/ USER1
Oranges
Procedure
1. Issue the MQSC command DEF TOPIC(APPLE) TOPICSTR('Price/Fruit/Apples').
2. Grant access as follows:
• z/OS :
430 Securing IBM MQ
In the previous task USER1 was granted access to subscribe to topic "Price/Fruit/Apples" by
granting the user access to the hlq.SUBSCRIBE.FRUIT profile.
This single profile also granted USER1 access to subscribe to "Price/Fruit/Oranges"
"Price/Fruit/#" and this access remains even with the addition of the new topic object and
the profiles associated with it.
Grant access to USER2 to subscribe to topic "Price/Fruit/Apples" by granting the user access
to the hlq.SUBSCRIBE.APPLE profile. Do this, using the following RACF commands:
• Other platforms:
In the previous task USER1 was granted access to subscribe to topic "Price/Fruit/Apples" by
granting the user subscribe access to the FRUIT profile.
This single profile also granted USER1 access to subscribe to "Price/Fruit/Oranges" and
"Price/Fruit/#", and this access remains even with the addition of the new topic object and the
profiles associated with it.
Grant access to USER2 to subscribe to topic "Price/Fruit/Apples" by granting the user
subscribe access to the APPLE profile. Do this, using the authorization command for the platform:
IBM i
Results
On z/OS, when USER1 attempts to subscribe to topic "Price/Fruit/Apples" the first security check
on the hlq.SUBSCRIBE.APPLE profile fails, but on moving up the tree the hlq.SUBSCRIBE.FRUIT
profile allows USER1 to subscribe, so the subscription succeeds and no return code is sent to the MQSUB
call. However, a RACF ICH message is generated for the first check:
When USER2 attempts to subscribe to topic "Price/Fruit/Apples" the result is success because the
security check passes on the first profile.
When USER2 attempts to subscribe to topic "Price/Fruit/Oranges" the result is failure with an
MQRC_NOT_AUTHORIZED message, together with:
• On z/OS, the following messages seen on the console that show the full security path
through the topic tree that has been attempted:
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_SUB_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit/Oranges"
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_SUB_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit/Oranges"
The disadvantage of this setup is that, on z/OS, you receive additional ICH messages on the console. You
can avoid this if you secure the topic tree in a different manner.
Procedure
1. Issue the MQSC command DEF TOPIC(ORANGE) TOPICSTR('Price/Fruit/Oranges').
2. Grant access as follows:
• z/OS :
432 Securing IBM MQ
Define a new profile and add access to that profile, and the existing profiles. Do this, using the
following RACF commands:
• Other platforms:
Set up the equivalent access by using the authorization commands for the platform:
IBM i
Results
On z/OS, when USER1 attempts to subscribe to topic "Price/Fruit/Apples" the first security check
on the hlq.SUBSCRIBE.APPLE profile succeeds.
Similarly, when USER2 attempts to subscribe to topic "Price/Fruit/Apples" the result is success
because the security check passes on the first profile.
When USER2 attempts to subscribe to topic "Price/Fruit/Oranges" the result is failure with an
MQRC_NOT_AUTHORIZED message, together with:
• On z/OS, the following messages seen on the console that show the full security path
through the topic tree that has been attempted:
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_SUB_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames ORANGE, FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit/Oranges"
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_SUB_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames ORANGE, FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit/Oranges"
Procedure
1. Issue the MQSC command DEF TOPIC(VEG) TOPICSTR('Price/Vegetables').
2. Grant access as follows:
• z/OS :
Grant access to USER1 to publish to topic "Price/Vegetables" by granting the user access to
the hlq.PUBLISH.VEG profile. Do this, using the following RACF commands:
• Other platforms:
Grant access to USER1 to publish to topic "Price/Vegetables" by granting the user access to
the VEG profile. Do this, using the authorization command for the platform:
434 Securing IBM MQ
IBM i
Results
When USER1 attempts to publish to topic "Price/Vegetables" the result is success; that is, the
MQOPEN call succeeds.
When USER2 attempts to publish to topic "Price/Vegetables" the MQOPEN call fails with an
MQRC_NOT_AUTHORIZED message, together with:
• On z/OS, the following messages seen on the console that show the full security path
through the topic tree that has been attempted:
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_OPEN_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames VEG, SYSTEM.BASE.TOPIC
TopicString "Price/Vegetables"
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_OPEN_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames VEG, SYSTEM.BASE.TOPIC
TopicString "Price/Vegetables"
Note that this is an illustration of what you see; not all the fields.
In the previous task USER1 was granted access to publish topic "Price/Vegetables/Potatoes" by
granting it access to the hlq.PUBLISH.VEG profile on z/OS or publish access to the VEG profile on other
platforms. This single profile also grants USER1 access to publish at "Price/Vegetables/Onions".
When USER1 attempts to publish at topic "Price/Vegetables/Potatoes" the result is success; that
is the MQOPEN call succeeds.
When USER2 attempts to subscribe to topic "Price/Vegetables/Potatoes" the result is failure; that
is, the MQOPEN call fails with an MQRC_NOT_AUTHORIZED message, together with:
• On z/OS, the following messages seen on the console that show the full security path through the topic
tree that has been attempted:
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_OPEN_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames VEG, SYSTEM.BASE.TOPIC
TopicString "Price/Vegetables/Potatoes"
436 Securing IBM MQ
• The event message you receive on other platforms is similar to the one received in the previous task,
but the actual topic string is different.
Procedure
Grant access as follows:
• z/OS :
In an earlier task USER1 was granted access to subscribe to topic "Price/Fruit" by granting the
user access to the hlq.SUBSCRIBE.FRUIT profile.
• Other platforms:
Grant access to USER1 to publish to topic "Price/Fruit" by granting the user publish access to the
FRUIT profile. Do this, using the authorization command for the platform:
IBM i
Results
On z/OS, when USER1 attempts to publish to topic "Price/Fruit" the security check on the MQOPEN
call passes.
When USER2 attempts to publish at topic "Price/Fruit" the result is failure with an
MQRC_NOT_AUTHORIZED message, together with:
• On z/OS, the following messages seen on the console that show the full security path
through the topic tree that has been attempted:
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_OPEN_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit"
MQRC_NOT_AUTHORIZED
ReasonQualifier MQRQ_OPEN_NOT_AUTHORIZED
UserIdentifier USER2
AdminTopicNames FRUIT, SYSTEM.BASE.TOPIC
TopicString "Price/Fruit"
Following the complete set of these tasks, gives USER1 and USER2 the following access authorities for
publish and subscribe to the topics listed:
438 Securing IBM MQ
Table 81. Complete list of access authorities resulting from security examples
Topic Subscribe Publish Topic object
access access
required required
Price No user No user None
Price/Fruit USER1 USER1 FRUIT
Price/Fruit/ USER1 and APPLE
Apples USER2
Price/Fruit/ USER1 ORANGE
Oranges
Price/ USER1 VEG
Vegetables
Price/
Vegetables/
Potatoes
Price/
Vegetables/
Onions
Where you have different requirements for security access at different levels within the topic tree, careful
planning ensures that you do not receive extraneous security warnings on the z/OS console log. Setting up
security at the correct level within the tree avoids misleading security messages.
Subscription security
MQSO_ALTERNATE_USER_AUTHORITY
The AlternateUserId field contains a user identifier to use to validate this MQSUB call. The call can
succeed only if this AlternateUserId is authorized to subscribe to the topic with the specified access
options, regardless of whether the user identifier under which the application is running is authorized to
do so.
MQSO_SET_IDENTITY_CONTEXT
The subscription is to use the accounting token and application identity data supplied in the
PubAccountingToken and PubApplIdentityData fields.
If this option is specified, the same authorization check is carried out as if the destination queue was
accessed using an MQOPEN call with MQOO_SET_IDENTITY_CONTEXT, except in the case where the
MQSO_MANAGED option is also used in which case there is no authorization check on the destination
queue.
If this option is not specified, the publications sent to this subscriber have default context information
associated with them as follows:
This option is only valid with MQSO_CREATE and MQSO_ALTER. If used with MQSO_RESUME, the
PubAccountingToken and PubApplIdentityData fields are ignored, so this option has no effect.
If a subscription is altered without using this option where previously the subscription had supplied
identity context information, default context information is generated for the altered subscription.
If a subscription allowing different user IDs to use it with option MQSO_ANY_USERID, is resumed by a
different user ID, default identity context is generated for the new user ID now owning the subscription
and any subsequent publications are delivered containing the new identity context.
AlternateSecurityId
This is a security identifier that is passed with the AlternateUserId to the authorization service
to allow appropriate authorization checks to be performed. AlternateSecurityId is used only if
MQSO_ALTERNATE_USER_AUTHORITY is specified, and the AlternateUserId field is not entirely blank
up to the first null character or the end of the field.
MQSO_FIXED_USERID
When MQSO_FIXED_USERID is specified, the subscription can only be altered or resumed by a single
owning user ID. This user ID is the last user ID to alter the subscription that set this option, thereby
removing the MQSO_ANY_USERID option, or if no alters have taken place, it is the user ID that created the
subscription.
If an MQSUB verb refers to an existing subscription with MQSO_ANY_USERID set and alters the
subscription (using MQSO_ALTER) to use option MQSO_FIXED_USERID, the user ID of the subscription
is now fixed at this new user ID. The call succeeds only if the new user ID has authority to subscribe to the
topic.
If a user ID other than the one recorded as owning a subscription trys to resume or alter an
MQSO_FIXED_USERID subscription, the call will fail with MQRC_IDENTITY_MISMATCH. The owning user
ID of a subscription can be viewed using the DISPLAY SBSTATUS command.
If neither MQSO_ANY_USERID or MQSO_FIXED_USERID is specified, the default is MQSO_FIXED_USERID.
440 Securing IBM MQ
Publish/subscribe security between queue managers
Publish/subscribe internal messages, such as proxy subscriptions and publications, are put to publish/
subscribe system queues using normal channel security rules. The information and diagrams in this topic
highlight the various processes and user IDs involved in the delivery of these messages.
On a system where little has been considered regarding security, the distributed publish/subscribe
processes are likely to be running under a user ID in the mqm group, the MCAUSER parameter on a
channel is blank (the default), and messages are delivered to the various system queues as required.
The unsecured system makes it easy to set up a proof of concept to demonstrate distributed publish/
subscribe.
On a system where security is more seriously considered, these internal messages are subject to the
same security controls as any message going over the channel.
If the channel is set up with a non-blank MCAUSER and a PUTAUT value specifying that MCAUSER must
be checked, then the MCAUSER in question must be granted access to SYSTEM.INTER.QMGR.* queues.
If there are multiple different remote queue managers, with channels running under different MCAUSER
IDs, all those user IDs need to be granted access to the SYSTEM.INTER.QMGR.* queues. Channels
running under different MCAUSER IDs might occur, for example, when multiple hierarchical connections
are configured on a single queue manager.
If the channel is set up with a PUTAUT value specifying that the context of the message is used, then
access to the SYSTEM.INTER.QMGR.* queues are checked based on the user ID inside the internal
message. Because all these messages are put with the user ID of the distributed publish/subscribe agent
from the queue manager that is sending the internal message, or publication message (see Figure 31 on
page 442 ), it is not too large a set of user IDs to grant access to the various system queues (one per
remote queue manager), if you want to set up your distributed publish/subscribe security in this way.
It still has all the same issues that channel context security always has; that of the different user ID
domains and the fact that the user ID in the message might not be defined on the receiving system.
However, it is a perfectly acceptable way to run if required.
442 Securing IBM MQ
System queue security provides a list of queues and the access that is required to securely
set up your distributed publish/subscribe environment. If any internal messages or publications fail to
be put due to security violations, the channel writes a message to the log in the normal manner and the
messages can be sent to the dead-letter queue according to normal channel error processing.
All inter-queue manager messaging for the purposes of distributed publish/subscribe runs using normal
channel security.
For information about restricting publications and proxy subscriptions at the topic level, see Publish/
subscribe security.
Create and grant access to the 'qmqm' user ID if hierarchically attached to a queue manager on IBM i for
Queue Managers on Windows, UNIX, Linux, and z/OS platforms.
Create and grant access to the 'mqm' user ID if hierarchically attached to a queue manager on Windows,
UNIX, or Linux for Queue Managers on IBM i and z/OS platforms.
Create and grant user access to the z/OS channel initiator address space user ID if hierarchically attached
to a queue manager on z/OS for Queue Managers on Windows, UNIX, Linux, and IBM i platforms.
User IDs can be case sensitive. The originating queue manager (if IBM i, Windows, UNIX, or Linux
systems) forces the user ID to be all uppercase. The receiving queue manager (if Windows, UNIX or
Linux systems) forces the user ID to be all lowercase. Therefore, all user IDs created on UNIX and Linux
systems must be created in their lowercase form. If a message exit has been installed, forcing the user ID
into uppercase or lowercase does not take place. Care must be taken to understand how the message exit
processes the user ID.
To avoid potential problems with conversion of user IDs:
• On UNIX, Linux, and Windows systems, ensure the user IDs are specified in lowercase.
• On IBM i and z/OS, ensure the user IDs are specified in uppercase.
• Local OS registry
• System Authorization Facility interface on z/OS
• Any other registry type supported by WebSphere Application Server Liberty
Roles can be assigned to IBM MQ Console users, and to REST API users to determine what level of access
they are granted to IBM MQ objects.
After a user is assigned a role, there are a number of methods that can be used to authenticate the user.
With the IBM MQ Console, users can log in with a user name and password, or can use client certificate
authentication. With the REST API, users can use basic HTTP authentication, token based authentication,
or client certificate authentication.
Procedure
1. Define the user registry to authenticate users, and assign each user or group a role to authorize the
users and groups to use the IBM MQ Console or REST API. For more information, see “Configuring
users and roles” on page 445
2. Choose how users of the IBM MQ Console authenticate with the mqweb server. You do not have to use
the same method for all users:
• Let users authenticate by using token authentication. In this case, a user enters a user ID and
password at the IBM MQ Console log in screen. An LTPA token is generated that enables the user
to remain logged in and authorized for a set amount of time. No further configuration is required
to use this authentication option, but you can optionally configure the expiry time for the LTPA
token. For more information, see Configuring the LTPA token expiry interval.
• Let users authenticate by using client certificates. In this case, the user does not use a user ID
or password to log in to the IBM MQ Console, but uses the client certificate instead. For more
information, see “Using client certificate authentication with the REST API and IBM MQ Console” on
page 450.
3.
Choose how users of the REST API authenticate with the mqweb server. You do not have to use the
same method for all users:
• Let users authenticate by using HTTP basic authentication. In this case, a user name and
password is encoded, but not encrypted, and sent with each REST API request to authenticate
and authorize the user for that request. In order for this authentication to be secure, you must use
a secure connection. That is, you must use HTTPS. For more information, see “Using HTTP basic
authentication with the REST API” on page 454.
• Let users authenticate by using token authentication. In this case, a user provides a user ID
and password to the REST API login resource with the HTTP POST method. An LTPA token is
generated that enables the user to remain logged in and authorized for a set amount of time. In
444 Securing IBM MQ
order for this authentication to be secure, you must use a secure connection. That is, you must use
HTTPS. For more information, see Configuring the LTPA token expiry interval.
• Let users authenticate by using client certificates. In this case, the user does not use a user ID or
password to log in to the REST API, but uses the client certificate instead. For more information,
see “Using client certificate authentication with the REST API and IBM MQ Console” on page 450.
4.
Optional: Configure Cross Origin Resource Sharing for the REST API.
By default, a web browser does not allow scripts, such as JavaScript, to invoke the REST API when
the script is not from the same origin as the REST API. That is, cross-origin requests are not enabled.
You can configure Cross Origin Resource Sharing (CORS) to allow cross-origin requests from specified
URLs. For more information, see “Configuring CORS for the REST API” on page 460.
For information about MFT roles, and an example, see “Configuring MFT REST API security”
on page 470
Procedure
1. Ensure that you are a privileged user.
2. Copy one of the sample XML files from one of the following paths:
•
local_os_registry.xml
This sample configures use of local operating system users and groups.
Members of the 'mqm' group are granted MQWebAdmin role and all other authenticated users
are granted an MQWebUser role.
The user names and passwords in the operating system registry are used to authenticate and
authorize users of the IBM MQ Console and the REST API.
• ldap_registry.xml
This sample defines a connection to an LDAP registry from which user and group information is
retrieved.
The user names and passwords in the LDAP registry are used to authenticate and authorize use
of the IBM MQ Console and the REST API.
zos_saf_registry.xml
This sample configures use of the System authorization facility (SAF) interface on z/OS.
RACF, or other security product, profiles are used to grant users and groups access to roles.
The user names and passwords in the RACF database are used to authenticate and authorize
users of the IBM MQ Console and REST API.
3. Place the sample file in the appropriate directory:
•
On UNIX, Linux, and Windows: MQ_DATA_DIRECTORY/web/installations/
installationName/servers/mqweb
•
On z/OS: WLP_user_directory/servers/mqweb
where WLP_user_directory is the directory that was specified when the crtmqweb.sh script ran to
create the mqweb server definition.
4. Optional: If you changed any configuration settings in mqwebuser.xml, copy them into the sample
file.
5. Delete the existing mqwebuser.xml file and rename the sample file to mqwebuser.xml.
6. Edit the new mqwebuser.xml file to add users and groups as necessary:
• For security setups based off the basic_registry.xml sample, add users and groups within the
basicRegistry tags.
Be aware that any user with the MQWebUser role can perform only the operations that the user ID is
granted to perform on the queue manager. Therefore, the user ID defined in the registry must have
an identical user ID on the system on which IBM MQ is installed. These user IDs must be in the
same case, or the mapping between the user IDs can fail.
For more information about configuring basic user registries, see Configuring a basic user registry
for Liberty in the WebSphere Application Server Liberty documentation.
•
For security setups based off the local_os_registry.xml sample, the registry accesses the
local operating system to validate passwords, identify users and calculate group membership.
446 Securing IBM MQ
This type of user registry is enabled by adding <feature>localOSAuthenticationMQ-1.0</
feature> to the featureManager section of the mqwebuser.xml file.
For client certificate authentication with the local OS authentication feature, the user identity is the
common name (CN) from the distinguished name (DN) of the client certificate. If the user identity
does not exist as an operating system user, client certificate login will fail and fallback to password
based authentication.
• For security setups based off the ldap_registry.xml sample, change the LDAP registry settings
within the ldapRegistry and idsLdapFilterProperties tags.
Be aware that any user with the MQWebUser role can perform only the operations that the user ID is
granted to perform on the queue manager. Therefore, the user ID defined on the LDAP server, must
have an identical user ID on the system on which IBM MQ is installed. These user IDs must be in
the same case, or the mapping between the user IDs can fail.
For more information about configuring LDAP registries, see Configuring LDAP user registries in
Liberty in the WebSphere Application Server Liberty documentation.
7. Edit the new mqwebuser.xml file to assign roles to users and groups.
There are three roles available that authorize users and groups to use the IBM MQ Console, and the
REST API. Each role grants a different level of access. For more information, see “Roles on the IBM MQ
Console and REST API” on page 449.
• To assign roles and grant access to the IBM MQ Console, add your users and groups
between the appropriate security-role tags within the <enterpriseApplication
id="com.ibm.mq.console"> tags.
•
To assign roles and grant access to the REST API, add your users and groups
between the appropriate security-role tags within the <enterpriseApplication
id="com.ibm.mq.rest"> tags.
For help with the format of the user and group information within the security-role tags, see the
example.
8. If you provided passwords for users in mqwebuser.xml, you should encode these passwords,
to make them more secure, by using the securityUtility encoding command provided by
WebSphere Application Server Liberty. For more information, see Liberty:securityUtility command in
the WebSphere Application Server Liberty product documentation.
Example
In the following example, the group MQWebAdminGroup is granted access to the IBM MQ Console with
the role MQWebAdmin. The user, reader, is granted access with the role MQWebAdminRO, and the user
guest is granted access with the role MQWebUser:
<enterpriseApplication id="com.ibm.mq.console">
<application-bnd>
<security-role name="MQWebAdmin">
<group name="MQWebAdminGroup" realm="defaultRealm"/>
</security-role>
<security-role name="MQWebAdminRO">
<user name="reader" realm="defaultRealm"/>
</security-role>
<security-role name="MQWebUser">
<user name="guest" realm="defaultRealm"/>
</security-role>
</application-bnd>
</enterpriseApplication>
<enterpriseApplication id="com.ibm.mq.console">
<application-bnd>
<security-role name="MQWebAdmin">
<group name="MQAdmin" realm="defaultRealm"/>
</security-role>
<security-role name="MQWebAdminRO">
<user name="reader" realm="defaultRealm"/>
</security-role>
<security-role name="MQWebUser">
<user name="guest" realm="defaultRealm"/>
</security-role>
</application-bnd>
</enterpriseApplication>
<enterpriseApplication id="com.ibm.mq.rest">
<application-bnd>
<security-role name="MQWebAdmin">
<group name="MQAdmin" realm="defaultRealm"/>
</security-role>
<security-role name="MQWebUser">
<user name="user" realm="defaultRealm"/>
</security-role>
</application-bnd>
</enterpriseApplication>
What to do next
Choose how users authenticate:
IBM MQ Console authentication options
• Let users authenticate by using token authentication. In this case, a user enters a user ID and
password at the IBM MQ Console log in screen. An LTPA token is generated that enables the user
to remain logged in and authorized for a set amount of time. No further configuration is required
to use this authentication option, but you can optionally configure the expiry interval for the LTPA
token. For more information, see Configuring the LTPA token expiry interval.
• Let users authenticate by using client certificates. In this case, the user does not use a user ID
or password to log in to the IBM MQ Console, but uses the client certificate instead. For more
information, see “Using client certificate authentication with the REST API and IBM MQ Console” on
page 450.
448 Securing IBM MQ
Roles on the IBM MQ Console and REST API
When you authorize users and groups to use the IBM MQ Console or REST API, you must assign the
users and groups one of three roles: MQWebAdmin, MQWebAdminRO, and MQWebUser. Each role provides
different levels of privilege to access the IBM MQ Console and REST API, and determines the security
context that is used when an allowed operation is attempted.
Note: With the exception of the MQWebUser role, the user ID is not case sensitive. See “MQWebUser” on
page 449 for the specific requirements for this role.
MQWebAdmin
A user or group that is assigned this role can perform all operations, and operates under the security
context of the operating system user ID that is used to start the mqweb server.
MQWebAdminRO
This role gives read only access to the IBM MQ Console or REST API. A user or group that is assigned
this role can perform the following operations:
• Display and inquire operations on IBM MQ objects such as queues and channels.
• Browse messages on queues.
A user or group that is assigned this role operates under the security context of the operating system
user ID that is used to start the mqweb server.
MQWebUser
A user or group that is assigned this role can perform any operation that the user ID is granted to
perform on the queue manager. For example:
• Start and stop operations on IBM MQ objects such as channels.
• Define and set operations on IBM MQ objects such as queues and channels.
• Display and inquire operations on IBM MQ objects such as queues and channels.
A user or group that is assigned this role operates under the security context of the principal, and can
perform only the operations that the user ID is granted to perform on the queue manager.
Therefore, the user or group that is defined in the mqweb user registry must be given authority within
IBM MQ before that user can perform any operations. By using this role, you can finely control which
users have which type of access to specific IBM MQ resources when they use the IBM MQ Console
and REST API.
Note:
• The maximum length of a user ID that is assigned this role is 12 characters.
• The case of the user ID must be the same in the mqweb user registry and on the IBM MQ system.
If the case of the user ID is different, the user might be authenticated by the IBM MQ Console and
REST API but not authorized to use IBM MQ resources.
For more information about configuring users and groups to use these roles, see “Configuring users and
roles” on page 445.
Overlapping roles
A user or group can be assigned more than one role. When a user performs an operation in this situation,
the highest privilege role that is applicable to the operation is used. For example, if a user with the roles
MQWebAdminRO and MQWebUser performs an inquire queue operation, the MQWebAdminRO role is used
and the operation is attempted under the context of the system user ID that started the web server. If
that same user performs a define operation, the MQWebUser role is used, and the operation is attempted
under the context of the principal.
– local_os_registry.xml
– ldap_registry.xml
– zos_saf_registry.xml
• That you are using a UNIX, Linux, or Windows system.
• You are a privileged user.
Note: The following procedure outlines the steps necessary to use client certificates with the IBM MQ
Console and REST API. For developer convenience, the steps detail how to create and use self-signed
certificates. However, for production, use certificates that are obtained from a certificate authority.
Procedure
1. Start the mqweb server by entering the strmqweb command on the command line.
2. Create a client certificate:
a) Create a PKCS#12 keystore:
i) Open the IBM Key Management tool by entering the strmqikm command on the command line.
ii) From the Key Database File menu in the IBM Key Management tool, click New.
iii) Select PKCS12 from the Key database type list.
450 Securing IBM MQ
iv) Select a location to save the keystore, and enter an appropriate name in the File Name field. For
example, user.p12
v) Set a password when prompted.
b) Create the certificate, either by creating a self-signed certificate, or by obtaining a certificate from a
certificate authority:
• Create a self-signed certificate:
i) Click New Self-Signed.
ii) Enter user in the Key Label field.
iii) If you are using a basic user registry, enter the name of a user from your user registry in the
Common Name field. For example, mqadmin. For an LDAP user registry, make sure that the
distinguished name for the certificate matches the distinguished name in the LDAP registry.
iv) Click OK.
• Obtain a certificate from a certificate authority. The CA certificate must include the appropriate
user name within the common name (CN) of the distinguished name (DN) field:
i) Request a new certificate. From the Create menu, click New Certificate Request.
ii) In the Key Label field, enter the certificate label.
iii) If you are using a basic user registry, in the Common Name field, enter the user name of the
user that the certificate is for.
If you are using a local OS registry, the Common Name field must match the local OS user id.
For an LDAP user registry, make sure that the distinguished name for the certificate matches
the distinguished name in the LDAP registry.
iv) Type or select values for the remaining fields, as applicable.
v) Choose where to save the certificate request, and the filename for the certificate request,
then click OK.
vi) Send the certificate request file to a certificate authority (CA).
vii) When you have the certificate from the CA, open the IBM Key Management tool by entering
the strmqikm command on the command line.
viii) From the Key Database File menu in the IBM Key Management tool, click Open.
ix) Select the PKCS#12 keystore that holds the client certificate. For example, user.p12
x) Click Receive, select the appropriate certificate, and click OK.
3. Extract the public part of the client certificate:
a) Open the IBM Key Management tool by entering the strmqikm command on the command line.
b) From the Key Database File menu in the IBM Key Management tool, click Open.
c) Select the PKCS#12 keystore that holds the client certificate. For example, user.p12
d) Select the client certificate from the certificate list in the IBM Key Management tool.
e) Click Extract Certificate.
f) Select a location to save the certificate, and enter an appropriate file name in the Certificate file
name field. For example, user.arm.
4. Import the public part of the client certificate into the mqweb server trust keystore as a signer
certificate so that the server can validate the client certificate:
a) Create a trust.jks keystore for use by the mqweb server, if one does not already exist:
i) From the Key Database File menu in the IBM Key Management tool, click New.
ii) Select JKS from the Key database type list.
iii) Click Browse and navigate to: MQ_DATA_DIRECTORY/web/installations/
installationName/servers/mqweb/resources/security.
b) Check that the serverKeyAlias value matches the name of the server certificate. If you are using
the default server certificate, the value is correct.
c) Change the value for password for the defaultKeyStore to an encoded version of the password
for the key.jks keystore:
i) From the MQ_INSTALLATION_PATH/web/bin directory, enter the following command on the
command line:
ii) Place the output of this command in the password field for the defaultKeyStore.
d) Change the value for password for the defaultTrustStore to match the password for the
trust.jks keystore:
i) From the MQ_INSTALLATION_PATH/web/bin directory, enter the following command on the
command line:
ii) Place the output of this command in the password field for the defaultTrustStore.
e) Remove, or comment out, the:
<sslDefault sslRef="mqDefaultSSLConfig"/>
452 Securing IBM MQ
7. Stop the mqweb server by entering the endmqweb command on the command line.
8. Start the mqweb server by entering the strmqweb command on the command line.
9. Use the client certificate to authenticate:
• To use the client certificate with the IBM MQ Console, install the client certificate into the web
browser that is used to access the IBM MQ Console. For example, install the client certificate
user.p12 as a personal certificate.
• To use the client certificate with the REST API, provide the client certificate with each
REST request. When you use HTTP POST, PATCH, or DELETE methods, you must provide extra
authentication with the client certificate to prevent cross-site request forgery attacks. That is, the
extra authentication is used to confirm that the credentials that are being used to authenticate the
request are being used by the owner of the credentials.
This extra authentication is provided by the ibm-mq-rest-csrf-token HTTP header. The
required contents of this header varies depending on the version of IBM MQ.
For IBM MQ 9.0.4 and earlier, calculate the value of the ibm-mq-rest-csrf-token HTTP header
by:
a. Generating a CSRF token cookie, by submitting an HTTP GET request on the login REST API
resource. Use the client certificate to authenticate the request.
b. Setting the value of the ibm-mq-csrf-token header to the value of the CSRF token cookie,
csrfToken, that is returned by the request.
Note that you cannot use a cached version of the content of the cookie, because the content of
the cookie can change. You must use the latest value of the cookie for each request.
For IBM MQ 9.0.5 and later, set the value of the ibm-mq-csrf-token header to
anything including blank. The header needs to be set in the request, but its value is not checked.
Then, in both cases, submit the request.
Example
Important: In the example, not all cURL implementations support self signed certificates, so you must
use a curl that does.
The following cURL example shows how to create a new queue Q1, on queue manager QM1, with client
certificate authentication. The exact configuration of this cURL command depends on the libraries that
cURL was built against. The example is based on a Windows system, with cURL built against OpenSSL:
• From IBM MQ 9.0.5, you only need to issue a single HTTP request. Use the HTTP POST
method with the queue resource, authenticating with the client certificate and including the ibm-mq-
rest-csrf-token HTTP header with an arbitrary value. This value can be anything, or blank; it is not
checked by the mqweb server.
IBM MQ 9.0.5 and later:
• For IBM MQ 9.0.4 and earlier two HTTP requests are needed:
1. The first request generates the CSRF token cookie.
Use the HTTP GET method with the login resource, authenticating with the client certificate. The
CSRF token that is returned is stored within the cookiejar.txt file. The --cert-type1 flag
specifies that the certificate is a PKCS#12 certificate. The --cert flag specifies the location of the
<feature>basicAuthenticationMQ-1.0</feature>
Procedure
1. Concatenate the user name with a colon, and the password.
For example, a user name of admin, and a password of admin becomes the following string:
admin:admin
454 Securing IBM MQ
Authorization: Basic YWRtaW46YWRtaW4=
4.
When you use HTTP POST, PATCH, or DELETE methods, you must provide extra authentication, as well
as a user name and password.
This extra authentication is provided by the ibm-mq-rest-csrf-token HTTP header. The required
contents of this header varies depending on the version of IBM MQ.
For IBM MQ 9.0.4 and earlier, the value of the header is taken from a CSRF token cookie. To obtain this
cookie you need to perform the following procedure:
a) Generate a CSRF token cookie by submitting an HTTP GET request on the login REST API
resource. Use the basic user name and password authentication that is outlined in this procedure to
authenticate the request.
b) Put the contents of the CSRF token cookie, csrfToken, that is returned by the request in an extra
HTTP header as the header value. The header must be called ibm-mq-rest-csrf-token.
The content of the csrfToken cookie is used to confirm that the credentials that are being used to
authenticate the request are being used by the owner of the credentials. That is, the token is used
to prevent cross-site request forgery attacks.
You cannot use a cached version of the content of the cookie because the content of the cookie can
change. You must use the latest value of the cookie for each request.
From IBM MQ 9.0.5, the ibm-mq-rest-csrf-token HTTP header needs to be present in the
request; its value can be anything including blank.
5. Submit your REST request to IBM MQ with the appropriate headers.
Example
The following example shows how to create a new queue Q1, on queue manager QM1, with basic
authentication, on Windows systems. The example uses cURL:
• From IBM MQ 9.0.5, you only need to issue a single HTTP request. Use the HTTP POST
method with the queue resource, authenticating with basic authentication and including the ibm-mq-
rest-csrf-token HTTP header with an arbitrary value. This value can be anything, or blank; it is not
checked by the mqweb server.
• For IBM MQ 9.0.4 and earlier, two HTTP requests are needed:
1. The first request generates the CSRF token cookie.
Use the HTTP GET method with the login resource, authenticating with basic authentication. The
CSRF token that is returned is stored within the cookiejar.txt file. The -u flag specifies the user
name and password. The -c flag specifies the location of the file to store the token in:
Procedure
1. Log in a user:
a) Use the HTTP POST method on the login resource:
https://host:port/ibmmq/rest/v1/login
Include the user name and password in the body of the JSON request, in the following format:
{
"username" : name,
"password" : password
}
b) Store the LTPA token, LtpaToken2 that is returned from the request in the local cookie store.
2. Authenticate REST requests with the stored LTPA token, LtpaToken2, as a cookie with every request.
For requests that use the HTTP PUT, PATCH, or DELETE methods, include an ibm-mq-rest-csrf-
token header. The value of this header can be anything, including blank.
3. Log out a user:
a) Use the HTTP DELETE method on the login resource:
https://host:9443/ibmmq/rest/v1/login
456 Securing IBM MQ
You must provide the LTPA token, LtpaToken2, as a cookie to authenticate the request, and
include an ibm-mq-rest-csrf-token header. The value of this header can be anything, including
blank
b) Process the instruction to delete the LTPA token from the local cookie store.
Note: If the instruction is not processed, and the LTPA token remains in the local cookie store, then
the LTPA token can be used to authenticate future REST requests. That is, when the user attempts
to authenticate with the LTPA token after the session is ended, a new session is created that uses
the existing token.
Example
The following cURL example shows how to create a new queue Q1, on queue manager QM1, with token-
based authentication, on Windows systems:
• Log in and add the LTPA token, LtpaToken2, to the local cookie store. The user name and password
information are included in the JSON body. The -c flag specifies the location of the file to store the
token in:
• Create a queue. Use the HTTP POST method with the queue resource, authenticating with the LTPA
token. The LTPA token, LtpaToken2, is retrieved from the cookiejar.txt file by using the -b flag.
CSRF protection is provided by the presence of the ibm-mq-rest-csrf-token HTTP header:
• Log out and delete the LTPA token from the local cookie store. The LTPA token, LtpaToken2, is
retrieved from the cookiejar.txt file by using the -b flag. CSRF protection is provided by the
presence of the ibm-mq-rest-csrf-token HTTP header. The location of the cookiejar.txt file is
specified by the -c flag so that the LTPA token is deleted from the file:
What to do next
If both HTTP and HTTPS ports are enabled for the mqweb server, consider enforcing the use of a
secure HTTPS connection with the LTPA token. You can configure the mqweb server to require an HTTPS
connection when an LTPA token is used:
1. As a privileged user, open the mqwebuser.xml file.
The mqwebuser.xml file can be found in one of the following directories:
• On z/OS: WLP_user_directory/servers/mqweb
where WLP_user_directory is the directory that was specified when the crtmqweb.sh script ran to
create the mqweb server definition.
2. Add the following line to the mqwebuser.xml file:
<webAppSecurity ssoRequiresSSL="true"/>
Related reference
POST /login
Procedure
1. Log in a user:
a) Use the HTTP POST method on the login resource:
https://host:port/ibmmq/v1/login
Include the user name and password in the body of the JSON request, in the following format:
{
"username" : name,
"password" : password
}
b) Store the LTPA token, LtpaToken2, and CSRF token cookie, csrfToken, that are returned from
the request in the local cookie store.
2. Authenticate REST requests with the stored tokens:
• Provide the LTPA token, LtpaToken2, as a cookie with every request.
• For requests that use the HTTP PUT, PATCH, or DELETE methods, include the contents of the CSRF
token, csrfToken, in a ibm-mq-rest-csrf-token header.
The content of the csrfToken cookie is used to confirm that the credentials that are being used to
authenticate the request are being used by the owner of the credentials. That is, the token is used
to prevent cross-site request forgery attacks.
You cannot use a cached version of the content of the cookie because the content of the cookie can
change. You must use the latest value of the cookie for each request.
3. Log out a user:
a) Use the HTTP DELETE method on the login resource:
https://host:9443/ibmmq/v1/login
458 Securing IBM MQ
You must provide the LTPA token, LtpaToken2, as a cookie to authenticate the request. You
must also include the contents of the CSRF token, csrfToken, in an ibm-mq-rest-csrf-token
header.
b) Process the instruction to delete the LTPA token from the local cookie store.
Note: If the instruction is not processed, and the LTPA token remains in the local cookie store, then
the LTPA token can be used to authenticate future REST requests. That is, when the user attempts
to authenticate with the LTPA token after the session is ended, a new session is created that uses
the existing token.
Example
The following cURL example shows how to create a new queue Q1, on queue manager QM1, with token-
based authentication, on Windows systems:
• Log in and add the LTPA token, LtpaToken2, and CSRF token, csrfToken, to the local cookie store.
The user name and password information are included in the JSON body. The -c flag specifies the
location of the file to store the token in:
• Create a queue. Use the HTTP POST method with the queue resource, authenticating with the LTPA
token and including the contents of the CSRF token in a header. The LTPA token, LtpaToken2, is
retrieved from the cookiejar.txt file by using the -b flag. The CSRF token, csrfToken, is included
in an ibm-mq-rest-csrf-token HTTP header. The value of the CSRF token is copied from the
cookiejar.txt file:
IBM MQ 9.0.4:
• Log out and delete the LTPA token from the local cookie store. The LTPA token, LtpaToken2, is
retrieved from the cookiejar.txt file by using the -b flag. The CSRF token, csrfToken, is included
in an ibm-mq-rest-csrf-token HTTP header. The value of the CSRF token is copied from the
What to do next
If both HTTP and HTTPS ports are enabled for the mqweb server, consider enforcing the use of a
secure HTTPS connection with the LTPA token. You can configure the mqweb server to require an HTTPS
connection when an LTPA token is used:
1. As a privileged user, open the mqwebuser.xml file.
The mqwebuser.xml file can be found in one of the following directories:
• On z/OS: WLP_user_directory/servers/mqweb
where WLP_user_directory is the directory that was specified when the crtmqweb.sh script ran to
create the mqweb server definition.
2. Add the following line to the mqwebuser.xml file:
<webAppSecurity ssoRequiresSSL="true"/>
Related reference
POST /login
GET /login
DELETE /login
Procedure
•
Use one of the following methods to configure the host name:
460 Securing IBM MQ
• From IBM MQ 9.0.4, use the setmqweb properties command:
- View the current configuration by entering the following command and viewing the
mqRestCorsAllowedOrigins and mqRestCorsMaxAgeInSeconds entries:
dspmqweb properties -a
- Specify the origins that are allowed to access the REST API by entering the following command:
setmqweb properties -k mqRestCorsAllowedOrigins -v allowedOrigins
where allowedOrigins specifies the origin that you want to allow cross-origin requests from.
You can use an asterisk surrounded by double quotation marks, "*", to allow all cross-origin
requests. You can enter more than one origin in a comma-separated list, surrounded by double
quotation marks. To allow no cross-origin requests, enter empty quotation marks as the value for
allowedOrigins.
- Specify the time, in seconds, that you want to allow a web browser to cache the results of any
CORS pre-flight checks by entering the following command:
setmqweb properties -k mqRestCorsMaxAgeInSeconds -v time
• For IBM MQ 9.0.3 and earlier, edit the mqwebuser.xml file:
1. Ensure that you are a privileged user.
2. Open the mqwebuser.xml file.
The mqwebuser.xml file can be found in one of the following directories:
- On z/OS: WLP_user_directory/servers/mqweb
where WLP_user_directory is the directory that was specified when the crtmqweb.sh script
ran to create the mqweb server definition.
3. Configure CORS by adding or uncommenting the following lines in the mqwebuser.xml file:
4. Change the value of the mqRestCorsAllowedOrigins variable to the origin that you want to
allow cross-origin requests from. You can use an asterisk, *, to allow all cross-origin requests, or
you can enter more than one origin in a comma-separated list.
5. Change the value of the mqRestCorsMaxAgeInSeconds variable to the time, in seconds, that
you want to allow a web browser to cache the results of any CORS pre-flight checks.
Example
For more information about configuring the logging levels, see Configuring logging.
You can optionally enable command and configuration events to provide information about most
IBM MQ Console activity. For example, the creation of channels, and the inquiry of queues
generate command and configuration events. For more information about enabling command and
configuration events, see Controlling configuration, command and logger events. For these command
and configuration event messages, the MQIACF_EVENT_ORIGIN field is set to MQEVO_REST and the
MQCACF_EVENT_APPL_IDENTITY field reports the first 32 characters of the authenticated principal
name. If a user has the MQWebAdmin or MQWebAdminRO role, the MQCACF_EVENT_USER_ID field reports
the user name of the principal that started the web server, not the user name of the principal that issued
the command. However, if the user has the MQWebUser role, the MQCACF_EVENT_USER_ID reports the
user name of the principal that issued the command.
Related concepts
“Auditing” on page 412
You can check for security intrusions, or attempted intrusions, by using event messages. You can also
check the security of your system by using the IBM MQ Explorer.
Security considerations for the IBM MQ Console and REST API on z/OS
On z/OS, there are additional options to configure security for the IBM MQ Console and REST API. You can
configure an LDAP registry. You can configure TLS for the IBM MQ Console and REST API to enable a user
to log in with a certificate. You can configure the System Authorization Facility interface so that a user can
log in with a z/OS user ID and password.
462 Securing IBM MQ
• The mqweb server address space user ID needs authorization to issue certain PCF commands, as well
as access to certain queues
For further information see:
– “IBM MQ Console - required command security profiles” on page 211
– “System queue security” on page 189
– “Profiles for context security” on page 199
• IBM MQ Console and REST API users that are assigned to the MQWebUser role operate under the
security context of the principal.
These user IDs can only perform operations that the user ID is granted to perform on the queue
manager, and need to be granted access to the same system queues as the mqweb server address
space.
The mqweb server address space user ID needs to be granted alternate user access to all users
assigned to the MQWebUser role. For more information on alternate user security, see “Profiles for
alternate user security” on page 198
Procedure
• Authority required by the mqweb server started task user ID
• Access to IBM MQ resources, required to use the MQ Console or REST API
• Configuring TLS for the REST API and IBM MQ Console on z/OS
• Configuring System Authorization Facility interface
Connection authentication
If your queue manager has been configured to require that all batch applications provide a valid user ID
and password, by setting CHKLOCL(REQUIRED), you must give the mqweb server started task user ID
UPDATE access to the hlq.BATCH profile in the MQCONN class.
This authority causes connection authentication to operate in CHKLOCL(OPTIONAL) mode for the mqweb
server started task user ID.
Procedure
1. Grant the mqweb started task user ID, alternate user access to each user ID in the MQWebUser role.
Do this on every queue manager that users will administer through the MQ Console or REST API.
You can use the following sample RACF commands to grant, the mqweb started task user ID, alternate
user access to a user in the MQWebUser role:
where:
hlq
Is the profile prefix, that can be either the queue manager name, or queue sharing group name
userId
Is the user in the MQWebUser role
mqwebUserId
Is the mqweb started task user ID
Note: If you are using mixed-case security, use the MXADMIN class rather than the MQADMIN class.
2. Grant each user in the MQWebUser role, access to system queues that are necessary to use the MQ
Console and REST API.
To do this, for both the SYSTEM.ADMIN.COMMAND.QUEUE and SYSTEM.REST.REPLY.QUEUE, give
each user UPDATE access to the MQQUEUE or MXQUEUE classes, depending on whether mixed-case
security is in use.
You need to do this on every queue manager that the user will administer through the REST API,
including from IBM MQ 9.0.4, or remote queue managers administered through the administrative
REST API gateway.
3. From IBM MQ 9.0.4, you can use the REST API to administer remote queue managers.
To allow a user in the MQWebUser role to administer remote queue managers, grant the user UPDATE
access to the profile in the MQQUEUE or MXQUEUE class, protecting the transmission queue used to
send commands to the remote queue manager. Note, that you need to give the user UPDATE access on
the gateway queue manager.
On the remote queue manager, grant access for the same user, to put to the transmission queue used
to send command response messages back to the gateway queue manager.
464 Securing IBM MQ
4. Grant the users in the MQWebuserRole access to any other resources required to perform the
operations supported by the MQ Console and REST API.
The access needed to:
• Perform operations in the REST API, is described in the Security requirements sections of the
individual REST API resources
• Issue commands by the MQ Console is described in “IBM MQ Console - required command security
profiles” on page 211
Configuring TLS for the REST API and IBM MQ Console on z/OS
A method of configuring TLS for the IBM MQ Console and REST API on z/OS.
Procedure
1. In mqwebuser.xml, comment out the existing definitions for:
• mqDefaultSSLConfig
• defaultKeyStore
2. In mqwebuser.xml, add the following code statements:
<server>
<featureManager>
<feature>ssl-1.0</feature>
</featureManager>
<sslDefault sslRef="mqDefaultSSLConfig"/>
<ssl id="mqDefaultSSLConfig" keyStoreRef="defaultKeyStore"
sslProtocol="TLSv1.2"
serverKeyAlias="def2"
clientAuthentication="true"
/>
<keyStore id="defaultKeyStore"
filebased="false"
location="safkeyring://userid/keyring"
password="password"
readOnly="true"
type="JCERACFKS"
/>
</server>
Notes:
a. The text in bold is required to define the TLS interface.
b. The value of sslRef="mqDefaultSSLConfig" in sslDefault must match one of the <ssl
id=...... values
c. The value of <ssl keyStoreRef="defaultKeyStore" in <ssl must match the id= value in a
<keystore.
d. Specify the user ID, and the keyring of the user ID, to be used in the location="safkeyring://
userid/keyring" statement.
Ring:
>MYKEYRING<
Certificate Label Name Cert Owner USAGE DEFAULT
-------------------------------- ------------ -------- -------
SCENCA CERTAUTH CERTAUTH NO
def2 ID(SCENSTC) PERSONAL NO
Note: If you are using self-signed certificates these need to be connected to the keyring.
3. Restart the mqweb server.
There should be no messages in //STDERR
There should be messages in //STDOUT similar to those listed in Getting started with the IBM MQ
Console..
Notes:
a. If you are using only certificates to authenticate to the IBM MQ Console, the browser might display
a list of certificates for you to select from.
b. If you want to use a different certificate you need to close and restart your browser.
c. If you are using certificates that are not in the RACF database, you can use RACF certificate name
filtering, to map attributes in the certificate to a user ID, for example:
Results
You have set up a TLS interface for the IBM MQ Console and REST API.
466 Securing IBM MQ
About this task
The SAF interface allows the mqweb server to call the external security manager for authentication and
authorization checking for both the IBM MQ Console and REST API.
Note that you need to be a privileged user to perform some of the steps in this task.
Procedure
1. Follow the steps in Enabling z/OS authorized services on Liberty for z/OS to give your mqweb Liberty
server access to use z/OS authorized services.
Sample JCL for starting the angel process is in USS_ROOT/web/templates/zos/procs/
bbgzangl.jcl, where USS_ROOT is the path in Unix System Services where IBM MQ for z/OS USS
components are installed.
In bbgzangl.jcl, change the SET ROOT statement to point to USS_ROOT/web, for
example, /usr/lpp/mqm/V9R0M0/web.
See Administering Liberty on z/OS for further information on stopping and starting the angel process.
2. Follow the steps in Liberty: Setting up the System Authorization Facility (SAF) unauthenticated user
to create the unauthenticated user needed by Liberty.
3. Use the zos_saf_registry.xml file.
From IBM MQ 9.0.5, copy the zos_saf_registry.xml file from the following path:
PathPrefix /web/mq/samp/configuration where PathPrefix is the IBM MQ Unix System
Services Components installation path.
For IBM MQ 9.0.4 and earlier, use this file:
<!--
Role mappings are granted by giving users and groups READ access to the
following profiles in the EJBROLE class:
1) MQWEB.com.ibm.mq.console.MQWebAdmin
MQWebAdmin role access for the MQ Console. All MQ commands issued by the
MQ Console use the security context of the operating system user running
the application server.
2) MQWEB.com.ibm.mq.console.MQWebAdminRO
3) MQWEB.com.ibm.mq.console.MQWebUser
4) MQWEB.com.ibm.mq.rest.MQWebAdmin
MQWebAdmin role access for the MQ REST API. All MQ commands issued by the
REST API use the security context of the operating system user running
the application server.
5) MQWEB.com.ibm.mq.rest.MQWebAdminRO
MQWebAdminRO role access for the MQ REST API. The security context of
the operating system user running the application server is used for
all read-only MQ commands, such as DISPLAY CHANNEL, QUEUE, etc,
issued by the REST API.
6) MQWEB.com.ibm.mq.rest.MQWebUser
MQWebUser role access for the MQ REST API. All MQ commands issued by
the REST API use the security context of the principal and so the
user must be known to the queue manager and authorized to issue the
command.
<!--
Enable features
-->
<featureManager>
<feature>appSecurity-2.0</feature>
<feature>zosSecurity-1.0</feature>
<feature>basicAuthenticationMQ-1.0</feature>
</featureManager>
<!--
The MQ Console
-->
<enterpriseApplication id="com.ibm.mq.console"/>
<!--
The MQ REST API
-->
<enterpriseApplication id="com.ibm.mq.rest"/>
<!--
Example SAF Registry
-->
<safAuthorization racRouteLog="ASIS"/>
<safRegistry id="saf"/>
<safAuthorization id="saf"/>
<safCredentials unauthenticatedUser="WSGUEST" profilePrefix="MQWEB"/>
<!--
Enable HTTP by uncommenting the line below.
-->
<!--
<variable name="httpPort" value="9080"/>
-->
<!--
By default the server listens for HTTP/HTTPS requests on localhost only. To
listen on all available network interfaces uncomment the line below. To listen
on a specific IP address or hostname replace the * with an appropriate value.
-->
<!--
<variable name="httpHost" value="*"/>
-->
<!--
Default MQ SSL configuration allows TLS v1.2 ONLY, refer to the
IBM Documentation section on "IBM MQ Console and REST API security"
for details of how to configure security.
-->
<sslDefault sslRef="mqDefaultSSLConfig"/>
<!--
Enable client certificate authentication by uncommenting the
block below and creating a trust.jks store. Basic registry
maps the common name (CN=) issued by a trusted CA to
users names in the registry. For example a certificate with
a distinguished name of 'CN=mqadmin,O=IBM,C=GB' will be granted
a MQWebAdmin role under the 'mqadmin' user.
468 Securing IBM MQ
https://developer.ibm.com/wasdev/docs/configuring-ssl-liberty/
-->
<!--
<keyStore id="defaultKeyStore" location="key.jks" type="JKS" password="password"/>
<keyStore id="defaultTrustStore" location="trust.jks" type="JKS" password="password"/>
<ssl id="thisSSLConfig" clientAuthenticationSupported="true" keyStoreRef="defaultKeyStore"
trustStoreRef="defaultTrustStore" sslProtocol="TLSv1.2" serverKeyAlias="default"/>
<sslDefault sslRef="thisSSLConfig"/>
-->
<!--
Uncomment the following two variables, and adjust them, to change
the default CORS settings.
-->
<!--
<variable name="mqRestCorsAllowedOrigins" value="https://localhost:9883"/>
<variable name="mqRestCorsMaxAgeInSeconds" value="120"/>
-->
</server>
9. Grant all users, or groups, to be authenticated to the MQ Console or REST API READ access to the
mqweb server APPLID in the APPL class.
You must also do this for the unauthenticated user defined in step “2” on page 467. The following
example grants a user READ access to the mqweb server APPLID in RACF:
10. Define the profiles in the EJBROLE class needed to give users access to roles in the MQ Console and
REST API.
The following example defines the profiles in RACF, where profilePrefix is the value specified for
the profilePrefix attribute in step “7” on page 469.
Results
You have set up SAF authentication for the IBM MQ Console and REST API.
470 Securing IBM MQ
<featureManager>
<feature>appSecurity-2.0</feature>
</featureManager>
</application-bnd>
</enterpriseApplication>
The runmqckm command requires the IBM MQ JRE component to be installed. If this
component is not installed you can use the runmqackm command instead.
The runmqakm command
The runmqakm command is available on UNIX, Linux, and Windows.
To use the runmqakm command, ensure that the systems environment variables are correctly
configured by running the setmqenv command.
If you need to manage TLS certificates in a way that is FIPS compliant, use the runmqakm command
instead of the runmqckm commands. This is because the runmqakm command supports stronger
encryption.
Use the runmqckm and runmqakm commands to do the following:
• Create the type of CMS key database files that IBM MQ requires
• Create certificate requests
• Import personal certificates
• Import CA certificates
• Manage self-signed certificates
Related information
Keytool
• runmqakm
– Is available on UNIX, Linux, and Windows.
– Supports the creation of certificates and certificate requests with Elliptic Curve public keys whereas
the runmqckm command does not.
– Supports stronger encryption of the key repository file than the runmqckm command through the
-strong parameter.
– Has been certified as FIPS 140-2 compliant, and can be configured to operate in a FIPS compliant
manner, using the -fips parameter, unlike the runmqckm command.
• runmqckm
– Is available on UNIX and Windows.
– Supports the JKS and JCEKS key repository file formats, whereas the runmqakm command does not.
-stash
-keydb -create
Create a CMS key database:
472 Securing IBM MQ
-keydb -create -db filename
-pw password -type cms -expire days -stash
-keydb -stashpw
Stash the password of a CMS key database into a file:
-cert -getdefault
Note: The default certificate is not supported by IBM MQ 8.0. You should use certificate label
configuration as described in Digital certificate labels, understanding the requirements.
Get the default personal certificate:
-cert -modify
Modify a certificate.
Note: Currently, the only field that can be modified is the Certificate Trust field.
-cert -setdefault
Note: The default certificate is not supported by IBM MQ 8.0 or later. You should use certificate label
configuration as described in Digital certificate labels, understanding the requirements.
Set the default personal certificate:
-keydb -convert
convert the key database from one format to another:
-keydb -delete
Delete a key database:
-keydb -list
List currently-supported types of key database:
-keydb -list
-cert -add
Add a certificate from a file into a key database:
-cert -create
Create a self-signed certificate:
-cert -delete
Delete a certificate:
-cert -details
List the detailed information for a specific certificate:
-cert -export
Export a personal certificate and its associated private key from a key database into a PKCS #12 file,
or to another key database:
474 Securing IBM MQ
-cert -export -db filename -pw password -label label
-type cms | pkcs12
-target filename -target_pw password -target_type
cms | pkcs12
-cert -extract
Extract a certificate from a key database:
-cert -import
Import a personal certificate from a key database:
The -label option is required and specifies the label of the certificate that is to be imported from the
source key database.
The -new_label option is optional and allows the imported certificate to be given a different label in
the target key database from the label in the source database.
-cert -list
List all certificates in a key database:
-cert -receive
Receive a certificate from a file:
-cert -sign
Sign a certificate:
-certreq -create
Create a certificate request:
-certreq -delete
Delete a certificate request:
-certreq -details
List the detailed information of a specific certificate request:
List the detailed information about a certificate request and show the full certificate request:
-certreq -extract
Extract a certificate request from a certificate request database into a file:
-certreq -list
List all certificate requests in the certificate request database:
-certreq -recreate
Re-create a certificate request:
476 Securing IBM MQ
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-keydb -list
List currently-supported types of key database:
-keydb -list
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-cert -add
Add a certificate from a file to a cryptographic device:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-cert -create
Create a self-signed certificate on a cryptographic device:
Note: You cannot import a certificate containing multiple OU (organizational unit) attributes in the
distinguished name.
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-cert -delete
Delete a certificate on a cryptographic device:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
List the detailed information and show the full certificate for a specific certificate on a cryptographic
device:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-cert -extract
Extract a certificate from a key database:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-cert -import
Import a certificate to a cryptographic device with secondary key database support:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
478 Securing IBM MQ
-type cms
-crypto module_name -tokenlabel token_label -pw
password
-secondaryDB filename -secondaryDBpw password -fips
Import a PKCS #12 certificate to a cryptographic device with secondary key database support:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
Note: You cannot import a certificate containing multiple OU (organizational unit) attributes in the
distinguished name.
-cert -list
List all certificates on a cryptographic device:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-cert -receive
Receive a certificate from a file to a cryptographic device with secondary key database support:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
Using the runmqakm command:
-certreq -create
Create a certificate request on a cryptographic device:
Note: You cannot import a certificate containing multiple OU (organizational unit) attributes in the
distinguished name.
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-certreq -delete
Delete a certificate request from a cryptographic device:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-certreq -details
List the detailed information of a specific certificate request on a cryptographic device:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
List the detailed information about a certificate request and show the full certificate request on a
cryptographic device:
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-certreq -extract
Extract a certificate request from a certificate request database on a cryptographic device into a file:
480 Securing IBM MQ
-pw password -label label -target filename
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
-certreq -list
List all certificate requests in the certificate request database on a cryptographic device:
-pw password
If you are using certificates or keys stored on PKCS #11 cryptographic hardware, note that runmqckm
and strmqikm are 64-bit programs. External modules required for PKCS #11 support will be
loaded into a 64-bit process, therefore you must have a 64-bit PKCS #11 library installed for the
administration of cryptographic hardware. The Windows and Linux x86 32-bit platforms are the only
exceptions, as the strmqikm and runmqckm programs are 32-bit on those platforms.
Table 83. Options that can be used with runmqckm and runmqakm
Parameter Description
-create Option to create a key database.
-crypto Name of the module to manage a PKCS #11 cryptographic device.
The value after -crypto is optional if you specify the module name in the
properties file.
If you are using certificates or keys stored on PKCS #11 cryptographic hardware,
note that runmqckm and strmqikm are run using the Java virtual machine
(JVM) supplied with the IBM MQ installation. External modules required for PKCS
#11 support will be loaded into the JVM process, therefore you must have a
PKCS #11 library installed for the administration of cryptographic hardware that
matches the bitness of the JVM , and must specify this library to runmqckm or
strmqikm.
-db Fully qualified path name of a key database.
-default_cert Sets a certificate as the default certificate. The value can be yes or no. The
default is no.
482 Securing IBM MQ
Table 83. Options that can be used with runmqckm and runmqakm (continued)
Parameter Description
-sig_alg The hashing algorithm used during the creation of a certificate request, a self-
signed certificate, or the signing of a certificate. This hashing algorithm is used to
create the signature associated with the newly-created certificate or certificate
request.
For runmqckm, the value can be, MD2_WITH_RSA, MD2WithRSA,
MD5_WITH_RSA, MD5WithRSA, SHA1WithDSA, SHA1WithECDSA,
SHA1WithRSA, SHA2/ECDSA, SHA224WithECDSA, SHA256_WITH_RSA,
SHA256WithECDSA, SHA256WithRSA, SHA2WithECDSA, SHA3/ECDSA,
SHA384_WITH_RSA, SHA384WithECDSA, SHA384WithRSA, SHA3WithECDSA,
SHA5/ECDSA, SHA512_WITH_RSA, SHA512WithECDSA, SHA512WithRSA,
SHA5WithECDSA, SHA_WITH_DSA, SHA_WITH_RSA, SHAWithDSA,
SHAWithRSA. The default value is SHA1WithRSA.
For runmqakm, the value can be md5,
MD5_WITH_RSA, MD5WithRSA, SHA_WITH_DSA, SHA_WITH_RSA,
sha1, SHA1WithDSA, SHA1WithECDSA, SHA1WithRSA, sha224,
SHA224_WITH_RSA, SHA224WithDSA, SHA224WithECDSA, SHA224WithRSA,
sha256, SHA256_WITH_RSA, SHA256WithDSA, SHA256WithECDSA,
SHA256WithRSA, SHA2WithRSA, sha384, SHA384_WITH_RSA,
SHA384WithECDSA, SHA384WithRSA, sha512, SHA512_WITH_RSA,
SHA512WithECDSA, SHA512WithRSA, SHAWithDSA, SHAWithRSA,
EC_ecdsa_with_SHA1, EC_ecdsa_with_SHA224, EC_ecdsa_with_SHA256,
EC_ecdsa_with_SHA384, or EC_ecdsa_with_SHA512. The default value is
SHA1WithRSA.
-stash Stash the key database password to a file. Only applicable to databases of type
CMS and PKCS12.
Note: -stash is valid on -keydb -create commands to tell runmqckm/
runmqakm to create a stash file containing the password.
Issuing the command $ runmqakm -help lists the high-level help parameters
only.
-stashed Indicates password for the key database or PKCS #12 file is in a stash file.
Note: The -stashed option is valid on calls apart from the -keydb -create
commands. If you do not specify this option, you have to supply the password
using -pw.
In addition, only when you instruct the command what kind of action you are
performing does the detailed help showing -stashed appear.
-x509version Version of X.509 certificate to create. The value can be 1, 2, or 3. The default is 3.
-rfc3339 Use this parameter to output the date in the RFC 3339 format for the runmqakm
-cert -details command, which is of the following format:
Note that the -rfc3339 parameter has to appear in the command after the
additional parameters:
Note: Properties provided with IBM Global Security Kit (GSKit) relating to symmetric-key encryption
-seckey parameter in the runmqckm utility are ignored and not supported by IBM MQ.
484 Securing IBM MQ
Error code Error Message
7 An error occurred while re-opening the database
file.
8 Database creation failed.
9 The database already exists.
10 An error occurred while deleting the database file.
11 The database could not be opened.
12 An error occurred while reading the database file.
13 An error occurred while writing data to the
database file.
14 A database validation error occurred.
15 An invalid database version was encountered.
16 An invalid database password was encountered.
17 An invalid database file type was encountered.
18 The specified database has been corrupted.
19 An invalid password was provided or the key
database has been tampered with or corrupted.
20 A database key entry integrity error occurred.
21 A duplicate certificate already exists in the
database.
22 A duplicate key already exists in the database
(Record ID).
23 A certificate with the same label already existed in
the key database.
24 A duplicate key already exists in the database
(Signature).
25 A duplicate key already exists in the database
(Unsigned Certificate).
26 A duplicate key already exists in the database
(Issuer and Serial Number).
27 A duplicate key already exists in the database
(Subject Public Key Info).
28 A duplicate key already exists in the database
(Unsigned CRL).
29 The label has been used in the database.
30 A password encryption error occurred.
31 An LDAP related error occurred. (LDAP is not
supported by this program)
32 A cryptographic error occurred.
33 An encryption/decryption error occurred.
34 An invalid cryptographic algorithm was found.
486 Securing IBM MQ
Error code Error Message
64 A mutex error occurred.
65 An invalid parameter was found.
66 A null parameter or memory allocation error was
encountered.
67 Number or size is too large or too small.
68 The old password is invalid.
69 The new password is invalid.
70 The password has expired.
71 A thread related error occurred.
72 An error occurred while creating threads.
73 An error occurred while a thread was waiting to
exit.
74 An I/O error occurred.
75 An error occurred while loading CMS.
76 A cryptography hardware related error occurred.
77 The library initialization routine was not
successfully called.
78 The internal database handle table is corrupted.
79 A memory allocation error occurred.
80 An unrecognized option was found.
81 An error occurred while getting time information.
82 Mutex creation error occurred.
83 An error occurred while opening message catalog.
84 An error occurred while opening error message
catalog
85 A null file name was found.
86 An error occurred while opening files, check for file
existence and permissions.
87 An error occurred while opening files to read.
88 An error occurred while opening files to write.
89 There is no such file.
90 The file cannot be opened because of its
permission setting.
91 An error occurred while writing data to files.
92 An error occurred while deleting files.
93 Invalid Base64-encoded data was found.
94 An invalid Base64 message type was found.
488 Securing IBM MQ
Error code Error Message
124 An error occurred while converting the CMS key
database to a key ring file.
125 An error occurred while creating a certificate for
the certificate request.
126 A complete issuer chain cannot be built.
127 Invalid WEBDB data was found.
128 There is no data to be written to the key ring file.
129 The number of days that you entered extends
beyond the permitted validity period.
130 The password is too short; it must consist of at
least {0} characters.
131 A password must contain at least one numeric
digit.
132 All characters in the password are either
alphabetic or numeric characters.
133 An unrecognized or unsupported signature
algorithm was specified.
134 An invalid database type was encountered.
135 The specified secondary key database is in use by
another PKCS#11 device.
136 No secondary key database was specified.
137 The label does not exist on the PKCS#11 device.
138 Password required to access the PKCS#11 device.
139 Password not required to access the PKCS#11
device.
140 Unable to load the cryptographic library.
141 PKCS#11 is not supported for this operation.
142 An operation on a PKCS#11 device has failed.
143 The LDAP user is not a valid user. (LDAP is not
supported by this program)
144 The LDAP user is not a valid user. (LDAP is not
supported by this program)
145 The LDAP query failed. (LDAP is not supported by
this program)
146 An invalid certificate chain was found.
147 The root certificate is not trusted.
148 A revoked certificate was encountered.
149 A cryptographic object function failed.
150 There is no certificate revocation list data source
available.
490 Securing IBM MQ
Error code Error Message
221 An unsupported signature algorithm was
encountered. At this stage only MD5 and SHA1 are
supported.
222 PCKS11 not supported for that particular
operation.
223 The action passed is not a known -random action.
224 A length than less than zero is not allowed.
225 When using the -strong tag the minimum length
password is 14 characters.
226 When using the -strong tag the maximum length
password is 300 characters.
227 The MD5 algorithm is not supported when in FIPS
mode.
228 The site tag is not supported for the -cert -list
command. This attribute is added for backward
compatibility and potential future enhancement.
229 The value associated with the -ca tag is not
recognized. The value must be either 'true' or
'false'.
230 The value passed in with the -type tag is not valid.
231 The value passed in with the -expire tag is below
the allowed range.
232 The encryption algorithm used or requested is not
supported.
233 The target already exists.
XAResourceManager:
Name=mydb2
SwitchFile=db2swit
XAOpenString=db=mydbname,uid=+USER+,pwd=+PASSWORD+,toc=t
ThreadOfControl=THREAD
XAResourceManager:
Name=myoracle
SwitchFile=oraswit
XAOpenString=Oracle_XA+Acc=P/+USER+/+PASSWORD++SesTm=35
+LogDir=/tmp+threads=true
ThreadOfControl=THREAD
Work with the credentials for the database to the MQ XA credentials store
After you update the qm.ini file with the replaceable credential strings, you must add the user
name and password to the MQ credentials store by using the setmqxacred command. You can also
use setmqxacred to modify existing credentials, delete credentials, or list credentials. The following
examples give some typical use cases:
Adding credentials
The following command securely saves the user name and password for the queue manager QM1 for
the resource mqdb2.
Updating credentials
To update the user name and password used to connect to a database, re-issue the setmqxacred
command with the new user-name and password:
You must restart the queue manager for the changes to take effect.
Deleting credentials
The following command deletes the credentials:
Listing credentials
The following command lists credentials:
setmqxacred -m QM1 -l
Related reference
setmqxacred
492 Securing IBM MQ
IBM MQ queue managers so you must complete at least some configuration before you can use an AMQP
channel.
For more information about how to configure channel authentication rules to allow AMQP connections to
your queue manager, see Creating and using AMQP channels.
If you are using an MQ Light client, you can specify credentials by including them in the AMQP address
you connect to, for example:
amqp://mwhitehead:mYp4ssw0rd@localhost:5672/sports/football
Note: On Windows, the MCAUSER user ID setting is only supported for user IDs up to 12
characters in length.
SSL/TLS support
AMQP channels support SSL/TLS encryption using keys from the key repository configured for your queue
manager. AMQP channel configuration options for SSL/TLS encryption support the same options as other
types of MQ channel; you can specify a cipher specification and whether the queue manager requires
certificates from AMQP client connections.
By using the FIPS attributes of the queue manager you can control the SSL/TLS cipher suites, which you
can use to secure connections from AMQP clients.
For information about how to set up a key repository for the queue manager see Working with SSL or TLS
on UNIX, Linux and Windows systems.
For information about how to configure SSL/TLS support for an AMQP client connection, see Creating and
using AMQP channels.
You can optionally configure AMQP channels with a JAAS login module, which can check the user name
and password provided by an AMQP client. See “Configuring JAAS for AMQP channels” on page 495.
Related tasks
Developing AMQP client applications
Creating and using AMQP channels
494 Securing IBM MQ
Table 85. AdoptNewMCA and AdoptNewMCACheck settings to restrict client takeover (continued)
AdoptNewMCA AdoptNewMCACheck Criteria checked before client
takeover is allowed
ALL (or value other than NO) QM or undefined None. Client takeover is allowed
for all client connections that
are authenticated and pass all
CHLAUTH rules.
ALL (or value other than NO) NAME User ID (when SASL enabled)
Channel name
ALL (or value other than NO) ADDRESS User ID (when SASL enabled)
IP address
ALL (or value other than NO) ALL User ID (when SASL enabled)
Channel name
IP address
The queue manager attributes AdoptNewMCA and AdoptNewMCACheck are part of the queue manager
configuration, which is defined in the CHANNELS stanza. On IBM MQ for Windows and IBM MQ for Linux
x86-64 systems, modify configuration information using the IBM MQ Explorer. On other systems, modify
the information by editing the qm.ini configuration file. For information about how to modify the queue
manager channels information, see Attributes of the channels stanza.
Related tasks
Developing AMQP client applications
Creating and using AMQP channels
Procedure
You configure a JAAS configuration module for AMQP channels by completing the following steps:
com.ibm.mq.MQXR.JAASConfig=JAAS_stanza_name
for example:
com.ibm.mq.MQXR.JAASConfig=MQXRConfig
3. Configure the queue manager environment to include the class of the custom module. The AMQP
service must have access to the Java class configured in the JAAS configuration stanza.
You do this by adding the path to the JAAS class to the MQ service.env file. Edit the service.env
file in the MQ configuration directory (MQ_config_directory) or the queue manager configuration
directory (QM_config_directory) to set the CLASSPATH variable to the location of the JAAS module
class.
What to do next
A sample JAAS login module is shipped with the product in the mq_installation_directory/amqp/
samples directory. The sample JAAS login module authenticates all client connections, regardless of the
username or password the client connects with.
You can modify the source code of the sample and recompile it to try authenticating only specific users
with a particular password. To configure the AMQP channel on a UNIX system to use the sample JAAS
login module shipped with the product:
1. Edit the file /var/mqm/qmgrs/QMNAME/amqp/amqp_unix.properties and set the property
com.ibm.mq.MQXR.JAASConfig=MQXRConfig.
2. Edit the file /var/mqm/service.env and set the property CLASSPATH=mq_installation_location/
amqp/samples
The jaas.config file already contains a stanza named MQXRConfig that specifies the sample class
samples.JAASLoginModule as the login module class. No changes are required to jaas.config
before you try the sample module.
Related tasks
Developing AMQP client applications
Creating and using AMQP channels
496 Securing IBM MQ
Advanced Message Security
Advanced Message Security (AMS) is a component of IBM MQ that provides a high level of protection for
sensitive data flowing through the IBM MQ network, while not impacting the end applications.
AMS overview
IBM MQ applications can use Advanced Message Security to send sensitive data, such as high-value
financial transactions and personal information, with different levels of protection by using a public key
cryptography model.
Related reference
GSKit return codes used in AMS messages
• From IBM MQ 9.0.0 Fix Pack 8, a check has been added to the IBM
MQ library code that runs within the customer's application program. The check runs early in its
initialization to read the value of the environment variable AMQ_AMS_FIPS_OFF and, if it is set to any
value, then the GSKit code will be run in non-FIPS mode in that application.
Error handling
IBM MQ Advanced Message Security defines an error handling queue to manage messages that contain
errors or messages that cannot be unprotected.
Defective messages are dealt with as exceptional cases. If a received message does not meet the security
requirements for the queue it is on, for example, if the message is signed when it should be encrypted,
or decryption or signature verification fails, the message is sent to the error handling queue. A message
might be sent to the error handling queue for the following reasons:
Effect on performance
AMS uses a combination of symmetric and asymmetric cryptographic routines to provide digital signing
and encryption. As symmetric key operations are very fast in comparison to asymmetric key operations,
which are CPU intensive, this in turn can have a significant impact on the costs of protecting large
numbers of messages with AMS.
Asymmetric cryptographic routines
For example, when putting a signed message, the message hash is signed using an asymmetric key
operation.
When getting a signed message, a further asymmetric key operation is used to verify the signed hash.
Therefore, a minimum of two asymmetric key operations are required per message to sign and verify
the message data.
Asymmetric and symmetric cryptographic routines
When putting an encrypted message, a symmetric key is generated and then encrypted using an
asymmetric key operation for each intended recipient of the message.
The message data is then encrypted with the symmetric key. When getting the encrypted message the
intended recipient needs to use an asymmetric key operation to discover the symmetric key in use for
the message.
All three qualities of protection, therefore, contain varying elements of the CPU intensive asymmetric
key operations, which will significantly impact the maximum achievable messaging rate for applications
putting and getting messages.
Key reuse
Confidentiality policies do, however, allow for symmetric key reuse over a sequence of messages.
498 Securing IBM MQ
You can use this approach to significantly reduce the costs involved in encrypting a number of messages
intended for the same recipient or recipients.
For example, when putting 10 encrypted messages to the same set of recipients, a symmetric key is
generated, and then encrypted for the first message, using an asymmetric key operation for each intended
recipient of the message.
Based upon policy controlled limits, the encrypted symmetric key can then be reused by subsequent
messages that are intended for the same recipients. An application that is getting encrypted messages
can apply the same optimization, in that the application can detect when a symmetric key has not
changed and avoid the expense of retrieving the symmetric key.
In this example 90% of the asymmetric key operations can be avoided by both the putting and getting
applications by reusing the same key.
For more information on how to use key reuse, see:
• MQSC command SET POLICY
• Control command setmqspl
500 Securing IBM MQ
• IBM MQ classes for .Net in an unmanaged mode
Note: Advanced Message Security supports X.509 compliant certificate authorities.
Known limitations
Learn about limitations of Advanced Message Security.
• The following IBM MQ options are not supported or have limitations:
– Publish/subscribe.
Note: One of the major benefits of a publish/subscribe messaging model over point-to-point is that
the sending and receiving applications do not need to know anything about each other for data to
be sent and received. This benefit is negated by the use of Advanced Message Security policies that
must define intended recipients or authorized signers. It is possible for an application to publish to
a topic via an alias queue definition that is protected by a policy, it is also possible for a subscribing
application to get messages from a policy protected queue. It is not possible to assign a policy
directly to a topic string, policies can only be assigned to queue definitions.
– Channel data conversion.
Note: The protected payload of an Advanced Message Security protected message is transmitted
using binary format, this ensures that data conversion on a channel between applications does
not invalidate the message digest. Applications retrieving messages from a policy protected queue
should request data conversion, the conversion of the protected payload will be attempted after
messages have been successfully verified and unprotected.
– Distribution lists.
Note: Advanced Message Security policies can be used when protecting applications putting
messages to distribution lists, provided each destination queue in the list has an identical policy
defined. If inconsistent policies are identified when an application opens a distribution list, the open
operation will fail and a security error returned to the application.
– Application message segmentation.
Note: The size of policy protected messages will increase and it is not possible for applications to
accurately specify the segment boundaries of a message.
– Non-threaded applications on HP-UX platforms are not supported.
– Applications using IBM MQ classes for .NET in a managed mode (client connections) are not
supported.
Note: MCA interception can be used to allow unsupported clients to use AMS.
– Message Service client for .NET (XMS) applications in a managed mode are not supported.
Note: MCA interception can be used to allow unsupported clients to use AMS.
– IBM MQ queues processed by the IMS bridge are not supported.
Note: AMS is supported on CICS Bridge queues. You should use the same user ID to MQPUT
(encrypt) and MQGET (decrypt) on CICS Bridge queues.
• Users should avoid putting more than one certificate with the same Distinguished Name in a single
keystore file, because the choice of which certificate to use when protecting a message is undefined.
• AMS is not supported in JMS if the WMQ_PROVIDER_VERSION property is set to 6.
• The AMS interceptor is not supported for AMQP or MQTT channels.
User scenarios
Familiarize yourself with possible scenarios to understand what business goals you can achieve with
Advanced Message Security.
Procedure
1. Create a queue manager
crtmqm QM_VERIFY_AMS
strmqm QM_VERIFY_AMS
3. Create a queue called TEST.Q by entering the following command into runmqsc for queue manager
QM_VERIFY_AMS
DEFINE QLOCAL(TEST.Q)
Results
If the procedure is completed, command entered into runmqsc will display details about TEST.Q:
DISPLAY Q(TEST.Q)
502 Securing IBM MQ
2. Creating and authorizing users
Procedure
1. Create the two users and ensure that HOMEPATH and HOMEDRIVE are set for both these users.
2. Authorize the users to connect to the queue manager and to work with the queue
3. You should also allow the two users to browse the system policy queue and put messages on the error
queue.
Attention: IBM MQ optimizes performance by caching policies so that you do not have to
browse records for policy details on the SYSTEM.PROTECTION.POLICY.QUEUE in all cases.
IBM MQ does not cache all the policies available. If there are high number of policies,
IBM MQ caches a limited number of policies. So, if the queue manager has a low
number of policies defined, there is no need to provide the browse option to the
SYSTEM.PROTECTION.POLICY.QUEUE.
However, you should give browse authority to this queue, in case there is a high number of
policies defined, or if you are using old clients. The SYSTEM.PROTECTION.ERROR.QUEUE is
used to put error messages generated by the AMS code. The put authority against this queue
is checked only when you attempt to put an error message to the queue. Your put authority
against the queue is not checked when you attempt to put or get message from an AMS
protected queue.
Results
Users are now created and the required authorities granted to them.
What to do next
To verify if the steps were carried out correctly, use the amqsput and amqsget samples as described in
section “7. Testing the setup” on page 506.
Procedure
1. Use the IBM Key Management GUI ( strmqikm.exe ) to create a new key database for the user
alice.
Type: CMS
Filename: alicekey.kdb
Location: C:/Documents and Settings/alice/AMS
Note:
• It is advisable to use a strong password to secure the database.
• Make sure that Stash password to a file check box is selected.
2. Change the key database content view to Personal Certificates.
3. Select New Self Signed ; self signed certificates are used in this scenario.
4. Create a certificate identifying the user alice for use in encryption, using these fields:
Note:
• For the purpose of this guide, we are using self-signed certificate which can be created without using
a Certificate Authority. For production systems, it is advisable not to use self-signed certificates but
instead rely on certificates signed by a Certificate Authority.
• The Key label parameter specifies the name for the certificate, which interceptors will look up to
receive necessary information.
• The Common Name and optional parameters specifies the details of the Distinguished Name (DN),
which must be unique for each user.
5. Repeat step 1-4 for the user bob
Results
The two users alice and bob each now have a self-signed certificate.
4. Creating keystore.conf
cms.keystore = dir/keystore_file
cms.certificate = certificate_label
504 Securing IBM MQ
Example
For this scenario, the contents of the keystore.conf will be as follows:
Note:
• The path to the keystore file must be provided with no file extension.
• The certificate label can include spaces, thus "Alice_Cert" and "Alice_Cert " (with a space on the end) for
example, are recognized as labels of two different certificates. However, to avoid confusion, it is better
not to use spaces in label's name.
• There are the following keystore formats: CMS (Cryptographic Message Syntax), JKS ( Java Keystore)
and JCEKS ( Java Cryptographic Extension Keystore). For more information, refer to “Structure of the
keystore configuration file (keystore.conf) for AMS” on page 526.
• %HOMEDRIVE%\%HOMEPATH%\.mqs\keystore.conf (eg. C:\Documents and
Settings\alice\.mqs\keystore.conf) is the default location where Advanced Message Security searches
for the keystore.conf file. For information about how to use a non-default location for the
keystore.conf, see “Using keystores and certificates” on page 526.
• To create .mqs directory, you must use the command prompt.
5. Sharing Certificates
Procedure
1. Extract the certificate identifying alice to an external file:
runmqakm -cert -add -db "C:/Documents and Settings/bob/AMS/bobkey.kdb" -pw passw0rd -label
Alice_Cert -file alice_public.arm
Results
The two users alice and bob are now able to successfully identify each other having created and shared
self-signed certificates.
runmqakm -cert -details -db "C:/Documents and Settings/bob/AMS/bobkey.kdb" -pw passw0rd -label
Alice_Cert
Example
This is an example of a policy defined for the TEST.Q queue. In the example, messages are signed with
the SHA1 algorithm and encrypted with the AES256 algorithm. alice is the only valid sender and bob is
the only receiver of the messages on this queue:
Note: The DNs match exactly those specified in the respective user's certificate from the key database.
What to do next
To verify the policy you have defined, issue the following command:
dspmqspl -m QM_VERIFY_AMS
To print the policy details as a set of setmqspl commands, use the -export flag. This allows storing
already defined policies:
Procedure
1. Switch user to run as user alice
Right-click cmd.exe and select Run as.... When prompted, log in as the user alice.
2. As the user alice put a message using a sample application:
506 Securing IBM MQ
4. Switch user to run as user bob
Open another window by right-clicking cmd.exe and selecting Run as.... When prompted, log in as the
user bob.
5. As the user bob get a message using a sample application:
Results
If the application has been configured properly for both users, the user alice 's message is displayed
when bob runs the getting application.
8. Testing encryption
Procedure
1. Using the runmqsc command against queue manager QM_VERIFY_AMS, create an alias queue.
3. As the user alice, put another message using a sample application just as before:
4. As the user bob, browse the message using a sample application via the alias queue this time:
5. As the user bob, get the message using a sample application from the local queue:
Results
The output from the amqsbcg application shows the encrypted data that is on the queue proving that the
message has been encrypted.
Procedure
1. Create a queue manager
crtmqm QM_VERIFY_AMS
strmqm QM_VERIFY_AMS
3. Create a queue called TEST.Q by entering the following command into runmqsc for queue manager
QM_VERIFY_AMS
DEFINE QLOCAL(TEST.Q)
Results
If the procedure completed successfully, the following command entered into runmqsc will display
details about TEST.Q:
DISPLAY Q(TEST.Q)
508 Securing IBM MQ
Procedure
1. Create the two users
useradd alice
useradd bob
2. Authorize the users to connect to the queue manager and to work with the queue
3. You should also allow the two users to browse the system policy queue and put messages on the error
queue.
Attention: IBM MQ optimizes performance by caching policies so that you do not have to
browse records for policy details on the SYSTEM.PROTECTION.POLICY.QUEUE in all cases.
IBM MQ does not cache all the policies available. If there are high number of policies,
IBM MQ caches a limited number of policies. So, if the queue manager has a low
number of policies defined, there is no need to provide the browse option to the
SYSTEM.PROTECTION.POLICY.QUEUE.
However, you should give browse authority to this queue, in case there is a high number of
policies defined, or if you are using old clients. The SYSTEM.PROTECTION.ERROR.QUEUE is
used to put error messages generated by the AMS code. The put authority against this queue
is checked only when you attempt to put an error message to the queue. Your put authority
against the queue is not checked when you attempt to put or get message from an AMS
protected queue.
Results
User groups are now created and the required authorities granted to them. This way users who are
assigned to those groups will also have permission to connect to the queue manager and to put and get
from the queue.
What to do next
To verify if the steps were carried out correctly, use the amqsput and amqsget samples as described in
section “8. Testing encryption” on page 513.
mkdir /home/alice/.mqs -p
runmqakm -keydb -create -db /home/alice/.mqs/alicekey.kdb -pw passw0rd -stash
Note:
• It is advisable to use a strong password to secure the database.
• The stash parameter stores the password into the key.sth file, which interceptors can use to open
the database.
2. Ensure the key database is readable
chmod +r /home/alice/.mqs/alicekey.kdb
Note:
• For the purpose of this guide, we are using self-signed certificate which can be created without using
a Certificate Authority. For production systems, it is advisable not to use self-signed certificates but
instead rely on certificates signed by a Certificate Authority.
• The label parameter specifies the name for the certificate, which interceptors will look up to
receive necessary information.
• The DN parameter specifies the details of the Distinguished Name (DN), which must be unique for
each user.
4. Now we have created the key database, we should set the ownership of it, and ensure it is unreadable
by all other users.
Results
The two users alice and bob each now have a self-signed certificate.
4. Creating keystore.conf
cms.keystore = dir/keystore_file
cms.certificate = certificate_label
510 Securing IBM MQ
Example
For this scenario, the contents of the keystore.conf will be as follows:
cms.keystore = /home/alice/.mqs/alicekey
cms.certificate = Alice_Cert
Note:
• The path to the keystore file must be provided with no file extension.
• There are the following keystore formats: CMS (Cryptographic Message Syntax), JKS ( Java Keystore)
and JCEKS ( Java Cryptographic Extension Keystore). For more information, refer to “Structure of the
keystore configuration file (keystore.conf) for AMS” on page 526.
• HOME/.mqs/keystore.conf is the default location where Advanced Message Security searches
for the keystore.conf file. For information about how to use a non-default location for the
keystore.conf, see “Using keystores and certificates” on page 526.
5. Sharing Certificates
Procedure
1. Extract the certificate identifying alice to an external file:
runmqakm -cert -add -db /home/bob/.mqs/bobkey.kdb -pw passw0rd -label Alice_Cert -file
alice_public.arm
runmqakm -cert -extract -db /home/bob/.mqs/bobkey.kdb -pw passw0rd -label Bob_Cert -target
bob_public.arm
runmqakm -cert -add -db /home/alice/.mqs/alicekey.kdb -pw passw0rd -label Bob_Cert -file
bob_public.arm
Results
The two users alice and bob are now able to successfully identify each other having created and shared
self-signed certificates.
What to do next
Verify that a certificate is in the keystore by running the following commands which print out its details:
Example
This is an example of a policy defined for the TEST.Q queue. In this example, messages are signed by the
user alice using the SHA1 algorithm, and encrypted using the 256-bit AES algorithm. alice is the only
valid sender and bob is the only receiver of the messages on this queue:
Note: The DNs match exactly those specified in the respective user's certificate from the key database.
What to do next
To verify the policy you have defined, issue the following command:
dspmqspl -m QM_VERIFY_AMS
To print the policy details as a set of setmqspl commands, use the -export flag. This allows storing
already defined policies:
Procedure
1. Change to the directory containing the samples. If MQ is installed in a non-default location, this may be
in a different place.
cd /opt/mqm/samp/bin
su alice
512 Securing IBM MQ
5. Stop running as user alice
exit
su bob
Results
If the application has been configured properly for both users, the user alice 's message is displayed
when bob runs the getting application.
8. Testing encryption
Procedure
1. Using the runmqsc command against queue manager QM_VERIFY_AMS, create an alias queue.
3. As the user alice, put another message using a sample application just as before:
4. As the user bob, browse the message using a sample application via the alias queue this time:
5. As the user bob, get the message using a sample application from the local queue:
Results
The output from the amqsbcg application will show the encrypted data that is on the queue proving that
the message has been encrypted.
Procedure
1. Create a queue manager
crtmqm QM_VERIFY_AMS
strmqm QM_VERIFY_AMS
3. Create and start a listener by entering the following commands into runmqsc for queue manager
QM_VERIFY_AMS
4. Create a channel for our applications to connect in through by entering the following command into
runmqsc for queue manager QM_VERIFY_AMS
5. Create a queue called TEST.Q by entering the following command into runmqsc for queue manager
QM_VERIFY_AMS
DEFINE QLOCAL(TEST.Q)
Results
If the procedure completed successfully, the following command entered into runmqsc displays details
about TEST.Q:
DISPLAY Q(TEST.Q)
514 Securing IBM MQ
protection policies defined in this scenario, these users must be granted access to some system queues.
For more information about the setmqaut command refer to setmqaut.
Procedure
1. Create the two users as described in the Quick Start Guide ( Windows or UNIX ) for your platform.
2. Authorize the users to connect to the queue manager and to work with the queue
3. You should also allow the two users to browse the system policy queue and put messages on the error
queue.
Attention: IBM MQ optimizes performance by caching policies so that you do not have to
browse records for policy details on the SYSTEM.PROTECTION.POLICY.QUEUE in all cases.
IBM MQ does not cache all the policies available. If there are high number of policies,
IBM MQ caches a limited number of policies. So, if the queue manager has a low
number of policies defined, there is no need to provide the browse option to the
SYSTEM.PROTECTION.POLICY.QUEUE.
However, you should give browse authority to this queue, in case there is a high number of
policies defined, or if you are using old clients. The SYSTEM.PROTECTION.ERROR.QUEUE is
used to put error messages generated by the AMS code. The put authority against this queue
is checked only when you attempt to put an error message to the queue. Your put authority
against the queue is not checked when you attempt to put or get message from an AMS
protected queue.
Results
Users are now created and the required authorities granted to them.
What to do next
To verify if the steps were carried out correctly, use the JmsProducer and JmsConsumer samples as
described in section “7. Testing the setup” on page 518.
Procedure
1. Create a directory in which to create your keystore, for example /home/alice/.mqs. You might wish
to create it in the same directory as used by the Quick Start Guide ( Windows or UNIX ) for your
platform.
Note:
• If your keystore-dir contains spaces, you must put quotes round the full name of your keystore
• It is advisable to use a strong password to secure the keystore.
• For the purpose of this guide, we are using self-signed certificate which can be created without using
a Certificate Authority. For production systems, it is advisable not to use self-signed certificates but
instead rely on certificates signed by a Certificate Authority.
• The alias parameter specifies the name for the certificate, which interceptors will look up to
receive necessary information.
• The dname parameter specifies the details of the Distinguished Name (DN), which must be unique
for each user.
3. On UNIX, ensure the keystore is readable
chmod +r keystore-dir/keystore.jks
Results
The two users alice and bob each now have a self-signed certificate.
4. Creating keystore.conf
Example
For this scenario, the contents of the keystore.conf for alice are as follows:
JKS.keystore = keystore-dir/keystore
JKS.certificate = Alice_Java_Cert
JKS.encrypted = no
JKS.keystore_pass = passw0rd
JKS.key_pass = passw0rd
JKS.provider = IBMJCE
For this scenario, the contents of the keystore.conf for bob are as follows:
JKS.keystore = keystore-dir/keystore
JKS.certificate = Bob_Java_Cert
JKS.encrypted = no
JKS.keystore_pass = passw0rd
JKS.key_pass = passw0rd
JKS.provider = IBMJCE
Note:
516 Securing IBM MQ
• The path to the keystore file must be provided with no file extension.
• If you already have a keystore.conf file because you have followed the instructions in the Quick Start
Guide ( Windows or UNIX ), you can edit the existing file to add these lines.
• For more information, see “Structure of the keystore configuration file (keystore.conf) for AMS” on page
526.
5. Sharing certificates
Procedure
1. Extract the certificate identifying alice.
2. Import the certificate identifying alice into the keystore that bob will use. When prompted indicate
that you will trust this certificate.
Results
The two users alice and bob are now able to successfully identify each other having created and shared
self-signed certificates.
What to do next
Verify that a certificate is in the keystore by running the following commands which print out its details:
Note: The DNs match exactly those specified in the respective user's certificate from the key database.
What to do next
To verify the policy you have defined, issue the following command:
dspmqspl -m QM_VERIFY_AMS
To print the policy details as a set of setmqspl commands, the -export flag. This allows storing already
defined policies:
Procedure
1. To run these JMS sample applications, use the CLASSPATH setting for your platform as shown in
Environment variables used by IBM MQ classes for JMS to ensure the samples directory is included.
2. As the user alice, put a message using a sample application, connecting as a client:
3. As the user bob, get a message using a sample application, connecting as a client:
Results
If the application has been configured properly for both users, the user alice 's message is displayed
when bob runs the getting application.
518 Securing IBM MQ
policy, the message is encrypted before it is passed to the IBM MQ to handle it. After Advanced
Message Security has processed the message put into a remote queue, IBM MQ puts it into associated
transmission queue and forwards it to the target queue manager and target queue.
When a GET operation is performed on the local queue, Advanced Message Security tries to decode the
message according to the policy set on the local queue. For the operation to succeed, the policy used
to decrypt the message must be identical to the one used to encrypt it. Any discrepancy will cause the
message to be rejected.
If for any reason both policies cannot be set at the same time, a staged roll-out support is provided. The
policy can be set on a local queue with toleration flag on, which indicates that a policy associated with
a queue can be ignored when an attempt to retrieve a message from the queue involves a message that
does not have the security policy set. In this case, GET will try to decrypt the message, but will allow
non-encrypted messages to be delivered. This way policies on remote queues can be set after the local
queues has been protected (and tested).
Remember: Remove the toleration flag once the Advanced Message Security roll-out has been
completed.
Related reference
setmqspl (set security policy)
1 cecil's
DEFINE QLOCAL(QIN)
5. Set up the security policy for the QIN queue to an eligible configuration. Use the identical setup for
the QBOB, QCECIL and QDEF queues.
This scenario assumes the security policy where alice is the only authorized sender and bob and cecil
are the recipients.
6. Define alias queues AIN, ABOB and ACECIL referencing local queues QIN, QBOB and QCECIL
respectively.
7. Verify that the security configuration for the aliases specified in the previous step is not present;
otherwise set its policy to NONE.
8. In IBM Integration Bus create a message flow to route the messages arriving on the AIN alias queue
to the BOB, CECIL, or DEF node depending on the routeTo property of the message. To do so:
a) Create an MQInput node called IN and assign the AIN alias as its queue name.
b) Create MQOutput nodes called BOB, CECIL and DEF, and assign alias queues ABOB, ACECIL and
ADEF as their respective queue names.
c) Create a route node and call it TEST.
d) Connect the IN node to the input terminal of the TEST node.
e) Create bob, and cecil output terminals for the TEST node.
f) Connect the bob output terminal to the BOB node.
g) Connect the cecil output terminal to the CECIL node.
h) Connect the DEF node to the default output terminal.
i) Apply the following rules:
520 Securing IBM MQ
$Root/MQRFH2/usr/routeTo/text()="bob"
$Root/MQRFH2/usr/routeTo/text()="cecil"
9. Deploy the message flow to the IBM Integration Bus runtime component.
10. Running as the user Alice put a message that also contains a message property called routeTo
with a value of either bob or cecil. Running the sample application amqsstm will allow you to do
this.
11. Running as user bob retrieve the message from the queue QBOB using the sample application
amqsget.
Results
When alice puts a message on the QIN queue, the message is protected. It is retrieved in protected form
by the IBM Integration Bus from the AIN alias queue. IBM Integration Bus decides where to route the
message reading the routeTo property which is, as all properties, not encrypted. IBM Integration Bus
places the message on the appropriate unprotected alias avoiding its further protection. When received
by bob or cecil from the queue, the message is decrypted and the digital signature is verified.
mqsireload execution-group-name
If IBM Integration Bus is considered an authorized party allowed to read or sign the message payload,
you must configure Advanced Message Security for the user starting the IBM Integration Bus service. Be
aware it is not necessarily the same user who puts/gets the messages onto queues nor the user creating
and deploying the IBM Integration Bus applications.
Procedure
1. Configure alice, bob, cecil and dave and the IBM Integration Bus service user, to use Advanced
Message Security as described in the Quick Start Guide ( Windows or UNIX ).
Ensure the following steps are completed:
• Creating and authorizing users
• Creating Key Database and Certificates
• Creating keystore.conf
2. Provide alice, bob, cecil and dave's certificates to the IBM Integration Bus service user.
5. Define a local queue named OUT, and define the security policy with the service user for the IBM
Integration Bus specified as author, and cecil and dave specified as recipients:
6. In IBM Integration Bus create a message flow with an MQInput and MQOutput node. Configure the
MQInput node to use the IN queue and the MQOutput node to use the OUT queue.
7. Deploy the message flow to the IBM Integration Bus runtime component.
8. Running as user alice or bob put a message on the queue IN using the sample application amqsput.
9. Running as user cecil or dave retrieve the message from the queue OUT using the sample application
amqsget.
Results
Messages sent by alice or bob to the input queue IN are encrypted allowing only IBM Integration Bus
to read it. IBM Integration Bus only accepts messages from alice and bob and rejects any others. The
accepted messages are appropriately processed, then signed and encrypted with cecil's and dave's keys
before being put onto the output queue OUT. Only cecil and dave are capable of reading it, messages not
signed by IBM Integration Bus are rejected.
522 Securing IBM MQ
In this scenario we consider a simple topology comprising one machine with two Managed File Transfer
queues and two agents, AGENT1 and AGENT2, sharing a single queue manager, as described in the
scenario Scenario overview. Both agents connect in the same way, either in bindings mode or client mode.
1. Creating certificates
Procedure
1. Create a self-signed certificate to identify the user ftagent as detailed in the appropriate Quick Start
Guide.
Use a Distinguished Name (DN) as follows:
2. Create a keystore.conf file to identify the location of the keystore and the certificate within it as
detailed in the appropriate Quick Start Guide.
Procedure
1. Shut down the Managed File Transfer agents in preparation for protection using the fteStopAgent
command.
2. Create a security policy to protect the SYSTEM.FTE.DATA.AGENT2 queue.
3. Ensure the user running the Managed File Transfer Agent process has access to browse the system
policy queue and put messages on the error queue.
4. Restart your Managed File Transfer agents using the fteStartAgent command.
Results
You are now able to submit transfers from AGENT1 to AGENT2, and the file contents will be transmitted
securely between the two agents.
Auditing on z/OS
Advanced Message Security for z/OS provides a means for optional auditing of MQI operations on policy-
protected queues. When enabled, IBM System Management Facility (SMF) audit records are generated
for the success and failure of these operations on policy-protected queues. Operations audited include
MQPUT, MQPUT1, and MQGET.
Auditing is disabled by default, however, you can activate auditing by configuring _AMS_SMF_TYPE and
_AMS_SMF_AUDIT in the configured Language Environment® _CEE_ENVFILE file for the AMS address
space. For more information, see Task 24: Create procedures for Advanced Message Security. The
_AMS_SMF_TYPE variable is used to designate the SMF record type and is a number between 128 and
255. A SMF record type of 180 is usual, however is not mandatory. Auditing is disabled by specifying
a value of 0. The _AMS_SMF_AUDIT variable configures whether audit records are created for MQI
operations that are successful, MQI operations that fail, or both. The auditing options can also be
dynamically changed while AMS is active using operator commands. For more information, see Operating
Advanced Message Security.
The SMF record is defined using subtypes, with subtype 1 being a general auditing event. The SMF record
contains all data relevant to the request being processed.
The SMF record is mapped by the CSQ0KSMF macro (note the zero in the macro name), which is provided
in the target library SCSQMACS. If you are writing data-reduction programs for SMF data, you can include
this mapping macro to aid in the development and customization of SMF post-processing routines.
In the SMF records produced by Advanced Message Security for z/OS, the data is organized into sections.
The record consists of:
• a standard SMF header
• a header extension defined by Advanced Message Security for z/OS
• a product section
• a data section
The product section of the SMF record is always present in the records produced by Advanced Message
Security for z/OS. The data section varies based on subtype. Currently, one subtype is defined and
therefore a single data section is used.
SMF is described in the z/OS System Management Facilities manual (SA22-7630). Valid record types are
described in the SMFPRMxx member of your system PARMLIB data set. See SMF documentation for more
information.
524 Securing IBM MQ
Advanced Message Security audit report generator (CSQ0USMF)
Advanced Message Security (AMS) for z/OS provides an audit report generator tool called CSQ0USMF
which is provided in the installation SCSQAUTH library. Sample JCL to run the CSQ0USMF utility called
CSQ40RSM is provided in the installation library SCSQPROC.
As an example, the following JCL dumps SMF type 180 records from an SMF data set, and transfers them
to a target data set.
You must verify the actual SMF data set names used by your installation. The target data set for the
dumped records must have a record format of VBS, and a record length of 32760.
Note: If SMF logstreams are being used, you must use program IFASMFDL to dump a logstream out to a
sequential dataset. See Processing type 116 SMF records for an example of the JCL used.
The target data set can then be used as input to the CSQ0USMF utility to produce an AMS audit report. For
example:
The CSQ0USMF program accepts two optional parameters, which are listed in the following table:
• On Windows: %HOMEDRIVE%%HOMEPATH%\.mqs\keystore.conf
If you are using a specified keystore filename and location, you should use the following commands
• For Java: java -DMQS_KEYSTORE_CONF=path/filename app_name
• For C Client and Server:
– On UNIX and Linux: export MQS_KEYSTORE_CONF=path/filename
– On Windows: set MQS_KEYSTORE_CONF=path\filename
Note: The path on Windows can, and should, specify the drive letter if more than one drive letter is
available.
Related concepts
“Sender distinguished names in AMS” on page 551
The sender distinguished names (DNs) identify users who are authorized to place messages on a queue.
“Recipient distinguished names in AMS” on page 553
The recipient distinguished names (DN) identify users who are authorized to retrieve messages from a
queue.
526 Securing IBM MQ
JCERACFKS
Java Cryptographic Encryption RACF keyring KeyStore, configuration entries are prefixed with:
jceracfks.
Important: From IBM MQ 9.0 the JCEKS.provider and JKS.provider values are ignored. The Bouncy
Castle provider is used, in conjunction with whichever JCE/JCE provision is supplied by the JRE in use. For
more information, see “Support for non-IBM JREs with AMS” on page 530.
Example structures for keystores:
CMS
cms.keystore = /dir/keystore_file
cms.certificate = certificate_label
PKCS#11
pkcs11.library = dir\cryptoki.dll
pkcs11.certificate = certificatelabel
pkcs11.token = tokenlabel
pkcs11.token_pin = tokenpin
pkcs11.secondary_keystore = dir\signers
PEM
pem.private = /dir/keystore_file_private_key
pem.public = /dir/keystore_file_public_keys
pem.password = password
Java JKS
jks.keystore = dir/Keystore
jks.certificate = certificate_label
jks.encrypted = no
jks.keystore_pass = password
jks.key_pass = password
jks.provider = IBMJCE
Java JCEKS
jceks.keystore = dir/Keystore
jceks.certificate = certificate_label
jceks.encrypted = no
jceks.keystore_pass = password
jceks.key_pass = password
jceks.provider = IBMJCE
Java JCERACFKS
jceracfks.keystore = safkeyring://user/keyring
jceracfks.certificate = certificate_label
private
public
password
library
certificate
token
token_pin
secondary_ke
ystore
encrypted
keystore_pas
s
key_pass
provider
safkeyring://user/keyring
where:
– user is the user id that owns the keyring
– keyring is the keyring name.
private
PEM configuration only. File name of a file that contains private key and certificate in PEM format.
528 Securing IBM MQ
public
PEM configuration only. File name of a file that contains trusted public certificates in PEM format.
password
PEM configuration only. Password that is used to decrypt an encrypted private key.
library
PKCS#11 only. Path name of the PKCS#11 library.
certificate
CMS, PKCS#11 and Java configuration only. Certificate label.
token
PKCS#11 only. Token label.
token_pin
PKCS#11 only. PIN to unlock the token.
secondary_keystore
PKCS#11 only. Path name of the CMS keystore, provided without the .kdb extension, that contains
anchor certificates (root certificates) required by certificates stored on the PKCS #11 token. The
secondary keystore can also contain certificates that are intermediate in the trust chain, as well
as recipient certificates that are defined in the privacy security policy. This CMS keystore must be
accompanied by a stash file which must be located in the same directory as the secondary keystore.
encrypted
Java configuration only. Status of the password.
keystore_pass
Java configuration only. Password for the keystore file.
Note:
• For the CMS keystore, AMS relies on the stash files (.sth), whereas JKS and JCEKS might require a
password for both the certificate and the user's private key.
• Important: Storing passwords in plain text form is a security risk.
Related tasks
“Protecting passwords in Java” on page 543
Storing keystore and private key passwords as plain text poses a security risk so Advanced Message
Security provides a tool that can scramble those passwords using a user's key, which is available in the
keystore file.
For Long Term Support for IBM MQ 9.0.0 Fix Pack 6 and later, the Bouncy Castle JAR files
used are the following files:
From IBM MQ 9.0.0 Fix Pack 6: The provider JAR file, which is fundamental to Bouncy
Castle operations.
This JAR file is called bcprov-jdk15on.jar.
From IBM MQ 9.0.0 Fix Pack 6: The "PKIX" JAR file, which contains the support for CMS
operations that are used by Advanced Message Security.
This JAR file is called bcpkix-jdk15on.jar.
From IBM MQ 9.0.0 Fix Pack 12: The "UTIL" JAR file, which contains classes used by the
other Bouncy Castle APIs.
This JAR file is called bcutil-jdk15on.jar.
530 Securing IBM MQ
Bouncy Castle 1.69 introduced a new JAR file, bcutil-VER.jar. The "BCUTIL" JAR file is a
collection of classes that do not need to be in the JCE provider JAR file, but are used by the other
Bouncy Castle APIs.
The modified classes have been tested with IBM JREs and Oracle JREs. They are also likely to run
successfully under any J2SE-compliant JRE. However, you should note the following dependencies:
• There are no changes to AMS configuration
• The Bouncy Castle classes are used only for CMS operations. All other security-related operations, for
example keystore access, the actual encryption of data, and calculation of signature checksums use the
functionality provided by the JRE.
Important: For this reason, the JRE used must include a JCE provider implementation.
• To use some strong encryption algorithms, you might need to install the unrestricted policy files for the
JRE's JCE implementation
Refer to the JRE documentation for more details.
• If you have enabled Java security:
– Add java.security.SecurityPermissioninsertProvider.BC to the application, so that the
Bouncy Castle classes can be used as a security provider.
– Grant java.security.AllPermission to the Bouncy Castle JAR files, which are:
mq_install_dir/java/lib/bcutil-jdk15on.jar
mq_install_dir/java/lib/bcpkix-jdk15on.jar
mq_install_dir/java/lib/bcprov-jdk15on.jar
Related concepts
What is installed for IBM MQ classes for JMS
What is installed for IBM MQ classes for Java
pem.certificate.channel.channelname
Procedure
1. Create the key database and certificates by using the following commands to create a shell script.
Also, change the INSTLOC and KEYSTORELOC or run the required commands. Note that you might
not need to create the certificate for bob.
INSTLOC=/opt/mq90
KEYSTORELOC=/home/testusr/ssl/ams1
mkdir -p $KEYSTORELOC
chmod -R 777 $KEYSTORELOC
chown -R mqm:mqm $KEYSTORELOC
export PATH=$PATH:$INSTLOC/gskit8/bin
echo "PATH = $PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTLOC/gskit8/lib64
532 Securing IBM MQ
2. Share the certificates between the two key databases so that each user can successfully identify the
other.
It is important that you use the method described in Task 5. Sharing Certificates in the Quick Start
Guide (Windows or UNIX).
3. Create keystore.conf with the following configuration: Keystore.conf location: /home/
userID/ssl/ams1/
cms.keystore = /home/userID/ssl/ams1/alicekey
cms.certificate.channel.SYSTEM.DEF.SVRCONN = alice_cert
export MQS_KEYSTORE_CONF=/home/userID/ssl/ams1/keystore.conf
export MQSERVER='SYSTEM.DEF.SVRCONN/TCP/127.0.0.1(14567)'
12. Run amqsputc from an MQ client that does not automatically enable an MCA interceptor; for
example an IBM WebSphere MQ 7.1 or earlier client. Put the following two messages:
Related tasks
“Quick Start Guide for AMS with Java clients” on page 514
Procedure
• To disable AMS at the client, use one of the following options:
AMQ_DISABLE_CLIENT_AMS environment variable
You need to set this variable in the following cases:
– If you are using Java Runtime Environment (JRE) other than the IBM Java Runtime Environment
(JRE)
– If you are using IBM WebSphere MQ 7.5, or later IBM MQ classes for JMS or IBM MQ classes for
Java client.
Create the AMQ_DISABLE_CLIENT_AMS environment variable and set it to TRUE in the
environment where the application is running. For example:
export AMQ_DISABLE_CLIENT_AMS=TRUE
534 Securing IBM MQ
For example, you can set the Java system property as a -D option when the Java command is
invoked:
Alternatively, you can specify the Java system property within a JMS configuration file,
jms.config, if the application uses this file.
MQS_DISABLE_ALL_INTERCEPT environment variable
You need to set this variable if you are using IBM MQ 8.0 or later with native clients and you need
to disable AMS at the client.
Create the environment variable MQS_DISABLE_ALL_INTERCEPT and set it to TRUE in the
environment where the client is running. For example:
You can use the MQS_DISABLE_ALL_INTERCEPT environment variable for C clients only. For Java
clients, you need to use the AMQ_DISABLE_CLIENT_AMS environment variable instead.
DisableClientAMS property in the mqclient.ini file
You can use this option for IBM MQ classes for JMS and IBM MQ classes for Java clients, and for C
clients.
Add the property name DisableClientAMS under the Security stanza of the mqclient.ini
file as shown in the following example:
Security:
DisableClientAMS=Yes
Security:
DisableClientAMS=No
What to do next
For more information on problems with opening AMS protected queues, see “Problems opening protected
queues when using JMS” on page 572.
Related concepts
“Message Channel Agent (MCA) interception” on page 531
MCA interception enables a queue manager running under IBM MQ to selectively enable policies to be
applied for server connection channels.
The IBM MQ classes for JMS configuration file
Related tasks
Configuring a client using a configuration file
Procedure
Add the following options to the keystore configuration file:
Note: All the OCSP stanza are optional and can be specified independently.
Option Description
ocsp.enable=off Enable the OCSP checking if the certificate being
checked has an Authority Info Access (AIA)
Extension with an PKIX_AD_OCSP access method
containing a URI of where the OCSP Responder is
located.
Possible values: on or off.
536 Securing IBM MQ
Option Description
ocsp.http.proxy.host=OCSP_proxy The URL address of the OCSP proxy server. If this
option is omitted then a proxy is not used for non-
AIA online certificate checks.
ocsp.http.proxy.port=port_number The OCSP proxy server's port number. If this option
is omitted then the default port of 8080 is used.
ocsp.nonce.generation=on/off Generate nonce when querying OCSP.
The default value is off.
Using java.security
Check whether your certificate contains an Authority Information Access (AIA) certificate extension.
Procedure
1. If AIA is not set up or you want to override your certificate, edit the $JAVA_HOME/lib/security/
java.security file with the following properties:
ocsp.responderURL=http://url.to.responder:port
ocsp.responderCertSubjectName=CN=Example CA,O=IBM,C=US
ocsp.enable=true
ocsp.enable=true
What to do next
If you are using Java Security Manager, too complete the configuration, add the following Java permission
to lib/security/java.policy
Using keystore.conf
Procedure
Add the following attribute to the configuration file:
ocsp.enable=true
Important: Setting this attribute in the configuration file overrides java.security settings.
What to do next
To complete the configuration, add the following Java permissions to lib/security/java.policy:
certificateRevocationList,
certificateRevocationList;binary,
authorityRevocationList,
authorityRevocationList;binary
538 Securing IBM MQ
deltaRevocationList
deltaRevocationList;binary,
Enabling certificate validation and certificate revocation list support in native interceptors
You must modify the keystore configuration file so that Advanced Message Security can download CLRs
from the Lightweight Directory Access Protocol (LDAP) server.
Procedure
Add the following options to the configuration file:
Note: All the CRL stanza are optional and can be specified independently.
Option Description
crl.ldap.host=host_name LDAP server host name.
crl.ldap.port=port_number LDAP server port number.
You can specify up to 11 servers. Multiple LDAP
hosts are used to ensure transparent failover in
case of LDAP connection failure. It is expected
that all LDAP servers are replicas and contain
the same data. When the AMS Java interceptor
successfully connects to an LDAP server, it does
not attempt to download CRLs from the remaining
servers provided.
Procedure
1. Add the following options to the configuration file:
Header Description
crl.ldap.host=host_name LDAP host name.
crl.ldap.port=port_number LDAP server port number.
You can specify up to 11 servers. Multiple LDAP
hosts are used to ensure transparent failover in
case of LDAP connection failure. It is expected
that all LDAP servers are replicas and contain
the same data. When the AMS Java interceptor
successfully connects to an LDAP server, it
does not attempt to download CRLs from the
remaining servers provided.
Java does not use crl.ldap.user and
crl.ldaworldp.pass values. It does not use a
user and password when connecting to an LDAP
server. As a consequence, CRL attributes in LDAP
must be world-readable.
540 Securing IBM MQ
Property Name Description
com.ibm.security.enableCRLDP This property takes the following values: true,
false.
If it is set to true, when doing certificate
revocation check, CRLs are located using the
URL from CRL distribution points extension of the
certificate.
If it is set to false or not set, checking CRL
by using the CRL distribution points extension is
disabled.
You can specify multiple LDAP server host names and ports as follows:
You can specify up to 10 host names. If you do not specify a port number for your LDAP servers, the port
number specified by crl.ldap.port is used. Each LDAP server must use the same crl.ldap.user/password
combination for access.
When the CRLFILE DD is specified the configuration is loaded during initialization of the Advanced
Message Security address space and CRL checking is enabled. If the CRLFILE DD is not specified, or
the CRL configuration file is unavailable, or invalid, CRL checking is disabled.
AMS performs a CRL check using IBM System SSL certificate validation services as follows:
If a message operation fails a CRL check Advanced Message Security performs the following actions:
542 Securing IBM MQ
AMS for z/OS uses IBM System SSL services to validate certificates, which includes CRL and trust
checking. IBM System SSL provides environment variable GSK_CRL_SECURITY_LEVEL to moderate the
operation of CRL checking. For example:
GSK_CRL_SECURITY_LEVEL=MEDIUM
This variable is documented in the z/OS Cryptographic Services System Secure Sockets Layer
Programming manual. Valid assignments include:
• LOW - Certificate validation will not fail if the LDAP server cannot be contacted.
• MEDIUM- Certificate validation requires the LDAP server to be contactable, but does not require a CRL
to be defined.
• HIGH - Certificate validation requires the LDAP server to be contactable and a CRL to be defined.
The IBM System SSL default is MEDIUM. You can set this variable in the configuration file specified
via the ENVARS DD in the started task JCL for the AMS address space. A sample environment variable
configuration file is provided in thlqual.SCSQPROC(CSQ40ENV).
Note: It is the responsibility of administrators to ensure relevant LDAP services are available and to
maintain CRL entries for relevant Certificate Authorities.
Procedure
1. Edit the keystore.conf files to include path to the keystore and users label.
An output with encrypted passwords is generated and can be copied to the keystore.conf file.
To copy the output to the keystore.conf file automatically, run:
Note:
For a list of default locations of keystore.conf on various platforms, see “Using keystores and
certificates” on page 526.
Example
Here is an example of such output:
544 Securing IBM MQ
For more information about certificates, labels, and the RACDCERT command, see z/OS: Security Server
RACF Command Language Reference and z/OS: Security Server RACF Security Administrator's Guide.
In this example, admin specifies the user ID of your security administrator, or any user you want to use
the RACDCERT command.
GSK_TRACE_FILE=/u/... /gsktrace
GSK_TRACE=0xff
Scenario
A scenario of a sending application and a receiving application is used to explain the required steps.
In the examples that follow, user1 is the originator of a message and user2 is the recipient. The user ID
of the Advanced Message Security address space is WMQAMSD.
All of the commands in the examples shown here are issued from ISPF option 6 by the administrative user
ID admin.
Note: Certificates signed with this local certificate authority certificate show an issuer of
CN=AMSCA,O=ibm,C=us when listed with the RACDCERT LIST command.
The RACDCERT ALTER command is required to add the TRUST attribute to the certificate. When a
certificate is first created using this procedure, it has a different valid date range than the signing
certificate. As a result, RACF marks it as NOTRUST, which means that the certificate is not to be used. Use
the RACDCERT ALTER command to set the TRUST attribute.
The KEYUSAGE attributes HANDSHAKE, DATAENCRYPT and DOCSIGN must be specified for certificates
used by Advanced Message Security.
546 Securing IBM MQ
RING(drq.ams.keyring) DEFAULT USAGE(PERSONAL))
RACDCERT ID(user2) CONNECT(ID(user2) LABEL('user2')
RING(drq.ams.keyring) DEFAULT USAGE(PERSONAL))
RACDCERT ID(WMQAMSD) CONNECT(ID(user2) LABEL('user2')
RING(drq.ams.keyring) USAGE(SITE))
The certificate containing the private key used for decryption must be connected to the user's key ring as
the default certificate.
The RACDCERT USAGE(SITE) attribute prevents the private key from being accessible in the key ring,
while the RACDCERT USAGE(PERSONAL) attribute allows the private key to be used, if it exists. User2's
certificate must be connected to the AMS address space key ring because its public key is needed to
encrypt messages as they are put to the queue. USAGE(SITE) limits exposure of user2's private key.
The CERTAUTH certificate with label AMSCA must be connected to the Advanced Message Security
address space key ring because it was used to sign the certificate of user1, who is the message originator.
It is used to validate user1's signing certificate.
***
Label: user2
Certificate ID: 2QfH8Pny9/LzpKKFmfFA
Status: TRUST
Start Date: 2010/05/03 22:59:53
End Date: 2011/05/04 22:59:52
Serial Number:
>15<:
Issuer's Name:
>OU=AMSCA.O=ibm.C=us<:
Subject's Name:
>CN=user2.O=ibm.C=us<:
Key Usage: HANDSHAKE, DATAENCRYPT, DOCSIGN
Private Key Type: Non-ICSF
Private Key Size: 1024
Ring Associations:
Ring Owner: USER2
To improve performance, the contents of the drq.ams.keyring associated with the AMS address space is
cached for the life of the address space. Changes to that key ring do not become effective automatically.
The administrator can refresh the cache by either:
• Stopping and restarting the queue manager.
• Using the z/OS MODIFY command:
Related tasks
Operating Advanced Message Security
In this diagram, an application running as 'user1' puts a message to a remote queue managed by queue
manager CSQ1, intended to be retrieved by an application running as 'user2' from a local queue managed
by queue manager CSQ2. The diagram assumes an Advanced Message Security policy of privacy, which
means the message is both signed and encrypted.
Advanced Message Security intercepts the message when a put occurs and uses user2's certificate
(stored in the AMS address space user's key ring) to encrypt a symmetric key used to encrypt the
message data.
548 Securing IBM MQ
Note that user2's certificate is connected to the AMS address space user key ring with option
USAGE(SITE). This means the AMS address space user can access the certificate and public key, but
not the private key.
On the receiving end, Advanced Message Security intercepts the get issued by user2, and uses user2's
certificate to decrypt the symmetric key so that it can decrypt the message data. It then validates user1's
signature using the CA certificate chain of user1's certificate stored in the AMS address space user's key
ring.
Given this scenario, but with a data-protection policy of integrity, certificates for user2 would not be
required.
To use Advanced Message Security to enqueue messages on IBM MQ-protected queues having a message
protection policy of privacy or integrity, Advanced Message Security must have access to these data
items:
• The X.509 V2 or V3 certificate and private key for the user enqueuing the message.
• The chain of certificates used to sign the digital certificates of all message signers.
• If the data protection policy is privacy, the X.509 V2 or V3 certificate of the intended recipients. The
intended recipients are listed in the Advanced Message Security policy associated with the queue.
For processes and applications that run on z/OS, Advanced Message Security must have certificates in
two places:
• In a SAF-managed key ring associated with the RACF identity of the sending application (the application
that enqueues the protected message) or receiving application (if using privacy).
The certificate that Advanced Message Security locates is the default certificate, and must include the
private key. Advanced Message Security assumes the z/OS user identity of the sending application. That
is, it acts as a surrogate, so it can access the user's private key.
• In a SAF-managed key ring associated with the AMS address space user.
When sending messages protected with privacy, this key ring contains the public key certificates of the
message recipients. When receiving messages, it contains the chain of Certificate Authority certificates
needed to validate the message sender's signature.
The earlier examples shown have used RACF as the local CA. However, you may use another PKI provider
(Certificate Authority) at your installation. If you intend to use another PKI product, remember that the
private key and the certificate must be imported into a key ring associated with the z/OS RACF user IDs
that originate IBM MQ messages protected by Advanced Message Security.
You can use the RACF RACDCERT command as the mechanism to generate certificate requests, which can
be exported and sent to the PKI provider of your choice to be issued.
Here is a summary of the certificate-related steps:
1. Request the creation of a CA certificate, one in which RACF is the local CA. Omit this step if you are
using another PKI provider.
2. Generate user certificates signed by the CA.
3. Create the key rings for the users and the Advanced Message Security AMS address space ID.
4. Connect the user certificate to the user key ring with the default attribute.
5. Connect the recipients certificates to the Advanced Message Security AMS address space user key ring
using the usage(site) attribute (This step is necessary only for user certificates that will ultimately be
the recipients of privacy-protected messages).
6. Connect the CA certificate chains for message senders to the Advanced Message Security AMS
address space user key ring. (This step is necessary only for AMS tasks that will be verifying sender
signatures.)
550 Securing IBM MQ
• SHA-2 family:
– SHA256
– SHA384 (minimum key length acceptable - 768 bits)
– SHA512 (minimum key length acceptable - 768 bits)
A policy that does not specify a signature algorithm, or specifies an algorithm of NONE, implies that
messages placed on the queue associated with the policy are not signed.
Note: The quality of protection used for the message put and get functions must match. If there is a policy
quality of protection mismatch between the queue and the message in the queue, the message is not
accepted and is sent to the error handling queue. This rule applies for both local and remote queues.
Toleration in AMS
The toleration attribute indicates whether Advanced Message Security can accept messages with no
security policy specified.
When retrieving a message from a queue with a policy to encrypt messages, if the message is not
encrypted, it is returned to the calling application. Valid values include:
0
No ( default ).
1
Yes.
A policy that does not specify a toleration value or specifies 0, implies that messages placed on the queue
associated with the policy must match the policy rules.
Toleration is optional and exists to facilitate configuration roll-out, where policies were applied to queues
but those queues already contain messages that do not have a security policy specified.
CN=Common Name,O=Organization,C=Country
Important:
• All DNs must be in uppercase. All component name identifiers in the DN must be specified in the order
shown in the following table:
, (comma)
+ (plus)
" (double quote)
\ (backslash)
< (less than)
> (greater than)
; (semicolon)
• If the Distinguished Name contains embedded blanks, you should enclose the DN in double quotation
marks.
Related concepts
“Recipient distinguished names in AMS” on page 553
552 Securing IBM MQ
The recipient distinguished names (DN) identify users who are authorized to retrieve messages from a
queue.
CN=Common Name,O=Organization,C=Country
Important:
• All DNs must be in uppercase. All component name identifiers in the DN must be specified in the order
shown in the following table:
In Advanced Message Security, messages are encrypted with a symmetric key, and the symmetric key
is encrypted with the public keys of the recipients. Public keys are encrypted with the RSA algorithm,
with keys of an effective length up to 2048 bits. The actual asymmetric key encryption depends on the
certificate key length.
The supported symmetric-key algorithms are as follows:
• RC2
• DES
• 3DES
• AES128
• AES256
Advanced Message Security also supports the following cryptographic hash functions:
• MD5
• SHA-1
• SHA-2 family:
– SHA256
– SHA384 (minimum key length acceptable - 768 bits)
– SHA512 (minimum key length acceptable - 768 bits)
Note: The quality of protection used for the message put and get functions must match. If there is a policy
quality of protection mismatch between the queue and the message in the queue, the message is not
accepted and is sent to the error handling queue. This rule applies for both local and remote queues.
Quality of protection
Advanced Message Security data-protection policies imply a quality of protection (QOP).
The three quality of protection levels in Advanced Message Security include a fourth level
from IBM MQ 9.0 and all depend on cryptographic algorithms that are used to sign and encrypt the
message:
• Privacy - messages placed on the queue must be signed and encrypted.
• Integrity - messages placed on the queue must be signed by the sender.
• Confidentiality - messages placed on the queue must be encrypted. For more information,
see “Qualities of protection available with AMS” on page 498
• None - no data protection is applicable.
554 Securing IBM MQ
A policy that stipulates that messages must be signed when placed on a queue has a QOP of INTEGRITY.
A QOP of INTEGRITY means that a policy stipulates a signature algorithm, but does not stipulate an
encryption algorithm. Integrity-protected messages are also referred to as "SIGNED".
A policy that stipulates that messages must be signed and encrypted when placed on a queue has a
QOP of PRIVACY. A QOP of PRIVACY means that when a policy stipulates a signature algorithm and an
encryption algorithm. Privacy-protected messages are also referred to as "SEALED".
A policy that stipulates that messages must be encrypted when placed on a queue has a
QOP of CONFIDENTIALITY. A QOP of CONFIDENTIALITY means that a policy stipulates an encryption
algorithm.
A policy that does not stipulate a signature algorithm or an encryption algorithm has a QOP of NONE.
Advanced Message Security provides no data-protection for queues that have a policy with a QOP of
NONE.
• On UNIX, and Windows, you use the DELETE POLICY, DISPLAY POLICY, and SET POLICY
(or equivalent PCF) commands to manage your security policies.
– On Windows platforms, administrative tasks can be run from any location as the PATH
environment variable is updated at the installation.
• On IBM i, the DSPMQMSPL, SETMQMSPL, and WRKMQMSPL commands are installed into
the QSYS system library for the primary language of the system when IBM MQ is installed.
Additional national language versions get installed into QSYS29xx libraries according to the language
feature load. For example, a machine with US English as the primary language and Korean as the
secondary language has the US English commands installed into QSYS and the Korean secondary
language load in QSYS2962 as 2962 is the language load for Korean.
• On z/OS, the administrative commands are run using the message security policy utility
(CSQ0UTIL). When policies are created, modified or deleted on z/OS, the changes are not recognized
by Advanced Message Security until the queue manager is stopped and restarted, or the z/OS MODIFY
command is used to refresh the Advanced Message Security policy configuration. For example:
Related tasks
“Creating security policies in AMS” on page 556
Security policies define the way in which a message is protected when the message is put, or how a
message must have been protected when a message is received.
“Changing security policies in AMS” on page 556
You can use Advanced Message Security to alter details of security policies that you have already defined.
“Displaying and dumping security policies in AMS” on page 557
Use the dspmqspl command to display a list of all security policies or details of a named policy
depending on the command-line parameters you supply.
“Removing security policies in AMS” on page 559
To remove security policies in Advanced Message Security, you must use the setmqspl command.
Operating Advanced Message Security
– On z/OS, grant the authorities documented in The message security policy utility
(CSQ0UTIL).
– On other platforms other than z/OS, you must grant the necessary +connect, +inq and
+chg authorities using the setmqaut command.
For more information about configuring security see “Setting up security” on page 112.
• On z/OS, ensure the required system objects have been defined according to the
definitions in CSQ4INSM.
Example
Here is an example of creating a policy on queue manager QMGR. The policy specifies that messages be
signed using the SHA256 algorithm and encrypted using the AES256 algorithm for certificates with DN:
CN=joe,O=IBM,C=US and DN: CN=jane,O=IBM,C=US. This policy is attached to MY.QUEUE:
Here is an example of creating policy on the queue manager QMGR. The policy specifies that
messages be encrypted using the 3DES algorithm for certificates with DNs: CN=john,O=IBM,C=US and
CN=jeff,O=IBM,C=US and signed with the SHA256 algorithm for certificate with DN: CN=phil,O=IBM,C=US
Note:
• The quality of protection being used for the message put and get must match. If the policy quality of
protection that is defined for the message is weaker than that defined for a queue, the message is sent
to the error handling queue. This policy is valid for both local and remote queues.
Related reference
Complete list of setmqspl command attributes
556 Securing IBM MQ
– On z/OS, grant the authorities documented in The message security policy utility
(CSQ0UTIL).
– On other platforms other than z/OS, you must grant the necessary +connect, +inq and
+chg authorities using the setmqaut command.
For more information about configuring security see “Setting up security” on page 112.
Example
Here is an example of creating a policy named MYQUEUE on a queue manager named QMGR, specifying
that messages are to be encrypted using the 3DES algorithm for authors (-a) having certificates with
Distinguished Name (DN) of CN=alice,O=IBM,C=US and signed with the SHA256 algorithm for recipients
(-r) having certificates with DN of CN=jeff,O=IBM,C=US.
To alter this policy, issue the setmqspl command with all attributes from the example changing only the
values you want to modify. In this example, previously created policy is attached to a new queue and its
encryption algorithm is changed to AES256:
Related reference
setmqspl (set security policy)
– On z/OS, grant the authorities documented in The message security policy utility
(CSQ0UTIL).
– On other platforms other than z/OS, you must grant the necessary +connect, +inq and
+chg authorities using the setmqaut command.
For more information about configuring security see “Setting up security” on page 112.
This example shows a command that displays details of all policies defined for venus.queue.manager
and the output it produces:
dspmqspl -m venus.queue.manager
Policy Details:
Policy name: AMS_POL_04_ONE
Quality of protection: INTEGRITY
Signature algorithm: SHA256
Encryption algorithm: NONE
Signer DNs:
CN=signer1,O=IBM,C=US
Recipient DNs: -
Toleration: 0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Policy Details:
Policy name: AMS_POL_06_THREE
Quality of protection: INTEGRITY
Signature algorithm: SHA256
Encryption algorithm: NONE
Signer DNs:
CN=another signer,O=IBM,C=US
Recipient DNs: -
Toleration: 0
This example shows a command that displays details of a selected security policy defined for
venus.queue.manager and the output it produces:
Policy Details:
Policy name: AMS_POL_06_THREE
Quality of protection: INTEGRITY
Signature algorithm: SHA256
Encryption algorithm: NONE
Signer DNs:
CN=another signer,O=IBM,C=US
Recipient DNs: -
Toleration: 0
In the next example, first, we create a security policy and then, we export the policy using the -export
flag:
On z/OS, the exported policy information is written by CSQ0UTIL to the EXPORT DD.
On platforms other than z/OS, redirect the output to a file, for example:
• On UNIX:
558 Securing IBM MQ
1. Log on as a user that belongs to the mqm IBM MQ administration group.
2. Issue . policies.sh.
• On z/OS use the CSQ0UTIL utility, specifying to SYSIN the data set containing the
exported policy information.
Related reference
Complete list of dspmqspl command attributes
– On z/OS, grant the authorities documented in The message security policy utility
(CSQ0UTIL).
– On other platforms other than z/OS, you must grant the necessary +connect, +inq and
+chg authorities using the setmqaut command.
For more information about configuring security see “Setting up security” on page 112.
Example
Here is an example of removing a policy:
Related reference
Complete list of setmqspl command attributes
To use system queue protection on Windows, copy the keystore.conf file to the following
directory:
• SYSTEM.ADMIN.COMMAND.QUEUE
• SYSTEM.ADMIN.CONFIG.EVENT
• SYSTEM.ADMIN.LOGGER.EVENT
• SYSTEM.ADMIN.PERFM.EVENT
• SYSTEM.ADMIN.PUBSUB.EVENT
• SYSTEM.ADMIN.QMGR.EVENT
• SYSTEM.ADMIN.STATISTICS.QUEUE
• SYSTEM.ADMIN.TRACE.ROUTE.QUEUE
• SYSTEM.AUTH.DATA.QUEUE
• SYSTEM.BROKER.ADMIN.STREAM
• SYSTEM.BROKER.CLIENTS.DATA
• SYSTEM.BROKER.CONTROL.QUEUE
• SYSTEM.BROKER.DEFAULT.STREAM
• SYSTEM.BROKER.INTER.BROKER.COMMUNICATIONS
• SYSTEM.BROKER.SUBSCRIPTIONS.DATA
• SYSTEM.CHANNEL.INITQ
• SYSTEM.CHANNEL.SYNCQ
• SYSTEM.CHLAUTH.DATA.QUEUE
• SYSTEM.CICS.INITIATION.QUEUE
• SYSTEM.CLUSTER.COMMAND.QUEUE
• SYSTEM.CLUSTER.HISTORY.QUEUE
• SYSTEM.CLUSTER.REPOSITORY.QUEUE
• SYSTEM.CLUSTER.TRANSMIT.QUEUE
• SYSTEM.COMMAND.INPUT
• SYSTEM.DDELAY.LOCAL.QUEUE
• SYSTEM.DEAD.LETTER.QUEUE
• SYSTEM.DURABLE.SUBSCRIBER.QUEUE
• SYSTEM.HIERARCHY.STATE
• SYSTEM.INTER.QMGR.CONTROL
• SYSTEM.INTER.QMGR.FANREQ
• SYSTEM.INTER.QMGR.PUBS
• SYSTEM.INTERNAL.REPLY.QUEUE
560 Securing IBM MQ
• SYSTEM.JMS.PS.STATUS.QUEUE
• SYSTEM.JMS.REPORT.QUEUE
• SYSTEM.PENDING.DATA.QUEUE
• SYSTEM.PROTECTION.ERROR.QUEUE
• SYSTEM.PROTECTION.POLICY.QUEUE
• SYSTEM.QSG.CHANNEL.SYNCQ
• SYSTEM.QSG.TRANSMIT.QUEUE
• SYSTEM.QSG.UR.RESOLUTION.QUEUE
• SYSTEM.RETAINED.PUB.QUEUE
• SYSTEM.RETAINED.PUB.QUEUE
• SYSTEM.SELECTION.EVALUATION.QUEUE
• SYSTEM.SELECTION.VALIDATION.QUEUE
Procedure
To grant necessary permissions to a user, run:
Note: You only need to set these OAM authorities if you intend to connect clients, to the queue manager,
using Advanced Message Security 7.0.1.
Attention: Browse authority to the SYSTEM.PROTECTION.POLICY.QUEUE is not mandatory in all
situations. IBM MQ optimizes performance by caching policies so that you do not have to browse
records for policy details on the SYSTEM.PROTECTION.POLICY.QUEUE in all cases.
IBM MQ does not cache all the policies available. If there are high number of policies,
IBM MQ caches a limited number of policies. So, if the queue manager has a low
number of policies defined, there is no need to provide the browse option to the
SYSTEM.PROTECTION.POLICY.QUEUE.
However, you should give browse authority to this queue, in case there is a high number of policies
defined, or if you are using old clients. The SYSTEM.PROTECTION.ERROR.QUEUE is used to put
error messages generated by the AMS code. The put authority against this queue is checked only
when you attempt to put an error message to the queue. Your put authority against the queue is
not checked when you attempt to put or get message from an AMS protected queue.
CSQ0UTIL
The utility that allows users to run the setmqspl and dspmqspl commands requires the following
permissions, where the user name is the job user ID:
• For batch connection to the queue manager, issue:
• For access to the SYSTEM.PROTECTION.POLICY.QUEUE, required for the setmqpol command, issue:
• For access to the SYSTEM.PROTECTION.POLICY.QUEUE, required for the dspmqpol command, issue:
562 Securing IBM MQ
RDEFINE MQQUEUE QMgrName.SYSTEM.PROTECTION.POLICY.QUEUE UACC(NONE)
PERMIT QMgrName.SYSTEM.PROTECTION.POLICY.QUEUE CLASS(MQQUEUE)
ID(username) ACCESS(READ)
Procedure
1. To create a self-signed certificate using the OpenSSL tooling shipped with IBM i, issue the following
command from QShell:
The command prompts for various distinguished name attributes for a new self-signed certificate,
including:
• Common Name (CN=)
• Organization (O=)
• Country (C=)
This creates an unencrypted private key and a matching certificate, both in PEM (Privacy Enhanced
Mail) format.
For simplicity, just enter values for common name, organization, and country. These attributes and
values are important when creating a policy.
2. AMS requires that both the certificate and private key are held in the same file. Issue the following
command to achieve this:
The private.pem file in $HOME now contains a matching private key and certificate, while the
mycert.pem file contains all of the public certificates for which you can encrypt messages and
validate signatures.
The two files need to be associated with your environment by creating a keystore configuration file,
keystore.conf, in your default location.
By default, AMS looks for the keystore configuration in a .mqs subdirectory of your home directory.
3. In QShell create the keystore.conf file:
mkdir -p $HOME/.mqs
echo "pem.private = $HOME/private.pem" > $HOME/.mqs/keystore.conf
echo "pem.public = $HOME/mycert.pem" >> $HOME/.mqs/keystore.conf
echo "pem.password = unused" >> $HOME/.mqs/keystore.conf
Procedure
1. At a command line prompt enter;
You need to enter the distinguished name as an intended recipient, and the policy name must match
the queue name to be protected.
3. At a CL command prompt enter, for example:
564 Securing IBM MQ
To see that AMS protection is in effect, put some test messages to the PROTECTED queue, for example
using AMQSPUT0. You can then create an alias queue to browse the raw protected data while at rest.
Procedure
To grant necessary permissions to a user, run:
Browsing using the ALIAS queue name, for example using AMQSBCG4 or WRKMQMMSG, should reveal
larger scrambled messages where a browse of the PROTECTED queue shows cleartext messages.
The scrambled messages are visible, but the original cleartext is not decipherable using the ALIAS queue,
as there is no policy for AMS to enforce matching this name. Hence, the raw protected data is returned.
Related reference
Set MQM Security Policy (SETMQMSPL)
Work with MQ Messages (WRKMQMMSG)
Procedure
Configuration events
To enable configuration events, set CONFIGEV to ENABLED. To disable configuration events, set
CONFIGEV to DISABLED. For example, you can enable configuration events by using the following
MQSC command:
Command events
To enable command events, set CMDEV to ENABLED. To enable command events for commands
except DISPLAY MQSC commands and Inquire PCF commands, set the CMDEV to NODISPLAY. To
disable command events, set CMDEV to DISABLED. For example, you can enable command events by
using the following MQSC command:
Related tasks
Controlling configuration, command, and logger events in IBM MQ
Type = MQCFT_EVENT;
Command = MQCMD_COMMAND_EVENT;
MsgSeqNumber = 1;
Control = MQCFC_LAST;
ParameterCount = 2;
CompCode = MQCC_WARNING;
Reason = MQRC_COMMAND_PCF;
Note: ParameterCount value is two because there are always two parameters of MQCFGR type (group).
Each group consists of appropriate parameters. The event data consists of two groups, CommandContext
and CommandData.
CommandContext contains:
EventUserID
Description: The user ID that issued the command or call that generated the event. (This
is the same user ID that is used to check the authority to issue the command
or call; for commands received from a queue, this is also the user identifier
(UserIdentifier) from the MD of the command message).
Identifier: MQCACF_EVENT_USER_ID.
Data type: MQCFST.
Maximum length: MQ_USER_ID_LENGTH.
Returned: Always.
EventOrigin
566 Securing IBM MQ
Identifier: MQIACF_EVENT_ORIGIN.
Data type: MQCFIN.
Values: MQEVO_CONSOLE
Console command - command line.
MQEVO_MSG
Command message from IBM MQ Explorer plugin.
Returned: Always.
EventQMgr
Description: The queue manager where the command or call was entered. (The queue
manager where the command is executed and that generates the event is in
the MD of the event message).
Identifier: MQCACF_EVENT_Q_MGR.
Data type: MQCFST.
Maximum length: MQ_Q_MGR_NAME_LENGTH.
Returned: Always.
EventAccountingToken
EventIdentityData
EventApplType
Description: For commands received as a message (MQEVO_MSG), the type of application
(PutApplType) from the MD of the command message.
Identifier: MQIACF_EVENT_APPL_TYPE.
Data type: MQCFIN.
Returned: Only if EventOrigin is MQEVO_MSG.
EventApplName
Description: For commands received as a message (MQEVO_MSG), the name of the
application (PutApplName) from the MD of the command message.
EventApplOrigin
Command
Format = MQFMT_EVENT
Peristence = MQPER_PERSISTENCE_AS_Q_DEF
PutApplType = MQAT_QMGR //for both CLI and command server
Message buffer consist of MQCFH structure and the parameter structure that follows it. Possible MQCFH
values can be found in Event message MQCFH (PCF header).
Here are selected MQCFH values:
Type = MQCFT_EVENT
Command = MQCMD_CONFIG_EVENT
MsgSeqNumber = 1 or 2 // 2 will be in case of Change Object event
Control = MQCFC_LAST or MQCFC_NOT_LAST //MQCFC_NOT_LAST will be in case of 1 Change Object
event
ParameterCount = reflects number of PCF parameters following MQCFH
CompCode = MQCC_WARNING
Reason = one of {MQRC_CONFIG_CREATE_OBJECT, MQRC_CONFIG_CHANGE_OBJECT,
MQRC_CONFIG_DELETE_OBJECT}
568 Securing IBM MQ
The parameters following MQCFH are:
EventUserID
Description: The user ID that issued the command or call that generated the event. (This
is the same user ID that is used to check the authority to issue the command
or call; for commands received from a queue, this is also the user identifier
(UserIdentifier) from the MD of the command message).
Identifier: MQCACF_EVENT_USER_ID
Data type: MQCFST.
Maximum length: MQ_USER_ID_LENGTH.
Returned: Always.
SecurityId
EventOrigin
Returned: Always.
EventQMgr
Description: The queue manager where the command or call was entered. (The queue
manager where the command is executed and that generates the event is in
the MD of the event message).
Identifier: MQCACF_EVENT_Q_MGR
Data type: MQCFST
Maximum length: MQ_Q_MGR_NAME_LENGTH
Returned: Always.
ObjectType
Description: Object type.
Identifier: MQIACF_OBJECT_TYPE
Data type: MQCFIN
Returned: Always.
PolicyName
PolicyVersion
TolerateFlag
SignatureAlgorithm
EncryptionAlgorithm
Description: The Advanced Message Security policy encryption algorithm.
Identifier: MQIA_ENCRYPTION_ALGORITHM
Data type: MQCFIN
Value: 237 - a numeric value defined in IBM MQ 8.0 or in the cmqc.h file.
Returned: Whenever there is an encryption algorithm defined in the IBM MQ policy
570 Securing IBM MQ
SignerDNs
RecipientDNs
DRQJP0103E The Advanced Message Security Java interceptor failed to protect message.
com.ibm.security.pkcsutil.PKCSException: Error encrypting contents
(java.security.InvalidKeyException: Illegal key size or default parameters)
OSGi support
To use OSGi bundle with Advanced Message Security additional parameters are required.
Run the following parameter during the OSGi bundle startup:
-Dorg.osgi.framework.system.packages.extra=com.ibm.security.pkcs7
When using encrypted password in your keystore.conf, the following statement must be added when OSGi
bundle is running:
Restriction: AMS supports communication using only MQ Base Java Classes for queues protected from
within the OSGi bundle.
572 Securing IBM MQ
Local queuing of integrity-protected messages on z/OS
This example details the Advanced Message Security policies and certificates needed to send and retrieve
integrity-protected messages to and from a queue, local to the putting and getting applications.
This RACDCERT command creates a CA certificate which can then be used to issue a user certificate for
user 'TELLER5'. For example:
Your installation will have procedures for choosing or creating a CA certificate, as well as procedures for
issuing certificates and distributing them to relevant systems.
When exporting and importing these certificates, Advanced Message Security requires:
• The CA certificate (chain).
• The user certificate and its private key.
If you are using RACF, the RACDCERT EXPORT command can be used to export certificates to a data
set, and the RACDCERT ADD command can be used to import certificates from the data set. For more
information about these and other RACDCERT commands, refer to z/OS: Security Server RACF Command
Language Reference.
The certificates in this case, are required on the z/OS system running queue manager BNK6.
When the certificates have been imported on the z/OS system running BNK6, the user certificate requires
the TRUST attribute. The RACDCERT ALTER command can be used to add the TRUST attribute to the
certificate. For example:
This creates a key ring for the Advanced Message Security task user, WMQBNK6, and a key ring for the
sending user, 'TELLER5'. Note that the key ring name drq.ams.keyring is mandatory, and the name is
case-sensitive.
When the key rings have been created, the relevant certificates can be connected:
The sending user certificate must be connected as DEFAULT. If the sending user has more than one
certificate in its drq.ams.keyring, the default certificate is used for signing purposes.
The creation and modification of certificates is not recognized by Advanced Message Security until the
queue manager is stopped and restarted, or the z/OS MODIFY command is used to refresh the Advanced
Message Security certificate configuration. For example:
F BNK6AMSM,REFRESH KEYRING
In this policy, the queue manager is identified as BNK6. The policy name and associated queue is
FIN.XFER.Q7. The algorithm that is used to generate the sender's signature is MD5, and the distinguished
name (DN) of the sending user is 'CN=Teller5,O=BCO,C=US'.
After defining the policy, either restart the BNK6 queue manager, or use the z/OS MODIFY command to
refresh the Advanced Message Security policy configuration. For example:
F BNK6AMSM,REFRESH POLICY
574 Securing IBM MQ
Local queuing of privacy-protected messages on z/OS
This example details the Advanced Message Security policies and certificates needed to send and retrieve
privacy-protected messages to and from a queue, local to the putting and getting applications. Privacy-
protected messages are both signed and encrypted.
The example queue manager and local queue are as follows:
This RACDCERT command creates a CA certificate which can then be used to issue user certificates for
users 'TELLER5' and 'FINADM2'. For example:
Your installation will have procedures for choosing or creating a CA certificate, as well as procedures for
issuing certificates and distributing them to relevant systems.
When exporting and importing these certificates, Advanced Message Security requires:
• The CA certificate (chain).
• The sending user certificate and its private key.
• The recipient user certificate and its private key.
If you are using RACF, the RACDCERT EXPORT command can be used to export certificates to a data
set, and the RACDCERT ADD command can be used to import certificates from the data set. For more
information about these and other RACDCERT commands, refer to RACDCERT (Manage RACF digital
certificates) in the z/OS: Security Server RACF Command Language Reference.
The certificates in this case are required on the z/OS system running queue manager BNK6.
This creates a key ring for the Advanced Message Security task user and key rings for the sending
and recipient users. Note that the key ring name drq.ams.keyring is mandatory, and the name is case-
sensitive.
When the key rings have been created, the relevant certificates can be connected.
The sending and recipient user certificates must be connected as DEFAULT. If either user has more than
one certificate in its drq.ams.keyring, the default certificate is used for signing and decryption purposes.
The recipient user's certificate must also be connected to the Advanced Message Security task user's key
ring with USAGE(SITE). This is because the Advanced Message Security task needs the recipient's public
key when encrypting the message data. The USAGE(SITE) prevents the private key from being accessible
in the key ring.
The creation and modification of certificates is not recognized by Advanced Message Security until the
queue manager is stopped and restarted, or the z/OS MODIFY command is used to refresh the Advanced
Message Security certificate configuration. For example:
F BNK6AMSM,REFRESH KEYRING
576 Securing IBM MQ
Use the CSQ0UTIL utility to run the following command:
In this policy, the queue manager is identified as BNK6. The policy name and associated queue
is FIN.XFER.Q8. The algorithm that is used to generate the sender's signature is SHA1, and the
distinguished name (DN) of the sending user is 'CN=Teller5,O=BCO,C=US', and the recipient user is
'CN=FinAdm2,O=BCO,C=US'. The algorithm that is used to encrypt the message data is 3DES.
After defining the policy, either restart the BNK6 queue manager, or use the z/OS MODIFY command to
refresh the Advanced Message Security policy configuration. For example:
F BNK6AMSM,REFRESH POLICY
Note: For this example, BNK6 and BNK7 are queue managers running on different z/OS systems.
These users are used:
Your installation will have procedures for choosing or creating a CA certificate, as well as procedures for
issuing certificates and distributing them to relevant systems.
When exporting and importing these certificates, Advanced Message Security require:
• The CA certificate (chain).
• The sending user certificate and its private key.
If you are using RACF, the RACDCERT EXPORT command can be used to export certificates to a data
set, and the RACDCERT ADD command can be used to import certificates from the data set. For more
information about these and other RACDCERT commands, refer to RACDCERT (Manage RACF digital
certificates) in the z/OS: Security Server RACF Command Language Reference.
The certificates in this case, are required on the z/OS system running queue manager BNK6 and BNK7.
In this example, the sending certificate must be imported on the z/OS system running BNK6, and the
CA certificate must be imported on the z/OS system running BNK7. When the certificates have been
imported, the user certificate requires the TRUST attribute. The RACDCERT ALTER command can be used
to add the TRUST attribute to the certificate. For example, on BNK6:
This creates a key ring for the sending user on BNK6. Note that the key ring name drq.ams.keyring is
mandatory, and the name is case-sensitive.
On BNK7:
This creates a key ring for the Advanced Message Security task user on BNK7. No user key ring is required
for 'TELLER5' on BNK7.
When the key rings have been created, the relevant certificates can be connected.
On BNK6:
On BNK7:
578 Securing IBM MQ
The sending user certificate must be connected as DEFAULT. If the sending user has more than one
certificate in its drq.ams.keyring, the default certificate is used for signing purposes.
The creation and modification of certificates is not recognized by Advanced Message Security until the
queue manager is stopped and restarted, or the z/OS MODIFY command is used to refresh the Advanced
Message Security certificate configuration. For example:
On BNK6:
F BNK6AMSM,REFRESH,KEYRING
On BNK7:
F BNK7AMSM,REFRESH,KEYRING
In this policy, the queue manager is identified as BNK6. The policy name and associated queue is
FIN.XFER.Q7. The algorithm that is used to generate the sender's signature is MD5, and the distinguished
name (DN) of the sending user is 'CN=Teller5,O=BCO,C=US'.
Also, use the CSQ0UTIL utility to run the following command to define an integrity policy for the local
queue on BNK7:
In this policy, the queue manager is identified as BNK7. The policy name and associated queue is
FIN.RCPT.Q7. The algorithm expected for the sender's signature is MD5, and the distinguished name (DN)
of the sending user is expected to be 'CN=Teller5,O=BCO,C=US'.
After defining the two policies, either restart the BNK6 and BNK7 queue managers, or use the z/OS
MODIFY command to refresh the Advanced Message Security policy configurations. For example:
On BNK6:
F BNK6AMSM,REFRESH,POLICY
On BNK7:
F BNK7AMSM,REFRESH,POLICY
Note: For this example, BNK6 and BNK7 are queue managers running on different z/OS systems of the
same name.
These users are used:
This RACDCERT command creates a CA certificate which can then be used to issue user certificates for
users 'TELLER5' and 'FINADM2'. For example:
Your installation will have procedures for choosing or creating a CA certificate, as well as procedures for
issuing certificates and distributing them to relevant systems.
When exporting and importing these certificates, Advanced Message Security requires:
• The CA certificate (chain).
• The sending user certificate and its private key.
• The recipient user certificate and its private key.
If you are using RACF, the RACDCERT EXPORT command can be used to export certificates to a data
set, and the RACDCERT ADD command can be used to import certificates from the data set. For more
information about these and other RACDCERT commands, refer to z/OS: Security Server RACF Command
Language Reference.
580 Securing IBM MQ
The certificates in this case, are required on the z/OS system running queue manager BNK6 and BNK7.
In this example, the sending and recipient certificates must be imported on the z/OS system running
BNK6, and the CA and recipient certificates must be imported on the z/OS system running BNK7. When
the certificates have been imported, the user certificates require the TRUST attribute. The RACDCERT
ALTER command can be used to add the TRUST attribute to the certificate. For example:
On BNK6:
On BNK7:
This creates a key ring for the Advanced Message Security task user and a key ring for the sending user on
BNK6. Note that the key ring name drq.ams.keyring is mandatory, and the name is case-sensitive.
On BNK7:
This creates a key ring for the Advanced Message Security task user and a key ring for the recipient user
on BNK7.
When the key rings have been created, the relevant certificates can be connected.
On BNK6:
On BNK7:
The sending and recipient user certificates must be connected as DEFAULT. If either user has more than
one certificate in its drq.ams.keyring, the default certificate is used for signing and encryption/decryption
purposes.
F BNK6AMSM,REFRESH,KEYRING
On BNK7:
F BNK7AMSM,REFRESH,KEYRING
In this policy, the queue manager is identified as BNK6. The policy name and associated queue
is FIN.XFER.Q7. The algorithm that is used to generate the sender's signature is SHA1, the
distinguished name (DN) of the sending user is 'CN=Teller5,O=BCO,C=US', and the recipient user is
'CN=FinAdm2,O=BCO,C=US'. The algorithm that is used to encrypt the message data is 3DES.
Also, use the CSQ0UTIL utility to run the following command to define a privacy policy for the local queue
on BNK7:
In this policy, the queue manager is identified as BNK7. The policy name and associated queue is
FIN.RCPT.Q7. The algorithm expected for the sender's signature is SHA1, the distinguished name
(DN) of the sending user is expected to be 'CN=Teller5,O=BCO,C=US', and the recipient user is
'CN=FinAdm2,O=BCO,C=US'. The algorithm that is used to decrypt the message data is 3DES.
After defining the two policies, either restart the BNK6 and BNK7 queue managers, or use the z/OS
MODIFY command to refresh the Advanced Message Security policy configuration. For example:
On BNK6:
F BNK6AMSM,REFRESH,POLICY
On BNK7:
F BNK7AMSM,REFRESH,POLICY
582 Securing IBM MQ
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently available in
your area. Any reference to an IBM product, program, or service is not intended to state or imply that
only that IBM product, program, or service may be used. Any functionally equivalent product, program, or
service that does not infringe any IBM intellectual property right may be used instead. However, it is the
user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this
document. The furnishing of this document does not grant you any license to these patents. You can
send license inquiries, in writing, to:
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property
Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in
any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of
the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
exchange of information between independently created programs and other programs (including this
one) and (ii) the mutual use of the information which has been exchanged, should contact:
IBM Corporation
Software Interoperability Coordinator, Department 49XA
3605 Highway 52 N
Rochester, MN 55901
U.S.A.
Trademarks
IBM, the IBM logo, ibm.com®, are trademarks of IBM Corporation, registered in many jurisdictions
worldwide. A current list of IBM trademarks is available on the Web at "Copyright and trademark
information"www.ibm.com/legal/copytrade.shtml. Other product and service names might be trademarks
of IBM or other companies.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or
both.
584 Notices
UNIX is a registered trademark of The Open Group in the United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
This product includes software developed by the Eclipse Project (http://www.eclipse.org/).
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or
its affiliates.
Notices 585
586 Securing IBM MQ
IBM®
Part Number:
(1P) P/N: