18
Thu, Apr
5 New Articles

Security Patrol: Security Considerations for the Integrated File System (IFS)

IBM i (OS/400, i5/OS)
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

 

Securing the Integrated File System (IFS) is an issue that all OS/400 security administrators must deal with because of the way it comes secured--or not secured--from IBM. By default, the IFS comes shipped wide open--the equivalent of *PUBLIC(*ALL). Why would the good folks at IBM Rochester do this, you ask? Because that's the way UNIX applications expect the root (/) directory to be secured. And one of the reasons for implementing the IFS was to allow UNIX applications to port to OS/400.

The IFS consists of several file systems. It always includes the QSYS.LIB file system and may include the NFS file system, the QLANSrv file system that supports the Integrated xSeries Server for iSeries and other Windows 2000 servers on your network, etc. This article concentrates on how to secure the "nonspecific" parts of the IFS--root (/), QOpenSys, and user-defined file systems.

These parts of the IFS use a different authority scheme from the "traditional" QSYS.LIB file system. These parts use a UNIX-based authority scheme. Other file systems use their own authorization method. For example, the QLANSrv file system uses a Windows-based authorization scheme. The UNIX authorities and how they map into OS/400 authorities is in Figure 1.

  Authorities
*RWX
*RW
*RX
*R
*WX
*W
*X
  Object
  *OBJMGT
  *OBJEXIST
  *OBJALTER
  *OBJREF
  *AUTLMGT
  Data
  *OBJOPR
X
X
X
X
X
X
X
  *READ
X
X
X
X
     
  *ADD
X
X
   
X
X
 
  *UPD
X
X
   
X
X
 
  *DLT
X
X
         
  *EXECUTE
X
 
X
 
X
 
X

Note: *OBJOPR authority, an "object authority" in OS/400 terms, is included with the data authorities that make up the implementation of these UNIX authorities on OS/400.

Figure 1: This table identifies how IFS authorities map to OS/400 authorities.


*R (read authority) allows the contents of a directory to be listed or an object (like a stream file) to be read.
*W (write authority) allows a new object, such as a stream file or a subdirectory, to be added to a directory.
*X (execute authority) allows a directory to be traversed.
*RWX equates to the OS/400 authority of *CHANGE.
*RX equates to the OS/400 authority of *USE.

I'll discuss these authorities in more detail later.

IFS Authorities

When managing access to objects in the IFS, you must deal with two sets of authorities--data authorities and object authorities. As you can see in Figure 1, the UNIX authorities of *R, *W, and *X map to data authorities. But even though you might be working with a UNIX application and its objects, the objects are still OS/400 objects "under the covers." So you can't ignore the fact that all OS/400 authorities must be accounted for--thus, the object authorities.

Managing Authorities to IFS Objects

You can manage authorities to IFS object two ways: through green-screen commands or through iSeries Navigator.

To manage through green-screen, use the Work with Authority (WRKAUT), Change Authority (CHGAUT), or Display Authority (DSPAUT) commands. These commands take a path name, not the traditional library_name/object_name *OBJTYPE naming convention that you're used to.

Figure 2 shows the default access for the root (/) directory as it ships. Note that *PUBLIC authority has data authorities *RWX and all object authorities. In "traditional" OS/400 security terms, this is the equivalent of *PUBLIC(*ALL).

http://www.mcpressonline.com/articles/images/2002/IFS%20-%20MCPressV500.png

Figure 2: Here, the Work with Authority (WRKAUT) command shows the default authority to root (/). (Click images to enlarge.)

If you're uncomfortable typing in the path name, you can navigate through the directory structure using the Work with Link (WRKLNK) command. On the directory or object you wish to change authorities for, take option 9 to Work with Authority. That will take you to the WRKAUT command with the path name filled in for you.

Or you can use iSeries Navigator. Go to My Connections->iSeries_system->File systems-> Integrated File System. Right-click on Root. Choose Permissions. This will bring you to the screen shown in Figure 3.

http://www.mcpressonline.com/articles/images/2002/IFS%20-%20MCPressV501.png

Figure 3: This iSeries Access Permissions screen shows the default access for root (/).

Managing "Traditional" OS/400 Objects through IFS Authority Commands

You can manage the authority of any object--including objects in the QSYS.LIB file system--by using either the green-screen or iSeries Navigator interfaces. The screen shown in Figure 4 allows you to manage authority to the APPDEVSRC library by using the Change Authority (CHGAUT) command. Figure 4 shows an example identifying an OS/400 object using a path name.


http://www.mcpressonline.com/articles/images/2002/IFS%20-%20MCPressV502.png

Figure 4: Use the Change Authority (CHGAUT) command to manage authorities to an OS/400 object.

QPWFSERVER Authorization List

You can prevent users from accessing the QSYS.LIB file system through iSeries Access file serving (i.e., via iSeries Navigator), NetServer file serving, and file serving between iSeries systems by removing users' authority to the QPWFSERVER authorization list. IBM ships this authorization list with OS/400. The *PUBLIC authority defaults to *USE. Setting *PUBLIC to *EXCLUDE will prevent users from accessing QSYS.LIB through interfaces like Ops Nav. The best way to think of it is that it will prevent access through directory structure interfaces (Ops Nav presents QSYS.LIB in a directory structure). However, the authority to the authorization list is not checked by interfaces such as FTP, ODBC, or DDM.

Helpful Tools

OS/400 SECTOOLS provides two tools to help you manage authorities to IFS objects. Both Print Public Authority (PRTPUBAUT) and Print Private Authority (PRTPVTAUT) allow you to specify a path name for the object name. When specifying a directory, you also get the option to search the subdirectories and include those objects in the report. Warning: If you run the report for root (/), the printed report for either command can be huge.

There's also a set of free--but unsupported--management tools for IFS from IBM. Some of these tools are quite handy. Tom McBride from IBM Rochester performed a review of the tools. Before downloading and using these tools, I highly recommend that you read this review to get an understanding of the function and purpose of each tool:

  • QRYIFSLIB dumps information such as file size, owner, primary group, etc. to an outfile.
  • CHGOWNALL runs the CHGOWN command on all files and subdirectories in the specified directory. You can run this tool to make sure all the directory's objects are owned by the correct owner.
  • CHGAUTALL runs the CHGAUT command on all files and subdirectories in the specified directory. You can use this tool to make sure the appropriate authorities are set.
  • RNMIFSF renames an invalid file or directory name.
  • DLTIFSF deletes from the IFS a file containing invalid characters.
  • DSPLINK displays the actual location that a symbolic link references.
  • CHGCCSID changes the CCSID on one file or all files in a directory.
  • ATTRIB allows IFS file attributes to be updated from OS/400 without requiring a network drive or PC connection. For example, this is one way to remove or change the read-only or hidden file attributes for a particular file or files in a specific directory.
  • DELTREE deletes all files, directories, and subdirectories from the parent directory down. Obviously, this one needs to be used with caution.


A couple of these tools are very helpful for security administration--especially CHGOWNALL and CHGAUTALL. However, there are side effects to some of the tools, so again, please read the review before using them!

Audit Entries for Objects in the IFS

Just as you can audit objects in OS/400 (or the QSYS.LIB file system), you can audit objects in the IFS. The challenge comes when you try to read the audit journal entries for those objects. The objects' names are actually path names and can be variable in length. You will recognize an audit entry for an IFS object by the *N that appears for the object name. In this case, you will have to refer to the "Absolute Path Name" field, which is at the end of the audit journal entry. If the path name is longer than 5002 bytes, the IFS object name is identified with something called a file ID or FID. This number uniquely identifies the object. To get the path name from the FID, you must use the Get Path Name of Object from Its File ID (Qp0lGetPathFromFileID()) API. Fortunately, not too many path names exceed 5002 bytes!

Gotchas and Helpful Hints

There are some definite "gotchas" associated with the IFS. These gotchas are not necessarily a result of the IFS being poorly architected or implemented; they're a result of the developers in Rochester being forced to follow the way UNIX does things. To an OS/400-bigot, this often constitutes a gotcha! Here are the things you'll want to be aware of:

  • It is very easy to over-secure the IFS. Make sure you document the authorization steps you take in case you need to back them out.
  • Adopted authority is not honored within the IFS. Therefore, if the user does not have authority to the object, the application has to accommodate it through a version of a profile swap. Next month's "Security Patrol" will discuss authorization methods that work well in the IFS.
  • The attribute of a user profile that automatically assigns ownership of newly created objects to the user's group (the OWNER parameter) is not honored. The user--not the group-- always owns a newly created object.
  • Displaying the contents of a directory requires *RX data authority to every directory in the object's path. Changing the current directory only requires *R data authority to the directory. Therefore, it is possible for users to change their working directory to a directory for which they cannot display the contents!

