Discovering and controlling secure TCP/IP connectivity with profile tables
You can discover applications that are using TCP/IP connections without compliant authentication methods or encrypted connections to take corrective action or enforce compliance.
Before you begin
If the Db2 profile tables and related objects does not exist on the Db2 subsystem, you must create them. For a list of the objects and how to create them, see Profile tables.
The distributed data facility (DDF) must be loaded, with the DDF subsystem parameter set to AUTO or COMMAND. See DDF STARTUP OPTION field (DDF subsystem parameter).
If you plan to use TCP/IP domain names for profile filtering, you must enable the database services address space (ssnmDBM1) to access TCP/IP services. See Enabling Db2 to access TCP/IP services in z/OS UNIX System Services.
This task describes one of several uses for profile tables. For an overview of how to use profile tables and a summary of the different uses, see Monitoring and controlling Db2 by using profile tables.
When multiple matching security profiles are defined, the most specific profile filter applicable for the connection’s product type is used.
About this task
This type of profile monitors connections for a specified product type for use of desired authentication and encryption methods.
Profiles of this type apply to all connections regardless of whether a connection can be matched to a more specific profile. This differs from the precedence rules for applying profiles that are described in How Db2 applies multiple matching profiles for threads and connections.
Procedure
To discover and control secure connectivity to Db2 by using profile tables, complete the following steps:
Examples
- Example 1
-
Assume that you want to enforce that connections from native REST requesters use basic authentication or client certificates, and you want to discover any JDBC connections that do not use basic authentication with a defined AT-TLS policy.
In this case, you might complete the following steps:
- Insert the following DSN_PROFILE_TABLE rows.
PROFILEID LOCATION ROLE AUTHID PRDID COLLID PKGNAME 1 ::0 null null null null null - Insert the following DSN_PROFILE_ATTRIBUTES rows.
PROFILEID KEYWORDS ATTRIBUTE1 ATTRIBUTE2 ATTRIBUTE3 1 MONITOR REST CONNECTIONS FOR SECURITY EXCEPTION_DIAGLEVEL3 5 null 1 MONITOR JDBC CONNECTIONS FOR SECURITY WARNING 1 1 - Issue a -START PROFILE command.
Creating this example profile has the following results:
- Native REST applications that connect to Db2 by using client certificates with an AT-TLS policy defined are allowed. REST connections using user ID and password are also allowed regardless of AT-TLS policy. Other forms of authentication are rejected with a DSNT776I exception message.
- JDBC applications connecting to Db2 by using basic user ID and password with an AT-TLS policy defined are allowed. Other forms of authentication are also allowed with a DSNT771I warning message.
- Connections from product types other than REST or JDBC use the TCPALVER subsystem parameter to determine what form of security is required.
- Insert the following DSN_PROFILE_TABLE rows.
- Example 2
- This example demonstrates the precedence rules when multiple security and thread monitoring profiles are defined. Consider the following profile definitions:
- Insert the following DSN_PROFILE_TABLE rows.
PROFILEID LOCATION ROLE AUTHID PRDID COLLID PKGNAME 1 ::0 null null null null null 2 9.61.0.0/16 null null null null null 3 9.61.15.0/24 null null null null null - Insert the following DSN_PROFILE_ATTRIBUTES rows.
PROFILEID KEYWORDS ATTRIBUTE1 ATTRIBUTE2 ATTRIBUTE3 1 MONITOR * CONNECTIONS FOR SECURITY WARNING 5 1 1 MONITOR JDBC CONNECTIONS FOR SECURITY EXCEPTION_DIAGLEVEL3 5 null 1 MONITOR THREADS EXCEPTION 10 null 2 MONITOR * CONNECTIONS FOR SECURITY EXCEPTION 1 1 2 MONITOR DSN CONNECTIONS FOR SECURITY EXCEPTION 2 null 2 MONITOR THREADS EXCEPTION 15 0 3 MONITOR REST CONNECTIONS FOR SECURITY EXCEPTION 4 null - Issue a START PROFILE command.
Creating this example profile has the following results:- From IP address 9.7.49.252, a Db2 for z/OSapplication establishes a non-secure connection to the Db2 server with a user ID and password.
- Profile ID 1 is the only security profile match for the IP address and product type.
- The connection is allowed based on profile ID 1 MONITOR * CONNECTIONS FOR SECURITY rule.
- Because the rule specifies TLS (ATTRIBUTE3=1) and a warning action, the DSNT771I console warning message is issued for the non-secure connection.
- For monitoring threads, profile ID 1 is also the only match and the threshold of 10 threads is enforced.
- From IP address 9.61.15.1 a REST client establishes a secure connection using a client certificate to the Db2 server.
- Profile ID 3 is the most specific security profile match for the IP address and product type.
- The connection is allowed based on profile ID 3 MONITOR REST CONNECTIONS FOR SECURITY rule.
- For monitoring threads, profile ID 2 is the best match and the threshold of 15 threads is enforced.
- This example demonstrates how two different profiles are applied because security profiles and thread monitoring profiles do not interact with one another.
- From IP address 9.61.15.6 a CLI application establishes a secure connection to the Db2 server with a user ID and password.
- Profile ID 3 is the most specific security profile match for IP address.
- However, there is no security profile rule which governs the CLI application’s product type.
- Profile ID 2 is evaluated because its subnet filter is the next best match for the IP address. The MONITOR * CONNECTIONS FOR SECURITY rule governs the CLI application’s product type and the connection is allowed.
- For monitoring threads, profile ID 2 is the best match and the threshold of 15 threads is enforced.
- This example demonstrates how multiple profiles, ID=3 and subsequently ID=2, in the same LOCATION filtering category are evaluated for security profiles, and how both the location filter and product type are used to determine which profile is applied.
- Insert the following DSN_PROFILE_TABLE rows.