26
Sun, May
0 New Articles

Security Patrol

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

Question: I read that V4R2 supports column-level security in database files. Could you please explain column-level security and how it may apply to existing applications?

Answer: Column-level security, which was added in V4R2, allows you to control who can update and reference fields (columns) in a database file. The words update and reference sound like the capability to modify and read selected columns. The term update does mean the capability to update a column, but, unfortunately, reference authority is not control of read authority. Object reference authority simply provides authority to specify the field as part of the parent key in a referential constraint. (Referential constraints are conditions that the database will enforce between files: for example, that an employee master record must exist before you can have an associated skill file record for that master file record.)

While column-level security is a step in the right direction toward meeting the needs of applications, without read authority at the column level, IBM has missed an important function that most AS/400 installations want: a way to control what users can read in the contents of a field (column). Because read-level security is not implemented, the new column-level security functions will have limited application for most AS/400 installations.

The specification of column-level security is done using the SQL statements GRANT and REVOKE. There is no CL command equivalent for column-level security. An example of a column-level security specification is shown in Figure 1. First, the CREATE TABLE statement creates the table (physical file) with four fields (NAME, ADDRESS, CITY, and SALARY). You could use DDS to create the file and then use SQL statements to secure the file. The second and third SQL statements are GRANT statements that specify that users WOELMT and QUSER are authorized to update the

NAME, ADDRESS, and CITY fields. Since the SALARY field is omitted, they are not authorized to modify the SALARY field. User WOELMT is granted authority to use the NAME field in a referential integrity statement only.

To display the column-level authority information, use the Display Object Authority (DSPOBJAUT) command:

DSPOBJAUT +

OBJ(EVANS/FILE0) +

OBJTYPE(*FILE)

The display in Figure 2 shows the object-level authorities granted by the SQL statements in Figure 1. Note the additional command key F16 to display the field (column) authorities. Also note that, when you create a table using SQL CREATE TABLE statements, the public authority to the table is *EXCLUDE. The GRANT SELECT authority gives the users read access to the table. The GRANT REFERENCES gives user WOELMT the *OBJREF authority shown at the R column.

When F16 is pressed, the display in Figure 3 shows the authority to individual fields in the file. Reviewing the SALARY field, we see that users WOELMT and QUSER are not allowed to update the field. INSERT authority was granted for the file, allowing user WOELMT to add a new record, including the salary field; however, the user profile is prevented from modifying any existing fields.

Object security information is stored in user profiles. When you back up user profiles with the Save System (SAVSYS) or Save Security Data (SAVSECDTA) command, the user profiles and all object security information are saved. For column (field) security, the information is stored not in the user profile but with the database file. Saving user profiles does not save the column security information. This information is saved when the file is saved.

I saved FILE0 and restored the file to a different library named WOETEMP. Then, I repeated the display of object authority for the restored file. In Figure 4, notice that only the owner’s authority is restored: The users WOELMT and QUSER do not have any authority for the restored file. However, when you press F16, you see in Figure 5 that the field-level authorities were saved and then restored when the file was restored. This is further verification that the field (column) authorities are stored with the file and not the user profile.

The field-level authority is enforced when the user attempts to update a record. When a user violates a field-level authority check, the subsequent error messages do an excellent job of describing the problem. For example, when signed on as user QUSER, I used the DFU (Data File Utility) to update the FILE0. DFU could change the fields NAME, CITY, and ADDRESS since the user QUSER had update (*UPD) authority on these fields. However, when QUSER attempted to modify the salary field, the messages shown in Figure 6 were issued.

The errors are reported in the generic range (CPF51xx-CPF53xx) for I/O errors, so existing applications that monitor for I/O errors will be notified of field (column) security violations, and standard error recovery procedures will be invoked.

A word of caution about field (column) security: Once you start maintaining the authority for a file using SQL statements, you must continue using SQL. I discovered that when I used the Edit Object Authority (EDTOBJAUT) command to change the object access for user WOELMT, and all of the field level authorities for WOELMT were lost. Compare column authority in Figure 5 to the column authority after EDTOBJAUT in Figure 7, and you can see the column authority for user WOELMT has been removed.

There is no CL command interface to specify field (column) security, but the Operations Navigator can be used to specify column security. Figure 8 shows the

Operations Navigator display of the permissions (authorities) for the file FILE0. Figure 9 shows the detailed permissions (authorities) for file FILE0. Selecting the option for column (field) authorities displays multiple screens reflecting the users authorized to the different fields in the FILE0. The Operations Navigator shows column authorities for the file owner even though there was no SQL GRANT statement for user profile WOEVANS. Using the Operations Navigator to specify column security is easy when compared to using the SQL statements. Using a graphical interface is superior to using SQL statements.

Enter SQL Statements

Type SQL statement, press Enter.

> CREATE TABLE MYLIB/FILE0 (NAME CHAR (30) NOT NULL WITH DEFAULT,

ADDRESS CHAR (20) NOT NULL WITH DEFAULT, CITYST CHAR (15) NOT NULL

WITH DEFAULT, SALARY DEC (10, 2) NOT NULL WITH DEFAULT)

