SAF Security

The System Authorization Facility (SAF) is the common front door z/OS products use to ask “is this user allowed to do this on this resource?” IBM MQ for z/OS is a SAF caller: queue opens, connects, and many administrative actions translate into SAF requests with resource class, profile name, and access level. SAF itself does not store rules—it routes to the installed external security manager (ESM), almost always RACF in IBM shops, sometimes CA ACF2 or Broadcom Top Secret. Understanding SAF separates platform security architecture from MQ object names beginners memorize in tutorials. When SAF denies access, applications see MQRC_NOT_AUTHORIZED (2035) and operators work with security teams on profiles, not on mqauth.conf files. This tutorial explains SAF’s role, the request and return code model, how MQ maps objects to SAF resources, differences from distributed OAM, auditing interfaces, performance and caching considerations at a high level, and coordinated troubleshooting with RACF administrators.

Why MQ Uses SAF Instead of OAM on z/OS

Distributed IBM MQ queue managers use the Object Authority Manager to store grants for principals and groups. z/OS enterprises standardized on SAF decades before cloud MQ; duplicating a second permission database for every subsystem would fragment audits. MQ therefore integrates with SAF so one RACF profile change can remove a user from datasets, transactions, and queues consistently. Skills you learn for CICS SAF checks transfer to MQ SAF checks—the resource class and profile naming differ, the pattern is the same.

SAF request components (conceptual)
ComponentRoleExample
Resource classCategory of resourceMQQUEUE (per IBM MQ doc)
Profile nameIdentifies specific resourceqmgr.queue.name pattern
User ID / ACEEWho is askingCICS region user PAYSRV
Access requestedREAD, UPDATE, CONTROL, ALTERUPDATE for MQPUT

SAF Return Codes and MQ Reason Codes

When SAF returns authorized, MQ continues the MQI call. When SAF returns not authorized, MQ surfaces 2035 to the application or fails the command. Other reason codes appear for object missing, queue full, or syncpoint errors—do not assume every failure is SAF without reading the reason code. MQ messages and CSQ output often include the user ID and sometimes the profile name that failed. Provide that text to security administrators verbatim to speed LISTDSD lookups.

text
1
2
3
4
5
Application MQOPEN fails -> MQ reason 2035 (NOT_AUTHORIZED) -> MQ invoked SAF for class/profile/access -> ESM (e.g. RACF) denied -> Fix: PERMIT correct ID/GROUP on profile, REFRESH class

Resource Classes and Profile Naming

IBM MQ documents which SAF/RACF classes apply to queues, queue managers, channels, and commands for each release. Profile names often concatenate queue manager and object identifiers; wildcards reduce profile count but require governance. Security teams sometimes split test and production with different queue manager names in profiles even when object names match. Never copy production profiles to test without changing queue manager qualifiers—accidental production grants in test IDs are a common audit finding.

SAF and Connection Security

Before MQOPEN, MQCONN or equivalent attach may require SAF authority to the queue manager resource class. Distributed client connections to z/OS queue managers still end in SAF checks for the asserted user ID after CONNAUTH and TLS mapping. The full stack is: network TLS, connection authentication (CONNAUTH), channel CHLAUTH and MCAUSER, then SAF on each object operation. A failure at any layer looks like “MQ broken” to applications but has different owners.

Explainer: Universal Security Intercom

SAF is the intercom every program uses to ask security the same way. IBM MQ speaks into the intercom; RACF (or another guard) answers yes or no. Without the intercom, every program would need its own guard with separate rulebooks.

ESM Neutrality: RACF, ACF2, Top Secret

SAF abstracts the ESM. MQ documentation primarily examples RACF because of IBM portfolio prevalence. ACF2 and Top Secret sites use the same SAF entry points with ESM-specific administration commands. Profile syntax and class names differ—MQ administrators on those systems pair with their ESM experts using IBM MQ for z/OS manuals for their product. The conceptual tutorial here still applies: profiles, access levels, user IDs, audit.

Auditing SAF Decisions

Failed accesses often generate RACF SMF type records when auditing is enabled. Successful accesses may be audited for high-risk profiles only due to volume. MQ’s own error logs supplement SMF. Incident response playbooks should list which team pulls SMF versus AMQ logs. Periodic access certification uses RACF reports filtered to MQ classes.

Performance and Caching (High Level)

High-volume MQ applications open and close queues frequently. z/OS and MQ may cache SAF decisions per internal rules to reduce RACF load. Caching does not mean security is off—profile changes propagate after refresh intervals documented by IBM and RACF. After RACF maintenance, operators may need MQ refresh or application restart if accesses behave inconsistently—follow site runbooks.

SAF Versus OAM on Distributed MQ

  • SAF — platform standard on z/OS; profiles in ESM; audited via RACF SMF.
  • OAM — queue manager local authority store; setmqaut/dspmqaut on distributed.
  • Same intent — gate MQOPEN/MQPUT/MQGET and admin by identity.
  • Hybrid links — channel from Linux to z/OS still hits SAF on z/OS for the mapped user.

Troubleshooting SAF Denials

  1. Confirm reason code 2035 versus other codes.
  2. Identify effective user ID (CICS, batch, channel MCAUSER).
  3. Map queue or object to documented profile name format.
  4. LIST profile in ESM; verify PERMIT to user or group.
  5. Check universal access (UACC) is not NONE when unintended.
  6. Refresh RACF class after changes; retest MQOPEN.

Explain Like I'm Five: SAF Security

SAF is how IBM MQ asks the mainframe security guard one standard question: “Can this person touch this thing?”

Practice Exercises

Exercise 1

Write the SAF request components for a batch job MQPUT to QUEUE.PAY.IN under user PAYBAT.

Exercise 2

Compare one distributed dspmqaut line to its SAF/RACF equivalent conceptually.

Exercise 3

List three teams to involve when production sees sudden widespread 2035 after RACF maintenance.

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. SAF is:

  • z/OS security API
  • A queue type
  • TLS cipher
  • JCL statement

2. RACF sits:

  • Behind SAF as ESM
  • Inside MQ client jar
  • On Linux only
  • In CCDT

3. MQRC_NOT_AUTHORIZED is often:

  • 2035
  • 2009
  • 2085
  • 1999

4. ACF2 and Top Secret also:

  • Answer SAF requests
  • Replace TCP
  • Disable OAM on z/OS
  • Remove channels
Published
Read time20 min
AuthorMainframeMaster
Verified: IBM MQ for z/OS security documentation