A user, here, is an object: a user profile, type *USRPRF, living in QSYS like
everything else. It holds the password, the authorities, the job description its work takes
settings from, the current library, the initial program.
There is no separate list for the database, one for the operating system and one for the application: whoever connects over SQL from a PC and whoever signs on to a 5250 session are the same profile, with the same authorities. One consequence not everyone accounts for: a profile designed for the green-screen application carries the same authorities into an ODBC connection, where the menus that constrained it are no longer there.
Special authorities
Eight authorities go beyond normal object checking:
| Authority | What it allows |
|---|---|
*ALLOBJ |
accessing any object on the system, even without a private authority |
*SECADM |
creating, changing and deleting user profiles |
*JOBCTL |
changing job and print priority, ending a job, deleting output; stopping active subsystems and loading the system |
*SPLCTL |
every spool function: displaying, changing, deleting, holding, releasing spooled files |
*SAVSYS |
saving, restoring and freeing storage for all objects, even without object existence authority |
*SERVICE |
starting service tools (STRSST), debugging a program with only *USE, display and alter service functions |
*AUDIT |
viewing and changing auditing characteristics |
*IOSYSCFG |
changing the configuration: communications, TCP/IP servers |
*ALLOBJ is the obvious one. *SAVSYS and *SPLCTL matter nearly as much and get noticed
less: whoever can save every object can carry it away, whoever sees all printed output sees
the payroll too. And *JOBCTL opens confidential output when the output queue has
OPRCTL(*YES).
Who has *ALLOBJ:
SELECT AUTHORIZATION_NAME, STATUS, SPECIAL_AUTHORITIES, TEXT_DESCRIPTION
FROM QSYS2.USER_INFO
WHERE SPECIAL_AUTHORITIES LIKE '%*ALLOBJ%'
SPECIAL_AUTHORITIES is a list of the profile's special authorities, each padded with
blanks to eleven characters, and null when the profile has none: the LIKE searches inside
that list.
Warning
the query sees the authorities written in the profile, not those coming from
its group. A user without *ALLOBJ in a group that has it still uses it. Groups are
profiles, so they show up in the same query: their members are in GROUP_PROFILE_NAME
and SUPPLEMENTAL_GROUP_LIST.
Where the special authorities nobody remembers granting come from: CRTUSRPRF assigns them
with SPCAUT(*USRCLS), that is by user class. Class *SECOFR gets all eight at every
security level, *SYSOPR gets *SAVSYS and *JOBCTL. At levels 10 and 20 even a *USER
is created with *ALLOBJ and *SAVSYS.
Object authorities
Beneath special authorities sits normal checking, which comes in two forms. Commands use four summary levels:
*EXCLUDE: no access;*USE: read and run;*CHANGE: read and change the data;*ALL: everything, including deleting the object and changing its authorities.
Beneath the four levels are the real authorities, split between object (*OBJOPR,
*OBJMGT, *OBJEXIST, *OBJALTER, *OBJREF) and data (*READ, *ADD, *UPD, *DLT,
*EXECUTE). Day to day you work with the four; the ten matter when exactly one thing has
to be granted: reading without being able to delete the object, say.
Every object also has a public authority, *PUBLIC, applying to anyone not otherwise
provided for. For a new object it is set by the system value QCRTAUT, but only when the
library has CRTAUT(*SYSVAL) and the object is created with AUT(*LIBCRTAUT); otherwise
the library, or the command, decides. The value IBM recommends for QCRTAUT is *CHANGE,
and the public can change new objects.
Important
with public at *CHANGE, any user can change the data in a new file. A
menu application may offer no way to do it; an ODBC or ACS connection does. Restricting
public authority and granting by group is the review that changes the most, and also the
one that breaks the most. It is not done by changing QCRTAUT: IBM warns that several
supplied libraries, QSYS included, have CRTAUT(*SYSVAL), and that a value other than
*CHANGE can stop sign-on at new or automatically created devices. Work library by
library, collecting authority use first and restricting afterwards: that is the subject of
Measuring *PUBLIC before restricting it.
Groups and authorization lists
Authorities granted profile by profile soon become unmanageable. Two things make them governable:
Group profiles. A user can belong to a primary group (GRPPRF) and fifteen
supplemental ones (SUPGRPPRF), sixteen in all; authorities are granted to the group and
members use them. A group is an ordinary user profile: the system recognises it as a group
when the first member is added. IBM advises against groups owning objects, because every
member would then have the owner's authority to the object, deletion included.
Authorization lists (*AUTL). A list holds who may do what, and objects are told to
follow the list. One operation grants a user authority to every object on the list; each
user holds one private authority, the one to the list, which keeps profiles smaller and
security data saves faster. Files get an extra benefit: by default an open file cannot have
authority granted or revoked; if it is secured by a list, authorities can be changed even
while it is open.
CRTAUTL AUTL(PAYDATA) TEXT('Payroll files')
ADDAUTLE AUTL(PAYDATA) USER(GRPPAY) AUT(*CHANGE)
GRTOBJAUT OBJ(PRODLIB/PAYROLL) OBJTYPE(*FILE) AUTL(PAYDATA)
Adopted authority
A program can run with the owner's authority in addition to the caller's:
CRTxxxPGM ... USRPRF(*OWNER). *PGM, *SRVPGM and SQL packages can do it. It is the way
to give the user *USE on the files, so that through SQL they can only read, and let the
maintenance program do the updating.
What is adopted, according to IBM:
- the owner's private and ownership authorities, and those of its primary group; not public authority, and not the groups the owner belongs to;
- the owner's special authorities,
*ALLOBJincluded; - authorities only: other profile attributes, such as limited capabilities, are not.
Warning
adopted authority stays active while the program is on the call stack, and
the programs it calls use it too (unless USEADPAUT(*NO)). A program owned by a profile
with *ALLOBJ that leads to a command line hands *ALLOBJ to whoever gets there. It is not
passed on by SBMJOB, TFRCTL, trigger or exit point programs, or the IFS.
DSPPGMADP shows which programs adopt a profile's authority, and PRTADPOBJ produces a
report. The use of adopted authority is recorded in the audit journal as AP entries when
QAUDLVL includes *PGMADP; they are read with SYSTOOLS.AUDIT_JOURNAL_AP.
DSPPGMADP USRPRF(QSECOFR)
Security levels
The system value QSECURITY decides how seriously the system takes all this. Changing it
needs *ALLOBJ and *SECADM, and the new value takes effect at the next restart.
| Level | What it does |
|---|---|
| 10 | no password, access to everything. It cannot be set: it remains only on a system already there |
| 20 | password required, but profiles are created with *ALLOBJ. It can no longer be set either, and a system that leaves it cannot go back |
| 30 | passwords and object authority: a specific authority is needed for every resource, and only class *SECOFR gets *ALLOBJ automatically |
| 40 | as 30, plus integrity: programs fail if they access objects through unsupported interfaces, and whoever submits a job needs *USE to the user profile in the job description. It is the default |
| 50 | as 40, plus checking of the parameters passed to supported interfaces. For installations with strict security requirements |
DSPSYSVAL SYSVAL(QSECURITY)
Warning
going from 30 to 40 can stop programs that ran at 30. IBM's route: turn on
auditing, put at least *AUTFAIL and *PGMFAIL in QAUDLVL, run every application at 30
and look in the journal for AF entries (subtypes B, C, D, J, R, S are those
that become failures at 40); then fix, and only then CHGSYSVAL and an IPL.
Where to start on an inherited system
Four questions, each answered by one query or command:
- How many profiles have
*ALLOBJ, directly or through a group, and who are they really? - Are there enabled profiles that have not signed on for months?
USER_INFOhas the last sign-on inPREVIOUS_SIGNON. - What is
QSECURITYset to? - Is auditing on (
QAUDCTLother than*NONE) or is the system recording nothing of what happens?
Sources
- IBM: Special authority
- IBM: Create User Profile (CRTUSRPRF)
- IBM: USER_INFO view
- IBM: Authority for new objects (QCRTAUT)
- IBM: Group profiles
- IBM: Advantages of using an authorization list
- IBM: Objects that adopt the owner's authority
- IBM: AUDIT_JOURNAL_AP table function
- IBM: Change Security Auditing (CHGSECAUD)
- IBM: Security level (QSECURITY)
- IBM: Security level 20
- IBM: Security level 40
- IBM: Changing to security level 40
Comments
No comments yet. Be the first to comment!
You need an account to comment. Log in · Sign up