Most security operations centres can see every Windows logon in the estate and almost nothing that happens on the z/OS systems that run payments, policies and payroll. The data exists: System Management Facilities (SMF) records every RACF decision, job start, TCP/IP connection and Db2 audit event. What is missing is a pipeline that selects the right record types, gets them off the mainframe in near real time, parses binary records into fields a SIEM can query, and turns them into detections an analyst who has never used ISPF can triage. This guide is for detection engineers and SOC leads building that pipeline with mainframe systems programmers. It covers record selection, SMFPRMxx and log stream design, the real-time interface, parsing and field mapping, starter detections and how to measure the feed. Platforms and products are named only to explain the data path. For evidence handling during an incident, see the Mainframe Incident Response and Forensics Guide; for RACF configuration, see the Mainframe Identity and RACF Security Guide.
Key takeaways
- Select by question, not by volume. Type 80 (RACF), type 30 (jobs and address spaces), type 119 (TCP/IP, FTP, TN3270) and type 102 (Db2 audit) answer most SOC questions; data set and catalog records are high volume and best forwarded with filters.
- Log streams first, then real time. The SMF real-time interface needs SMF in log stream recording mode; in-memory resources named on INMEM are protected by FACILITY profiles of the form IFA.IFASMF.name.
- Parse on or near the platform. SMF records are binary with self-defining sections; ship parsed, named fields (user, event, qualifier, resource, source IP) rather than raw hex.
- Start with ten detections the SOC can triage. Privileged RACF commands, SETROPTS changes, logon failure bursts, FTP from new addresses, Db2 grants and audit trace stops cover the highest-value behaviours.
- Monitor the feed as a detection. A silent mainframe source looks exactly like a quiet mainframe; alert on gaps per system and record type.
Why SMF is different from other log sources
- Format: SMF records are binary, with a standard header, a record type and subtype, and triplets (offset, length, count) pointing to sections. They are not text lines a syslog collector can read.
- Volume and cost: a busy LPAR writes millions of records a day, most of them performance and accounting data. Forwarding everything can cost more in SIEM ingestion than the mainframe security budget.
- Configuration ownership: SMF recording is set in the SMFPRMxx parmlib member and changed with SET SMF=xx by systems programmers. Security teams usually do not own it and need a change process.
- What gets audited depends on RACF: type 80 content depends on RACF audit options (SETROPTS AUDIT, LOGOPTIONS, UAUDIT and profile AUDIT settings). If RACF is not told to log an event, no SIEM can find it.
- Identity semantics: user IDs are eight characters, many are started tasks and batch IDs, and surrogate and OMVS UIDs complicate attribution. See the Mainframe Service Accounts and Batch Job Identity Guide.
Record selection: what to forward and why
| Record type | Source | Security value | Forwarding advice |
|---|---|---|---|
| 80 | RACF | Logons and job initiation (event 1 JOBINIT), resource access (2 ACCESS), user and group changes (10 ADDUSER, 13 ALTUSER, 14 CONNECT, 17 DELUSER), PERMIT (19), RDEFINE and RALTER (21, 20), SETROPTS (24), RVARY (25), z/OS UNIX events, RACDCERT (66) | Forward all, real time. This is the core identity feed. |
| 81, 83 | RACF | 81: RACF initialisation at IPL; 83: security label changes and other security events including R_auditx and LDAP subtypes | Forward all; low volume. |
| 30 | z/OS | Job, step and address space start and end, program name, submitter | Forward subtypes for job start and end; filter interval records. |
| 119 | Communications Server | TCP connection initiation (1) and termination (2), TN3270E session initiation and termination (20, 21), FTP server transfer completion (70), FTP server logon failure (72), FTP server session (104), IPSec tunnel events (73 to 80), VTAM 3270 IDS events (81), OpenSSH (94 to 98) | Forward subtypes 1, 2, 20, 21, 70, 72, 104 and 81; others on demand. |
| 102 | Db2 for z/OS | Audit trace: authorisation failures, grants and revokes, use of SYSADM and DBADM authority, trusted context use | Forward audit IFCIDs only, not performance traces. |
| 90 | z/OS | System changes such as SET commands and dynamic changes to system lists | Forward all; low volume, high value for persistence. |
| 14, 15, 17, 18 | DFSMS | Data set read, update, scratch and rename | Filter to sensitive data set prefixes or forward to cheaper storage. |
| 110 | CICS | Transaction monitoring and statistics | Usually not needed for SOC detections; use for investigations. |
Type 80 event names and numbers come from the RACF auditable event table (89 codes as published). The event code qualifier field (SMF80EVQ) carries the outcome, such as success or the reason for a failure, so parse it rather than inferring success from the event code alone.
Pipeline architecture: from SMFPRMxx to the SIEM
Recording configuration
- Log stream recording: record SMF to log streams rather than SYS1.MANx data sets. Log streams allow routing record types to different streams with LSNAME and DEFAULTLSNAME, and record signing (RECSIGN) applies to records written to log streams.
- In-memory resources: add an INMEM parameter per in-memory resource, with a name of the form IFASMF.rname, the RESSIZMAX size and the TYPE list. Record types named on INMEM are not written to the DEFAULTLSNAME stream, so to keep a durable copy list the type on both INMEM and an LSNAME.
- Access control: each in-memory resource is protected by a FACILITY class profile IFA.IFASMF.rname, with READ access for the collector's user ID. If that SAF check fails when SET SMF=xx is issued, SMF rejects the whole SMFPRMxx member, so test in a lower environment first.
Collection
The SMF real-time interface lets a collector query available resources (IFAMQRY), connect (IFAMCON), read records in a loop as they are written (IFAMGET) and disconnect (IFAMDSC). Commercial and IBM collectors use this interface or read log streams directly, parse the records, and send them over TCP or TLS to the SIEM or a streaming platform. Batch alternatives, such as nightly IFASMFDP dumps transferred by FTP, leave up to a day of activity unseen and should be a fallback only.
| Approach | Latency | Mainframe cost | When to use |
|---|---|---|---|
| Real-time interface with on-platform parsing | Seconds | Collector address space CPU, partly offloadable to zIIP depending on product | Production LPARs with RACF, TCP/IP and Db2 feeds |
| Log stream reader with off-platform parsing | Seconds to minutes | Lower on-platform CPU; parsing load moves to distributed servers | Where mainframe CPU is tightly constrained |
| Scheduled dump and transfer | Hours | Low; batch job | Development LPARs, compliance archives, recovery when the real-time feed fails |
Transport and the collector identity
The collector is a non-human identity with READ to every security event on the system. Give it a dedicated protected user ID (no password, started task or batch only), READ only on the IFA profiles it needs, and TLS with certificate authentication to the receiving endpoint, using AT-TLS policy where the product supports it. Alert on any change to its RACF profile, and keep its certificate and keyring under the same rotation process as other machine credentials.
Parsing and field mapping
Normalise SMF fields to the SIEM's common schema so mainframe events join identity, VPN and endpoint data. Map at least these fields:
| Common field | Type 80 | Type 119 | Type 30 |
|---|---|---|---|
| Timestamp and system | Header time and date, system ID | Header time and date, system ID | Header time and date, system ID |
| User | User ID, group, and for commands the target user or profile | Logged-on user for FTP and TN3270 records | Job owner user ID |
| Action and outcome | Event code (SMF80EVT) and qualifier (SMF80EVQ) | Subtype; FTP reply codes | Subtype; completion code |
| Object | Resource or data set name, class, access level requested and allowed | File name, bytes transferred | Job name, step, program |
| Network | Terminal or port of entry where present | Local and remote IP and port | Not applicable |
- Enrich user IDs: join RACF user IDs to the HR or identity directory and tag started task, batch and human IDs. Without this, analysts cannot tell a scheduler ID from a person.
- Preserve raw: keep the original record or a hash of it in cold storage for investigations, alongside signature records if record signing is on.
- Decode once: keep the mapping of event codes and qualifiers in a lookup table owned by the detection team, versioned with z/OS releases.
Starter detections
These rules are behaviour descriptions to implement in your SIEM's query language. Tune thresholds on 30 days of baseline.
| Detection | Logic | ATT&CK |
|---|---|---|
| Privileged attribute granted | Type 80 ALTUSER (13) or ADDUSER (10) adding SPECIAL, OPERATIONS or AUDITOR, outside an approved change | T1098 |
| New user created by an unusual administrator | Type 80 ADDUSER (10) by an ID that has not created users in the baseline period | T1136 |
| Security options changed | Any type 80 SETROPTS (24), especially audit or password rule changes | T1685 |
| Access granted to sensitive resources | Type 80 PERMIT (19) or RALTER (20) on APF libraries, parmlib, RACF database data sets or FACILITY profiles such as IFA.* | T1098 |
| Logon failure burst | Type 80 JOBINIT (1) failures for one user or one source above threshold; type 119 subtype 72 FTP logon failures | T1110 |
| Revoked or dormant ID used | Successful JOBINIT for an ID with no activity for 90 days, or after an HR leaver date | T1078 |
| FTP transfer to a new destination | Type 119 subtype 70 to a remote IP not seen in the baseline, or with byte counts far above the user's norm | T1048 |
| Db2 privilege change | Type 102 audit records for GRANT of SYSADM, DBADM or SECADM, or grants on audited tables | T1098 |
| Audit trace stopped | Db2 audit trace stop, RACF audit options reduced, or SMF recording changes in type 90 | T1685 |
| Mass data set updates by one job | Type 15 updates across many data sets from one job in a short window | T1486 |
For each rule, document the RACF or Db2 setting it depends on. A SETROPTS detection is useless if command auditing is off, and a Db2 grant rule fails silently if the SECMAINT audit category is not active in an audit policy. Db2 audit policies are rows in SYSIBM.SYSAUDITPOLICIES with categories including CHECKING, VALIDATE, OBJMAINT, EXECUTE, CONTEXT, SECMAINT, SYSADMIN and DBADMIN, started with START TRACE using the AUDTPLCY option; policies can be defined to start at Db2 startup, and secure or tamper-proof policies resist being stopped by the administrators being audited. See IBM Db2 Security.
Implementation: phased rollout
- Agree scope (weeks 1 to 2): SOC, mainframe security and systems programming agree the questions the SOC must answer, the LPARs in scope and an ingestion budget.
- Check audit settings (weeks 2 to 4): review RACF audit options and Db2 audit policies against the detection list. Raise changes through normal change control.
- Pilot one LPAR (weeks 4 to 8): enable log stream recording and an INMEM resource on a development or test LPAR, define the IFA profile, run the collector, and validate parsing against known test actions (create a test user, change a test profile, run an FTP transfer).
- Production rollout by ring: one production LPAR, then the rest of the sysplex. Monitor collector CPU and SMF buffer warnings at each step.
- Detections in audit mode: run starter rules as dashboards for two to four weeks, tune, then promote to alerts with runbooks that name the mainframe on-call contact.
- Rollback: keep the previous SMFPRMxx member; reverting is a SET SMF=xx to the old member. Because a failed SAF check rejects the new member, validate profiles before activation.
Decision guidance
- Everything vs selected types: forward selected types and subtypes in real time to the SIEM, and everything else to a cheaper data lake or archive for investigations.
- Parse on-platform vs off-platform: on-platform parsing simplifies the SIEM side and reduces bytes on the wire; off-platform parsing saves mainframe CPU. Many sites parse type 80 and 119 on-platform and send bulk types raw to the lake.
- Small estates: one or two LPARs can start with a single collector and the ten detections above. Large sysplexes need per-LPAR collectors, a feed health dashboard and a shared lookup of user ID types.
- SIEM vs dedicated mainframe tooling: dedicated tools give deep RACF context; a SIEM gives correlation with the rest of the estate. The SOC needs at least the identity and network events in the SIEM either way.
Detection and measurement
- Feed latency: median time from SMF record write to SIEM index for type 80 (target under one minute).
- Feed gaps: intervals with no type 80 records from a production LPAR; alert at a threshold that reflects normal activity.
- Coverage: percentage of production LPARs and Db2 subsystems feeding the SIEM.
- Parse error rate: records that fail to parse, by type, after z/OS or product upgrades.
- Time to alert on privileged change: from a test ALTUSER SPECIAL to an alert in the SOC queue.
- Ingestion cost per LPAR: tracked monthly to keep filtering decisions honest.
Treat the feed itself as a monitored source. See Log Source Health Monitoring and the Log Source Coverage Matrix Template.
Framework mapping
| Pipeline area | NIST CSF 2.0 | NIST SP 800-53 r5 | CIS Controls v8.1 |
|---|---|---|---|
| Record selection and audit settings | PR.PS-04 | AU-2, AU-12 | 8.2 |
| Forwarding and centralisation | PR.PS-04 | AU-6 | 8.9 |
| Record integrity and collector protection | PR.PS-04 | AU-9 | 8.3 |
| Retention | PR.PS-04 | AU-11 | 8.10 |
| Detections and review | DE.CM-09, DE.AE-02 | AU-6, SI-4 | 8.11 |
Common failure patterns
- Nightly batch only: SMF dumped and sent once a day, so detections fire long after the activity.
- RACF not auditing what the rules expect: detections written for commands that RACF is not set to log.
- Raw records in the SIEM: hex blobs nobody can query, so the feed exists but nothing uses it.
- Unprotected collector: a collector user ID with broad authority and a password, which becomes an attractive target itself.
- No feed health alert: an INMEM or collector failure goes unnoticed for weeks because the SOC reads silence as normal.
- No mainframe contact in the runbook: alerts reach analysts who cannot judge whether a PERMIT was planned.
Practitioner checklist
- Agree the SOC questions, LPARs and ingestion budget with mainframe security and systems programming.
- Confirm RACF audit options and Db2 audit policies produce the events your detections need.
- Record SMF to log streams and define INMEM resources for the security record types.
- Protect each in-memory resource with an IFA.IFASMF profile and grant READ only to the collector ID.
- Run the collector under a protected ID with TLS and certificate authentication to the SIEM.
- Parse records into named fields and enrich user IDs with human, batch or started task type.
- Deploy the ten starter detections in audit mode, then promote with runbooks.
- Alert on feed gaps per LPAR and record type.
- Re-test parsing and detections after every z/OS, Db2 or collector upgrade.
Standards and references
- IBM: z/OS SMF real-time interface
- IBM: Defining in-memory resources
- IBM: SMFPRMxx (system management facilities parameters)
- IBM: RACF event codes
- IBM: SMF 119 record subtypes
- IBM: Db2 for z/OS SYSAUDITPOLICIES catalog table
- IBM: Db2 audit policies
Related NHI Mgmt Group resources: Mainframe Identity and RACF Security Guide · IBM z/OS Security Hardening Guide · Mainframe Incident Response and Forensics Guide · Detection Engineering Guide