7.2 Netezza Advanced Security Admin Guide
7.2 Netezza Advanced Security Admin Guide
7.2 Netezza Advanced Security Admin Guide
Release 7.2
IBM Netezza
Release 7.2
Note
Before using this information and the product it supports, read the information in “Notices” on page D-1
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-3
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X-1
This equipment was tested and found to comply with the limits for a Class A
digital device, according to Part 15 of the FCC Rules. These limits are designed to
provide reasonable protection against harmful interference when the equipment is
operated in a commercial environment. This equipment generates, uses, and can
radiate radio frequency energy and, if not installed and used in accordance with
the instruction manual, might cause harmful interference to radio communications.
Operation of this equipment in a residential area is likely to cause harmful
interference, in which case the user is required to correct the interference at their
own expense.
Properly shielded and grounded cables and connectors must be used to meet FCC
emission limits. IBM® is not responsible for any radio or television interference
caused by using other than recommended cables and connectors or by
unauthorized changes or modifications to this equipment. Unauthorized changes
or modifications might void the authority of the user to operate the equipment.
This device complies with Part 15 of the FCC Rules. Operation is subject to the
following two conditions: (1) this device might not cause harmful interference, and
(2) this device must accept any interference received, including interference that
might cause undesired operation.
Responsible manufacturer:
Dieses Gerät ist berechtigt, in Übereinstimmung mit dem Deutschen EMVG das
EG-Konformitätszeichen - CE - zu führen.
Verantwortlich für die Einhaltung der EMV Vorschriften ist der Hersteller:
IBM Deutschland
Technical Regulations, Department M456
IBM-Allee 1, 71137 Ehningen, Germany
Telephone: +49 7032 15-2937
Email: tjahn@de.ibm.com
This product is a Class A product based on the standard of the Voluntary Control
Council for Interference (VCCI). If this equipment is used in a domestic
environment, radio interference might occur, in which case the user might be
required to take corrective actions.
This is electromagnetic wave compatibility equipment for business (Type A). Sellers
and users need to pay attention to it. This is for any areas other than home.
Install the NPS® system in a restricted-access location. Ensure that only those
people trained to operate or service the equipment have physical access to it.
Install each AC power outlet near the NPS rack that plugs into it, and keep it
freely accessible.
High leakage current. Earth connection essential before connecting supply. Courant
de fuite élevé. Raccordement à la terre indispensable avant le raccordement au
réseau.
Homologation Statement
This product may not be certified in your country for connection by any means
whatsoever to interfaces of public telecommunications networks. Further
certification may be required by law prior to making any such connection. Contact
an IBM representative or reseller for any questions.
Audience
This guide is written for administrators who are using the IBM Netezza
Multi-Level Security and other advanced security features.
For more information about system security, see the IBM Netezza System
Administrator’s Guide.
Each object has an owner. Individual owners automatically have full access to their
objects and do not require individual object privileges to manage them.
In the Netezza system, the admin user owns all predefined objects. The admin
user has full access to all functions and objects, which is similar to the super user
(root) in UNIX. There are no privilege records associated with the admin user. You
cannot delete the admin user or change its name. Unlike all other objects, admin
user has no owner.
The PUBLIC group is also predefined. All users automatically are members of the
group. You cannot delete the PUBLIC group or change its name. Its owner is the
admin user.
Advanced security
The advanced security feature on the IBM Netezza system has the following areas:
v User login control provides session context and access restrictions.
v Masquerading provides a way for a user to operate as another user, with all the
privileges of that user.
v Advanced query history captures details about the user activity on the Netezza
system, such as the queries that are run, query plans, table access, column
access, session creation, and failed authentication requests.
v Multi-Level Security (MLS) is an abstract security model, which Netezza uses to
define rules to control access to table rows.
The advanced security features are enabled by default on IBM Netezza systems.
You can enable or disable the features with registry variables as described in
Appendix C, “Enable and disable security commands,” on page C-1.
Using the Netezza host for purposes other than running the Netezza database
software is a security issue, and can create denial-of-service situations. For
example, filling the host disks with non-Netezza data can stop audit logging and
therefore stop activity on the system. Creating demand on the processors, memory,
or disk subsystem can all interfere with provision of database services.
The admin user is the super user in the Netezza system database. It is necessary to
have such a user for initial configuration and to manage configuration and security
problems. However, the admin user can control all users and see all data – if not
directly, then by the ability to create objects that allow such access. Do not use the
admin user login in normal operations. Give explicit privileges to other user
identities for the management of the system and conduct DBA and operations
tasks on the system.
For example, to control the Multi-Level Security model and create users, create a
Netezza database user account for a Database Security Officer (DSO) with only
certain privileges, as in the following example. (For more information, see
Appendix B, “Examples,” on page B-1.)
SYSTEM.ADMIN(ADMIN)=> CREATE USER dso;
CREATE USER
SYSTEM.ADMIN(ADMIN)=> GRANT MANAGE SECURITY TO dso;
GRANT
SYSTEM.ADMIN(ADMIN)=> GRANT USER TO dso;
GRANT
For more information about sessions and creating users and groups, see the IBM
Netezza System Administrator’s Guide.
Session context
When a user logs in through an application and uses the IBM Netezza system, all
work is done in the context of a session. A session is owned by its session user,
who is constant after the session is created. You can control when sessions can be
created and how many concurrent (simultaneous) sessions can occur.
You can access session operations through any SQL interface. The following table
shows examples of SQL statements used for sessions, where each session has an
ID.
Table 2-1. Session SQL commands
SQL statement Meaning
SHOW SESSION [ID | ALL] [VERBOSE] Display the active session in verbose mode
ALTER SESSION [ID] PRIORITY Change the session priority
ALTER SESSION [ID] ROLLBACK Roll back any transactions in the session
TRANSACTION
DROP SESSION [ID] Remove the session
The security system controls what users and sessions you can access. Although
session lists are accessible to all users, you can read only the names of objects for
which you have List privileges.
Related concepts:
Chapter 3, “Masquerading,” on page 3-1
Concurrent sessions
You can limit the number of concurrent sessions that are owned by a single user,
and you can set different concurrent session values for each user.
For example, to set the number of concurrent sessions to 3 for user John Doe:
The following table shows command examples for different restrictions on a user.
The days are numbered 1 - 7, beginning with Sunday as 1.
Table 2-2. Restriction setting examples
Restriction Definition
ACCESS TIME ALL; No restriction on access.
ACCESS TIME DEFAULT; Restrictions are defined by GROUP settings.
ACCESS TIME (DAY ALL START Access is allowed every day from 8:00 a.m. to 6:00
'8:00' END '18:00'); p.m.
ACCESS TIME (DAY 3,4,5 START Access is allowed Tuesday, Wednesday, and Thursday
'7:00' END '18:00', DAY 2, 6 START from 7:00 a.m. to 6:00 p.m., and on Monday and
'6:00' END '15:00'); Friday from 6:00 a.m. to 3:00 p.m.
The times define when users can log in, but users can remain on the system past
the restriction time, if they logged in during the allowed timeframe and do not log
out.
The following example creates a user with a concurrent session limit of 2 and an
access time that ranges from 7:00 a.m. to 7:00 p.m.:
SYSTEM(ADMIN)=> CREATE USER jdoe CONCURRENT SESSIONS 2 ACCESS TIME
(DAY ALL START ’7:00’ END ’19:00’);
CREATE USER
The following example creates a group with a concurrent session limit of 8 and an
access time that ranges from Tuesday to Thursday, from 9:00 a.m. to 6:00 p.m.:
SYSTEM(ADMIN)=> CREATE GROUP finance CONCURRENT SESSIONS 8 ACCESS TIME
(DAY 3,4,5 START ’9:00’ END ’18:00’);
CREATE GROUP
Password restrictions
This section describes some techniques to control password policies for IBM
Netezza database users.
The following features allow for greater control in password setup for users:
v Password expiration
For more information about the specific usage of SQL command-line options, see
the IBM Netezza Database User’s Guide.
In this use case, system security is set up so that users do not access an Netezza
database directly, but do it through an application. The application allows certain
users access to the database. Each database user has an associated security profile,
determining what information can be accessed.
The Netezza system does not do the user authentication, but leaves that to the
application. In masquerading, a client uses the application to access the database as
another user (called a target user), thus accessing the database with the security
profile of the target user.
To run EXECUTE AS, use the following syntax, where target-user-name is the name
of an existing user for whom you have EXECUTE AS privilege:
EXECUTE AS target-user-name
The following command example begins a session for user John, with the
password ABCD, and accessing the database BIZ:
nzsql -u JOHN -pw ABCD -db BIZ
BIZ.SCM(JOHN)=>
To see which is the session user and which is the current user, run the following
commands:
BIZ(JOHN)=> SELECT session_user, current_user;
SESSION_USER | CURRENT_USER
--------------+--------------
JOHN | HANK
(1 row)
You can create stored procedures to use nested masquerading commands. For the
next example, first login as Admin and set up a group of users and privileges.
BIZ.SCM(ADMIN)=> CREATE USER john PASSWORD ’john’;
CREATE USER
BIZ.SCM(ADMIN)=> CREATE USER hank PASSWORD ’hank’;
CREATE USER
BIZ.SCM(ADMIN)=> CREATE USER tom PASSWORD ’tom123’;
CREATE USER
BIZ.SCM(ADMIN)=> GRANT EXECUTE AS ON tom to hank;
GRANT
BIZ.SCM(ADMIN)=> GRANT LIST ON john,hank,tom to john, hank, tom;
GRANT
BIZ.SCM(ADMIN)=> GRANT CONNECT ON dev to john, hank, tom;
GRANT
BIZ.SCM(ADMIN)=> GRANT CREATE PROCEDURE to hank;
GRANT
HANK grants JOHN the EXECUTE permission on the procedure, and runs the
procedure as JOHN. The procedure does not include the REVERT command,
because this is done automatically on a return from a stored procedure. This means
that you exit a stored procedure with the same current user and session user you
had when calling the procedure.
DEV.SCM(HANK)=> GRANT EXECUTE on proc_as(integer) to john;
GRANT
DEV.SCM(HANK)=> \c dev john john
You are now connected to database dev as user john.
DEV.SCM(JOHN)=> CALL proc_as(1);
NOTICE: Current User <HANK> Session User <JOHN>
PROC_AS
---------
1
(1 row)
DEV.SCM(JOHN)=> CALL proc_as(6);
NOTICE: Current User <TOM> Session User <JOHN>
PROC_AS
---------
6
(1 row)
For more information about creating encrypted passwords, see the IBM Netezza
System Administrator’s Guide.
Encrypt passwords
In the IBM Netezza system, passwords now can be encrypted for both the host and
the client by using the AES_256 algorithm (AES with a 256-bit key).
On the host side, passwords can be encrypted (and decrypted for verification
during authentication) by using a host key, a symmetric key stored on the host in
encrypted form. You can choose an encryption key in a keystore to be the host key.
On the client side, the nzpassword command is used to store the user passwords.
Individual clients have unique client keys to encrypt the user passwords. For more
information about nzpassword usage, see the IBM Netezza Database User’s Guide.
When nzpassword is used for the first time, it generates a native client key, which is
stored on the client machine and serves to encrypt the user passwords on the
client. The administrator does not choose this key, it is generated by the system.
Note: The keystore encryption process and utilities are not related to the IBM
Netezza SQL Extensions toolkit encryption functions.
Or you can set the default to NONE, which reencrypts the format on the host side,
as in the following example:
SET SYSTEM DEFAULT HOSTKEY TO NONE;
Since some users can have a mix of host and client versions, the .nzpassword file
on the client might need to be accessed by different clients, some that understand
the old Blowfish format, and some that understand both the Blowfish format and
the AES_256 format. In such cases, the .nzpassword file needs to be maintained in
the old format. If you are using the Blowfish format, you can continue to add
passwords in that format.
Digital signing
Digital signing of audit data is used to show attempts at log tampering and
provide for non-repudiation of the audit log.
Each file within each load gets a digital signature. The signature and the sequence
information are stored in the audit database.
To set the audit digital signature key, use the syntax as in the following example:
ALTER HISTORY CONFIG
KEY <keystore name>.<key name>;
Netezza uses an encryption key based on the keystore to encrypt and decrypt all
the keys in that keystore.
To import a key into a keystore, you use the CREATE CRYPTO KEY command
with two additional fields VALUE and PASSWORD, as in the following command:
CREATE CRYPTO KEY <keystore name>.<key name> TYPE <type> VALUE <value>
PASSWORD <password>
<keystore name>
Name of the keystore.
<key name>
Name of the key.
<type>
The encryption type. The supported types are asymmetric keys of type
DSA_KEYPAIR or DSA_KEYPAIR_2048, and symmetric keys of type
AES_256.
<value>
The key pair (encrypted form) that you want to import to the keystore. The
imported key has a required format that includes three parts separated by
the dollar sign ($) character:
v The first part of the key is the salt value used to create the key based on
the password. It is 16 bytes base64 encoded, resulting in a string of 23
padded bytes. Netezza uses PBKDF2-SHA256 to derive the
password-key from the password string and the salt.
v The second and third parts are the encrypted key (32 bytes) and
initialization vector (16 bytes), for a total of 48 bytes base64 encoded
resulting in a string of 64 bytes. The key is encrypted in CBC mode.
Netezza uses the Botan library for the base64 encoding and
encrypt/decrypt functions.
<password>
Used to decrypt the key <value> when you import a key.
SQL language extensions were added for the key and keystore operations, as
shown in the following table. You must have MANAGE SECURITY privileges to
use these commands.
Table 4-1. SQL language extensions
Command Meaning
CREATE keystore Creates a keystore
SHOW keystore Displays the keystore configuration in summary or detail
(VERBOSE) format
ALTER keystore Changes the keystore parameters
DROP keystore Deletes a keystore
CREATE CRYPTO Sets a key entry
KEY
SHOW CRYPTO KEY Displays key-entry details
DROP CRYPTO KEY Deletes a key entry
For more information about query history, see the IBM Netezza System
Administrator’s Guide.
Collect history
In some high-security environments, the activities of all users must be logged at all
times. In other environments, it is not necessary to capture all activity all of the
time. The COLLECT HISTORY command enables the security administrator to
control which users, groups, and databases are subject to having history collected.
The user session is the unit of history collection control. The setting is calculated
on session creation and is not altered after that time. The session user and the
connected database both must be set to collect history or no history is collected for
the session.
History in a session is collected if both the user setting and the database setting are
COLLECT HISTORY ON, which is the default. If the group specifications conflict,
history is collected. If the security administrator does not want to collect history,
the administrator can ALTER the database and set COLLECT HISTORY OFF.
With these rules, you can avoid collecting history on operations against a
development or test database, while allowing identified users (or users in an
identified group) to have their work audited.
Thus groups can be used as roles. For example, a GROUP might be granted update
access on a table and also be set to collect history. A different group might be
created for table readers that does not collect history.
To create the database and turn on the COLLECT HISTORY feature, use the
following syntax:
CREATE DATABASE database-name [create-db-clause]...
create-db-clause ::=
... existing clauses ...
| COLLECT HISTORY ON
For example, if the session setting is set to ON, history is collected, even if the
cross-database setting is OFF. If the session setting is OFF, history is not collected,
even if the cross-database settings are set to ON.
Audit database
The audit database is stored in tables that use row-level security. Each row is given
a label derived from combining the label of the user who is doing the action and
the audit categories associated with that user. The label of the user is used so that
someone who views the audit data is able to see the original data as well, since
what is captured for the operations might contain some of the original data.
Access to the data is restricted by adding in audit categories, which can prevent
the user that is doing the action from viewing the audit data. It also allows the
audit data to be partitioned among auditors.
There can be two IBM Netezza systems, the source system where the audit data is
captured, and the target system, where the audit data is stored. These systems can
be the same system.
To create the audit database, run the following command aimed at the target
system, configuring desired options. If an option is not specified, the associated
environment variable is used.
/nz/kit/bin/adm/nzhistcreatedb [options]
The version must match the version number specified for the active
history configuration; otherwise, the loader process will fail.
-h | --help Display the help text.
-u | --USER=[USER] The user name on the target system used to load audit data to the
database. The command configures privileges to allow the user to
write to the audit database, but not to read from it.
Related reference:
“The nzhistcleanupdb command” on page A-38
Since loading requires that the Netezza database to be online and available,
loading is separate from the capture function.
Audit configuration
You can configure a system for audit logging or query history, but not both. Audit
logging provides a superset of the information collected by query history.
After data is captured, it is signed, even if the data does not get loaded. Signing is
done with the history configuration that is current during the capture phase of the
operation, not the load phase. For more information, see the CREATE HISTORY
CONFIGURATION command in the IBM Netezza Database User’s Guide.
Service commands
A subset of the CLI can be audited by setting the SERVICE collect flag in the
History Configuration. The CLI commands in the following table are captured, and
the SERVICETYPE values are used in the history database.
All the commands in previous table are associated with the IBM Netezza “system
user” login and password. Audited data relates each command invocation to the
invoker session.
Even if a service command fails due to lack of privileges, it is still captured. The
data does not indicate whether the service finished successfully or not. Service
attempts that fail at login based on username/password are captured as failed
authentications.
The following list shows certain CLI commands that are not captured, because they
are already audited through SQL or they do not connect to the database.
v nzcontents
v nzconvert
v nzhostbackup
v nzhostrestore
v nzstart
v nzstop
v nzwebstart
v nzwebstop
v nzload
v nzpassword
v nzsession
v nzsql
v nztopology
v nzrev
v nzinventory
v nzevent (options other than dump)
The following table lists the state change events that are captured.
Table 5-3. State change events
Event CHANGETYPE
System changed to Online 1
System changed to a Paused state 2
System changed to an Offline state 3
System changed to a Stopped state 4
Related concepts:
Chapter 6, “Multi-Level Security and row-secure tables,” on page 6-1
Authentication events
The advanced security feature captures additional events related to failed
authentications. Failed authentication data is unrelated to any current sessions.
These events are captured in the $hist_failed_authentication table.
The user name captured might or might not be the name of a valid user. The data
captured is also security-sensitive, so the failed authentication data is always
captured with the OMNI:OMNI:OMNI security label, requiring the highest level of
access to view this data.
Related concepts:
Chapter 6, “Multi-Level Security and row-secure tables,” on page 6-1
The history database version specifies the kind of information that the history
database collects for the queries and sessions that occur on your system. Starting in
Release 4.6, the history database version was 1. In Release 7.0.3, the version of the
history database changed to 2 to collect information related to multiple schema
support and also captures history when users change to a new database or a new
schema in a session using the SET CATALOG and SET SCHEMA commands. In
When you upgrade to 7.1 or later, your existing version 1 and 2 history
configurations continue to work and collect data, but the information may not
accurately capture changes relating to the 7.1 features. As a best practice, you
should create a new version 3 history database and collect the latest information
going forward. The older history databases will become dormant (that is, no new
data will be loaded into them after you start using the version 3 database), but you
can still query against the older history database as needed.
The set of user access privileges is called a security profile. Every user (also called
a principal) created on the system gets at least the default security profile, at the
lowest possible level. When a user attempts to access a table row, the system
checks the user’s profile against the row security label; if the profile allows, the
user can access the row.
The following sections explain the components of the access rules and how they
interact with each other.
For more information about SQL, see the IBM Netezza Database User’s Guide.
Related concepts:
“System state changes” on page 5-5
“Authentication events” on page 5-6
Security labels
The security label has three dimensions: level, category, and cohort.
All table rows require a security label, and if not defined, the system applies a
default level of PUBLIC. The system provides the pre-defined values shown in the
following table.
For example, if the security label is defined with a level of Top Secret, a category
of Alpha, and a cohort of UK, it would look like the following example:
TOP_SECRET: Alpha: UK
Each component of the label is treated like a SQL identifier. Security labels are
handled as character strings, and in SQL must be presented as string literals. If you
have any character separation within the string, connect characters with
underscores or enclose the string in quotation marks.
"For Your Eyes Only" : AUDIT : Finance_Management, HR
Spaces before and after the colon are ignored by the system. The label example can
be described in any of the following ways:
TOP_SECRET: Alpha: UK
TOP_SECRET : Alpha : UK
TOP_SECRET:Alpha:UK
The NONE identifier can be used for category and cohort, and explicitly indicates
the empty set:
CONFIDENTIAL : Alpha, Beta, Gamma: NONE
The following label is assigned to the Admin user, with access to all rows.
OMNI:OMNI:OMNI
The following is the PUBLIC level, with missing categories and cohorts:
::
Strings are restricted to 7-bit ASCII characters, with a maximum length of 4000
characters. While any user can create a label, you must have Manage Security
privileges to define the parts.
Important: Never change the letter case of a database that contains row-secure
tables. Using nzconvertsyscase on row-secure tables can cause serious problems
and possible data loss.
NAME | LEVEL
----------+--------
PUBLIC | 0
CONF | 500
GREATER | 600
SECRET | 800
OMNI | 32767
(5 rows)
Restriction: You cannot change level values or drop any security levels, cohorts, or
categories if you have any row-secure tables defined in the system.
To alter a security level, you rename it and give it the new value, as in the
following example by using the name and value of CONF from the previous
example:
DEV.SCHEMA(ADMIN)=> ALTER SECURITY LEVEL conf RENAME TO TOP_SECRET VALUE
1000;
ALTER SECURITY LEVEL
So now a user with the altered TOP_SECRET level can access SECRET levels, but a
user with SECRET levels cannot access TOP_SECRET levels.
The following is an example of how to create and display categories. The system
automatically generates IDs.
DEV.SCHEMA(ADMIN)=> CREATE CATEGORY super;
CREATE CATEGORY
DEV.SCHEMA(ADMIN)=> CREATE CATEGORY insider;
CREATE CATEGORY
DEV.SCHEMA(ADMIN)=> CREATE CATEGORY audit;
CREATE CATEGORY
DEV.SCHEMA(ADMIN)=> SHOW CATEGORY ALL;
NAME | ID
----------+--------
AUDIT | 3
INSIDER | 2
SUPER | 1
OMNI | 0
(4 rows)
To alter a category, rename it and give it the new value, as in the following
example:
DEV.SCHEMA(ADMIN)=> ALTER CATEGORY SUPER RENAME TO TOP_SECRET;
ALTER CATEGORY
Cohorts are a strict set of hierarchies, and you can put cohorts into other cohorts
for a finer control of access, as in the following example:
DEV.SCHEMA(ADMIN)=> CREATE COHORT TOP;
CREATE COHORT
DEV.SCHEMA(ADMIN)=> CREATE COHORT SALES IN COHORT TOP;
CREATE COHORT
The following is an example of how to create and display different cohorts. The
system automatically generates the IDs:
DEV.SCHEMA(ADMIN)=> CREATE COHORT "NA" in COHORT sales;
CREATE COHORT
DEV.SCHEMA(ADMIN)=> CREATE COHORT "EUROPE" in COHORT sales;
CREATE COHORT
DEV.SCHEMA(ADMIN)=> CREATE COHORT "Asia" in COHORT sales;
CREATE COHORT
DEV.SCHEMA(ADMIN)=> CREATE COHORT DIST in COHORT top;
CREATE COHORT
DEV.SCHEMA(ADMIN)=> CREATE COHORT ENG in COHORT "Europe";
CREATE COHORT
DEV.SCHEMA(ADMIN)=> CREATE COHORT FRA in COHORT "Europe";
The hierarchy shows that the cohort at the top can access all the cohorts beneath it.
DIST cannot access SALES cohorts (both are “siblings” of TOP), and vice versa.
NA, EUROPE, and ASIA cannot access NE and vice versa.
When a user accesses a table row, the security profile of the user is compared to
the security label on the object to determine whether to allow access. The access
check is as follows:
v The label level must be less than or equal to the profile level.
v All members of the label category must be members of the profile. The user
must have all data categories.
v At least one member of the table row cohort must also be a member of the
profile.
You do not have to use all three dimensions (level, category, cohort) of the security
label. For example, if you wanted to use security level and category, but not
cohorts, you can specify as in the following:
DEV.SCHEMA(ADMIN)=> CREATE USER MARY PASSWORD ’abcd’ SECURITY LABEL ’secret:
blue’;
CREATE USER
The absence of a specified dimension does not have an identifier, and is treated as
missing. The missing state is used to decide whether to evaluate the access check.
If the label on a row is missing, the system ignores the user state and allows
access. If the user label is missing, it is treated as NONE.
The following table shows the all-of comparison used for comparing categories.
Table 6-2. All-of comparison (categories)
User Security
profile label Result
Missing Missing Allow access
Missing Specified Access not allowed
Specified Missing Allow access
Specified Specified The user must have all categories that the table row has. The user
can have more categories.
From the examples given, the following table shows how a match against the
created user GRETA determines which access is allowed.
Table 6-4. Labels and access
Category Cohort
Level (all-of) (any-of) Can access
CONF INSIDER Asia Yes.
CONF INSIDER SALES No. User is restricted because none of the cohorts of
user is SALES.
AUDIT OMNI Asia No. User is restricted because OMNI equals all
categories, and INSIDER and AUDIT are a subset of
the all-of categories.
GREATER AUDIT FRA Yes. FRA belongs to cohort Europe.
TOP_SECRET SUPER GER No. Level is too low and user ID does not have
SUPER as a category.
When security labels are combined, the rules of Multi-Level Security determine
that the result is the most restrictive combination, defined as the following:
v The maximum of the levels.
v The union of the all-of tag sets (categories).
v The intersection of the any-of tag sets (cohorts).
The IBM Netezza system does not automatically calculate combinations of labels.
You can define functions and aggregates to enforce rules.
The following built-in functions can be used to calculate the combination of two or
more security labels:
v combine_label(label1, label2)
This is a scalar function that combines two or more labels and returns the most
restrictive combination.
v max_label(label)
This is an aggregate function that combines a set of labels and returns a single,
most restrictive label.
To label query results or use for CTAS, you may combine labels with max_label
and combine_label, which calculates the most restrictive label. Joins have no label,
just the result.
Row-secure tables
A row-secure table (RST) looks like a normal database table, but returns different
answers to queries, based upon the security label of the user. Only user tables can
have row security, which can be specified when a table is created.
To create a row-secure table, you must have Create Table privilege. Even a table
owner might not have the rights to see all the table rows. To create a row-secure
table, use the following syntax:
create table rst ... row security;
The resulting created table has an extra column named “_sec_label” of type
varchar, with a 4000 character limit and Latin9 support. To access the _sec_label
column you must have LABEL ACCESS permission.
Important: If there are RSTs in the system, you can rename objects and create
new levels, categories, and cohorts, but you cannot drop levels, categories, or
cohorts, and you cannot alter any level value.
RST caveats
When using the advanced security features, note the following operational
considerations:
The nzrestore command checks for compatibility before beginning to insert data.
The comparison shows any security discrepancies early in the restore operation,
rather than during the data load phase. The compatibility check can be disabled if
you want.
To avoid the load error, create a test table in the same database that contains the
target table for the concurrent loads that failed. Insert a sample row into the test
table for each security mask that is used in the failed load commands. This defines
each security mask in the database, and you can reissue the load commands to
load the data into the target RST.
To capture the label with a SELECT statement, you must be explicit, as in the
following example:
DEV(ADMIN)=> CREATE TABLE rst (id int, name varchar(80), metric int)
ROW SECURITY;
CREATE TABLE
DEV(ADMIN)=> CREATE EXTERNAL TABLE ’TMP/XT' AS SELECT *, _SEC_LABEL
FROM rst;
INSERT 0 0
ALTER CATEGORY
Use the ALTER CATEGORY command to change the name of the category.
Synopsis
Inputs
Outputs
Usage
ALTER COHORT
Use the ALTER COHORT command to change the name or the hierarchy position
of the cohort.
Synopsis
Inputs
Description
Usage
ALTER DATABASE
Use the ALTER DATABASE command with the added COLLECT HISTORY clause
to specify history collection for the databases and the users who are connected to
it.
Synopsis
Outputs
Description
For details about all the options of the ALTER DATABASE command, see theIBM
Netezza Database User’s Guide. The ALTER DATABASE command has the following
characteristics:
Privileges required
You must be the admin user, the database owner, or your account must
have the Alter privilege for the database or for the Database object class.
You must have Manage Security privilege to alter the history collection
attribute of a database.
Common tasks
In addition to its previous functions, the command assigns the collect
history to the database object.
Usage
Synopsis
Inputs
Outputs
Description
For details about all the options of the ALTER GROUP command, see theIBM
Netezza Database User’s Guide. The ALTER GROUP command has the following
characteristics:
Privileges required
You must have Manage Security privilege to alter a group.
Common tasks
Use the ALTER GROUP command to alter a group with additional clauses.
Synopsis
Inputs
Outputs
For details about all the options of the ALTER HISTORY CONFIGURATION
command, see theIBM Netezza Database User’s Guide. Current query or audit is not
interrupted by ALTER as this action can be done only on a configuration that is
not current. The ALTER is logged to the current query or audit history log.
If you frequently change configurations, it is possible to have some staged data not
loaded yet. If the configuration corresponding to part of the staged data is
changed, it is possible the loader can error out and the files moved to the error
directory.
Privileges required
You must have Manage Security privilege to alter query or audit logging.
Common tasks
The ALTER HISTORY CONFIGURATION command updates the query or
audit history configuration in the catalog, and can be done only on a
configuration that is not current.
Usage
Synopsis
Inputs
Description
Develop and review your label security configuration before you create any ROW
SECURITY tables. After tables are defined, you can add levels to the system or
rename levels, but you cannot change the value of or remove levels.
Privileges required
You must have Manage Security privilege to alter security levels.
Common tasks
Use the ALTER SECURITY LEVEL command to update the system catalog
to add the new object, and update the security level name to value
mapping.
Usage
ALTER USER
Use the ALTER USER command to change user settings.
Inputs
Outputs
Usage
CREATE CATEGORY
Use the CREATE CATEGORY command to create a security category.
Synopsis
Inputs
Outputs
Description
Privileges required
You must have Manage Security privilege to create security categories.
Usage
CREATE COHORT
Use the CREATE COHORT command to create a security cohort.
Synopsis
Inputs
Outputs
Description
Privileges required
You must have Manage Security privilege to create security cohorts.
Common tasks
Use CREATE COHORT to create a security cohort.
Usage
CREATE DATABASE
Use the CREATE DATABASE command with the added COLLECT HISTORY
clause.
Synopsis
Outputs
Description
For details about all the options of the CREATE DATABASE command, see theIBM
Netezza Database User’s Guide. The CREATE DATABASE command has the
following characteristics:
Privileges required
None.
Common tasks
In addition to its previous functions, the command assigns the collect
history to the database object.
Usage
Synopsis
Inputs
Outputs
Description
For details about all the options of the CREATE GROUP command, see theIBM
Netezza Database User’s Guide. The CREATE GROUP command has the following
characteristics:
Privileges required
You must have Manage Security privilege to create a group with additional
clauses.
Common tasks
Use the CREATE GROUP command to create a group with additional
clauses.
Usage
Inputs
Outputs
Description
This command creates a security level of the given name. The security manager
must carefully allocate level numbers. IBM Netezza suggests leaving gaps between
levels so that a level can be added if needed later.
Privileges required
You must have Manage Security privilege to create security levels.
Common tasks
Use the CREATE SECURITY LEVEL command to update the system
catalog to add the new object, and update the security level name to value
mapping.
CREATE TABLE
Use the CREATE TABLE command to create a table with the option of row
security support.
Synopsis
Inputs
Outputs
Description
For details about all the options of the CREATE TABLE command, see theIBM
Netezza Database User’s Guide. The CREATE TABLE command has the following
characteristics:
Privileges required
You must have CREATE TABLE privilege to create a table. No additional
privilege is required to create a table with row-level security.
Common tasks
Use the CREATE TABLE command to create a table with the option of row
security support.
Usage
CREATE USER
Use the CREATE USER command to create a user with additional clauses.
Inputs
Outputs
Description
Usage
DROP CATEGORY
Use the DROP CATEGORY command to remove the category from the label
security configuration.
Synopsis
Inputs
Outputs
Description
Privileges required
You must have Manage Security privilege to drop security categories.
Common tasks
Use the DROP CATEGORY command to remove the category from the
label security configuration.
DROP COHORT
Use the DROP COHORT command to remove a cohort.
Synopsis
Inputs
Outputs
Description
The DROP COHORT command removes the cohort from the label security
configuration. Any children of this cohort are modified so they have no parent
cohort.
Privileges required
You must have Manage Security privilege to create security levels.
Common tasks
Use the DROP COHORT command to remove a cohort.
Synopsis
Inputs
Outputs
Description
For details about all the options of the DROP HISTORY CONFIGURATION
command, see theIBM Netezza Database User’s Guide. This command does not allow
the current query or audit history configuration to be dropped. If you want to
drop the current configuration you have from SET HISTORY CONFIGURATION to
another configuration, restart the IBM Netezza system and then DROP HISTORY
CONFIGURATION.
Usage
Synopsis
Inputs
Outputs
The DROP SECURITY LEVEL command removes a security level if there are no
ROW SECURITY tables defined in any database in the system.
Privileges required
You must have Manage Security privilege to drop security levels.
Common tasks
Use the DROP SECURITY LEVEL command to remove a security level.
Usage
EXECUTE AS
Use the EXECUTE AS command to set the CURRENT USER of the session.
Synopsis
Inputs
Outputs
Description
This statement allows a suitably privileged user to set the CURRENT USER of
their session to a different user. On successful completion of this statement, the
CURRENT USER is the target user specified in the syntax. Security checks are
based on the security profile the CURRENT USER.
EXECUTE AS operates outside of the transaction scope, just like SET statements.
Running EXECUTE AS while in an explicit transaction is allowed. Rolling back the
transaction does not affect the EXECUTE AS setting. For example, suppose that
you are running as jdoe and running the following:
BEGIN;
EXECUTE AS dd;
ROLLBACK;
SELECT current_user;
CURRENT_USER
--------------
DD
(1 row)
Privileges required
You must have EXECUTE AS privilege on the target user.
Common tasks
Use the EXECUTE AS command to set the CURRENT USER of the session.
Usage
REVERT
Use the REVERT command to reset the CURRENT USER of the session back to the
previous EXECUTE AS user; if none, then revert to the SESSION USER.
Synopsis
Inputs
None.
Outputs
Usage
The following provides sample usage:
REVERT;
Related reference:
“EXECUTE AS” on page A-30
Syntax
Inputs
Outputs
Description
Until the next Netezza software restart, the current configuration and settings
remain in effect. After the restart, the history loader process attempts to load any
existing history data in the staging or loading area for the previous configuration.
Privileges required
You must be the admin user, or your account must have Manage Security
permissions to set a history configuration.
Usage
The following provides sample usage:
SET HISTORY CONFIGURATION all_hist;
SHOW CATEGORY
Use the SHOW CATEGORY command to display one or more categories.
Synopsis
Inputs
Outputs
Description
Privileges required
You must have Manage Security privilege to show security categories.
Common tasks
Use the SHOW CATEGORY command to display one or more categories.
Usage
SHOW COHORT
Use the SHOW COHORT command to display one or more cohorts or to display
the cohort hierarchy.
Synopsis
Inputs
Outputs
Description
Usage
Syntax
Inputs
Outputs
Description
For details about all the options of the SHOW HISTORY CONFIGURATION
command, see theIBM Netezza Database User’s Guide. This command displays the
current or ALL or a specific query or audit configuration settings.
Privileges required
You must be an administrator or must have the Manage Security
permission
Common tasks
Use the SHOW HISTORY CONFIGURATION command to display the
query or audit history configuration settings.
Usage
Synopsis
Inputs
Outputs
Description
Usage
CLI commands
This section describes the CLI commands for the security feature.
Synopsis
Inputs
The nzhistcleanupdb command takes the following input options. The input
options have two forms for the option names.
Table A-47. The nzhistcleanupdb inputs
Input Description
-d | --db Specifies the name of the history database from which you want to remove
<dbname> old data. The name must be a valid, unquoted, identifier.
-n | --host Specifies the host name of the IBM Netezza system where the database is.
<hostname> The default and only value for this option is NZ_HOST.
Outputs
None.
Description
After running the command, you can run nzreclaim to completely remove the
deleted rows in the table. However, use caution when planning the time to reclaim.
Reclaims lock the tables that they process, which can cause the loader to error
when attempting to load new history data.
Privileges required
You must be the nz user to run this command.
Usage
The following deletes history data which is older than January 1, 2009,10:45 p.m.,
from the histdb history database:
nzhistcleanupdb -d histdb -u myuser -p password -t "1/1/2009,22:45"
Related concepts:
“Audit database” on page 5-2
Synopsis
Inputs
Outputs
Description
Usage
The DBA is not able to see any data above 'PUBLIC::' even in tables that they
create.
The next example explicitly enters a label, which is allowed because the engmgr
has Label Expand permission, which allows insertion of a label less restrictive than
their own
MLSSAMPLE.SCH(ENGMGR)=> INSERT INTO projstatus(id,name,metric,_SEC_LABEL)
VALUES (2, ’Project Red’, 113) ’confidential:red:eng’);
INSERT 0 1
The next example explicitly enters a label that sw1 can see.
MLSSAMPLE.SCH(ENGMGR)=> INSERT INTO projstatus(id,name,metric,_SEC_LABEL)
VALUES (3, ’Project Green’, 113) ’confidential:green:eng’);
INSERT 0 1
The next example fails because sw is a subset of eng, making it a more restrictive
label. This would be allowed if engmgr had Label Restrict permission.
MLSSAMPLE.SCH(ENGMGR)=> INSERT INTO projstatus(id,name,metric,_SEC_LABEL)
VALUES (4, ’Manhattan’, 102) ’secret:red:sw’);
ERROR: Security Label : Permission denied.
The next example fails because the category name does not exist.
MLSSAMPLE.SCH(ENGMGR)=> INSERT INTO projstatus(id,name,metric,_SEC_LABEL)
VALUES (4, ’General’, 164) ’confidential:eng’);
ERROR: Security Label : Category name does not exist.
The user has Label Access permission, and can see the label. In the following
example, the user does not have Label Expand permission to change from
confidential to public.
MLSSAMPLE.SCH(SW2)=> UPDATE projstatus SET _SEC_LABEL = ’public:red:sw’
WHERE NAME = ’SW2 Red’;
ERROR: Security Label : Permission denied.
Now change to engmgr to try the example again. With Label Expand permission, it
now works. The rule to expand is relative to the existing row label, not the security
label of the user, and is independent of the ability to create the label.
MLSSAMPLE.SCH(SW2)=> \c mlssample engmgr emem
You are now connected to database mlssample as user engmgr.
MLSSAMPLE.SCH(ENGMGR)=> UPDATE projstatus SET _SEC_LABEL = ’public:red:sw’
WHERE NAME = ’SW2 Red’;
Update 1
The following example fails because the user does not have Label Access.
MLSSAMPLE.SCH(SW1)=> SELECT *, _SEC_LABEL FROM projstatus;
ERROR: query: permission denied.
MLSSAMPLE.SCH(SW1)=> SELECT * FROM projstatus;
ID | NAME | METRIC
----+-------------+--------
1 | SW1 Project | 143
(1 row)
In the following example, the project cannot be deleted, because it cannot be seen
with the available permissions.
MLSSAMPLE.SCH(SW1)=> DELETE projstatus WHERE NAME = ’Project Red’;
DELETE 0
The advanced security features are disabled by default on Netezza systems. If you
run a command that is described in this document and the command fails with the
message ERROR: <command> is not currently supported, you must enable the
features.
To enable or disable the features, you must log in to the IBM Netezza system host,
set the history configuration to QUERY or NONE and edit the postgresql.conf
file. After you specify the configuration setting, save the file and restart the system
(nzstop and nzstart) for the settings to take effect.
When the flag is false, the system returns an error if you use EXECUTE AS and
REVERT.
When the flag is false, the system no longer enforces those settings. For example, a
user with CONCURRENT SESSIONS set to 1 before the setting changed to false
can have any number of concurrent sessions.
Suppose that you created a history configuration with some users and some
databases to have COLLECT HISTORY OFF.
v When the setting is true, the collect history setting is enforced and history is not
collected for those users and databases.
v When the setting is false, the system no longer enforces those settings, so history
is collected for all users on all databases.
IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may
be used instead. However, it is the user's responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not grant you
any license to these patents. You can send license inquiries, in writing, to: This
information was developed for products and services offered in the U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply
to you.
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it
believes appropriate without incurring any obligation to you.
IBM Corporation
Software Interoperability Coordinator, Department 49XA
3605 Highway 52 N
Rochester, MN 55901
U.S.A.
The licensed program described in this document and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement or any equivalent agreement
between us.
All statements regarding IBM's future direction or intent are subject to change or
withdrawal without notice, and represent goals and objectives only.
All IBM prices shown are IBM's suggested retail prices, are current and are subject
to change without notice. Dealer prices may vary.
This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
© your company name) (year). Portions of this code are derived from IBM Corp.
Sample Programs.
If you are viewing this information softcopy, the photographs and color
illustrations may not appear.
Trademarks
IBM, the IBM logo, ibm.com® and Netezza are trademarks or registered trademarks
of International Business Machines Corporation in the United States, other
countries, or both. If these and other IBM trademarked terms are marked on their
first occurrence in this information with a trademark symbol (® or ™), these
symbols indicate U.S. registered or common law trademarks owned by IBM at the
time this information was published. Such trademarks may also be registered or
common law trademarks in other countries. A current list of IBM trademarks is
available on the web at "Copyright and trademark information" at
http://www.ibm.com/legal/copytrade.shtml.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other
names may be trademarks of their respective owners.
Red Hat is a trademark or registered trademark of Red Hat, Inc. in the United
States and/or other countries.
D-CC, D-C++, Diab+, FastJ, pSOS+, SingleStep, Tornado, VxWorks, Wind River,
and the Wind River logo are trademarks, registered trademarks, or service marks
of Wind River Systems, Inc. Tornado patent pending.
APC and the APC logo are trademarks or registered trademarks of American
Power Conversion Corporation.
Notices D-3
D-4 IBM Netezza Advanced Security Administrator's Guide
Index
A crypto key
create 4-2
L
access control, time 2-2 drop 4-2 label
access time control 2-2 show 4-2 access 6-7
advanced query history 5-1 expand 6-7
advanced security 1-1 restrict 6-7
AES_256 algorithm 4-1 level 6-1
ALTER D login control, user 2-1
CATEGORY A-3 data capture, audit 5-4
COHORT A-4 data flow, audit 5-3
DATABASE A-5
GROUP A-7
DATABASE
ALTER A-5
M
CREATE A-18 masquerading 3-1
HISTORY CONFIGURATION A-9
Digital signing 4-2 multi-level security 6-1
SECURITY LEVEL A-12
USER A-14 DROP
audit CATEGORY A-26
configuration 5-4 COHORT A-27 N
data capture 5-4 HISTORY CONFIGURATION A-28 nesting 3-2
data flow 5-3 SECURITY LEVEL A-29 NONE 6-1
database 5-2 DSA_KEYPAIR 4-2 nzhistcreatedb 5-2
authentication events 5-6 nzpassword 4-1
E
B enabling security features C-1 P
basic security model 1-1 events, authentication 5-6 password
Blowfish format 4-1 EXECUTE AS 3-1 authentication 2-2
external tables 6-8 encrypting 4-1
expiration 2-2
C G
restrictions 2-2
string restrictions 2-2
category 6-1
GROUP public 1-1
CATEGORY
ALTER A-7 PUBLIC 6-1
ALTER A-3
CREATE A-16 CREATE A-20
DROP A-26
SHOW A-33 Q
changing keys 4-1 H query history 5-1
cohort 6-1 history 5-1
COHORT collect 5-1
ALTER A-4
CREATE A-17
HISTORY CONFIGURATION R
ALTER A-9 resetkey 4-1
DROP A-27 CREATE 5-4 REVERT 3-1, A-31
SHOW A-34 DROP A-28 row-secure tables 6-1
collect history 5-1 SET A-32 RST, See row-secure tables 6-7
commands, service 5-4 SHOW A-36
concurrent loads
RSTs 6-8
concurrent sessions 2-1
K S
context, session 2-1 security
control keys advanced 1-1
access time 2-2 changing 4-1 basic model 1-1
user login 2-1 creating 4-2 model 1-1
CREATE managing 4-1, 4-2 multi-level 6-1
CATEGORY A-16 keystore system 1-2
COHORT A-17 alter 4-2 security label syntax 6-2
DATABASE A-18 create 4-2 security labels 6-1
GROUP A-20 drop 4-2 SECURITY LEVEL
SECURITY LEVEL A-22 show 4-2 ALTER A-12
USER A-24 CREATE A-22
CREATE HISTORY DROP A-29
CONFIGURATION 5-4 SHOW A-37
CREATE TABLE A-23 SERVICE collect flag 5-4
T
tables
external 6-8
row secure 6-1
U
upgrade best practices 5-6
USER
ALTER A-14
CREATE A-24
user login control 2-1
Printed in USA