Most of the work on a z/OS system runs under identities no person logs on with: started task user IDs, batch job owners, scheduler IDs and the functional IDs that CICS, middleware and web gateways act for. These are the mainframe's non-human identities, and they are often the most privileged and least reviewed accounts in the estate: started tasks marked TRUSTED bypass RACF checks, schedulers can submit jobs as hundreds of other users, and PassTicket keys let a gateway sign on as anyone it is permitted to. This guide explains how each kind of mainframe service identity is created and authorised, how surrogate authority and PassTickets work, what to audit, and how to clean up an estate that has grown over decades. It is written for RACF administrators, mainframe security teams and identity governance leads who need to bring mainframe service accounts into the same discipline as cloud and Windows ones. Examples use RACF commands; ACF2 and Top Secret have equivalents. The wider RACF model is covered in the Mainframe Identity and RACF Security Guide; this page goes deeper on the non-human side.
Key takeaways
- Every started task needs its own protected user ID. Map started procedures in the STARTED class to dedicated IDs with no password, never to a shared ID or a person's ID.
- TRUSTED and PRIVILEGED are not convenience flags. Both let a started task bypass RACF checking; DISA's z/OS RACF STIG requires each TRUSTED task to be on IBM's approved list or formally justified.
- Surrogate authority is delegation, and it needs an owner. A SURROGAT profile such as
PAYROLL.SUBMITorPAYROLL.DFHSTARTlets one identity run work as another without its password; review who holds READ on each. - PassTicket keys are signing keys for user identities. Whoever holds
IRRPTAUTHauthority for an application can generate a one-time password for its users; keep replay protection on unless an application genuinely needs otherwise. - Audit the service identities, not just the people. Use UAUDIT, LOGOPTIONS and SMF records to see what started task and batch IDs actually access, and feed that into recertification.
The kinds of mainframe service identity
| Identity type | How it gets its user ID | Typical privilege | Main risk |
|---|---|---|---|
| Started task (STC) | STARTED class profile (or the legacy ICHRIN03 table) maps the procedure name to a user ID and group | System subsystems, databases, transaction managers, security and monitoring products; some TRUSTED | Shared or over-privileged IDs; TRUSTED granted to vendor tasks without need |
| Batch job owner | USER= on the JOB card, or propagated from the submitter, or a scheduler acting as surrogate | Application data sets, Db2 plans, file transfer | Passwords in JCL; schedulers with surrogate authority over many IDs |
| Scheduler and automation IDs | Started task ID of the scheduler or automation product | Submit and control jobs for many other IDs; operator commands | Broad SURROGAT and OPERCMDS access; one compromise runs everything |
| Transaction manager region IDs | CICS or IMS region started task ID | Access to everything the region's programs need; surrogate for default and transaction users | Region ID with data set access far beyond its transactions |
| Functional or execution IDs | Defined for work that CICS, batch or gateways start on behalf of users | Application-specific | Anyone with surrogate rights can act as them |
| Gateway and API IDs | Started task IDs of web, API or integration servers (for example Zowe's ZWESVUSR) | Authority to impersonate users (z/OS UNIX BPX.SERVER), map certificates to users, generate PassTickets | A compromised gateway can act as any user it serves |
See the Service Account Security Guide for the cross-platform principles these map to.
Started tasks and the STARTED class
IBM describes the STARTED class as a dynamic started procedures table: profiles are managed with RDEFINE, RALTER and RLIST and take effect without code changes or an IPL. Setup uses SETROPTS GENERIC(STARTED) and SETROPTS CLASSACT(STARTED) RACLIST(STARTED), then SETROPTS RACLIST(STARTED) REFRESH after each change.
- Profile per procedure: each profile is the procedure name and job name (for example
DB2PMSTR.*) with an STDATA segment that setsUSER,GROUP,TRUSTED,PRIVILEGEDandTRACE. IBM's example uses a catch-all**profile withUSER(=MEMBER)andTRACE(YES); if you use one, point it at a user ID with no data access so that an undefined task fails safe, and watch the trace messages for tasks that fall through to it. - Dedicated, protected IDs: started task IDs should have no password or password phrase (RACF
NOPASSWORD, which makes the user protected), so they cannot be used to log on to TSO or other applications and cannot be revoked by failed logon attempts. Zowe's documented setup is a good pattern: separate IDs for each server task, each with an OMVS segment and no password, and STDATA withPRIVILEGED(NO) TRUSTED(NO) TRACE(YES). - Groups for started tasks: put STC IDs in an STC group, but grant data access to the individual ID or a group specific to that product, not to the shared STC group.
- TRUSTED and PRIVILEGED: both bypass RACF checking. DISA's IBM z/OS RACF STIG (finding V-223661) requires that TRUSTED tasks be compared with IBM's list in the MVS Initialization and Tuning Reference, that tasks with PRIVILEGED be removed, and that anything else be justified and approved. Justification is for tasks that create or access many unpredictably named data sets, or whose failure to get access could stop an IPL, such as the security manager itself. Fix with
RALTER STARTED <profile> STDATA(TRUSTED(NO))orSTDATA(PRIVILEGED(NO))and refresh. A TRUSTED change only takes effect when the task is recycled, because the attribute is part of the security environment built at address space start. - Who can start what: the ability to start a procedure is an operator command (
S procname) controlled in the OPERCMDS class; restrictMVS.START.STC.*style profiles so that a console user cannot start a task with a privileged identity.
Batch job identity and surrogate authority
A batch job runs under one user ID. That ID comes from the USER= parameter on the JOB statement, from propagation of the submitter's identity when no user is given, or from a scheduler that submits on behalf of others. The ways that ID is authorised decide whether batch is controlled delegation or a credential problem.
| Method | How it works | Assessment |
|---|---|---|
USER= and PASSWORD= in JCL | Credentials stored in the job stream | Avoid: passwords end up in libraries, spool and backups (ATT&CK T1552.001 Credentials In Files) |
| Propagation | The submitted job runs under the submitter's ID | Fine for personal work; wrong for production, which should not run as a person |
| Surrogate submission | A SURROGAT class profile named execution-userid.SUBMIT; submitters with READ can submit jobs that run as the execution ID without its password | Preferred for production: no stored password, explicit and auditable delegation |
| Scheduler as surrogate | The scheduler's started task ID holds surrogate authority for the production IDs it runs | Standard pattern; the scheduler ID becomes a concentration of privilege and must be treated as such |
- Scope surrogate profiles narrowly: one profile per execution ID, READ granted to the scheduler ID or a small operations group, never
UACC(READ), and no generic**.SUBMITgrant. - Control job submission separately: the JESJOBS class can restrict which IDs may submit or cancel jobs with given names, so job naming conventions become an access control rather than a habit.
- Separate the scheduler's own rights: the scheduler ID needs surrogate authority and operator commands; it should not itself hold production data access. Jobs should run as the execution ID, which has only what that application needs.
- CICS surrogates: CICS uses the same SURROGAT class for work it starts on behalf of others. IBM advises that the XUSER system initialisation parameter should always be on and warns that without surrogate security any user can run requests on behalf of any other. Key profiles are
executionuserid.DFHSTART(START and related commands),executionuserid.DFHINSTL(installing resources that run under an ID, checked for the region ID at startup),defaultuserid.DFHINSTL,pluserid.DFHINSTL,executionuserid.DFHEXCI(batch EXCI calls) andexecutionuserid.SUBMIT(submitting JCL through CICS).
PassTickets and gateway identities
A PassTicket is a one-time password generated for a specific user ID and application, so that a trusted server can sign a user on to z/OS without knowing the user's password. Integration layers such as Zowe API Mediation Layer use them to reach services that only accept a user ID and password.
- Configuration: activate the PTKTDATA class (
SETROPTS CLASSACT(PTKTDATA) RACLIST(PTKTDATA)andGENERIC(PTKTDATA)), define a profile per application ID with its secured sign-on key (SSIGNON(KEYMASKED(...)), or a key held in ICSF), and grant the generating server UPDATE onIRRPTAUTH.applid.*withUACC(NONE). - Who can generate is the real control: UPDATE on
IRRPTAUTH.applid.userid(or a generic covering it) lets an ID generate PassTickets for that user on that application. A genericIRRPTAUTH.CICSPROD.*held by a gateway means the gateway can act as every CICS user. Restrict it to the gateway's started task ID and, where possible, to specific user groups. - Replay protection: by default RACF accepts a PassTicket within a window of plus or minus 10 minutes and protects against replay. IBM allows it to be bypassed per application by putting
NO REPLAY PROTECTIONin the profile's APPLDATA. Some documented integration setups include it; only use it where the application must reuse tickets, and record why. - Protect the keys: the secured sign-on key is the secret behind every PassTicket for that application. Prefer keys stored and used in ICSF over masked keys in the RACF database, restrict who can list or change PTKTDATA profiles, and rotate keys after staff changes in the security team.
- Other gateway authorities: gateways often also need z/OS UNIX
BPX.SERVER(UPDATE, to change the security environment of a thread to a client's ID),BPX.DAEMON, and FACILITY profiles such asIRR.RUSERMAP(map a client certificate to a user ID) andIRR.IDIDMAP.QUERY(map distributed identities). Each one is a form of impersonation authority (T1134 Access Token Manipulation is the closest ATT&CK analogue). Grant them only to the gateway's own ID.
See the NHI Authentication Guide for how these patterns compare with token-based delegation elsewhere.
Auditing and detection
RACF writes its audit records to SMF (type 80), and the RACF auditor controls what is recorded. IBM's Auditor's Guide lists the controls; the ones that matter for service identities are below.
| Control | What it records | Use for service identities |
|---|---|---|
ALTUSER <id> UAUDIT | The user's RACF commands, profile defines and access attempts to protected resources | Turn on for scheduler, gateway and TRUSTED started task IDs to see what they actually do |
SETROPTS AUDIT(STARTED SURROGAT PTKTDATA) | Commands and define activity in those classes | Detect changes to STC mappings, surrogate grants and PassTicket profiles |
SETROPTS LOGOPTIONS(...) | Logging per class: ALWAYS, NEVER, SUCCESSES, FAILURES or DEFAULT; overrides profile settings | Log successes for SURROGAT and PTKTDATA so every delegation is recorded |
SAUDIT (on by default) | Commands by SPECIAL and group-SPECIAL users | Changes to service identities by administrators |
OPERAUDIT (off by default) | Access granted through OPERATIONS authority | Turn on if any service ID has OPERATIONS |
CMDVIOL | Command violations | Failed attempts to change security settings |
- Alert on: new or changed STARTED profiles, especially with TRUSTED or PRIVILEGED; new READ grants in SURROGAT; new UPDATE grants on
IRRPTAUTHprofiles; logons by started task or batch IDs to TSO or other interactive applications (which a protected ID should make impossible); password resets on functional IDs (T1098 Account Manipulation). - Behaviour baselines: started task and batch IDs are predictable. Data sets accessed outside their normal pattern, jobs submitted under an execution ID by an unexpected surrogate, or PassTickets generated for unusual users are high-value signals for valid account abuse (T1078 Valid Accounts) and alternate authentication material (T1550). See the Service Account Behavioural Baselining Guide.
- Get SMF off the mainframe: forward type 80 records to the SIEM so that mainframe service identity events sit beside the rest of the identity telemetry.
Metrics
- Protected coverage: share of started task and batch IDs with no password, target 100%.
- TRUSTED and PRIVILEGED count: number of tasks with either attribute not on IBM's list without documented approval, target zero.
- Surrogate breadth: number of execution IDs each surrogate can act for; the scheduler should be the only large number.
- Passwords in JCL: count of members in production JCL libraries containing
PASSWORD=, target zero. - Recertification: share of service IDs with a named owner and a review in the last 12 months.
Cleaning up an existing estate
- Inventory. List all STARTED profiles (and any ICHRIN03 entries), all user IDs used on JOB cards in production libraries and scheduler definitions, all SURROGAT and PTKTDATA profiles with their access lists, and all IDs with OPERATIONS, SPECIAL or z/OS UNIX UID 0.
- Assign owners for each service ID, recorded in the user profile or your IGA tool. See the Mainframe and COBOL Application Security Guide for application-side ownership.
- Turn on auditing first (UAUDIT on the IDs in scope, LOGOPTIONS for SURROGAT and PTKTDATA) and collect at least a full business cycle, including month-end and year-end batch.
- Make IDs protected by removing passwords from started task and batch IDs, after confirming no job or application signs on with them.
- Replace passwords in JCL with surrogate submission, one execution ID at a time.
- Reduce TRUSTED and PRIVILEGED to IBM's list, giving former TRUSTED tasks explicit access in place of the bypass, and recycle each task in a change window. Keep the previous STDATA values so that you can roll back with a single
RALTERand refresh. - Narrow surrogate and PassTicket grants from generics to specific profiles.
- Bring the IDs into recertification with the rest of the organisation's non-human identities. See the NHI Offboarding and Decommissioning Guide for retiring IDs left by decommissioned applications.
A small installation with one LPAR and a few hundred jobs can usually complete this in a quarter. Large sysplexes with thousands of production IDs should work application by application, starting with the scheduler, the gateways and every TRUSTED task, because those three groups hold the most delegated power.
Framework mapping
| Framework | Reference | Applies to |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AC-2 Account Management; AC-6 Least Privilege; IA-4 Identifier Management; IA-5 Authenticator Management; IA-9 Service Identification and Authentication; AU-2, AU-6 | Owned, protected service IDs; no TRUSTED by default; no passwords in JCL; PassTicket keys; RACF auditing |
| NIST CSF 2.0 | PR.AA-01, PR.AA-05, DE.CM-03 | Managed non-human credentials, access policy, monitoring of account use |
| DISA IBM z/OS RACF STIG | V-223661 (trusted started tasks must be justified) | TRUSTED and PRIVILEGED review |
| MITRE ATT&CK | T1078 Valid Accounts; T1550 Use Alternate Authentication Material; T1552.001 Credentials In Files; T1098 Account Manipulation; T1134 Access Token Manipulation | Detection targets for service ID abuse |
Common failure patterns
- One STC ID for everything. Dozens of started tasks share a single ID with broad data set access, so a flaw in any of them exposes the data of all of them, and nobody can say which task needs which access.
- TRUSTED for vendor products by default. Installation guides suggest TRUSTED to avoid access problems, it is never revisited, and the task bypasses RACF for the rest of its life.
- Production running as people. Jobs propagated from the submitter run as an employee; when that person leaves, the account cannot be revoked without breaking production.
- Passwords in JCL and scheduler variables. Credentials are copied into libraries, spool output and backups, and the functional ID's password can never change.
- Generic surrogate and PassTicket grants. A generic SURROGAT or
IRRPTAUTHprofile gives a scheduler or gateway the power to act as every user, far beyond the applications it serves. - No auditing of service identities. UAUDIT and success logging are off, so a misused scheduler or gateway ID leaves nothing behind but normal-looking work.
Practitioner checklist
- Map every started procedure to a dedicated, owned user ID in the STARTED class, with a fail-safe catch-all profile.
- Remove passwords from started task and batch IDs so they cannot log on interactively.
- Limit TRUSTED to IBM's list, remove PRIVILEGED, and document any approved exception.
- Replace passwords in JCL with SURROGAT
execution-userid.SUBMITprofiles granted to the scheduler or a small group. - Turn on XUSER in every CICS region and review DFHSTART, DFHINSTL and SUBMIT surrogate profiles.
- Restrict
IRRPTAUTHto gateway IDs and specific users, keep replay protection on, and protect secured sign-on keys in ICSF. - Restrict impersonation FACILITY profiles (
BPX.SERVER,IRR.RUSERMAP) to the servers that need them. - Enable UAUDIT for scheduler, gateway and TRUSTED IDs and success logging for SURROGAT and PTKTDATA, and forward SMF type 80 to the SIEM.
- Recertify mainframe service IDs with the rest of the organisation's non-human identities.
Standards and references
- IBM: z/OS 3.1 RACF Security Administrator's Guide, setting up the STARTED class
- IBM: RACF Auditor's Guide, setting and listing audit controls
- IBM: RACF Security Administrator's Guide, bypassing PassTicket replay protection
- IBM: CICS Transaction Server, surrogate user security
- DISA (STIG Viewer): IBM z/OS RACF STIG, trusted started tasks must be justified
- Open Mainframe Project Zowe: Customizing z/OS system security
- Open Mainframe Project Zowe: PassTicket configuration
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Mainframe Identity and RACF Security Guide · NHI Authentication Guide · Service Account Security Guide · Human vs Non-Human Identity