Table FILE0 created in MYLIB.

> GRANT INSERT, SELECT, REFERENCES(NAME), UPDATE(NAME, ADDRESS,

CITYST) ON MYLIB/FILE0 TO WOELMT

GRANT of authority to FILE0 in MYLIB completed.

> GRANT INSERT, SELECT, UPDATE(NAME, ADDRESS, CITYST) ON MYLIB/FILE0

TO QUSER

GRANT of authority to FILE0 in MYLIB completed.

===>

Bottom

F3= Exit F4=Prompt F6=Insert line F9=Retrieve F10=Copy line

F12=Cancel F13=Services F24=More keys Display Object Authority

Object . . . . . . . : FILE0 Owner . . . . . . . : WOEVANS

Library . . . . . : MYLIB Primary group . . . : *NONE

Object type . . . . : *FILE

Object secured by authorization list . . . . . . . . . . . . : *NONE

Object -----Object------ ------Data-

User Group Authority O M E A R R A U D E

WOEVANS * ALL X X X X X X X X X X

QUSER USER DEF X X X X

WOELMT USER DEF X X X X X

*PUBLIC *EXCLUDE

Bottom

Press Enter to continue.

F3= Exit F12=Cancel F16=Display field authorities F17=Top F18=Bottom Display Field Authority

Object . . . . . . . : FILE0 Owner . . . . . . . : WOEVANS

Library . . . . . : MYLIB Primary group . . . : *NONE

Object type . . . . : *FILE

Figure 1: SQL commands for column-level security

Figure 2: Display of object authority

Object -----------Field Authorities-

Field User Authority Mgt Alter Ref Read Add Update

NAME WOELMT USER DEF X X X X

QUSER USER DEF X X X

ADDRESS WOELMT USER DEF X X X

QUSER USER DEF X X X

CITYST WOELMT USER DEF X X X

QUSER USER DEF X X X

SALARY WOELMT USER DEF X X

QUSER USER DEF X X

Bottom

Press Enter to continue.

F3= Exit F12=Cancel F16=Display field authorities F17=Top F18=Bottom Display Object Authority

Object . . . . . . . : FILE0 Owner . . . . . . . : WOEVANS

Library . . . . . : MYLIB Primary group . . . : *NONE

Object type . . . . : *FILE

Object secured by authorization list . . . . . . . . . . . . : *NONE

Object -----Object------ ------Data-

User Group Authority O M E A R R A U D E

WOEVANS * ALL X X X X X X X X X X

*PUBLIC *EXCLUDE

Bottom

Press Enter to continue.

F3= Exit F12=Cancel F16=Display field authorities F17=Top F18=Bottom Display Field Authority

Object . . . . . . . : FILE0 Owner . . . . . . . : WOEVANS

Library . . . . . : MYLIB Primary group . . . : *NONE

Object type . . . . : *FILE

Object -------Field Authorities-

Field User Authority Mgt Alter Ref Read Add Update

NAME WOELMT *NONE X X X X

QUSER * NONE X X X

ADDRESS WOELMT *NONE X X X

QUSER * NONE X X X

CITYST WOELMT *NONE X X X

QUSER * NONE X X X

SALARY WOELMT *NONE X X

QUSER * NONE X X

Bottom

Press Enter to continue.

F3= Exit F12=Cancel F16=Display field authorities F17=Top F18=Bottom Display All Messages

System: MCRISC

Job . . : QPADEV0001 User . . : WOELMT Number . . . : 121443

3> chgdta file0_dfu

Not authorized to field SALARY of file FILE0.

Figure 3: Display of field authorities

Figure 4: Authority of restored file

Figure 5: Field authorities of restored file

Not authorized to process request on member FILE0.

You are not authorized to perform the requested operation.

All records added, changed, or deleted will be printed.

Bottom

Press Enter to continue.

F3= Exit F5=Refresh F12=Cancel F17=Top F18=Bottom Display Field Authority

Object . . . . . . . : FILE0 Owner . . . . . . . : WOEVANS

Library . . . . . : MYLIB Primary group . . . : *NONE

Object type . . . . : *FILE

Object -----------Field Authorities-

Field User Authority Mgt Alter Ref Read Add Update

NAME QUSER *NONE X X X

ADDRESS QUSER *NONE X X X

CITYST QUSER *NONE X X X

SALARY QUSER *NONE X X

Bottom

Press Enter to continue.

F3= Exit F12=Cancel F16=Display field authorities F17=Top F18=Bottom

Figure 6: Error messages modifying SALARY field

Figure 7: Column authority lost when using EDTOBJAUT

<>
<>
<>

Figure 8: Operations Navigator permissions



Security_Patrol505-00.png 893x664
<>
<>
<>

Figure 9: Operations Navigator detailed permissions



Security_Patrol506-00.png 893x664
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: