02
Sat, Nov
2 New Articles

Security Patrol: Reader Q&A

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

Stop Spammers from Using Your iSeries Mail Server

Q: We have just learned that someone has accessed our AS/400 and used our mail server to send spam. Based on what I have found on the forum and elsewhere, it appears that this is quite easy to do by Telnetting to port 25. Is there an easy way to shut this door?

A: Yes, and you should do so at once! Some spammer has discovered that your iSeries is acting as an open relay, and they are using your system and your domain name to obscure the true source of this spam. Given some of the vile content that can be contained in spam email, putting a fix in place has to be a paramount priority.

IBM has released two methods of limiting SMTP relays, and the method you should use depends upon the OS/400 release you're on. If you are at V4R5 or less, you'll need to perform the following steps:

  1. Create a source physical file called QUISRSYS/QTMSADRLST. IBM requires that the CCSID be equal to 500 so be sure to specify that parameter. Example: CRTSRCPF FILE(QUISRSYS/QTMSADRLST) CCSID(500).
    Using your favorite source entry tool, create a member in that source file called ACCEPTRLY (Accept Relay).
  2. Add an entry into this source file (one per line) for each IP address or IP range that you wish to allow. Each entry can have up to two elements: The first element is an IP address, and the second element is the subnet mask. For example, if your internal TCP/IP addressing scheme is of the 192.168.* range, your first entry might look like this: 192.168.0.0 255.255.0.0. This mask will allow email relaying from all IP addresses from 192.168.0.0 through 192.168.255.255.
  3. If you want to allow some specific email address, tighten the subnet mask like so: 10.0.0.17 255.255.255.255.


The IBM Information Center also warns you to delete the data area called QUSRSYS/QTMSNORLY after you've created this source file. That data area prevents all email relay, something you might not want to do.

For versions less than V4R5, you will have to load a PTF to enable this relay constraint. The PTFs and their respective OS releases are as follows:

  • V4R2 5769TC1 SF52864
  • V4R3 5769TC1 SF53421
  • V4R4 5769TC1 SF54014


If you're at V5R1 though, IBM has made things a bit easier for you. You need only issue the CHGSMTPA command and specify that you would like to limit SMTP relay to a predefined list of TCP/IP addresses. That command would look like this: CHGSMTPA ALWRLY(*LIST).
Then, use the ADDSMTPLE command (and its corresponding RMVSMTPLE command) to manage the TCP/IP addresses that should be allowed to relay email through your AS/400.

Restricting ODBC

Q: Can you tell me how to set up ODBC security on our AS/400? Is an exit program the only way to do this?

A: Well, an exit program is not the only way, but it is often the most effective and efficient way to implement security on iSeries machines that have traditional security models. And to be clear, ODBC in and of itself does not represent a security exposure, but rather it (and other network access points such as FTP, DDM, etc.) allows your users to exploit an existing security exposure that plagues most iSeries installations.

ODBC brings your pre-existing security problem into sharper focus. At the heart of the matter is whether an end user has OS/400 object level authority to data. ODBC cannot magically grant access when a user requests to read or change data through PC applications such as Microsoft Excel. The ODBC driver used by Excel is required to present a user's OS/400 credentials to your operating system, and the operating system will still insist that the user has proper authority before granting access to your data. But if you are running a typical OS/400 application, your application users have *ALL rights to the data by virtue of their membership in some powerful group profile. In our security practice, we often find that the general public (*PUBLIC) has at least *CHANGE rights to application data. If this is the case in your shop, you have two basic routes you can go: Rearrange your fundamental security model or install network security exit programs.

If you have the time, resources, and enough detailed knowledge of your software package to rearrange your security model, you will want to focus on five primary areas of improvement: exclude based posture, proper ownership, meaningful group profile(s), objects secured by authorization lists, and program authority adoption.

The exclude based posture means that you will remove every user's individual access to all of the data, and then you'll change *PUBLIC's authority to *EXCLUDE on every file. This step is designed to refuse any attempted access to your data except as defined by you in the steps below.

Once the general public is properly excluded from the application, you should look to setting proper ownership of your application objects. Do this by creating a series of special owner user profiles. One profile will own (nearly) all of the objects in the application (the application owner profile). For future reference, let's call the set of objects owned by this user Object Set A. Next, create a series of application administration profiles that will be used to give certain users access to the application. These application administration profiles are not assigned to real users; each will own a small number of programs that will be used in an adopted authority scheme. More on that later. For future reference, the objects that are owned by these profiles will be referred to as Object Sets B through n. These application administration user profiles will roughly match your application group profiles (described later) on a one-to-one basis. These new special owner and administrator user profiles do not need passwords or any special authorities, nor should they be group profiles for any other system user. Their primary purpose is to own the application objects.

To create meaningful group profiles, you will want to segregate your existing users into distinct group profiles that can be secured to specific job functions. Logical groups of users in an organization might include AP personnel, AR personnel, shipping dock workers, order entry operators, payroll staff, department supervisors, senior managers, and so on. The general idea here is to tightly scope the job function so that a group of users can be given very specific action rights. Create the group profiles with meaningful names and assign each user to at least one group. In some cases, you will need to assign a user to more than one group (the payroll supervisor, for example might belong to both the Payroll Group and the Supervisor Group), but that won't be a problem because group profile authority in OS/400 is cumulative.

