26
Fri, Apr
1 New Articles

File Shares: Accessing Objects in the IFS

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

File shares are what make the IFS, or part of the IFS, available for viewing or manipulation via the network. You use file shares when you want all users on the network to have access to something. Many organizations define file shares to allow users to map a drive and easily drag and drop documents to or retrieve them from a directory on IBM i.

Editor's Note: This article is excerpted from chapter 7 of IBM i Security Administration and Compliance: Third Edition, by Carol Woodbury.

It’s important to note that although an individual file or the entire root directory may be shared on the network, users still need the appropriate authority to a directory or file to perform the intended request. Just because a file is shared doesn’t mean everyone can read it. That ability is still determined by the object authority settings on the directory or library being shared. (Yes, you can share a library!)

The list of shares that have been defined can be viewed using Navigator for i. Go to My Connections > system_name > File Systems > File Shares. (See Figure 7.5.) From this display, you can add, modify, or delete a file share. It also lists the number of users currently connected to the share. This is helpful information if you are trying to delete a share or modify it from read/write to read-only. If you want to delete the share but users are connected to it, right-click on the share name > Properties > Sessions to see the list of users currently connected. Note that this is a point in time. Users who connected earlier in the day and then disconnected won’t be listed, for example.

To create a new file share, you use Navigator. Go to My Connections > system_name > File Systems > Integrated File System, right-click the directory or library you want to share, and select Sharing. You can choose to make the share read-only or read/write. If at all possible, make the share a read-only share since it will prevent uploading to that location. You can also choose how many users can use the share at one time.

File Shares: Accessing Objects in the IFS - Figure 1

Figure 7.5: Listing of file shares

The Risk of File Shares

Prior to the onslaught of malware, the risk that file shares posed was exposing data to users in user interfaces that allowed for easy manipulation (including deletion) when you didn’t have a good object-level security scheme in place—in other words, when users had more authority than was appropriate. While that risk remains, the risk today is from malware. Specifically, the risk manifests itself when a user is attached to a read/write share and their workstation is infected by malware. At that point, IBM i looks like any other drive attached to the workstation, so when the malware is fin- ished infecting the workstation, it marches right across to whatever has been shared on IBM i. If that share happens to be to root (/), your entire system—I repeat, your entire system—is open to infection. I have seen malware that renames directories as well as ransomware that wreaks havoc on IBM i systems that have a read/write share to root. The attack is most successful when root has been left at its shipped value of DTAAUT(*RWX) OBJAUT(*ALL).

Unlike on Windows, you can’t set the access for a file share. Once you’ve created a share, it is available for all network users who possess an IBM i user profile and password.

When creating file shares, follow these guidelines:

  • First and foremost, you should never create a read/write share to share root.
  • You should also never create a read/write share to /QSYS.lib as this will share all of your libraries. If you need to allow sharing of the contents of a library, create the share on that library, not on QSYS.
  • If you create a share to root (or /QSYS.lib), create it as read-only and add a dollar-sign character ($) on the end. (Adding a $ to the end of the file share name causes it to not be browsable on the network.)
  • Create the file share directly at the point that needs to be shared, no higher.
  • Create shares as read-only whenever possible.
  • If you don’t want the share to be discoverable on the network, add a $ to the end of the name.

File Shares: Accessing Objects in the IFS - Technical Note

Review (and Remove) File Shares

Many systems—especially development systems—have an overabundance of file shares, meaning there are multiple shares for the same directory, shares that point to objects that no longer exist, and shares that are no longer in use. Most of the shares have been added without any realization as to what is being made available to the entire network.

To prevent users from being able to create file shares, change the QZLSADFS (Add File Share) and QZLSCHRS (Change File Share) APIs from their default setting of *USE to *PUBLIC *EXCLUDE.

IBM i NetServer

The IBM i NetServer is what makes IBM i a file server. Two aspects of the NetServer have security implications. The first is that the NetServer can have a guest profile assigned to it. The functionality is as it sounds: when someone connects to the system via a file share, when a guest profile has been assigned to the NetServer, they don’t have to authenticate. They simply map a drive to a file share, and then they have access to whatever the guest profile has authority to access.

Two obvious problems arise from this. First, if multiple people connect as the same user, accountability is lost. Second, if you have not implemented a “deny by default” object security model, users will have whatever the *PUBLIC authority setting happens to be. For example, if the *PUBLIC authority of all database files is *ALL and the root directory has been shared, then every person who has access to your organization’s network can map a drive using the root share, connect without entering a valid IBM i user ID and password, and delete any file on your system!

To review the configuration of the NetServer and the list of users currently connected via a file share, open Navigator for i. Open Network, then Servers, then click on All Tasks. Open IBM i NetServer and choose Properties; when the properties are displayed, choose Security. Figure 7.6 shows that a guest profile—GUESTPROF—has been assigned to the NetServer.

