Pages

Showing posts with label security. Show all posts
Showing posts with label security. Show all posts

Tuesday, June 25, 2013

Deleting User Profile's in AS400

I am conclude User Profile topic with this topic until, I come across something that is interesting and important piece of  fact that I am missing to describe.

Deleting user profile's in AS400 is simple but it needs to have a look at many important piece of objects and items before we actually delete a user profile.

Why we need to analyze before deleting a User Profile?
An user can create objects and have access to many files and objects that could be affected the moment we decide to delete an user profile.

What all things we need to consider before deleting User Profile?
As per industry best practices, it is required to meet the audit compliance with SOX (Sarbanese -Oxley) and HIPAA(Health Insurance Portability and Accountability Act). 

If your company follows these standard and needs to meet audit compliance for SOX and HIPAA, then you might need to have proof of when the user left the organization and when the request was raised to remove the user profile. You might need to maintain a document based on the organizational practice. 

Sometimes, you might be required to immediately disable the User Profile after the person left the organization. This can be done by CHGUSRPRF.

CHGUSRPRF USRPRF(user_name) STATUS(*DISABLED)

Before, deleting a user profile it is needed to transfer all the objects that the user profile owns to another user. This is so because AS400 OS will not allow you to delete an User Profile if it has objects that it owns.
You can identify whom to assign the objects after checking with the group to whom this user belongs and then transfer all the objects that is owned by the user profile.

To identify the objects that the user profile owns, you can do

WRKOBJOWN USRPRF(user_name)

This can also be done by i Series - navigator.


You also need to identify how critical the user profile is, before you think of deleting it. There could be many user profiles which can not be deleted at all. Some basic example would be of the programmer or the programming manager who have designed almost all the programs and have setup all the interfaces. The administrator who have setup most of the batch jobs and the operator or user who have been for so long that it is difficult to figure out, which all jobs, objects and interfaces will be affected when the profile is deleted.

Such, user profile just reside in the system forever. 

If the user profile is not critical then get approval to delete the user profile from the departments required and  remember to document it before you proceed to delete the user profile. 

Deleting user profile :- 

WRKUSRPRF USRPRF(user_name)
Option 4 next to the user profile to delete the same. 

If the user profile will not delete that means there must be some objects that the User profile owns. Now, to change the ownership of the objects, use below command.

WRKUSRPRF USRPRF(user_name)
Take  option 12 to find the objects owned.
Take option 9 to change the owner.

Or you could also change the ownership of objects owned at the time of deletion by using the below command.

WRKUSRPRF USRPRF(user_name)
Take option 4 and prompt ( f4)
owned objects value => *CHGOWN
user profile name is *CHGOWN => OBJOWNER (this user will own the objects after deleting the user profile)

This can also be done by iSeries- navigator .Select the user profile and right click and select delete user profile. The below screen will appear where you can change the ownership of objects owned and then delete the user.


Monday, June 24, 2013

AS400 Group Profiles and some points to keep in mind

OS/400 group profiles are a boon to system administrators as they allow them to centralize object authority administration for several users in one place. A Group profile can be created in similar way as an user profile. While creating other user profile that are member of this group profile, mention the group profile name in group profile parameter(*GRPPRF).

Group profiles also have their downside and needs proper administration. Here are few industry best practices that we need to follow to avoid any loop-hole that can be a threat in security of the system.

1- Group profiles should not be allowed to sign-on to the system :- When a user is a member of a particular Group profile it inherits all the level of access that the Group profile has.  Since, group profile provides authority access to all the member user profiles, it has object authority that is fixed for all the member profiles.By changing authority at group level it affects all the member profiles.

 According industry best practices, it is not advisable to provide any user with group profile access. Therefore, the password of Group profile is set to *NONE. This restricts users to access the system using group profile.

CHGUSRPRF USRPRF(group profile name) PASSWORD(*NONE)

If you have a large number of group profiles in your system and you want to check which of them have any password, then use the below command.

DSPAUTUSR SEQ(*GRPPRF) OUTPUT(*PRINT)

2- Group Profiles should not own production objects :- Object owners are super users for all the objects they own. They can change, delete and move objects. Therefore, Group profiles should not own production objects as that would give access to all the member profiles.

This problem is compounded when software package specifies that all authorized users must belong to the group profile that owns the application objects.

3- Group profile should not have ALLOBJ authority :- User profiles like QSECOFR must not be a group profile. Administration profiles that have *ALLOBJ authority when made a group profile will give *ALLOBJ authority to all its users thus enabling them to do anything with all the objects. And this itself violets the purpose of having Group profile to secure objects.

4- Supplemental group profiles :- One user can have more than one group profile. While creating user profile you can specify one name in *GRPPRF parameter and you can specify upto 15 other group profiles in supplemental group profile parameter. *SGRPPRF. This is required when one person can have access to more than one department and would need to have different object authority based on different departments.

How to remove member user profiles from a group profile?

At times, you would be required to remove the group profile from many member user profiles. To perform this when the number of user profiles is more, it is easier to do via Ops navigator than modifying each one through emulator.

Go to iSeries Navigator and expand User ->Group->Group node

Now expand the group profile and highlight the users for which you want to remove the group profile name. Right click and select remove group profile.

Delete Group Profile :-

If you want to delete a group profile , then first you have to remove all the user profiles that are member of this group profile and also check if the group profile owns any object. Once these are cleared you can remove the group profile from the system via 5250 or Ops Navigator.




Thursday, June 20, 2013

Adding user profiles to authorization list

After, you create an user profile in AS400, it is required for Admin to ensure this user profile has been added to relevant authorization list.

What is Authorization list and how is it useful?
An Authorization list is a special system level object that resides in QSYS library with object type *AUTL. It simply defines user authority for objects belong to the list. Instead of providing individual private authority to an object when it is created, it is better to associate an object with appropriate Authorization list. The list will control individual and *PUBLIC authority of the object in the list.

It is beneficial in following way:-

1- Individual size of user profile is kept much lower by using Authorization list.
2- System performance is improved when running SAVSYS backup and saving security information by using SAVSECDTA.
3- Security changes can be made to object when the list are open and active. Only objects with private authority needs to be used when not in use.

How to create Authorization list?

Use command CRTAUTL  to create a new Authorization list.
Set *PUBLIC authority level using AUT parameter.

Once this is created you can work on it using EDTAUTL command.

You can grant object authority by GRTOBJAUT command or by adding objects to the list by ADDAUTLE.

Steps to create authorization list and add users is listed below.

1- Create authorization list, example

CRTAUTL AUTL(JOBSC) TEXT('job scheduler job')

When you do this the *PUBLIC authority will get the authority that you have selected, I have selected *CHANGE

Your ID will be added to this authorization list as you are the owner.


2- Add the objects that you want to secure using this AUTL.

The objects that you want to secure needs to be added to this AUTL. This can be done by EDTAUTL command. Here I want to secure CRTAUTL command access. So, I did the following


You can check the objects by taking F15 after entering the AUTL list.


3- Add other users that you want to secure via this authorization list.
ADDAUTLE command would do this

You can check the users added to this AUTL by taking option 5 next to the AUTL.


You can delete the authorization list by DLTAUTL command.







Wednesday, June 19, 2013

Now lets explore more on User profile security and audit

There are many common scenario's that needs to be taken care of while auditing and ensuring security of the system. Now, lets explore some of the basic one's.

1- Finding user profile's with default password :- While auditing IBM i, the common thing that the auditor would like to check is the list of user profile's that have default password. 

What is default password? When the user profile name and password are same, it is called default password. As you already know, the system defaults to *USRPRF while creating a new user profile and if unless changed would generate the user profile with same password as the user id, it is called default password.

As a responsible administrator, it is required to check periodically if any user profile has default password and the same report needs to be provided while auditing. So, how to generate a report with user profile's that have default password .

AS400 command ANZDFTPWD would do that.

Command is

ANZDFTPWD ACTION(*NONE)

This would generate a spool file QPSECPWD for the user. You can use iSeries navigator to download this report. 

If you want to disable the user profiles with default password , use the following

ANZDFTPWD ACTION(*DISABLE)

You can also expire the password of all the user profiles having default password, 

ANZDFTPWD ACTION(*PWDEXP)

ANZDFTPWD is that it produces a physical file containing all the information from its QPSECPWD listing. Whenever you run ANZDFTPWD, a complete list of all user profiles with default passwords is copied in the QASECPWD file in the QUSRSYS library. This file can be read in other programs or in an SQL query to gather more information.

2-  Password Configuration details :- Sometimes it would be required to check and provide the password configuration parameters for auditing. You can easily achieve this by iSeries Navigator.

Expand the system name under Management Central. Expand the security tab. Click on Password policy.





You can copy these details in General tab, validation tab and Expiration tab and provide it to auditors.

3- Querying User Profile to extract specific details :-  As a system administrator, it would be required to periodically check for users who no longer use the system for more than 6 months. Sometimes, to provide a list of users having a specific special authority. 

In order to do this, first create a physical file of the user profile in your system.  This can be done by
DSPUSRPRF USRPRF(*ALL) TYPE(*BASIC) OUTPUT(*OUTFILE) 
OUTFILE(LIBRARY NAME/FILE NAME) 

Now, this file is the physical file upon which you can query according to the requirement and provide the desired output. 

For generating report of all admin user profile,
SELECT  UPUPRF,  UPUSCL,  UPSPAU,  UPGRPF,  UPTEXT,  UPSTAT,  UPPSOD  FROM LIBNAME.FILENAME DSPUSRPRF  WHERE UPUSCL = '*SECADM' OR UPUSCL = '*SECOFR' OR UPUSCL = '*SYSOPR'   ORDER BY  2 

For user profile that have not used for last 6 months,

SELECT  UPUPRF,  UPGRPF,  UPTEXT,  UPSTAT,  UPPSOD,  UPPWCD,  UPPWEX,  UPLTCP,  UPSPAU,  UPOTQU  FROM LIBNAME.FILENAME SOXUSRPRF  WHERE UPPSOD < 'MMDDYYYY' AND UPSTAT <> '*ENABLED'   ORDER BY  2 

Run this statement to get all user profiles with a user class equal to *SECOFR or *PGMR.
SELECT * FROM LIBNAME.FILENAME WHERE UPUSCL = '*SECOFR' OR UPUSCL = '*PGMR'


To retrieve all user profile records that contain *ALLOBJ or *SECADM authority in their profiles, run this SQL statement.
SELECT * FROM LIB/FILENAME WHERE              
UPSPAU LIKE '%ALLOBJ%' OR UPSPAU LIKE '%SECADM%'


To capture all the user records that have command line authority on the system, run this SQL statement.
SELECT * FROM LIB/FILENAME WHERE UPLTCP = '*NO'

The hardest part is to determine the field name in this spool file. For that you can use

DSPFFD FILE(LIB/FILENAME) OUTPUT(*PRINT)

Since, these files could be way too big, it is better to use Help systems's  Showcase query as this enables the admin to generate the query output in excel sheet.  Showcase uses normal SQL to query the files.

3- Authority for running commands :-  The Auditors would also like to see the authority to run specific commands, for example SBMJOB, CHGJOB and ADDJOBSCDE command allows the user to make changes to jobs and change the job scheduler. To retrieve the authority information to run these commands, use the following.

DSPOBJAUTH OBJ(lib name/obj name) Objtype(*CMD)

I will discuss the rest security and auditing related parameters in my next post.

Thank you.




Related Posts Plugin for WordPress, Blogger...