Creating New Objects

  • In general, a new object inherits the authorities of its directory. (The exception is when you create IFS objects through APIs such as mkdir(), open(), or creat(). With those APIs, you can specify the data authorities for the owner, primary group, and public authorities.) Inherited authorities include the primary group authority, authorization list, and private authorities. The only difference would be the owner if a different user than the directory owner is creating the object.
  • Removing the owner's authority to a directory may produce undesirable results when objects are created into that directory. When an object is created into a directory, the owner of the new object is given the same authority as the owner of the directory. Therefore, if a user creates a file into a directory whose owner has had its authority removed, the user will have no authority to the newly created object.
  • Given that most IFS APIs allow data authority settings for the owner, primary group, and public to be specified on the call, education may be required for developers to ensure they have specified appropriate values for these parameters. Note: Since most of these APIs are UNIX APIs, they have no concept of object authorities. Therefore, the object authorities are inherited from the parent directory.
  • In V5R2, you have a new option for how the primary group is set for a newly created object. Prior to V5R2, the primary group and its authorities were set from the parent directory. Now, you have the option to have the primary group and its authorities set based on the user creating the object.

Copying Objects

  • The COPY command creates an exact duplicate of the object, including its authorities (except for the owner, of course). The CPY command does the same thing; actually, the COPY command is an alias of the CPY command, and they can be used interchangeably.
  • Since COPY copies authorities, in order to retrieve the authority information about the original object, a user must be the owner or have *OBJMGT to the object being copied.
  • The command CPYTOSTMF copies only data, not the stream file's authorities. By default, the owner will have *RWX authority, and the primary group and *PUBLIC authorities will be set to *EXCLUDE. If you want them set differently, you will have to do that (using a command such as CHGAUT) after the stream file has been copied.
  • Both the CPY and COPY commands allow you to make the owner of a copied object the same as the owner of the object being copied. Alternatively, you can set it to be the user making the copy. The default is to set the owner to the user making the copy. Depending on how these commands are used, it may be helpful to educate developers on this fact and retain the ownership of the object being copied. Or you could change the command default.


Other authority requirements are listed in iSeries Security Reference, Appendix D under the heading "Integrated File System Commands." This documentation can be very useful in determining what authority is required. (To find the iSeries Security Reference, go to the iSeries Information Center, choose the country, choose the release, and then open the Security tab. iSeries Security Reference is a downloadable .pdf.)

Virus Scanning

While OS/400 itself will not be affected by PC- or UNIX-based viruses and worms, the objects stored in the IFS can be. In addition, the IFS has proven numerous times that it very efficiently and effectively stores and propagates viruses. While there are commercially available virus scanners for Lotus Domino that run natively, there is no commercially available, natively running virus scanner that scans the rest of the IFS. Therefore, you will want to regularly map a drive to root (/), create a one-connection share so the IFS is visible to the network, and run a commercially available virus scanner from your PC against the IFS. You may be able to skip the QSYS.LIB file system, but some IBMers recommend scanning that as well. We recommend that you run the virus scanner at least once a week.

Next Month

Next month's "Security Patrol" will discuss file shares, security schemes for applications using IFS objects. and recommendations for securing the IFS.

Carol Woodbury is co-author of the book Implementing AS/400 Security as well as co-founder of SkyView Partners, a firm specializing in security consulting and services. Carol has over 12 years in the security industry, 10 of those working for IBM's Enterprise Server Group as the AS/400 Security Architect and Chief Engineering Manager of Security Technology. Carol can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it..

Carol Woodbury

 

Carol Woodbury is President and CTO of DXR Security and has over 30 years’ experience with IBM i Security. She started her career as Security Team Leader and Chief Engineering Manager for iSeries Security at IBM in Rochester, MN. Since leaving IBM, she has co-founded two companies – SkyView Partners and DXR Security. Her current company - DXR Security - specializes in penetration testing for IBM i. Her practical experience together with her intimate knowledge of the system combine for a unique viewpoint and experience level that cannot be matched.

Carol is known world-wide as an author and award-winning speaker on security technology, specializing in IBM i Security topics. She has written seven books on IBM i Security. Carol has been named an IBM Champion since 2018 and holds her CISSP and CRISC security certifications.

 


MC Press books written by Carol Woodbury available now on the MC Press Bookstore.

IBM i Security Administration and Compliance: Third Edition IBM i Security Administration and Compliance: Third Edition
Don't miss the newest edition by the industry’s #1 IBM i security expert.
List Price $71.95

Now On Sale

IBM i Security Administration and Compliance: Second Edition IBM i Security Administration and Compliance: Second Edition
Get the must-have guide by the industry’s #1 security authority.
List Price $71.95

Now On Sale

IBM i Security Administration and Compliance IBM i Security Administration and Compliance
For beginners to veterans, this is the definitive security resource.
List Price $69.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: