Blocking Object Access

By Rich Loeber

I am often asked specific questions by readers about a situation in their shop. I enjoy hearing from readers about their real-life situations. One of the most frequent questions I hear is “How do I keep a specific user from accessing certain data files on my system?”.

The answer depends a many variables. First of all, if the user you want to block has been set up with all object authority at the user profile level (SPCAUT containing the *ALLOBJ setting), then there is really nothing you can do at the operating system level to block access. This is a frequent song that I sing, but there should be precious few user profiles on your system with this level of access. And, you should have some pretty good business reasons for granting it to those profiles where this level is supported.

Assuming that this is not an issue, then the easiest way to block access to a specific file is to edit the authority for that object using the Edit Object Authority (EDTOBJAUT) command. Add an entry for the user profile you want to block and set it to *EXCLUDE. If you want to block everyone except certain users, then set the *PUBLIC access to the object to *EXCLUDE and specifically authorize the profiles where access needs to be granted.

If your object is secured by an authorization list, then you should to make these changes to the associated authorization list. The list in force is shown when you edit the object authority. Having your object authority controlled by an authorization list is a good idea as it lets you make security changes at any time, not just when the object is not in use. Also, you can secure multiple objects with the same authorization list thereby simplifying your security administration task.

If you decide that you want to block access to all the files in a given library, then you can edit the object authority for the library. Adding public *EXCLUDE access authority at the library level will extend to all objects within the library. Remember, this will extend to all objects in the library, not just data file objects. This could be a concern for you depending on how your applications are implemented.

You can also exclude users from accessing objects that are stored in the Integrated File System (IFS). In the IFS, you can specify *EXCLUDE authority for any object for a given user profile. From the command line, you can work with IFS security from the WRKLNK command. From iSeries Access, the security functions are also available and may be easier to work with for you.

Lastly, if you have a whole group of people where you want to block access, consider placing them all into a group on your system. If you are already using group profiles and your blocking scheme does not match up with your current group implementation, then you can set up the users to be blocked in a supplemental group. The IBM i/OS provides for up to 14 supplemental groups for each user profile on the system giving you a lot of flexibility. Remember, doing things at the group level reduces your security administration overhead.

 

Adopted Authority Basics

By Rich Loeber

On your IBM i, every object is owned by a user profile, even if it is just a system default owner profile.  As objects are created, the ownership is established by the person who creates the object.  When new objects are added to your system that were created on a different system, such as third party software or objects restored to your system from another IBM i, the ownership that was in effect on the other system is carried over onto your system.

Program objects have a unique aspect of ownership that many programmers and users of IBM’s i/OS may not be aware of.  There is a setting in each *PGM object on your system that controls authority checking whenever that *PGM object is executed.  This is controlled by the USRPRF parameter when the program is compiled.  For existing programs, it can be changed by the CHGPGM command.

The default setting for the various compilation commands in i/OS, as shipped from the factory, sets the USRPRF parameter to the value “*USER”.  This means that when that program runs, the security settings are checked according to the user profile in effect for the user who actually runs the program.  This is the intuitive setting that you would normally want to have in effect.  When a user runs a program, you only want them to have access to objects on your system that they are authorized to work with.  If they run a program that they are not supposed to be using; one that accesses objects they are not authorized for, then you want the OS security to kick in an prevent the object access.  As long as your programs are set to *USER for the USRPRF parameter, then this is exactly what will happen.

The alternate setting for the USRPRF parameter in programs is *OWNER.  When this is specified, then the program is said to “adopt” the security settings for the user profile that owns the *PGM object (regardless of who is running the program).  So, using this method, someone with fairly limited security authorization can run a program and access objects that they are not normally cleared for.  A good example of when this is desirable would be with a payroll application where a clerk is cleared for file maintenance under program control but you don’t want them to have access to the payroll files for any other purposes.  By having the maintenance program adopt the authority of the program owner, you can accomplish this with ease.

So, what’s the problem then with adopted authority?

The problem is that it can be misused and, under certain circumstances, open your system to abuse.  Because of this, you need to know which programs on your system use adopted authority and then check those programs to make sure that they are well behaved and don’t break any of the generally accepted rules for programs of this type.

As an example, having a program that uses adopted authority which is owned by a user profile with *ALLOBJ authority could lead to a security exposure.  If that program contained an option to display an open command line, then the user could gain access to your entire system.  When reviewing this situation, it is important to remember that not only can security authority be adopted, it can also be inherited.  This happens when a program with adopted authority is run and then calls another program deeper in the program stack.  That called program will inherit the adopted authority of the program that called it from higher up in the program call stack.  This inheriting feature is only in effect for a single call level.  If your called program then, in turn, calls a third program, then the inherit feature is no longer in effect.

IBM’s i/OS contains a reporting feature that will allow you to review programs that adopt authority so you can see where your possible exposures may lie.  The Print Adopting Objects  (PRTADPOBJ) command will let you review this on-line or via a printed report.  It is run by user profile and, at a minimum, you should take a look at all of your user profiles that have *ALLOBJ authority.

This just scratches the surface of the issues associated with programs that adopt their owner’s authority.  For additional research, take a long look at the IBM i Security Manual.  It will show you ways to limit the use of adopted authority and provide additional insights into the issues presented.

More Control over User Profiles

By Rich Loeber

No matter how good your office procedures are for setting up, enabling, disabling and removing users from your system, there is always room for error.  There is nothing like a quick check of your user profile base to help keep your user profiles in good order.  The user profile is a key that lets people into your system and keeping the keys in order is, or should be, a primary obligation of your security controls.

For many of us who have been doing this for a while, the quick review takes the form of a session with the WRKUSRPRF command using the *ALL option.  But, this is a tedious process at best and you can easily miss something important this way.  The ideal would be to get the user profile information organized into various views to focus in on the myriad aspects of security that exist in today’s IBM i world.

