• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Two Tips Are Better Than One

    November 10, 2010 Patrick Botz

    In my two previous tips, I discussed the alternative PUBLIC authority technique and the re-adopted authority utility implemented via a Submit Job (SBMJOB) command exit point. Using these two ideas together provides an environment where everyone can continue to work normally while, at the same time, providing an environment where you can identify special cases requiring additional changes and can test all of your changes without affecting normal production usage.

    Let’s see how this works. If you recall, alternative PUBLIC authority involves setting up a group profile; we’ll call it ALTPUBLIC. After adding all of the production users (or all users) to this profile, you can change PUBLIC authority to *EXCLUDE for your data and programs. Users who are members of ALTPUBLIC will continue to work without problems–virtually regardless of any other authority changes you make.

    Where Do We Go From Here?

    Well, that’s all fine and dandy, but what other authority changes should you make? I usually make the following three changes.

    First, create a new application owner user profile, if one doesn’t already exist. We’ll call this profile APPOWNER. Make this new user profile the owner of all of the application programs and data objects.

    Second, change the initial program for the application to adopt authority. If you don’t own the initial program and it doesn’t have observability, write a “wrapper” CL program to call the real initial program. Make sure the wrapper program is owned by APPOWNER and that it adopts authority.

    Third, implement the Re-Adopt utility. Make sure to add the initial program or your wrapper program to the Re-Adopt configuration table.

    Select a Guinea Pig

    Assuming that most of the application users do not have *ALLOBJ special authority, these are most likely the only major changes you will have to make. But you don’t have to take my word for it; just select one application user and remove that person’s user profile from membership in ALTPUBLIC. If you created a new wrapper program, you also need to change the initial program in this person’s user profile to the new wrapper program.

    Working with the person you selected, tell them you are testing some authority changes and if everything goes as planned they should see no difference or encounter any problems with the application. Tell them if they do have any problems or questions at all to contact you immediately and you will fix the problem right away.

    If your test user runs into an issue, gather the information about which menu option or operation they were running. To debug any authority related problem, the information you ultimately need is:

    1. The user profile used by the system at the time the problem was encountered
    2. The program or command that was running when the problem occurred
    3. The object the program or command was trying to access
    4. The authority or special authority required to perform the failing operation

    The system audit journal is, by far, the best and fastest place to find most of this information. Appendix D of the Security Reference manual can also be very useful if you find a system command received the authority failure. In any case, as soon as you have this information, make the test person’s user profile a member of ALTPUBLIC again. Have them log out of the application and log back in and they will have lost very little of their productive time.

    Problem Types

    So what kinds of problems will be encountered? The most likely problems will fall into one of three categories:

    1. Trigger programs
    2. Programs with embedded dynamic SQL statements
    3. Direct access to data from outside of the application

    Adopted authority is not available to trigger programs, as they are launched by the database and not directly from by any user program. However, you can compile (or change) programs to run with adopted authority. If your developers can tell you the names of all trigger programs, fix them all at once. If not, it just means your testing process with real users will take longer.

    Embedded dynamic SQL statements (i.e., the program has a PREPARE or EXECUTE statement) do not automatically run with adopted authority in effect at the time the program is executed. This is true even if the User Profile attribute of the program is set to *OWNER and/or the “Use adopted authority” attribute of the program is set to *YES. The only official way to get the dynamic embedded SQL in a program to run with adopted authority is to recompile the program (e.g., CRTSQLRPG) with “Dynamic user profile” set to *OWNER. (The default is *USER.)

    There’s Always Someone

    Most customers I work with have someone–typically named Joe and working in marketing, go figure–who needs to access database information directly, often through Excel. This means they do not use the application, much less the initial program that adopts authority. There are a number of ways to fix this, but the one I like best and that requires the least maintenance over time is to use an ODBC exit program. You can write your own exit point program or you can buy a third-party exit point security product. Writing an ODBC exit point program is very doable for an experienced programmer. The advantage of writing your own is cost. The disadvantage is that you may not have anyone that understands the ODBC exit point, and it does require a bit of investigation.

    There is at least one exit point vendor whose product, in addition to allowing you to control who can access the system through ODBC, also allows you to specify the adopted authority that should be used for requests by people permitted to use ODBC. The only disadvantage of buying vendor software is that you may very likely only need to use the software for a very small number of exit points–but you’ll pay for the entire product anyway.

    When the first user is able to do their job for a period of time with which you are comfortable (e.g., a day, week, business cycle) without errors, then pick another test user, preferably in another job function to make sure you are exercising additional parts of the application. You’ll find that you encounter most problems with the first one or test users. After a couple of more test users, you’ll find yourself being ready to remove larger groups of people from ALTPUBLIC group membership (e.g., everyone in a department that has similar job functions). At some point, you’ll be comfortable enough to delete the ALTPUBLIC user profile. When it’s deleted the whole system is running with PUBLIC *EXCLUDE.

    A Gradual Approach

    So there you have it. Combining alternative PUBLIC authority with the re-adopt utility puts you well on the way to moving your system to an exclusionary access control model (i.e., PUBLIC = *EXCLUDE on all application programs and data objects). This approach gives you the ability to test authority changes with a single user while the rest of your users are blissfully unaware that any changes are being made. It also gives you the ability to identify and fix problems over a long period of time.

    Patrick Botz is the principal consultant and founder of Botz & Associates Inc. He is also president of Valid Technologies, LLC, a biometric middleware ISV. Pat spent nearly 20 years working at IBM in various security roles including lead IBM i security architect, IBM eServer security team, and the head of IBM Lab Services Security Consulting practice. Check out his Website at www.botzandassociates.com. Send your questions or comments for Patrick to Ted Holt via the IT Jungle Contact page.

    RELATED STORIES

    Re-Adopt Authority Utility

    Low Risk Authority Changes



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Bytware:  FREE Webinar! Scan your IBM i, AIX, and Linux Directories for Viruses. Nov. 17, 9 am PT
    iSeries DevCon2010:  Get 3 days of IBM i training and 365 DAYS OF VALUE, Nov 15-17, Las Vegas
    Profound Logic Software:  FREE Webinar: Creating Open and Portable IBM i Apps. Nov 16, 1 p.m. EST

    IT Jungle Store Top Book Picks

    BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The iSeries Pocket Database Guide: List Price, $59
    The iSeries Pocket SQL Guide: List Price, $59
    The iSeries Pocket WebFacing Primer: List Price, $39
    Migrating to WebSphere Express for iSeries: List Price, $49
    Getting Started with WebSphere Express for iSeries: List Price, $49
    The All-Everything Operating System: List Price, $35
    The Best Joomla! Tutorial Ever!: List Price, $19.95

    Attachmate Partners with Emirates for Airline App JDE Alliance Formed by Six Independent Vendors

    Leave a Reply Cancel reply

Volume 10, Number 35 -- November 10, 2010
THIS ISSUE SPONSORED BY:

WorksRight Software
ProData Computer Services
Twin Data Corporation

Table of Contents

  • Two Tips Are Better Than One
  • Down with Assumptions! Up with Diagnostics!
  • Admin Alert: Things to Think About When Changing Hardware Maintenance

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle