Secure Messaging Scenarios With WebSphere MQ

Transcription

IBM WebSphere Front coverSecure MessagingScenarios withWebSphere MQUsing strong authenticationUsing granular authorizationImplementing revocationcheckingT.Rob WyattGlenn BaddeleyNeil CaseyLong NguyenJørgen H. PedersenMorten Sætraibm.com/redbooks

International Technical Support OrganizationSecure Messaging Scenarios with WebSphere MQNovember 2012SG24-8069-00

Note: Before using this information and the product it supports, read the information in “Notices” onpage xi.First Edition (November 2012)This edition applies to WebSphere MQ Version 7.5. Copyright International Business Machines Corporation 2012. All rights reserved.Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Corp.

ContentsNotices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiTrademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiiThe team who wrote this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiiNow you can become a published author, too! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvComments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvStay connected to IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviChapter 1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.1 Why read this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.2 Currency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.3 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1233Chapter 2. What is security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.1 Defining requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Security as a system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 The security lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3.1 Provisioning access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3.2 Revoking access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3.3 Monitoring and accountability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.3.4 Ongoing maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.3.5 Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Chapter 3. Authentication and authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.1 Relationship between authentication and authorization . . . . . . . . . . . . . . . . . . . . . . . .3.2 Authentication in WebSphere MQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.1 Connection authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.2 Message-level authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.3 Authorization in WebSphere MQ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.3.1 Connection-level authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.3.2 Message-level authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1314141416161619Chapter 4. Connection-level security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2 Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.1 Assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.2 Origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.3 Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3 Identity resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.4 Binding authentication to authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.5 Default CHLAUTH rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.6 Provisioning access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.7 Upgrade and migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.8 Access control lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.9 Authorizing topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.10 Authorizations that grant administrative access . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.10.1 Granting crt authority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .212222222323232424252626272828 Copyright IBM Corp. 2012. All rights reserved.iii

iv4.10.2 Granting set authority on the queue manager . . . . . . . . . . . . . . . . . . . . . . . . .4.10.3 Granting setid or setall on queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.11 Common mistakes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.11.1 Unprotected channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.11.2 Granting access to principals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.11.3 Administrative users with mqm as a secondary group . . . . . . . . . . . . . . . . . . . .4.11.4 Unquoted asterisks in setmqaut commands . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.11.5 Using generic authorizations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.11.6 Granting access to the nobody group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282929303031323334Chapter 5. Message-level security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2 Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.3 Use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.3.1 Business-to-business (B2B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.3.2 End-to-end encryption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.3.3 Data aggregation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.3.4 Command and control flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3536363737383839Chapter 6. WebSphere MQ security controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2 Operating system and file system resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.1 File system as the root of trust in the server . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.2 Restrict file system access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.3 Restrict access to mqm home directory and tools . . . . . . . . . . . . . . . . . . . . . . . .6.2.4 Limit access to the mqm user ID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.5 mqm group membership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.6 Files and directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.7 Fully specified names in mqm cron job scheduler . . . . . . . . . . . . . . . . . . . . . . . .6.2.8 Do not administer WebSphere MQ as root . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.9 Protection of WebSphere MQ backups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.10 Increase the size of error logs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.11 Archiving error logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.12 Isolation of staging environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.13 Protect user-provided executables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3 Queue manager local resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.1 Define a system dead letter queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.2 Considerations for dead-letter queue handler. . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.3 Enable event messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.4 Restrict access to remote clustered queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.5 Do not disable WebSphere MQ authorization checks. . . . . . . . . . . . . . . . . . . . . .6.3.6 Generic authorization profile names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.7 PROCESS and SERVICE objects should use explicit paths . . . . . . . . . . . . . . . .6.3.8 Run the command server only when it is needed . . . . . . . . . . . . . . . . . . . . . . . . .6.3.9 Limited use of trigger monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.10 Minimal authority on SYSTEM objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.11 Object names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3.12 Realistic attribute values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4 Channels, transmission queues, and communications . . . . . . . . . . . . . . . . . . . . . . . . .6.4.1 Use channel authentication rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.2 Disable all incoming SYSTEM channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.3 Always specify a low-privileged MCAUSER . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.4 Avoid use of put authority context on channels . . . . . . . . . . . . . . . . . . . . . . . . . 2535455555657575959Secure Messaging Scenarios with WebSphere MQ

6.4.5 Do not enable automatic channel definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.6 Avoid using a default transmission queue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.7 Avoid use of SERVER channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.8 Restrict access to transmission queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.9 Increase message retry on channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.10 Use the managed listener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.11 Specify local address on outbound channels . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.12 Usage of port numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.4.13 Queue manager to queue manager versus clients . . . . . . . . . . . . . . . . . . . . . . .6.4.14 Separate channels for application messaging . . . . . . . . . . . . . . . . . . . . . . . . . .6.5 Queues and other objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.5.1 Restrict access to system default objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.5.2 Least access authorization model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.5.3 Authority to SYSTEM.BASE.TOPIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.5.4 Considerations for dead letter queue and topics. . . . . . . . . . . . . . . . . . . . . . . . . .6.6 Applications using WebSphere MQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.6.1 Avoid setting message context fields . . .

7.1.1 WebSphere MQ security management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.1.2 TLS/SSL certificate and key repository management. . . . . . . . . . . . . . . . . . . . . . 76 7.1.3 Queue sharing groups