Security is a critical aspect of mainframe computing environments. Mainframes often host an organization's most sensitive data and mission-critical applications, making security a top priority. JCL (Job Control Language) interacts with the mainframe security system in various ways, and understanding these interactions is essential for developing secure applications.
This tutorial covers the fundamental security concepts for mainframe environments, how they relate to JCL, and best practices for secure JCL development.
Most z/OS installations use one of three major security products:
While these products differ in implementation, they all provide similar core functionality for security in the mainframe environment. This tutorial primarily references RACF, but the concepts apply to all three products.
Users are identified by unique user IDs and authenticated through passwords or more advanced methods like multi-factor authentication. In the context of JCL batch jobs, the user ID associated with the job (either the submitter or a specified user) determines many of the job's access rights.
Security products protect various types of resources:
Security software controls who can access which resources and what they can do with them. Access levels typically include:
Security-relevant events are logged for audit purposes. This includes login attempts, access to protected resources, security violations, and administrative actions.
JCL interacts with security in multiple ways. Understanding these interactions is crucial for developing secure batch applications.
The JOB statement can include security-related parameters:
12345//JOBNAME JOB (ACCT),'JOB DESCRIPTION', // USER=userid, // PASSWORD=password, // GROUP=groupname, // SECLABEL=seclabel
Security Warning: Including passwords in JCL is a significant security risk. Modern environments use security passtickets, surrogates, or other mechanisms to avoid this practice. Check with your security administrator for the approved method at your installation.
When a JCL job accesses datasets, the security system checks if the associated user ID has the appropriate access rights:
Example of a dataset access that requires security checking:
123//STEP1 EXEC PGM=MYPROG //INPUT DD DSN=SECURE.INPUT.FILE,DISP=SHR //OUTPUT DD DSN=SECURE.OUTPUT.FILE,DISP=(NEW,CATLG,DELETE)
In this example, the job requires:
Many installations control which programs users can execute. This is often implemented through program control features of the security software or through dataset access controls on the program libraries.
1//STEP1 EXEC PGM=PAYROLL
In this example, the job requires authority to execute the PAYROLL program. This might be controlled through:
JCL can issue system commands through the COMMAND statement (in JES3) or through programs that issue commands. These commands are subject to command security controls.
1234567//STEP1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //SYSUT2 DD SYSOUT=(A,INTRDR) //SYSUT1 DD * /*$VS,'S MYJOB' /*
This example submits a JES2 command to start a job. The user would need appropriate authority to issue this command.
Started tasks (STCs) are jobs that are started by the operator or automatically by the system. They often run with special security privileges. JCL procedures for started tasks require careful security consideration.
Security for started tasks is typically managed through STARTED class profiles in RACF or equivalent facilities in other security products.
Temporary datasets (those with names beginning with ampersands or with DSN=&&name) have special security considerations:
1234567//TEMPDD DD DSN=&&TEMP, // DISP=(NEW,PASS), // SPACE=(CYL,(1,1)) //TEMPDD2 DD DSN=&SYSUID..TEMP.DATA, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(1,1))
Security considerations:
Apply the principle of least privilege by:
Never include sensitive information in JCL:
Follow secure practices for dataset usage:
Protect procedure libraries appropriately:
Use JOB statement security parameters appropriately:
1234//MYJOB JOB (ACCT#),'PRODUCTION JOB', // USER=PRODJOB, // GROUP=PRODGRP, // NOTIFY=&SYSUID
Be cautious with system commands in JCL:
Protect sensitive data within jobs:
Many installations implement custom security exits that perform additional checks during JCL processing:
These exits can implement installation-specific security policies beyond the standard security product controls. Always be aware of any custom security exits at your installation that might affect JCL processing.
JCL jobs and their security implications can be subject to audit and compliance requirements:
Note: Regularly review the audit logs for your batch jobs to identify and address any security issues proactively.
Review the following JCL and identify potential security issues:
12345678910111213//PAYRUN JOB (ACCT),'PAYROLL RUN',CLASS=A,MSGCLASS=X, // USER=ADMIN1,PASSWORD=SECRET99 //STEP1 EXEC PGM=PAYROLL //PAYFILE DD DSN=PAYROLL.MASTER.FILE,DISP=OLD //REPORT DD SYSOUT=A //BACKUP DD DSN=ADMIN1.PAYROLL.BACKUP, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(10,5)) //SYSIN DD * PROCESS ALL EMPLOYEES UPDATE SALARIES CONNECT=PRODDB,ADMIN1,DBPASS01 /*
Rewrite the JCL from Exercise 1 following security best practices. Consider:
You need to create JCL for a new application that will process sensitive customer data. Outline the security considerations you would address when designing the JCL, including:
1. Which of the following is a security best practice for JCL?
2. What access level is typically required to create a new dataset?
3. Which security product is developed by IBM specifically for z/OS?
4. What is the principle of least privilege in the context of JCL security?
5. What typically happens when a JCL job attempts to access a dataset without proper authorization?
Learn about the basics of RACF, a security product developed by IBM specifically for z/OS.
Understand how datasets are secured in z/OS using RACF and other security products.
Explore the security architecture of z/OS and how it protects data and resources.
Learn about auditing and compliance in z/OS and how it helps ensure security and regulatory compliance.