Which programs run with more authority than they need?

Here is a question that stumps more shops than it should: which of your jobs are running with more authority than they need?

We spend a lot of time worrying about user profiles. We spend almost none worrying about what our jobs actually adopt while they run, and that is where a lot of real exposure hides. A program created to adopt QSECOFR authority, called by a user who should have none, is a door most people never think to check.

You can see who is adopting what:

SELECT OBJECT_LIBRARY, OBJECT_NAME, OBJECT_TYPE,
      USER_PROFILE, USE_ADOPTED_AUTHORITY
 FROM QSYS2.PROGRAM_INFO
 WHERE USER_PROFILE <> '*USER'
 ORDER BY USER_PROFILE, OBJECT_LIBRARY;

Any program where USER_PROFILE is *OWNER is adopting the authority of whoever owns it. If that owner is a powerful profile, then every user who can call that program temporarily borrows that power for the length of the call.

Adopted authority is not a bug. It is a genuinely useful design and I have written plenty of programs that rely on it. The problem is never the technique. The problem is the program somebody wrote in 2008 to solve a one-time issue, that still adopts *ALLOBJ, that half the company can still call, and that everybody has forgotten exists.

Run the query. Look specifically for programs owned by powerful profiles that ordinary users can call. That short list is worth an afternoon of anyone’s time.

What is the oldest adopted-authority program still running in your shop?

#IBMi #Security #Power

Originally posted on LinkedIn. Join the conversation there.

Get new posts by email

Practical IBM i tips on SQL services, security and backup, sent when I publish. No spam, unsubscribe anytime.

Leave a Reply