Fortunately, IBM’s i/OS contains a facility to help you with this.  The command “Print User Profile” (PRTUSRPRF) has the ability to generate up to four different format reports that will organize your user profile information base to give you a good overview.  The report information for the four different reports concentrate on:

  • Authority type information
  • Environment type information
  • Password type information
  • Password level type information (V5R1 and higher only)

The command has up to four parameters to control the information presented on the listings.  Some of these parameters are context sensitive and will not always be prompted depending on other values you enter.  In addition to indicating which of the four report formats you want, you can also narrow your selection of the specific user profiles to be included, thereby letting you analyze like profiles together.  These selection options let you limit the reports to only users with specific special authority settings and users for specific user classes.  You will probably want to start by specifying all users, but if you’re in a very large shop, this may produce too much information for you to be able to focus in on.

The four reports, however, are the key to using this tool effectively.  The report on authority type information shows each selected profile along with a reference to any group profile or supplemental groups that the profile belongs to.  Then, the special authorities in effect for the user are shown along with their user class, the user profile object ownership setting and other object ownership related information.  A quick scan of this report can quickly show you users that are categorized in an incorrect group, users who are in a group that gives them more access rights than you really intend and many other options.

The report on environment type information presents a different report format.  This report focuses in on the job execution environment in place for each user profile.  These things include the current library, initial menu/library, default job description and other settings that control how jobs run by each user profile will be setup by your system.  This report lets you do a quick audit of user profiles to make sure that they are set up for just the work they should be doing and no more.

The third report produces password type information.  This report lists the current enabled/disabled status of each profile, the current number of invalid signon attempts, the last signon, when their password was last changed and more information that will help with administration of password controls.  In preparing this article, I discovered some unusual values on this report that seemed to indicate someone attempting to gain access to our test system via Telnet using the QSRV and QSYSOPR user profiles.  Both profiles were disabled and the not-valid signon attempts were at the maximum.  Since nobody uses these profiles in our shop, I can only conclude that an illegal signon attempt was made for both of these.  Fortunately, it appears that these attempts failed since we do not have the default passwords still active for any of the IBM supplied ‘Q’ user profiles.  Using this report, you can perform a very quick scan of the setup for each user and quickly spot anomalies, like I did.

The fourth report prints a report on password level type information.  Under the more recent versions of i/OS, you can optionally use longer passwords (up to 128 bytes long) and you can specify a controlled switch over from one setup to another.  This fourth report supplies you with information on how this extended password level is configured for each user on your system.  You can see additional information about this on the system value QPWDLVL and by using the DSPSECA command on these systems.

These four reports, and their various mutations when you use the filtering options, will give you a good tool in keeping current on the status of the user profile pool on your system.  A monthly review of the first three reports would be in order and you can simplify this by just loading these commands into your system job scheduler to automatically run on a monthly basis.

Getting Control over User Profiles

By Rich Loeber

Every IBM i shop has the potential to have active user profiles on the system for users who have left the company.  Unless your personnel department is extra careful about global notifications when people leave, then you may have a security exposure that you don’t even know about.

You can, if you’re careful about setting up user profiles, take care of this problem when new profiles are created.  The “Password expiration interval” (PWDEXPITV) parameter on the Create User Profile (CRTUSRPRF) command lets you set up a separate expiration day interval for each user.  On a system-wide basis, you can also enforce a default expiration interval with the system value QPWDEXPITV.  Using the system value, you just have to use the default *SYSVAL setting for the PWDEXPITV parameter for each user profile.  I suspect that a lot of shops use this arrangement.

However, in every shop, there are users who have passwords that are set to never expire.  This is not recommended, but may make sense for some people who can closely guard their password and use the system heavily.  (I know many programmers and system operators who enjoy this luxury.)  For these people, simply relying on the password expiration interval won’t work, leaving you an even more serious exposure since the type of people who want permanent passwords also tend to have broad access to your system.

The good news is that IBM’s i/OS contains a way for you to enforce periodic expiration on user profiles that have not been used for a specified period of time.  There are several i/OS commands that will help you to enforce a policy of automatically forcing unused profiles to inactive status by disabling them.

The “Analyze Profile Activity” (ANZPRFACT) command will let you set up and control the number of days that the system should use to check for unused profiles.  Then, after this has been set, the system will scan the active profiles on your system once per day and disable those that have not been used for the specific period of time.  Before you start to use this, however, be sure to read on.  (Note, you can disable this check by running this command again and changing the setting to *NOMAX.)

The “Display Active Profile List” (DSPACTPRFL) command will let you display a list of specific profiles that the ANZPRFACT command will ignore when it is checking for unused profile activity.  These might be certain profiles that own object code on your system but are not actually used for signon purposes.  Some applications may require that these owner profiles remain active on your system.  This may be particularly true of third party software.

The “Change Active Profile List” (CHGACTPRFL) command lets you modify this list of profiles on your system.  You can use this command to add or remove entries from the list.  It is important to note that most Q profiles (IBM profiles) are automatically excluded from ANZPRFACT processing.  If you prompt the ANZPRFACT  command and use the HELP facility, you can access a quick list of the Q profiles that are excluded.

It is important for you to check the list (DSPACTPRFL) and update the list (CHGACTPRFL) before any regularly scheduled analysis processing takes place.  This will make sure that you don’t shoot yourself in the foot by disabling a user profile that needs to remain active.  If you use third party software on your system, check with each developer to find out if their ownership profile needs to remain enabled on your system.  Some third party software won’t care of the profile is disabled, but it is important to get the developer’s blessing before taking this step.  If you do have an owner profile that needs to remain enabled, you can always prevent user logon attempts by changing the password to *NONE.