In brief
IBM i security rests on three pillars: user profiles with special authorities, authority to every object (library, file, program) and the QAUDJRN security audit journal. The minimum is QSECURITY level 40 or 50, *ALLOBJ only for a few named administrators, public authority to data at *USE or *EXCLUDE, and auditing turned on. Most gaps appear not at the 5250 sign-on screen but in public authorities and in access through ODBC and FTP.
System security level: QSECURITY
The QSECURITY system value determines how the system checks access in the first place. According to IBM documentation, the default value is 40, and a change takes effect at the next restart of the system.
| Level | What it means |
|---|---|
| 20 | A password is required, but every user has access to all resources |
| 30 | Access depends on object authority |
| 40 | Same as 30, plus programs cannot use unsupported system interfaces |
| 50 | Same as 40, with additional checks on parameters passed to system interfaces |
Levels 10 and 20 are only available on systems already running at them, and once you raise the level you cannot go back. A system at level 20 or 30 is the first finding of any review. Moving to 40 requires checking whether old programs use unsupported interfaces: the audit journal records such errors as AF entries, so you can collect them before the change.
User profiles and special authorities
A user profile is a *USRPRF object that defines the password, user class, group profile, initial library list and special authorities. The CRTUSRPRF command knows eight special authorities: *ALLOBJ, *AUDIT, *IOSYSCFG, *JOBCTL, *SAVSYS, *SECADM, *SERVICE and *SPLCTL.
Three of them carry the most risk:
- *ALLOBJ: access to every object on the system, regardless of private authorities;
- *SECADM: creating and changing user profiles;
- *SPLCTL: access to all spooled files in output queues, which often means invoices, payroll and customer data.
In systems developed over many years, special authorities accumulate, because adding *ALLOBJ is easier than working out what a program really needs. A review starts with a list of profiles holding that authority:
SELECT authorization_name, status, previous_signon, special_authorities
FROM qsys2.user_info
WHERE special_authorities LIKE '%*ALLOBJ%'
ORDER BY previous_signon;The query shows authorities granted directly. Authorities inherited from a group profile need a separate check, because the group profile can have *ALLOBJ too. Two quick checks follow: the ANZDFTPWD command finds profiles with a default password (equal to the profile name), and profiles that have not signed on for many months get disabled or deleted.
Object authority
Every object on IBM i has an owner, private authorities for selected profiles or groups, and a public authority (*PUBLIC) for everyone else. Typical levels are *ALL, *CHANGE, *USE and *EXCLUDE. Authorities can also be granted through an authorization list (*AUTL), which keeps access to many objects in order at once.
The most common problem comes from defaults. The QCRTAUT system value defaults to *CHANGE, and libraries created with CRTAUT(*SYSVAL) pass it on to new objects. In practice, a new file with customer data may be changeable by every signed-on user. Data libraries should have CRTAUT set to *USE or *EXCLUDE, with access granted to groups.
The second mechanism is adopted authority: a program compiled with USRPRF(*OWNER) runs with its owner's authority. This is a good way to let users change data only through a program and not directly. However, a program that adopts the authority of a profile with *ALLOBJ and lets you run any command is a security hole.
Review tools:
| Tool | What it shows |
|---|---|
| PRTPUBAUT | Objects with public authority other than *EXCLUDE |
| PRTADPOBJ | Programs that adopt the authority of a given profile |
| QSYS2.OBJECT_PRIVILEGES | Object authorities as SQL rows |
| STRAUTCOL | Collects which authorities a user actually uses |
Authority collection (STRAUTCOL) helps before you tighten access: for a few weeks the system records which objects an application touches, and then you know what you can revoke without stopping production.
Access outside the 5250 screen
Many companies secure IBM i with menus and a limited command line (the LMTCPB parameter in the profile). That only works on the 5250 screen. The same user with a tool connecting through ODBC or JDBC can run an SQL query against any file they are authorized to, and download its contents through FTP. Menu restrictions do not replace object authority.
Exit programs give an additional layer of control. They are registered with the system for network servers, such as the database server and FTP. The program decides whether to let a request through and can log it. Services you do not need are worth turning off, and FTP is worth replacing with SFTP. Rules for REST services exposed from IBM i are covered in the article IBM i and modern applications: integration through REST APIs, and the broader approach to identity in the article Identity and access management (IAM).
Auditing: the QAUDJRN journal
The QAUDJRN security audit journal in library QSYS records the events selected in the QAUDCTL and QAUDLVL system values. The easiest way to turn it on is the CHGSECAUD command, which according to IBM documentation creates the journal if it does not exist and sets the default set of events: *AUTFAIL, *CREATE, *DELETE, *SECURITY and *SAVRST.
A few entry types worth starting your analysis with:
- AF: an attempt to access something without authority, including use of an unsupported interface;
- PW: an incorrect password or unknown user at sign-on;
- CP: a user profile created or changed;
- SV: a system value changed.
Entries are copied to files with the CPYAUDJRNE command or read through SQL. The journal achieves nothing if nobody reads it, so it is worth forwarding entries to a SIEM together with logs from other systems. How to build that monitoring is described in the article SOC and SIEM. In companies covered by NIS2 or DORA, the audit journal is also evidence when reporting an incident, as we explain in the article Incident reporting under DORA and NIS2.
Where to start the cleanup
- Check QSECURITY, QCRTAUT and the auditing status (DSPSECAUD).
- List profiles with *ALLOBJ, *SECADM and *SPLCTL, and profiles with a default password.
- Run PRTPUBAUT for data libraries and decide on the target public authorities.
- Turn on auditing and authority collection for one application, then tighten access step by step.
- Review network servers: which ones are needed and who uses them.
Further changes are rolled out in stages, tested on a copy of the environment, because revoking an authority that a nightly run depends on stops it just as effectively as an outage. The project on a KRI audit and information security management rollout shows an example of a security review in an organization.
Questions and answers
What QSECURITY level should I set on IBM i?
At least 40, which is the default. Level 50 adds checks on parameters passed to system interfaces and is recommended where security requirements are highest. Before raising the level from 30, it is worth collecting AF entries in the audit journal for a few weeks to find programs that use unsupported interfaces, because the change only takes effect after the system restarts.
Can developers have *ALLOBJ in production?
They should not. A developer in production usually needs to read logs and data to analyze defects, not access to everything. For emergencies, it is better to prepare a separate profile with elevated authority, used for the duration of a ticket and recorded in the audit journal. That approach is also easier to defend in front of an auditor.
How do I check who has access to a file with customer data?
The DSPOBJAUT command shows the owner, private authorities and public authority of a single object. For many objects, the QSYS2.OBJECT_PRIVILEGES view is more convenient, because it returns the same information as SQL rows. You also need to check authority to the library and programs that adopt the file owner's authority, because they provide indirect access.
Do menu restrictions protect data on IBM i?
No. Menus and command line restrictions only work on the 5250 screen. A user with an ODBC or JDBC tool or an FTP client has access to everything their object authorities allow. Data is protected by object authority, and exit programs for network servers add another layer of control.
Sources
- Security level (QSECURITY), IBM i 7.5 documentation
- Default authority for newly created objects (QCRTAUT), IBM i 7.5 documentation
- Create User Profile (CRTUSRPRF), IBM i 7.5 documentation
- Using CHGSECAUD to set up security auditing, IBM i 7.5 documentation
- Security auditing journal entries, IBM i 7.5 documentation
- Start Authority Collection (STRAUTCOL), IBM i 7.5 documentation
- Print Publicly Auth Objects (PRTPUBAUT), IBM i 7.5 documentation