File Shares: Accessing Objects in the IFS - Figure 2

Figure 7.6: Reviewing the NetServer configuration

To remove the guest profile, click Next Start, then blank out the Guest user ID field. Click OK, then stop and restart the server. To review the list of connected sessions, choose Sessions rather than Properties.

To Virus Scan or Not Virus Scan?

Although the IBM i operating system isn’t affected by PC- or UNIX-based viruses and worms, the objects stored in the IFS can be. In addition, the IFS has proven many times that it can very efficiently and effectively store and propagate viruses. Today, most viruses are caught by firewalls, routers, or email scanners and never reach the IFS. However, many organizations have processes that directly place objects into the IFS without passing them through a virus scanner—perhaps a download from a bank, EDI transactions, or FTP from a trading partner. If there’s any opportunity for something to be placed into the IFS without first being virus scanned, you’re putting your system at risk if you don’t scan the IFS. The most effective way to scan the IFS is to use a native virus scanner. I do not recommend that you point a virus scanner engine at the IFS and scan that way. That’s because this method actually creates more vulnerabilities on your system. It requires a read/write share to root (/), and the connection must be established using a profile with *ALLOBJ so that you can be assured all directories are scanned (even those that have been secured), and then, when the scan runs, the entire contents of your IFS are sent over your network in cleartext to the server doing the scan. Not only does this cause excessive network traffic, but all of your information in the IFS is being sent through your network in cleartext. (See why I don’t recommend this method?)

Native-running vendor solutions will use two security-related system values together with exit points to enable both static and real-time virus scanning. These features will allow you to determine when you want files to be scanned.

Tips for Avoiding Malware

Malware can and does affect IBM i. Just because the operating system itself is virus “resistant,” do not be lulled into thinking the system can’t be affected by malware or it can’t happen to your organization. If it never happens, great! But if it does, wouldn’t you rather be prepared? Here are some of the actions you can take to reduce the risk of the system being affected by malware:

  • DO NOT SHARE ROOT! There is no need to share root, especially with a read/write share. If you must share root, then make it a read-only share to ensure malware cannot affect objects on IBM i. But it’s better to not share root at all. Why? Because as I mentioned earlier, it shares the entire system, not just the So if someone maps to root, they can see the entire structure of the system. I would prefer not to expose the system in this way. Instead, create shares at the point that needs to be shared, no higher.
  • Create shares as read-only whenever possible.
  • Hide the share so it cannot be discovered by adding a $ to the end of the name when it’s created, e.g., ShareName$.
  • Reduce the permissions on directories to read-only or *EXCLUDE wherever possible to reduce or restrict access.
  • Reduce the number of users with *ALLOBJ special authority. An *ALLOBJ user mapped to a file share on IBM i will provide the malware with sufficient authority to do whatever it wants, regardless of the authorities on the That’s also why it’s important to make the shares read-only where possible. Users with *ALLOBJ will still only be able to read the contents when connected to a read-only share.
  • Reduce the number of users with *IOSYSCFG special authority. You can create a file share if you have *IOSYSCFG even if you have no authority to the directory being shared.
  • If you have exit point software, now’s the time to use it! Put rules in place to restrict who can access the system via the file server exit. (Note: It is not sufficient to simply Rules must be in place to block access.)
  • Restrict access to the /QSYS.lib file system when using Windows Explorer (and Navigator for i) by restricting access to (excluding users from) the QPWFSERVER authorization list.

Final Advice

As I said at the beginning of this chapter, the IFS is the most ignored part of IBM i— especially when it comes to security. Now is the time to start addressing security in the IFS. If you do nothing else, follow my guidelines for avoiding malware.

Helpful Tools

The IBM i SECTOOLS menu provides two tools to help you manage authorities to IFS objects. Both the PRTPUBAUT (Print Public Authority) command and the PRTPVTAUT (Print Private Authority) command let you specify a pathname for the object name. When specifying a directory, you also have 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.

Two other commands can be helpful in determining ownership and other object attributes for objects in a directory. The RTVDIRINF (Retrieve Directory Information) command produces an intermediate file of information, which you can then print using the PRTDIRINF (Print Directory Information) command. Unfortunately, the file produced by running RTVDIRINF is in a format that renders the command unusable for running queries or using SQL statements to produce customized reports.

SQL Views

Beginning with V7R4 TR (Technology Refresh) 1 and V7R3 TR7, IBM has provided the following views to help you manage IFS objects, including usage information. This is very helpful when trying to clean up (get rid of) obsolete objects.

  • IFS_JOB_INFO
  • IFS_OBJECT_LOCK_INFO
  • IFS_OBJECT_REFERENCES_INFO
  • IFS_OBJECT_STATISTICS

 

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: