When you use z/OS DFSMS data set encryption to
encrypt Db2 data, Integrated Cryptographic
Service Facility (ICSF) and Resource Access Control Facility (RACF®) or an equivalent security product must be configured to set up the encryption key and
the key label.
Procedure
The following sample procedure shows you how to set up ICSF and RACF for encryption using z/OS DFSMS data set encryption:
-
Use ICSF to define the encryption key.
The secure AES key can be defined in the ICSF Cryptographic Key Data set (CKDS) or Public Key
Data Set (PKDS).
-
Define the required authorities on RACF or an equivalent security product. RACF is used in this
example.
To allow the system to create encrypted data sets when the key label is specified by Db2, the Db2 address space ID or the utility user must have
at least READ authority to the following resource in the FACILITY class:
STGADMIN.SMS.ALLOW.DATASET.ENCRYPT
The system checks the RACF for authority to this resource
when the data set is first allocated and only when it is defined as extended format.
Exception: When the key label is specified in the DFP segment in the RACF data set profile. The system does not require the user to
have authority to this resource.
If an encryption key label is specified for a data set that is not extended format, the key label
is ignored and the data set is successfully created as a non-encrypted non-extended format data set,
when UACC(NONE) is specified for the following resource in the FACILITY class:
STGADMIN.SMS.FAIL.INVALID.DSNTYPE.ENC. For the system to fail the allocation, you must have at least
READ authority to STGADMIN.SMS.FAIL.INVALID.DSNTYPE.ENC as shown in the following sample:
SETR CLASSACT(FACILITY)
SETR RACLIST(FACILITY)
RDEF FACILITY STGADMIN.SMS.ALLOW.DATASET.ENCRYPT UACC(READ)
RDEF FACILITY STGADMIN.SMS.FAIL.INVALID.DSNTYPE.ENC UACC(NONE)
SETR RACLIST(FACILITY) REFRESH
Allow the DB2SYS.KEY02 and STG01KLABEL key labels to used by the SYSDSP DB2 address space ID when
the key labels are accessed by any application. Allow the DB2USR.KEY01 key label to be used by the
UTILUSR Db2 utility user only when the key
label is accessed by z/OS
DFSMS. The following
example shows how to define these permissions:
PERMIT DB2SYS.KEY02 CLASS(CSFKEYS) ID(SYSDSP) ACCESS(READ)
PERMIT STG01KLABEL CLASS(CSFKEYS) ID(SYSDSP) ACCESS(READ)
PERMIT DB2USR.KEY01 CLASS(CSFKEYS) ID(UTILUSR) ACCESS(READ)
WHEN(CRITERIA(SMS(DSENCRYPTION)))
SETR RACLIST(CSFKEYS CSFSERV CRYPTOZ) REFRESH
For details, see Setting up profiles in the CSFKEYS general resource class . In addition, for protected keys, see
Enabling use of encrypted keys in Symmetric Key Encipher and Symmetric Key Decipher
callable services
-
Encrypt the data sets by using JCL.
The following example shows the JCL you might use to encrypt data sets that are used by the REORG
utility:
SYSUT1 DD DSN=DB2SMS.N035UN02.REORGW.SYSUT1,
DATACLAS=DB2SMS10,DSKEYLBL=DB2SG.KEY01,
DISP=(MOD,DELETE,CATLG),UNIT=SYSDA,
SPACE=(8000,(200,20),,,ROUND)