IBM i has a reputation for being secure, and the reputation is earned: the security model is granular, enforced by the operating system, and has been refined over decades. But a well-designed model only protects you when it is configured correctly. A system with broad *PUBLIC authority, overpowered user profiles, or an outdated security level is not secure, regardless of what the platform is capable of.
IBM i security is object-based. Every object — program, file, data area, command, library — has an owner and a set of authorities. Access control is enforced at the object level by the operating system, not by application code. Even if someone bypasses the application, they still face object-level authority checks.
This guide covers system security levels, user profiles and special authorities, object and public authority, group profiles and authorization lists, adopted authority, password rules, auditing with QAUDJRN, Row and Column Access Control (RCAC), and a practical security review checklist.
Security Levels (QSECURITY)
The system value QSECURITY controls how strictly IBM i enforces security. There are five levels:
- Level 10 — no security. The system can no longer be set to level 10.
- Level 20 — password security only. User profiles are created with
*ALLOBJspecial authority by default, so in practice every user can reach every object. Level 20 can no longer be set on IBM i 7.5. - Level 30 — resource security. Object authority is checked on every access. This is the minimum acceptable level for any production system.
- Level 40 — level 30 plus integrity protection: programs cannot use unsupported interfaces to bypass security. New systems ship at level 40, and most production systems run at it.
- Level 50 — level 40 plus enhanced integrity protection, such as stricter validation of parameters passed to operating system interfaces. Used where the highest level of integrity protection is required.
-- Check the current security level
SELECT SYSTEM_VALUE_NAME, CURRENT_NUMERIC_VALUE, CURRENT_CHARACTER_VALUE
FROM QSYS2.SYSTEM_VALUE_INFO
WHERE SYSTEM_VALUE_NAME = 'QSECURITY';
/* Display or change the security level. A change takes effect at the next IPL. */
DSPSYSVAL SYSVAL(QSECURITY)
CHGSYSVAL SYSVAL(QSECURITY) VALUE('40')
If a system still runs at level 20, moving to level 30 or 40 is the single most important security change you can make. Plan it carefully: once object authority is enforced, users and batch jobs that relied on *ALLOBJ will start failing. Review profiles first and use authority-failure auditing (described below) to find what breaks before and after the IPL.
User Profiles
Every process on IBM i runs under a user profile. A user profile is an object (*USRPRF) stored in QSYS. It holds the password, special authorities, group profile, initial program and menu, message queue, output queue, and home directory.
-- All user profiles and key attributes
SELECT USER_NAME, STATUS, SPECIAL_AUTHORITIES,
USER_CLASS_NAME, DAYS_UNTIL_PASSWORD_EXPIRES
FROM QSYS2.USER_INFO
ORDER BY USER_NAME;
Creating a service account profile
CRTUSRPRF USRPRF(ORDAPI) +
PASSWORD(*NONE) + /* no sign-on with a password */
USRCLS(*USER) +
SPCAUT(*NONE) + /* no special authorities */
INLPGM(*NONE) +
INLMNU(*SIGNOFF) + /* sign off immediately if interactive */
LMTCPB(*YES) + /* limited capabilities: no command line */
TEXT('Order API service account')
PASSWORD(*NONE) means nobody can sign on to the profile with a password; work runs under it through job descriptions, submitted jobs, or server jobs. LMTCPB(*YES) restricts a user to their initial program and menu, so they cannot reach a command line. Together with SPCAUT(*NONE), these are the baseline for any service account.
Special authorities
Special authorities are system-level powers granted through the SPCAUT parameter. Several of them bypass or override normal object authority:
*ALLOBJ— access to every object regardless of its authority settings. Equivalent to root. Reserve it for a small number of named administrators.*SECADM— create, change, and delete user profiles. It does not include*ALLOBJ, and it cannot be used to hand out powers its holder lacks: a profile that creates or changes another profile must itself have every special authority it grants, and giving*SECADMto another user requires both*SECADMand*ALLOBJ.*JOBCTL— control any job, subsystem, and output queue: end, hold, or change priority.*SPLCTL— full control of all spooled files on the system.*SAVSYS— save and restore objects regardless of authority.*SERVICE— use service tools.*AUDIT— change auditing settings.*IOSYSCFG— configure communications and I/O.
Most application users need no special authorities. Developers typically need none, or *JOBCTL at most. Minimise special authorities rigorously and review them regularly.
-- Enabled users with *ALLOBJ special authority
SELECT USER_NAME, STATUS, LAST_USED_TIMESTAMP
FROM QSYS2.USER_INFO
WHERE SPECIAL_AUTHORITIES LIKE '%*ALLOBJ%'
AND STATUS = '*ENABLED'
ORDER BY USER_NAME;
Group Profiles
Managing authority user by user does not scale. A group profile defines an authority set once; users join the group with the GRPPRF parameter.
/* Create a group profile for order entry operators */
CRTUSRPRF USRPRF(ORDENTRY) PASSWORD(*NONE) USRCLS(*USER) +
TEXT('Order entry operators group')
/* Assign a user to the group */
CHGUSRPRF USRPRF(JSMITH) GRPPRF(ORDENTRY)
/* Grant the group authority to the order files */
GRTOBJAUT OBJ(ORDLIB/ORDHDR) OBJTYPE(*FILE) USER(ORDENTRY) AUT(*CHANGE)
GRTOBJAUT OBJ(ORDLIB/ORDLIN) OBJTYPE(*FILE) USER(ORDENTRY) AUT(*CHANGE)
When someone joins a team, add them to the group; when they leave, remove them. No individual object authority changes are needed.
Object Authority
Every object has an owner, a *PUBLIC authority, and optionally private authorities for specific users and groups.
The common system-defined authorities are:
*ALL— full control, including deleting the object and changing its authority.*CHANGE— read, add, update, and delete data, but not manage the object or its authority.*USE— read and execute: read records in a file, call a program, list a library.*EXCLUDE— explicitly denied. A private*EXCLUDEfor a user stops the search, so group or public authority does not grant access.*AUTL— public authority comes from the object’s authorization list.
These are combinations of individual object and data authorities. For a database file, the data authorities are *READ, *ADD, *UPD, *DLT, and *EXECUTE. For programs and commands, *EXECUTE is the authority a user needs to call or run them.
Checking authority
/* Show the owner, *PUBLIC, and private authorities for an object */
DSPOBJAUT OBJ(ORDLIB/ORDHDR) OBJTYPE(*FILE)
/* Check whether the current user has *CHANGE authority (signals CPF9802 if not) */
CHKOBJ OBJ(ORDLIB/ORDHDR) OBJTYPE(*FILE) AUT(*CHANGE)
DSPOBJAUT is the first command to run when someone says they cannot access a file or program. To review authorities across a whole library, query the QSYS2.OBJECT_PRIVILEGES view:
SELECT OBJECT_NAME, OBJECT_TYPE, AUTHORIZATION_NAME, OBJECT_AUTHORITY,
DATA_READ, DATA_ADD, DATA_UPDATE, DATA_DELETE
FROM QSYS2.OBJECT_PRIVILEGES
WHERE OBJECT_SCHEMA = 'ORDLIB'
AND OBJECT_TYPE = '*FILE'
ORDER BY OBJECT_NAME, AUTHORIZATION_NAME;
Granting and revoking authority
/* Grant *CHANGE on a file to the order API service account */
GRTOBJAUT OBJ(ORDLIB/ORDHDR) OBJTYPE(*FILE) USER(ORDAPI) AUT(*CHANGE)
/* Grant *USE on every program in a library */
GRTOBJAUT OBJ(ORDLIB/*ALL) OBJTYPE(*PGM) USER(ORDAPI) AUT(*USE)
/* Remove a user's private authority to a sensitive file */
RVKOBJAUT OBJ(ORDLIB/PAYROLL) OBJTYPE(*FILE) USER(TEMPUSER) AUT(*ALL)
For SQL tables, the SQL equivalents are useful in scripts:
GRANT SELECT, INSERT, UPDATE ON ORDLIB.ORDHDR TO ORDAPI;
REVOKE ALL PRIVILEGES ON ORDLIB.PAYROLL FROM TEMPUSER;
How authority is checked
In simplified form, IBM i looks for authority in this order and stops as soon as it finds a definitive answer:
- Does the user, or one of their group profiles, have
*ALLOBJ? Access is granted. - Is the user the owner, or do they have a private authority (directly or through an authorization list)? That authority applies, including a private
*EXCLUDE. - Do the user’s group profiles have private or owner authority?
- What is the object’s *PUBLIC authority?
- If the job is running a program that adopts authority, the program owner’s authority is also considered.
If none of these grants the requested access, the request fails with an authority error.
Public Authority
PUBLIC authority is the access any user gets when nothing more specific applies. This is where most IBM i security problems start: if PUBLIC is *CHANGE on a customer file, every user on the system can read, add, update, and delete customer records.
New objects take their *PUBLIC authority from the library’s CRTAUT value, which by default comes from the QCRTAUT system value. QCRTAUT ships as *CHANGE. The secure approach is to deny by default and grant explicit authority to the users and groups that need it.
/* Remove all *PUBLIC authority from an existing object (*PUBLIC becomes *EXCLUDE) */
RVKOBJAUT OBJ(ORDLIB/PAYROLL) OBJTYPE(*FILE) USER(*PUBLIC) AUT(*ALL)
/* Set the default *PUBLIC authority for objects created in this library from now on */
CHGLIB LIB(ORDLIB) CRTAUT(*EXCLUDE)
CHGLIB CRTAUT affects only objects created afterwards. Existing objects must be reviewed and changed individually. Stream files and directories in the IFS follow the same principles but use their own commands; see IBM i IFS permissions and security.
Authorization Lists
An authorization list (*AUTL) holds authority entries for many users in one object. Securing objects to the list lets you manage access in one place instead of on every object.
/* Create an authorization list */
CRTAUTL AUTL(ORDFILES) TEXT('Authority list for order files')
/* Add authority entries to the list */
ADDAUTLE AUTL(ORDFILES) USER(ORDENTRY) AUT(*CHANGE)
ADDAUTLE AUTL(ORDFILES) USER(ORDAPI) AUT(*CHANGE)
/* Secure the files with the authorization list */
GRTOBJAUT OBJ(ORDLIB/ORDHDR) OBJTYPE(*FILE) AUTL(ORDFILES)
GRTOBJAUT OBJ(ORDLIB/ORDLIN) OBJTYPE(*FILE) AUTL(ORDFILES)
Adding a new service account to the order files now requires one ADDAUTLE command instead of one GRTOBJAUT per file.
Adopted Authority
Adopted authority is one of the most important and most misunderstood IBM i security features. A program created with USRPRF(*OWNER) runs with the authority of its owner in addition to the authority of the user who calls it.
The classic use case is controlled access to sensitive data:
- The payroll program is owned by a profile, say
PAYOWNER, that has*CHANGEto the payroll file. - The program is created with
USRPRF(*OWNER). - Payroll clerks get
*USEto the program and no authority to the file. - When a clerk runs the program, it can update the payroll file using
PAYOWNER‘s authority. - If the clerk tries to open the file directly, from a query tool, ACS, or a command line, access is denied.
CRTBNDRPG PGM(PAYLIB/PAYROLLPGM) SRCSTMF('/repo/src/rpgle/PAYROLLPGM.rpgle') +
USRPRF(*OWNER)
Adopted authority flows down the call stack. If an adopting program calls another program, the called program also uses the adopted authority, even if it was created with USRPRF(*USER), as long as it uses the default USEADPAUT(*YES). To stop a called program from using authority adopted higher in the stack, change it to USEADPAUT(*NO):
CHGPGM PGM(PAYLIB/RPTPGM) USEADPAUT(*NO)
Because adopted authority propagates, an adopting program must never give the user a way to run arbitrary commands or call arbitrary programs. Keep adopting programs small, owned by profiles with only the authority they need, and review them regularly:
SELECT PROGRAM_LIBRARY, PROGRAM_NAME, PROGRAM_OWNER,
USER_PROFILE, USE_ADOPTED_AUTHORITY
FROM QSYS2.PROGRAM_INFO
WHERE PROGRAM_LIBRARY = 'PAYLIB'
AND USER_PROFILE = '*OWNER'
ORDER BY PROGRAM_NAME;
Password Rules
On current releases, password rules are controlled mainly by the password level and the password rules system value:
QPWDLVL— the password level. Levels 2 and 3 allow passwords up to 128 characters, passphrases with spaces, and case-sensitive passwords. Changing it takes effect at the next IPL and needs planning for older clients.QPWDRULES— rule-based validation. When it is set to anything other than*PWDSYSVAL, the system ignores the older individual valuesQPWDMINLEN,QPWDMAXLEN,QPWDRQDDGT,QPWDLMTCHR,QPWDLMTAJC,QPWDLMTREP, andQPWDPOSDIF.
/* At least 12 characters, mixed case, at least one digit, profile name not allowed */
CHGSYSVAL SYSVAL(QPWDRULES) VALUE('*MINLEN12 *MIXCASE1 *DGTMIN1 *LMTPRFNAME')
/* Password reuse cycle: 5 means the last 10 passwords cannot be reused */
CHGSYSVAL SYSVAL(QPWDRQDDIF) VALUE('5')
/* Password expiry interval in days */
CHGSYSVAL SYSVAL(QPWDEXPITV) VALUE('90')
/* Disable the profile after five failed sign-on attempts */
CHGSYSVAL SYSVAL(QMAXSIGN) VALUE('5')
CHGSYSVAL SYSVAL(QMAXSGNACN) VALUE('2')
QPWDLMTCHR is often misunderstood. It lists characters that are not allowed in a password, and *NONE means no characters are restricted; it does not require mixed case. It is not enforced at password level 2 or 3. Mixed-case rules only make sense when passwords are case-sensitive, which means QPWDLVL 2 or 3.
QMAXSGNACN decides what happens when QMAXSIGN failed attempts are reached: 1 disables the device, 2 disables the profile, and 3 disables both. Disabling the profile stops brute-force attempts against it; the trade-off is that the help desk must re-enable locked profiles.
Default passwords — a password equal to the profile name — are a classic finding. ANZDFTPWD reports them and can disable or expire them. It requires *ALLOBJ and *SECADM:
/* Report profiles whose password matches the profile name, without changing them */
ANZDFTPWD ACTION(*NONE)
Auditing with QAUDJRN
IBM i writes security-relevant events to the security audit journal QAUDJRN in QSYS. It records events such as authority failures, user profile changes, use of adopted authority, and object creation and deletion, depending on which auditing values are active. It is the primary source of evidence for security investigations and compliance audits.
CHGSECAUD creates the audit journal and receiver if they do not exist and sets the auditing system values in one step:
CHGSECAUD QAUDCTL(*AUDLVL *OBJAUD) +
QAUDLVL(*AUTFAIL *SECURITY *PGMADP *CREATE *DELETE *SAVRST)
*AUTFAIL— authority failures (journal entry typeAF).*SECURITY— security changes, including user profile changes (entry typeCP).*PGMADP— use of adopted authority.*CREATE,*DELETE— object creation and deletion.*SAVRST— save and restore operations.
On current releases, the SYSTOOLS audit journal table functions return the entries as ready-to-query columns:
-- Authority failures in the last 24 hours
SELECT ENTRY_TIMESTAMP, JOB_USER, JOB_NAME, JOB_NUMBER,
VIOLATION_TYPE, VIOLATION_TYPE_DETAIL,
OBJECT_LIBRARY, OBJECT_NAME, OBJECT_TYPE
FROM TABLE(SYSTOOLS.AUDIT_JOURNAL_AF(
STARTING_TIMESTAMP => CURRENT TIMESTAMP - 24 HOURS))
ORDER BY ENTRY_TIMESTAMP DESC;
-- User profile changes in the last 7 days
SELECT *
FROM TABLE(SYSTOOLS.AUDIT_JOURNAL_CP(
STARTING_TIMESTAMP => CURRENT TIMESTAMP - 7 DAYS))
ORDER BY ENTRY_TIMESTAMP DESC;
AF entries — attempts to access objects without sufficient authority — are the most useful starting point when investigating an incident or preparing a security-level change.
Row and Column Access Control (RCAC)
RCAC, introduced in IBM i 7.2 through the no-charge IBM Advanced Data Security feature, restricts access to rows and columns of a table based on who is running the query. It is enforced by the database for every access path, including SQL, native record-level access from RPG, and JDBC or ODBC clients, so existing programs are filtered without code changes.
Defining RCAC rules requires the QIBM_DB_SECADM function usage. A row permission or column mask has no effect until access control is activated on the table.
Row permission — users see only their own region’s orders:
CREATE PERMISSION ORDLIB.ORDHDR_REGION_PERM
ON ORDLIB.ORDHDR
FOR ROWS WHERE REGION = (
SELECT REGION FROM ORDLIB.USRREGION
WHERE USRNAME = SESSION_USER)
ENFORCED FOR ALL ACCESS
ENABLE;
ALTER TABLE ORDLIB.ORDHDR ACTIVATE ROW ACCESS CONTROL;
Column mask — show card numbers only to an authorised group:
CREATE MASK ORDLIB.PAYMENT_MASK
ON ORDLIB.PAYINFO
FOR COLUMN CARDNUM
RETURN CASE
WHEN VERIFY_GROUP_FOR_USER(SESSION_USER, 'PAYMENTADMIN') = 1
THEN CARDNUM
ELSE 'XXXX-XXXX-XXXX-' || RIGHT(CARDNUM, 4)
END
ENABLE;
ALTER TABLE ORDLIB.PAYINFO ACTIVATE COLUMN ACCESS CONTROL;
With row access control active, the absence of a matching permission denies access to a row. Test permissions with representative users before activating them in production.
Practical Security Patterns
Least-privilege service accounts:
PASSWORD(*NONE)— no sign-on with a password.LMTCPB(*YES)— no command line.SPCAUT(*NONE)— no special authorities.INLMNU(*SIGNOFF)— sign off immediately if an interactive session is somehow started.- Grant only the object authorities the profile needs:
*CHANGEto files it writes,*USEto files it reads and programs it calls. - Prefer adopted authority in small, reviewed programs over granting broad authority directly to service accounts.
Dormant profiles:
SELECT USER_NAME, STATUS, LAST_USED_TIMESTAMP, TEXT_DESCRIPTION
FROM QSYS2.USER_INFO
WHERE STATUS = '*ENABLED'
AND (LAST_USED_TIMESTAMP < CURRENT TIMESTAMP - 90 DAYS
OR LAST_USED_TIMESTAMP IS NULL)
AND USER_NAME NOT LIKE 'Q%'
ORDER BY LAST_USED_TIMESTAMP NULLS FIRST;
Enabled profiles that have not been used for 90 days should be reviewed and disabled if they are no longer needed. Dormant enabled profiles, often belonging to former employees, are one of the most common IBM i audit findings. IBM-supplied profiles start with Q and should be reviewed separately rather than disabled blindly.
Broad *PUBLIC authority in a production library:
SELECT OBJECT_NAME, OBJECT_TYPE, OBJECT_AUTHORITY
FROM QSYS2.OBJECT_PRIVILEGES
WHERE OBJECT_SCHEMA = 'ORDLIB'
AND AUTHORIZATION_NAME = '*PUBLIC'
AND OBJECT_AUTHORITY IN ('*ALL', '*CHANGE')
ORDER BY OBJECT_TYPE, OBJECT_NAME;
Any production object where PUBLIC has *CHANGE or *ALL is an exposure. Production libraries and sensitive files should normally have PUBLIC *EXCLUDE, with authority granted only to specific profiles, groups, or authorization lists.
A Security Review Checklist
If you have never reviewed security on your IBM i system, start here:
- Check QSECURITY. If the system is below level 40, plan the move; at level 20, it is the top priority.
- Find users with *ALLOBJ. The list should be a short set of named administrators.
- Review other special authorities.
*SECADM,*AUDIT,*SERVICE,*JOBCTL, and*SPLCTLshould be rare and justified. - Check *PUBLIC authority on sensitive data. Payroll, HR, and financial files should be
*EXCLUDE. - Find dormant enabled profiles. Disable profiles that are no longer needed.
- Run ANZDFTPWD. No profile should have a password equal to its name.
- Review password rules. Check
QPWDLVL,QPWDRULES,QMAXSIGN, andQMAXSGNACN. - Verify QAUDJRN is active. If you are not logging, you cannot investigate incidents.
- Review adopted-authority programs. Know which programs adopt authority, who owns them, and what they can reach.
- Review batch and server job profiles. Batch jobs often run under more powerful profiles than they need.
Summary
IBM i security rests on a few concepts: the system security level, user profiles and their special authorities, object and *PUBLIC authority, group profiles and authorization lists, and adopted authority for controlled elevation. Password rules, QAUDJRN auditing, and RCAC complete the picture.
IBM i security is not set-and-forget. Profiles accumulate, authorities drift, and applications add permissions that are never cleaned up. Running the queries in this guide regularly — and acting on what they show — keeps the security model honest and gives IBM i shops what they need to meet strict compliance requirements without third-party add-ons.