In this module, we will delve into the critical aspects of security and permissions in Control Language (CL). Understanding how to manage security and permissions is essential for maintaining the integrity and confidentiality of your system and data.
Key Concepts
- User Profiles: Define the identity of users and their access rights.
- Object Authority: Control access to objects such as files, programs, and libraries.
- Authorization Lists: Group objects and assign permissions collectively.
- Adopted Authority: Temporarily elevate permissions for specific tasks.
- Security Levels: System-wide settings that enforce security policies.
User Profiles
User profiles are the foundation of security in CL. They define who can access the system and what they can do.
Creating a User Profile
- USRPRF: Specifies the user profile name.
- PASSWORD: Sets the initial password.
- USRCLS: Defines the user class (e.g., *USER, *SECADM).
- TEXT: Provides a description of the user profile.
Modifying a User Profile
- CHGUSRPRF: Command to change user profile attributes.
- STATUS: Disables the user profile.
Object Authority
Object authority determines what actions a user can perform on an object.
Granting Object Authority
- GRTOBJAUT: Grants authority to an object.
- OBJ: Specifies the object path.
- OBJTYPE: Defines the type of object (e.g., *FILE, *PGM).
- USER: Indicates the user receiving the authority.
- AUT: Specifies the type of authority (e.g., *ALL, *USE, *CHANGE).
Revoking Object Authority
- RVKOBJAUT: Revokes authority from an object.
Authorization Lists
Authorization lists simplify the management of permissions by grouping objects.
Creating an Authorization List
- CRTAUTL: Creates an authorization list.
- AUTL: Specifies the authorization list name.
- TEXT: Provides a description.
Adding Objects to an Authorization List
- ADDAUTLE: Adds an object to an authorization list.
Adopted Authority
Adopted authority allows a program to run with the authority of the program owner.
Creating a Program with Adopted Authority
- CRTPGM: Creates a program.
- USRPRF: Specifies the user profile to adopt (*OWNER).
Security Levels
Security levels enforce system-wide security policies.
Setting the Security Level
- CHGSYSVAL: Changes a system value.
- SYSVAL: Specifies the system value to change (QSECURITY).
- VALUE: Sets the security level (e.g., 20, 30, 40, 50).
Practical Exercise
Exercise: Managing User Permissions
- Create a User Profile: Create a user profile named
DEVUSER
with a passworddevpass
and user class*USER
. - Grant Object Authority: Grant
DEVUSER
*USE authority to a file/home/dev/file.txt
. - Create an Authorization List: Create an authorization list
DEVLIST
and add the file/home/dev/file.txt
to it. - Set Adopted Authority: Create a program
MYLIB/DEVPGM
that adopts the owner's authority.
Solution
-- Step 1: Create a User Profile CRTUSRPRF USRPRF(DEVUSER) PASSWORD('devpass') USRCLS(*USER) TEXT('Developer User Profile') -- Step 2: Grant Object Authority GRTOBJAUT OBJ('/home/dev/file.txt') OBJTYPE(*FILE) USER(DEVUSER) AUT(*USE) -- Step 3: Create an Authorization List CRTAUTL AUTL(DEVLIST) TEXT('Developer Authorization List') ADDAUTLE AUTL(DEVLIST) OBJ('/home/dev/file.txt') OBJTYPE(*FILE) -- Step 4: Set Adopted Authority CRTPGM PGM(MYLIB/DEVPGM) USRPRF(*OWNER)
Common Mistakes and Tips
- Mistake: Forgetting to specify the correct object type when granting or revoking authority.
- Tip: Always double-check the object type to ensure the command applies correctly.
- Mistake: Not setting a strong password for user profiles.
- Tip: Use complex passwords and enforce password policies to enhance security.
Conclusion
In this module, we covered the essential aspects of security and permissions in CL, including user profiles, object authority, authorization lists, adopted authority, and security levels. By mastering these concepts, you can effectively manage access and maintain the security of your system. In the next module, we will explore interfacing with other systems, which will build on the security foundations we've established here.
CL (Control Language) Course
Module 1: Introduction to CL
- What is Control Language?
- Setting Up Your Environment
- Basic Syntax and Structure
- Writing Your First CL Program
Module 2: Basic CL Commands
- Introduction to CL Commands
- File Management Commands
- Job Management Commands
- System Management Commands
Module 3: Variables and Expressions
Module 4: Control Structures
Module 5: Advanced CL Commands
- Advanced File Operations
- Advanced Job Scheduling
- System Configuration Commands
- Security and Permissions