Once the group profiles and are set, you'll want to set two authorization lists to secure all of the objects in Object Set A. All of the data elements should be secured by one authorization list, and all of the programs (and other static, non-changing objects) should be secured by the second authorization list. Next, grant the *PUBLIC *EXCLUDE authority to both lists, and grant all of the application administration user profiles *CHANGE authority to the data authorization list and *USE authority to the program authorization list. To complete this step, you will secure each of the Object Sets (B through n) with their corresponding authorization list. Again, *PUBLIC will have *EXCLUDE authority to the objects on this list.

Finally, you can tie this whole scheme together by granting the various group profiles *USE authority to the corresponding adopted authority programs.

This way, when your users attempt to run your applications, the flow will go something like this:

  • Mary belongs to the group profile OrderEntry.
  • The group profile OrderEntry has *USE right to the program OE01 through the authorization list that secures program OE01.
  • When program OE01 is called, it adopts the authority of application administration user profile OEADMIN.
  • Application administration user profile OEADMIN has *CHANGE rights to the data in the application and *USE rights to the programs and other static objects in the application.
  • When Mary chooses a menu option that attempts to update the Order Entry file, she is allowed to because her job is adopting the authority of user OEADMIN.
  • If Mary attempts to read the Order Entry file using ODBC, she is denied access because neither user profile Mary nor group profile OrderEntry has any direct authority to the file.


This security model is quite secure, but if you're tempted to write to me and tell me it is too confusing, too difficult to implement on software packages that you purchased, or not workable because some of your users need read or update rights to some of your data via ODBC, save the electrons; I wholeheartedly agree.

This is why most OS/400 shops elect to use exit programs to secure network access from PC applications. Exit programs have the advantage of being simpler to implement (especially if you purchase them rather than try to write them yourself) and less disruptive than a complete security re-org.

With exit programs at the FTP, ODBC, and other various network interfaces, you can quickly take an exclude based posture. That is, exclude *PUBLIC from using the ODBC server at all, and then, if necessary, allow certain users to have just read access. You can even provide limited data update rights to your data if you have users who you trust to do that.

So, no, an exit program is not the only way to secure data from ODBC, but unless you have a lot of time on your hands, it's likely the best way.

Authority to Delete Device Descriptions

Q: We are on an AS/400 Model 820 with V5R1. Apparently in V5R1, *IOCFGSYS and *JOBCTL authority will not let you delete virtual devices and controllers automatically created by QSYS. We have created a CL program that adopts authority, but it gives us a command line. Is there a way to restrict that command line, in CL, just for that call? When F3 is pressed, I'd like my command line back.

A: I don't know that this is a change to V5R1; it is more likely something has changed in the way your users are authorized to the virtual device objects. In order to delete an object (any object) you have to have Object Existence (*OBJEXIST) rights to that object. Sure, *IOSYSCFG special authority is required to work with communications objects like virtual devices, and it makes sense that in certain circumstances you'll need *JOBCTL special authority in order to end a job that could be attached to the device description, but neither of those special authorities will give you the specific right to delete a device description object.

To solve your problem, consider putting all of your existing virtual devices into an authorization list and then authorizing selected users to delete the objects in that authorization list. Then, when new virtual devices are created by something like Telnet, the new device will assume the authority properties of the old device (including the authorization list), and your administrators will have the requisite authority to delete them.

Also, rather than give these users a command line that adopts widespread authority, consider using a more tightly scripted adopted authority routine that does exactly what you want--and only what you want. A three-line CL program with selective prompting like the one below can be used to adopt authority and only permit a single action, surely a better option than the unrestricted command line prompt.

PGM
   DLTDEVD ??DEVD()
ENDPGM

Try the command at a selective command prompt at a command line and see how it works.

John Earl is chief technology officer for the PowerTech Group in Kent, Washington. This month, John's hobby is dreaming up vicious tortures for the scofflaws that ruin the Internet for the rest of us by sending out gobs of unsolicited commercial email (spam). If you have a security question or a torture suggestion, you can send John an email at This email address is being protected from spambots. You need JavaScript enabled to view it. or post it online in the MCPressOnline Security Forum.

John Earl

John Earl is the founder and Director of Technology and Security for  The PowerTech Group.  a Seattle-area software company that specializes in System i security. He has over 25 years experience with IBM midrange systems and security, has published numerous articles and columns for industry magazines, and served as a Subject Matter Expert (SME) for Security for COMMON. A highly regarded speaker on OS/400 and i5/OS security, Mr. Earl has presented several hundred of iSeries security sessions at industry conferences and user groups all over the world. He is a three-time winner of COMMON's Speaker Excellence award and has also served on the board of directors of COMMON U.S.

 

He can be reached at 253.872.7788 or at This email address is being protected from spambots. You need JavaScript enabled to view it..

 

 

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

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: