Home > AS/400 Tips > iSeries security tips > Archiving private authorities
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES SECURITY TIPS

Archiving private authorities


Sanjay Lavakare
02.06.2004
Rating: -4.20- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Did you know that when you restore an object on the iSeries -- using the RSTOBJ/RSTLIB command -- it gets restored WITHOUT its private authorities? Well, that's a big loss when we consider the fact that many organizations do have hundreds of objects with customized authorities for specific users (though it is recommended to have the minimum possible private authorities on the iSeries). This is not the case when you restore the entire system backup (as you use the RSTAUT command at the end).

Documenting private authorities is a tedious task. Instead, here's a tip for an easier way out.

On a daily basis, run a scheduled command :

DSPOBJD OBJ(*ALLUSR/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE) OUTFILE(MYLIB/OBJLIST)

This should be run during off-peak times.

This command will create a file (OBJLIST) containing objects and their library names.

Then, code the program (PGM_PVTAUT) and execute it, either on a periodic basis depending on how frequently authority changes happen on your system. This program runs the DSPOBJAUT command for each object recorded in file OBJLIST and outputs the details to file OBJAUTS.

Subsequently, whenever an object is restored, you can run a query on file OBJAUTS and retrieve its private authorities (if any).

In case you are restoring a full library and need to restore private authorities in bulk, call program PGM_GRTAUT.

Codes for these pgms are given below.

Believe me, this really comes in handy.



Code

 
 /* Code for PGM_PVTAUT */ 
 
/***************************************************************************
/ 
  /** This program reads the file OBJLIST which has been created using
*/ 
  /** command DSPOBJD. For each object-entry, command DSPOBJAUT is executed
*/ 
  /** and the output is directed to file OBJAUTS */

 
/***************************************************************************
/ 
 

         PGM

 

         DCLF    FILE(MYLIB/OBJLIST) /*Listing of all objects on system*/

 

         CLRPFM  FILE(MYLIB/OBJAUTS) /*Clear outfile, if already populated
*/   
 

 START: RCVF

             MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(END))

 

             DSPOBJAUT  OBJ(&ODLBNM/&ODOBNM) OBJTYPE(&ODOBTP) +

                          OUTPUT(*OUTFILE) OUTFILE(MYLIB/OBJAUTS) +

                          OUTMBR(*FIRST *add)

             MONMSG     MSGID(CPF2208) /* Object not found */

 

                   GOTO START

 END:  ENDPGM    

***********************************************


  /** Code for Program PGM_GRTAUT *****/                               
 /** This program is run to restore private authorities of objects */ 
 /** in a library.                                                 */ 
 /** Use this when you restore a library from backup media.        */ 
 /** Program reads the file OBJAUTS and grants authorities to objs.*/ 
 /** in the specified library.                                     */ 
 /** To call :  CALL  PGM_GRTAUT  PARM(lib-name)                  **/ 
 /******************************************************************/ 
                                                                      
PGM PARM(&LIBNM)                                                      
             DCL        VAR(&LIBNM) TYPE(*CHAR) LEN(10)               
             DCLF       FILE(MYLIB/OBJAUTS)                           
  START:RCVF                                                          
             MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(END))         
                                                                      
      /***************************/                                   
             IF         COND(&OAOPR *EQ 'X') THEN(GRTOBJAUT +         
                          OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +      
                          USER(&OAUSR) AUT(*OBJOPR))                  
                                                                      
              IF         COND(&OAOMGT *EQ 'X') THEN(GRTOBJAUT +     
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +   
                           USER(&OAUSR) AUT(*OBJMGT))               
                                                                    
              IF         COND(&OAEXS *EQ 'X') THEN(GRTOBJAUT +      
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +   
                           USER(&OAUSR) AUT(*OBJEXIST))             
                                                                    
              IF         COND(&OAREAD *EQ 'X') THEN(GRTOBJAUT +     
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +   
                           USER(&OAUSR) AUT(*READ))                 
                                                                    
              IF         COND(&OAADD *EQ 'X') THEN(GRTOBJAUT +      
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +   
                           USER(&OAUSR) AUT(*ADD))                  
              IF         COND(&OAUPD *EQ 'X') THEN(GRTOBJAUT +      
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +   
                           USER(&OAUSR) AUT(*UPD))                  
                                                                    
              IF         COND(&OADLT *EQ 'X') THEN(GRTOBJAUT +      
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +   
                                                                    
                           USER(&OAUSR) AUT(*DLT))                    
              IF         COND(&OAEXEC *EQ 'X') THEN(GRTOBJAUT +       
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +     
                           USER(&OAUSR) AUT(*EXECUTE))                
              IF         COND(&OAALT *EQ 'X') THEN(GRTOBJAUT +        
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +     
                           USER(&OAUSR) AUT(*OBJALTER))               
                                                                      
              IF         COND(&OAREF *EQ 'X') THEN(GRTOBJAUT +        
                           OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +     
                           USER(&OAUSR) AUT(*OBJREF))                 
                                                                      
              GRTOBJAUT  OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +       
                           AUTL(&OAANAM)                              
              GRTOBJAUT  OBJ(&LIBNM/&OANAME) OBJTYPE(&OATYPE) +       
                           USER(*PUBLIC) AUT(*AUTL)                   
              GOTO       CMDLBL(START)                                
                                                                      
 END:                                                                 
 ENDPGM                                                               
 ****************** End of data ************************************** 

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Search400's targeted search engine: Get relevant information on security.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Check out this Search400.com Featured Topic: Top ten security tips


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Systems Management
Can you trust all those trigger programs?
Are your backups complete?
Controlling remote command processing
Watch your profiles
Avoid locking issues
Send message to users at a remote site
Security journal receiver management
Top 10 backup commands
Create an iSeries Access image and update it with the latest Service Pack
Tracking critical file access in real time

iSeries security tips
Security considerations for IBM i backups
Developing a security incident response system for System i
Tracking remote access users on System i
Setting up security for programmers on IBM i
Controlling remote access on your IBM i
Checking in on your IBM i authorization lists
PCI data security standards and the System i
Securing the integrated file system on IBM System i
Contextual security on IBM i: Limit user profile access
Time for a security checkup for your i

iSeries system and application security
Developing a security incident response system for System i
Setting up security for programmers on IBM i
Blocking AS/400 DB2 users
Trouble accessing IFS path from Win2k3 server
Checking in on your IBM i authorization lists
Strategies for securing IBM i production files
Changing password security levels and upgrading operating systems on the IBM i
Determine the value of parameter UPPWEI in the DSPUSRPRF field
Define journal code value "K"
Modify content within a journal receiver file

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
midrange  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts