Remote JDBC, ODBC, SQLJ, and REST traffic enters DB2 for z/OS through the Distributed Data Facility. Security has three layers that shops mix up: who you are (authentication), what you may do (authorization), and whether the wire is readable (TLS / AT-TLS). Distributed updates add a fourth concern: two-phase commit so two databases do not disagree after a crash.
Db2 supports SSL/TLS for DDF by using z/OS Communications Server Application Transparent Transport Layer Security (AT-TLS). The TCP/IP stack calls System SSL. Db2 still writes clear text to its socket; the stack encrypts on the wire. That is why DIST traces do not show TLS records, and why network administrators own PAGENT policy, not a Db2 ZPARM named “SSL=YES.”
Typical build-out (IBM Redpaper REDP-4799):
Server authentication and client authentication often use two SECPORT values (two AT-TLS rules), because each rule has one HandshakeRole. JDBC clients set sslConnection=true and connect to the secure port, with sslTrustStoreLocation / sslCertLocation on the client and optionally securityMechanism=18 (TLS client certificate) plus a Java keystore.
| Port | Use |
|---|---|
| PORT / TCPPORT | Unencrypted DRDA (SQL, REST if not on a separate listener) |
| SECPORT | TLS DRDA; AT-TLS HandshakeRole Server or ServerWithClientAuth |
| RESPORT | Two-phase commit resynchronization; unique per data-sharing member |
DISPLAY DDF shows TCPPORT, SECPORT, and RESPORT. SECPORT=0 means no secure port is configured. Auditors often want TCPPORT disabled or equal to SECPORT so only TLS clients get in. Changing BSDS ports with DSNJU003 needs a DDF stop/start. Profile tables can reject non-secure authentication as a softer control.
After the TCP session exists, Db2 still has to know which RACF user owns the DBAT. The TCPALVER (TCP/IP already verified) subsystem parameter on installation panel DSNTIP5 decides how much proof is required.
| Value | Meaning |
|---|---|
| NO / SERVER | User ID and password required (historic default NO is not the security target) |
| YES / CLIENT | User ID only; Db2 trusts that the client already verified the user — avoid |
| SERVER_ENCRYPT | Protected credentials: encrypted password, TLS session, or PassTicket |
IBM’s current security practice is SERVER_ENCRYPT. Installation CLIST APAR PH54096 warns when the value is not SERVER_ENCRYPT, because the old default NO allows passwords on a clear port. SERVER_ENCRYPT plus AT-TLS on SECPORT is the usual pair: the password never travels in the clear, and neither does the SQL.
Authorization after connect is ordinary Db2 privilege: the primary ID, secondary IDs, CURRENT SQLID, and roles. A common pattern is: grant table privileges to a role, not to the application user ID; create a trusted context that allows that role only when the connection uses a specific ID, encryption, and IP address or SERVAUTH zone. Then a stolen password from a laptop does not inherit the role.
Audit class 7 / IFCID 319 records how the client authenticated (password, PassTicket, certificate, clear text). Use it before you flip TCPALVER to SERVER_ENCRYPT so you can find clients that would break.
A remote unit of work updates one server per COMMIT. A distributed unit of work can update more than one server in one COMMIT. When two resource managers must both commit or both roll back, Db2 uses two-phase commit:
Two common coordinators:
On z/OS, RRSAF uses Resource Recovery Services for local two-phase commit with CICS, IMS, or other RRS participants. That is not DDF, but the idea is the same: one coordinator, many resource managers, indoubt recovery.
After a network or member failure, the requester must find the same member that owns the log for that unit of work. For TCP/IP, that is RESPORT — unique per data-sharing member in the sysplex. Register member domain names in DNS so the client can reconnect if the member restarts on another LPAR. SNA/VTAM keeps an LU affinity in the coupling facility for protected conversations until RESET GENERICLU.
Operators resolve leftover indoubt DBATs with -RECOVER INDOUBT when the coordinator will never return. XA indoubt XIDs also occupy SCA space in data sharing; resolve them rather than letting the list grow.
12-DISPLAY THREAD(*) LOCATION(*) TYPE(INDOUBT) -RECOVER INDOUBT ACTION(COMMIT) ID(luwid)
12345678* DISPLAY DDF — look for SECPORT not 0, unique RESPORT -DISPLAY DDF * JDBC client to the secure port jdbc:db2://db2a.example.com:448/DB2A:sslConnection=true; * ZPARM target TCPALVER=SERVER_ENCRYPT
Combine AT-TLS on SECPORT, TCPALVER(SERVER_ENCRYPT), least-privilege owners, trusted contexts for application IDs, and a tested RECOVER INDOUBT procedure. Encryption without authentication still lets anyone who has an ID in. Authentication without TLS still leaves SQL on the wire.
DDF is the front door of the Db2 house. TLS is putting a locked, tinted tunnel in front of the door so neighbours cannot read the mail. AT-TLS is the building’s security guard (TCP/IP), not the Db2 butler, wrapping every letter. TCPALVER is whether the butler asks for a password, a special one-time ticket, or just believes the name on the hat. Two-phase commit is two kids promising to swap toys: first both say “I still have mine” (prepare), then both swap (commit). If the phone dies in between, they are indoubt and have to call back the same kid (RESPORT) to finish.
1. How does Db2 for z/OS encrypt DDF traffic?
2. What is SECPORT used for?
3. Which TCPALVER value is the security best practice?
4. What is RESPORT for?
5. Who is the coordinator in a Java XA transaction to Db2?