Zos Encryption
Zos Encryption
Version 7
Redbooks
IBM Redbooks
December 2021
SG24-8410-01
Note: Before using this information and the product it supports, read the information in “Notices” on
page xi.
This edition applies to the required and optional hardware and software components needed for z/OS data set
encryption.
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .x
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Now you can become a published author, too! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Stay connected to IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Contents vii
5.5 Encrypting a data set with a secure key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
5.6 Verifying that the data set is encrypted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.7 Granting access to encrypted data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.8 Accessing encrypted data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
5.9 Viewing the encrypted text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Chapter 10. IBM Enterprise Key Management Foundation Web Edition . . . . . . . . . . 217
10.1 Introduction to IBM Enterprise Key Management Foundation - Web Edition (EKMF Web)
218
10.1.1 EKMF Web Edition overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
10.2 EKMF Web edition requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
10.2.1 Key hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
10.2.2 EKMF Web authorization roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
10.3 Key management with EKMF Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
10.3.1 EKMF Keystores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
10.3.2 Key template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
10.3.3 Key label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
10.3.4 Keystores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
10.3.5 Characteristics of the key template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
10.3.6 Key lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
10.3.7 Key rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
10.4 EKMF Web view of data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
10.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Appendix B. Sample REXX scripts for creating DATA and CIPHER keys . . . . . . . . . 241
Contents ix
x Getting Started with z/OS Data Set Encryption
Notices
This information was developed for products and services offered in the US. This material might be available
from IBM in other languages. However, you may be required to own a copy of the product or product version in
that language in order to access it.
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:
IBM Director of Licensing, IBM Corporation, North Castle Drive, MD-NC119, Armonk, NY 10504-1785, US
This information could include technical inaccuracies or typographical errors. Changes are periodically made
to the information herein; these changes will be incorporated in new editions of the publication. IBM may make
improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time
without notice.
Any references in this information to non-IBM websites are provided for convenience only and do not in any
manner serve as an endorsement of those websites. The materials at those websites are not part of the
materials for this IBM product and use of those websites is at your own risk.
IBM may use or distribute any of the information you provide in any way it believes appropriate without
incurring any obligation to you.
The performance data and client examples cited are presented for illustrative purposes only. Actual
performance results may vary depending on specific configurations and operating conditions.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm the
accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the
capabilities of non-IBM products should be addressed to the suppliers of those products.
Statements regarding IBM’s future direction or intent are subject to change or withdrawal without notice, and
represent goals and objectives only.
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 actual people or business enterprises is entirely
coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in
any form without payment to IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating platform for which the sample
programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore,
cannot guarantee or imply reliability, serviceability, or function of these programs. The sample programs are
provided “AS IS”, without warranty of any kind. IBM shall not be liable for any damages arising out of your use
of the sample programs.
The following terms are trademarks or registered trademarks of International Business Machines Corporation,
and might also be trademarks or registered trademarks in other countries.
CICS® IBM z13® Tivoli®
Db2® IBM z13s® WebSphere®
FlashCopy® IBM z14® z Systems®
IBM® PIN® z/OS®
IBM FlashSystem® QRadar® z13®
IBM Security™ RACF® z13s®
IBM Z® Redbooks® z15™
IBM z Systems® Redbooks (logo) ® zEnterprise®
The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive
licensee of Linus Torvalds, owner of the mark on a worldwide basis.
Other company, product, or service names may be trademarks or service marks of others.
This IBM® Redbooks® publication provides a broad explanation of data protection through
encryption and IBM Z® pervasive encryption with a focus on IBM z/OS® data set encryption.
It describes how the various hardware and software components interact in a z/OS data set
encryption environment.
In addition, this book concentrates on the planning and preparing of the environment and
offers implementation, configuration, and operational examples that can be used in z/OS data
set encryption environments.
This publication is intended for IT architects, system programmer, and security administrators
who plan for, deploy, and manage security on the Z platform. The reader is expected to have
a basic understanding of IBM Z security concepts.
Authors
This book was produced by a working at IBM Redbooks, Austin Center.
Bill White is an IBM Redbooks Project Leader and Senior Networking and Connectivity
Specialist at IBM Redbooks, Poughkeepsie Center.
Cecilia Carranza Lewis is a Senior Technical Staff Member (STSM) Software Engineer
within IBM Z development, based at the Silicon Valley Laboratory (SVL) in San Jose, CA. Her
focus is on strategy and architecture in the area of z/OS data and storage management within
z/OS Data Facilities Storage Management Subsystem (DFSMS), where she has over 30
years of experience. Cecilia has held numerous technical leadership positions focused on
supporting clients’ explosive data growth on IBM Z mainframes through improvements in total
cost of ownership, simplification, and data security. She is also the architect for the z/OS data
set encryption solution.
Eysha Shirrine Powers is a Cryptographic Software Designer and Developer with 14 years
of experience with IBM Z cryptography and security. She joined IBM Poughkeepsie with a
B.S. Computer Science from the University of Illinois at Urbana-Champaign and continued
her education with a M.S. Information Technology from Rensselaer Polytechnic Institute.
Eysha Shirrine has a passion for cryptography and has been designing and developing crypto
software for z/OS Integrated Cryptographic Services Facility (ICSF) for over nine years. She
also created and maintains the IBM Crypto Education online community and regularly
presents at SHARE, IBMTechU, Vanguard, and other technical conferences.
David Rossi is a Cybersecurity Architect for IBM United States. With a passion for innovation
and 20 years of experience in the IBM z platform known as the mainframe, David had
architected countless IBM Z-based solutions. Over the last 5 years, he has focused on all
aspects of IBM Z security. He is a recognized thought leader in IBM Z security. Recent focus
areas have been security intelligence, key management, and encryption. David is a Certified
Cloud Security Professional (CCSP) by ICS2, and also a Certified Information Privacy
Manager (CIPM) by IAPP.
Eric Rossman is a software and hardware designer and developer with 23 years of
experience across multiple IBM Z cryptography and security products. He thoroughly enjoys
cryptography and security, both from the design side at IBM and from helping clients
Andy Coulsonr works for IBM Security in Edinburgh, UK. Andy has worked at various
mainframe customers, including an airline, banks, and an insurance company, since he
started as an IBM MVS™ Systems Programmer in 1987. He has been with IBM for 12 years
in several technical mainframe roles, including hardware and software support. Currently, he
works in IBM Z Security pre-sales technical support.
Jacky Doll is a software engineer with the IBM Z business unit in Poughkeepsie. She has
developed content for web projects, digital media, and user manuals that support z/OS and its
products. Jacky is the team lead for Hot Topics magazine, and holds a Masters of Science in
Human-computer Interaction from Renssalaer Polytechnic Institute (RPI) in Troy, New York.
Brad Habbershow is an I/T Specialist at IBM Canada and the z/OS system programmer
team lead for Infrastructure Services, Securities Industry Services for IBM Global Technology
Services®, Canada. He has over 32 years of experience in the I/T field specializing in z/OS,
IBM Parallel Sysplex®, IBM RACF®, JES3 and many other IBM products. Brad holds a B.Sc
Degree from Western University in Ontario, Canada. He has written extensively on parallel
sysplex operations, z/OS High Availability and JES3 - JES2 migration topics in his career at
IBM.
is a z/OS Systems Programmer at Australia and New Zealand Banking Group Limited in
Australia. He has 32 years of mainframe experience and holds a B.Sc from University of
Melbourne in Victoria, Australia. His areas of expertise include z/OS installation,
maintenance, and security.
Ryan McCarry is an IBM Z Client IT Specialist in IBM Systems who is based out of the
Washington Systems Center in Herndon, VA. He joined IBM after obtaining a BS from
Syracuse University in 2016. He also recently obtained the Systems z Associate Certificate
from Marist College In Poughkeepsie, NY.
Philippe Richard works for IBM LBS in Montpellier, France. He joined IBM France in 1985 to
work in software support for MVS. Philippe has held several positions, including teaching,
systems programming, consultancy and Pre-sales technical support for IBM Z. Philippe is
now the WW lead developer of technical training and classes for IBM Z where he is in charge
of the z/OS curriculum content including z/OS, RACF, Parallel Sysplex, UNIX System
Services, IBM WebSphere®, and Liberty for z/OS. He has contributed to other IBM Redbooks
publications projects, and is a regular speaker at IBM conferences in Europe (STG university,
Security conference), and customers Guide/Share security meetings.
Romoaldo Santos is an IBM Z consultant in IBM Brazil. He has 37 years experience with the
mainframe and is currently working on virtualization and data center platforms. Romoaldo is
responsible for hardware configurations in IBM Global Accounts and supports GDPS®
environments in EMEA and the US. He also works on high availability and business
continuance projects. Other areas of expertise include Z I/O Supervisor, Assembler, Sysplex
problem determination, performance and tuning, and z/OS internals.
Isabel Arnold joined the team of technical specialists for mainframe software in 2004, where
she spent 15 years with CICS and modern application development. Since 2020 she has
been working as Technical Advisor and Innovation Lead for the Copenhagen Crypto
Competency Center, helping to secure the world, one bit at a time. She regularly speaks at
conferences and other events and demonstrates the funny side of the mainframe in her
cicsabel Youtube channel. In her free time, she does stand-up, musical and improv comedy.
This project was coordinated by Octavian Lascu, IBM Redbooks, Poughkeepsie Center.
Bill White
Cecilia Carranza Lewis
Eysha Shirrine Powers
David Rossi
Eric Rossman
Andy Coulson
Jacky Doll
Brad Habbershow
Thomas Liu
Ryan McCarry
Philippe Richard
IBM
Find out more about the residency program, browse the residency index, and apply online at:
ibm.com/redbooks/residencies.html
Comments welcome
Your comments are important to us!
We want our books to be as helpful as possible. Send us your comments about this book or
other IBM Redbooks publications in one of the following ways:
Use the online Contact us review Redbooks form found at:
ibm.com/redbooks
Preface xv
Send your comments in an email to:
redbooks@us.ibm.com
Mail your comments to:
IBM Corporation, IBM Redbooks
Dept. HYTD Mail Station P099
2455 South Road
Poughkeepsie, NY 12601-5400
Because of this issue, enterprises are experiencing increased pressure from internal and
external sources to protect and govern data. These demands are changing the perspective
around securely handling data.
One of the most impactful ways to protect data is to establish a fortified perimeter around that
data by using encryption. Protecting the data that is required to achieve compliance should be
viewed as a minimum threshold. Best practices suggest a shift from selective encryption
(protecting only specific types of data) to pervasive encryption (encrypting all data).
This chapter introduces the concept of pervasive encryption and how you can use z/OS data
set encryption to protect your data. It includes the following topics:
1.1, “Which data” on page 2
1.2, “Why protect data” on page 3
1.3, “Standards and regulations overview” on page 4
1.4, “How to protect data” on page 7
1.5, “Pervasive encryption for IBM Z” on page 9
1.6, “Understanding z/OS data set encryption” on page 12
1.7, “How z/OS data set encryption works” on page 17
1.8, “Administrator’s perspective of z/OS data set encryption” on page 20
Where is your data stored? Who creates it? Where is the data created? Where will the data
be transmitted? Who will receive the data? Where is the data stored for immediate use?
Where will the data be backed up? Where will the data be recovered from in a disaster?
When you are planning for data protection, you must consider the entire lifecycle of the data
from creation to destruction and throughout its journey (in-flight and at-rest). You must
consider how the data enters and exits your environment, and also potential exposure after
the data is out of your control.
To truly protect the data, you must know what data to protect and where that data is located.
For example, in an IBM Db2® environment, many security controls are available to control
access to view or query data. However, Db2 data is stored persistently in data sets. Possible
questions that would help identify potential exposure of data to accidental views include:
Does a developer without authorization to perform SQL queries have authorization to the
data sets that back the Db2 table?
Can those data sets be viewed or copied to development environments where the data is
used for internal testing?
What view and copy operations are allowed in your organization that might enable
accidental exposure of data?
For example, in an IBM CICS® environment, millions of transactions can occur an hour where
credit card numbers and transaction details might be stored in data sets. Storage
administrators are authorized to access the data sets for creating, deleting, backing up, and
recovering tasks, so one of the questions that may help identify potential insider attack
exposures is, can storage administrators copy sensitive data and transmit it to a non-trusted
environment?
1.2.4 Regulations
Industry regulations, such as European Union (EU) General Data Protection Regulation
(GDPR), Payment Card Industry Data Security Standard (PCI-DSS), and Health Insurance
Portability and Accountability Act (HIPAA) require organizations to protect sensitive data.
For additional information, see 1.3, “Standards and regulations overview” on page 4.
In addition, often there are also requirements for auditing and sufficiently granular access
controls.
For Payment Card Industry Security Standards, see PCI Security Standards Council.
An Ontario legislative bill was introduced that included some clauses providing equivalent
legislation to SOX. This is “The Keeping the Promise for a Strong Economy Act (Budget
Measures), 2002”.
For more information, see S.2521- Federal Information Security Modernization Act of 2014.
NIST Special Publication 800-53 (Security and Privacy Controls for Information Systems and
Organizations) was developed in response to FISMA 2014 and provides a catalog of security
and privacy controls for information systems and organizations.
1.3.7 Payment Card Industry (PCI) PTS HSM Security Requirements (PCI-HSM)
The PCI HSM standard covers the lifecycle of the HSM up to the point of its first delivery to
the initial point of deployment facility. Subsequent stages of the HSM’s lifecycle continue to be
of interest to PCI and are controlled by other PCI standards.
For more information, see HSM Device Evaluation: Frequently Asked Questions.
For more information, see H.R.3103 - Health Insurance Portability and Accountability Act of
1996.
1.4.3 Encryption
Encryption is a technology that is well-versed in the art of hiding sensitive information in plain
sight. Encryption operations require a cryptographic key and a cryptographic algorithm.
Together, a cryptographic key and algorithm can encrypt and decrypt data. Usually, the
Standard cryptographic algorithms (such as AES, DES, RSA, and ECC) are public and
validated by mathematicians, cryptographers, and cryptanalysts. Because the algorithms are
well-known and established, the security of encryption depends on the security of the
cryptographic keys.
Symmetric keys are created from random numbers that are generated by random number
generators (RNGs) in hardware or software. The length of the random number that is required
for symmetric encryption depends on the encryption algorithm, as shown in the following
examples:
DES (single-length) requires 56 random bits
TDES requires double- or triple-length keys with 112 and 168 random bits, respectively
AES requires 128, 192, or 256 random bits
Consider a DES 56-bit key, which has 256 (72,057,594,037,927,936) combinations. This
combination means that a brute force attack of a 56-bit DES key requires trying up to 72
quadrillion possible keys.
In the 1970s when 56-bit DES was invented, breaking the entire DES 56-bit key was
considered infeasible with the computing power that was available considering the associated
Therefore, it is recommended that symmetric encryption applications use long key lengths to
reduce the possibility of brute force attacks.
Key management
Key management is a critical aspect in any encryption strategy. Cryptographic keys feature a
lifecycle that includes tasks, such as key creation, key activation, key deactivation, key
archival, and key deletion. Some regulations, such as PCI-DSS1, require that key
management processes are created and well-documented. For more information about key
management, see Chapter 3.5, “Key management considerations” on page 50.
IBM Z pervasive encryption is enabled through tight platform integration. Several solutions
and enhancements are introduced across the Z platform in areas of hardware, software,
operating system, middleware, and tooling. The components of the IBM Z platform that play a
role in providing pervasive encryption are shown in Figure 1-1.
1
PCI DSS - Payment Card Industry - Data Security Standards - PCI Security Standards Council
2 For Key Management with Data Set Encryption, EKMF is available as EKMF Workstation or EKMF Web Edition.
Web Edition is focused on key management for Pervasive Encryption (and cloud) and the Workstation solution with
additional key management capabilities.
In addition, most organizations experience numerous audits per year. Ever evolving threats
from inside and outside of an organization are causing significant security concerns,
especially in the short term. Enterprises need security solutions that ensure maximum
visibility into activities in their entire infrastructure, along with automated threat analysis and
remediation.
The Z platform provides solutions for security teams and auditors to verify up-to-date
compliance statistics in near real time. Auditors can also use enhanced tooling to significantly
reduce the time and effort that is required to validate compliance requirements and complete
audits.
Approaches to encryption of data at-rest can be categorized into the following levels:
Full disk and tape encryption
File or data set-level encryption (z/OS data set encryption is the focus of this publication)
Database encryption
Application encryption
You can choose to layer one or more of these complementary solutions, depending on your
requirements.
The four encryption levels for data at-rest are mapped in Figure 1-2 to the coverage and the
security control granularity of the data.
This level is “all or nothing” encryption and encrypts only data, at-rest, at the storage
controller subsystem level by using a single key for all encryption. Self-encrypting storage
(such as IBM DS8900F, IBM FlashSystem® Storage Systems, tape, and virtual tape) solves
the following security problems:
Secure disposal of storage at the end of its lifecycle
Tapes that are lost during shipment
Data protection after return for repair or in case of theft
Because data remains encrypted (even during operational procedures), file and data set
encryption can eliminate the need to include storage administration as part of your
compliance scope. The use of extra compliance controls might not be needed because the
data remains encrypted when it is written.
For z/OS, data is encrypted in bulk with low overhead by using the IBM Z integrated
cryptographic hardware. z/OS data set encryption supports the following data set types:
VSAM extended format data sets (KSDS, ESDS, RRDS, VRRDS, Linear)
Sequential extended format, basic format and large format data sets
PDSEs (data members only)
These data set types also allow for exploitation of z/OS data set encryption by z/OS zFS, IBM
Db2, IBM IMS™, middleware, logs, batch, and Independent Software Vendor (ISV) solutions.
Applications or middleware that use these data set types accessed with VSAM, QSAM,
BSAM, or BPAM access methods can use z/OS data set encryption typically with no
application changes.
However, applications or middleware that use basic or large format data sets accessed with
Execute Channel Program (EXCP), a low-level I/O interface), can use z/OS data set
encryption but application changes are required in this case.
To understand how to detect if an EXCP application is accessing a data set, refer to section
"Candidates for encrypted basic and large format data sets" in z/OS DFSMS Using Data
Sets. To understand how to modify EXCP applications to support encrypted data sets, refer to
“Encrypting and Decrypting with the IGGENC Macro” in z/OS DFSMSdfp Advanced Services.
Database encryption
Database encryption protects data in-flight, in-use, and at-rest. It is not transparent to the
application and allows for separation of duties and granular access control. Database
encryption safeguards the encrypted sensitive data in logs, image copy data sets, and DASD
volume backups while it uses IBM Z integrated cryptographic hardware.
Application encryption
Application encryption provides encryption and data protection that is managed by the
application. It requires changes to applications to implement and maintain encryption and is
For more information about the IBM Z security solutions and their capabilities, see Chapter 2,
“Identifying components and release levels” on page 23.
For more information about getting started with IBM Z pervasive encryption, see IBM Z
Pervasive Encryption content solution.
z/OS data set encryption is intended to be more accessible to the organization than many
other forms of encryption. For example, in most cases, it is not apparent to the application
and requires no changes to application code. By using z/OS data set encryption, data can be
encrypted at course scale without the need to perform data identification and classification
first.
Basic and large format data sets can be accessed by applications using standard access
method APIs, as well as by applications using EXCP access. Applications that use EXCP to
access encrypted basic and large format data sets cannot transparently access the
encrypted data. In this case, they require modifications to successfully open the data set and
perform encryption and decryption of the data.
Important:
Before converting any basic or large format data sets to encrypted basic or large format
data sets:
1. Research is required to determine if the data sets are candidates for basic and large
format encryption.
2. Restrictions must be evaluated.
3. Unless the application using EXCP is modified to support encrypted basic and large
format data sets. Otherwise, application failures may result.
For information on how to identify candidates for basic and large format encryption, refer to
section "Candidates for encrypted basic and large format data sets" in publication IBM
z/OS DFSMS Using Data Sets, SC23-6855.
z/OS data set encryption is supported only for certain data set types. More data set types
might follow.
The following additional design benefits are built into z/OS data set encryption:
Offers a higher level of protection along with the high throughput of encryption by using
protected keys and a crypto coprocessor. As a result, sensitive key material is not visible
in clear form at any time.
Protects data in a way that is aligned with your current security access control
mechanisms, which offers a more straightforward configuration experience.
Performs efficiently at speed by use of the integrated Z crypto hardware and software
stack.
Enables encryption without requiring application or database changes.
Supports encrypted data throughout its journey. For example, with z/OS data set
encryption, any data that is replicated by using Peer-to-Peer Remote Copy (PPRC) or
Extended Remote Copy (XRC), backed up, or migrated, remains encrypted.
Provides cryptographic separation from other environments. Encryption keys can be
configured so that they are owned and managed by a logical organizational environment
(for example, production versus test).
Offers System Management Facility (SMF) records, subsystem logs, and system
interfaces to help simplify compliance and audit efforts.
There are a number of benefits provided by z/OS data set encryption that make it a clear
choice as a method to protect data in-flight and at-rest. The following are a few of the benefits.
Data set-level granularity
All of the benefits of z/OS data set encryption rest on establishing a robust key management
strategy, which is essential to governing and safeguarding the encryption keys that protect
your data. Therefore, you must ensure that the encryption keys are available whenever and
wherever an encrypted data set is used. As such, it is important to understand how z/OS data
set encryption works with the hardware and software components in the IBM Z cryptographic
system.
z/OS data set encryption relies on encryption keys that are in a keystore (such as
Cryptographic Key Data Set [CKDS]) when data sets are encrypted or decrypted. Those
encryption keys are managed by the z/OS Integrated Cryptographic Services Facility (ICSF)3,
or by using a the EKMF Key Management system (see Chapter 10, “IBM Enterprise Key
Management Foundation Web Edition” on page 217). Each encryption key includes a
corresponding key label. The key label is used as a handle to locate the encryption key within
the CKDS.
3
ICSF is a component of z/OS that provides APIs and utilities for creating and managing cryptographic keys, and
performing crypto operations in software or hardware.
z/OS data set encryption processing uses different types of encryption keys and features the
following key terminology:
Data-encrypting key An encryption key that is used to encrypt and decrypt data. z/OS
data set encryption supports only data-encrypting keys that are
using the AES algorithm with a 256-bit key length. Both DATA and
CIPHER key types are supported.
4
An HSM is a physical computing device that safeguards and manages digital keys for strong authentication and
provides cryptographic processing.
Generating data encryption keys as secure keys and storing them in the CKDS is the most
secure method of protecting key material on the Z platform. This process requires the use of
Crypto Express adapters.
When processing encrypted data sets, DFSMS access methods use only protected keys to
ensure that the sensitive data-encrypting keys are never available in clear text within the
operating system.
For more information about how the Z platform manages secure keys and protected keys, see
3.5.6, “Using protected keys for high-speed encryption” on page 51.
You can specify key labels to identify encryption keys (such as secure keys) that are in the
CKDS. When an encrypted data set is created, the key label is stored as an attribute of the
data set in the catalog.
Authorization to view the contents of a data set is based on access to the key label that is
associated with the data set. The encryption key that is associated with that key label is used
by DFSMS to start CPACF to encrypt and decrypt the data.
Encrypted data sets must be SMS-manged and, thus, cataloged. z/OS data set encryption
supports the encryption of the following data set types:
Sequential extended-format data sets, which are accessed through BSAM and QSAM
Sequential basic format and large format data sets, which are accessed through BSAM,
QSAM and EXCP. (Note that EXCP applications require changes to support encrypted
data sets).
VSAM extended-format data sets5 (KSDS, ESDS, RRDS, VRRDS, and LDS), which are
accessed through base VSAM and VSAM RLS.
PDSEs (data members only), which are accessed through BPAM, BSAM and QSAM.
A data set is defined as encrypted when a key label is supplied on allocation of a new data set
of a supported data set type. The default supported data set types for data set encryption are
sequential extended format and VSAM extended format data sets.
5
VSAM extended-format data sets also can be accessed by using licensed Media Manager (MM) interfaces.
Applications that use MM interfaces require changes to access encrypted data sets. For more information, contact
your IBM representative.
In order to take effect, the resource only needs to be defined. The system does not require
you to provide any authorization for this resource.
Note: Before allowing basic and large format encryption, research must be performed to
determine if any EXCP applications will access those data sets. If so, must determine if
those EXCP applications have been or plan to be modified in support of z/OS data set
encryption. Any EXCP application that opens an encrypted basic or large format data set
before it has been modified will receive an error attempting to open the data set. If you find
that no EXCP applications access the data sets, consider converting the data set to
sequential extended format encrypted data set. One benefit is that sequential extended
format data sets support access method compression, while basic and large format data
sets do not.
To determine if a data set is eligible to be an encrypted basic or large format data set, refer
to section "Candidates for encrypted basic and large format data sets" in publication z/OS
DFSMS Using Data Sets, SC23-6855. To understand how to modify EXCP applications to
support encrypted basic and large format data sets, refer to section "Encrypting and
Decrypting with the IGGENC Macro" in publication z/OS DFSMSdfp Advanced Services.
To identify that PDSEs are to be viewed as a supported data set type on the system, you must
fully define the following FACILITY class resource as a discrete profile:
STGADMIN.SMS.ALLOW.PDSE.ENCRYPT
In order to take effect, the resource only needs to be defined. The system does not require
you to provide any authorization for this resource.
A data set is defined as encrypted when a key label is supplied on allocation of a new data set
of a supported data set type for data set encryption. You can supply a key label by using
keywords in any of the following source formats on allocation of a new data set of a supported
data set type for data set encryption (by using the following order of precedence):
1. Data Facility Product6 (DFP) segment in the RACF data set profile.
2. JCL, dynamic allocation, TSO Allocate, IDCAMS DEFINE.
3. SMS data class.
An example of how a key label is used when an encrypted data set is created is shown in
Figure 1-4 on page 19. This example uses a key label that is specified in the DFP segment in
the RACF data set profile.
6
Data Facility Product (DFSMSdfp) tracks all data and programs that are managed within z/OS and provides data
access for z/OS applications.
Note: Neither Crypto Express nor CPACF are called during data set create processing.
An example of how key labels and keys are used with z/OS data set encryption is shown in
Figure 1-5. This example uses secure keys that are stored in the CKDS, and involves input
processing of an encrypted data set.
Figure 1-5 Encryption key process for decrypting an encrypted data set
Open performs the following process, as shown on the left side of Figure 1-5 on page 19:
1. DFSMS receives the key label that is associated with data set from the catalog and calls
RACF to verify the user’s access to the key label.
2. DFSMS calls ICSF with the key label.
3. ICSF obtains the secure key from CKDS and calls the Crypto Express7 features to unwrap
the key.
4. With assistance from firmware, Crypto Express decrypts the secure key and rewraps with
a transport key.
5. The wrapped key is sent to CPACF. With assistance from Z firmware, CPACF unwraps the
wrapped key with the transport key to expose the data-encrypting key.
6. The data-encrypting key is wrapped with the CPACF wrapping key to create the protected
key.
7. The protected key is sent to ICSF, where it is cached in protected memory for future
callers. ICSF sends the protected key to DFSMS to encrypt and decrypt data.
Read/Get performs the following steps, as shown on the right side of Figure 1-5 on page 19:
Step A DFSMS reads encrypted data from data set and starts CPACF, which passes the
protected key.
Step B CPACF decrypts data by using the protected key.
Step C Decrypted data is sent as clear text to the application through DFSMS.
One of the many benefits of z/OS data set encryption is separation of duties between data
owners and administrators. Creating a perimeter around the data means that you can create
an implementation that limits who can access the sensitive data.
At a minimum, administrators that are involved in your z/OS data set encryption
implementation must have security, storage, and cryptographic roles. For more information
about the necessary responsibilities of administrators, see 3.1.1, “Distinguishing roles and
responsibilities”.
You can design your implementation in such way that the security administrator has full
control over z/OS data set encryption. This level of responsibility allows the security
administrator to maintain separate duties that are required to limit who can access the
sensitive data.
For example, the security administrator can perform the following tasks:
Define or alter DATASET profiles to supply a key label for data set encryption. This
process allows the security administrator to control which data sets are created as
encrypted, and which key labels are to be used.
Define a security profile through the FACILITY class so that key labels can be supplied
through DATASET profiles only. This process prevents users (other than the security
administrator) from deciding to encrypt data sets that are outside of the control of the
security administrator.
Assign users and groups access to CSFKEYS profiles for the key labels that permit or
deny users to view sensitive data in data sets. This process allows the security
administrator to limit the users who can open an encrypted data set to only those users
who need access to the data in clear text, such as the data owners.
The storage administrator must be aware of data set naming conventions and data set types
and concern themselves with the following issues:
Do data sets exist that should be converted to extended-format or to another data set type
supported by data set encryption?
Do data sets exist that cannot be converted to extended-format or to another data set type
supported by data set encryption?
Do specific data set types exist that are not supported?
Do those unsupported data sets contain sensitive information?
The storage administrator works closely with the security administrator and ICSF
administrator to ensure that all necessary data sets are protected.
The storage administrator might be responsible for data migration, backup, and replication.
They can perform these functions for encrypted data sets without requiring authority to the
key label because these functions process the data in the encrypted form. However, there
may be other functions that storage administrators in your organization might perform that
would require them to have authority to the key label. Examples include IEBGENER or XMIT.
In such cases, it would be beneficial to limit the storage administrators that would require
access to the key labels.
The ICSF administrator works closely with the security administrators and key managers to
ensure that keys are available for z/OS data set encryption.
The key managers rely on ICSF administrator to provide a working cryptographic environment
and work closely with security administrators to define key label naming conventions that
ensure an easy mapping of DATASET profile resources to key labels.
In addition, every new release of z/OS continues to provide enhancements for various
aspects of data security beyond encryption, such as identity management, access control,
auditability, monitoring, and reporting.
The recommended and minimum supported levels of the Z platform components that are
needed to implement z/OS data set encryption are listed in Table 2-1. The enhancements that
are provided by the latest levels of Z hardware, firmware, and software ensure the best
scalability, performance, and enhanced system and security management capabilities.
Table 2-1 Supported levels of Z hardware and software for z/OS data set encryption
Recommended hardware z15 w/ FC 3863 (CPACF The CPACF in the z15 has
enablement)a and Crypto Express7S improved performance
compared to the IBM
z14®. The Crypto
Express7S delivers
improved throughput
capacity over CEX6S.
Minimum hardware IBM z13 or IBM z13s® with Crypto Certain key functions are
Express5Sc (FC 0890). not available w/ CEX5S
This section introduces the following hardware components to consider for use with z/OS
data set encryption:
IBM Z platform
Central Processor Assist for Cryptographic Function (CPACF)
Crypto Express adapters
TKE workstation
EKMF Web Edition or EKMF Workstation
At the time of this publication, the preferred and most optimized Z platform for data set
encryption is the combination of the z15 (including CPACF enablement) and Crypto
Express7S, with z/OS 2.4 and ICSF HCR77D1.
Note: APARs are required for basic and large format dataset encryption.
CPACF is a set of instructions that is available on every processor unit that accelerates
encryption. CPACF is designed to facilitate the privacy of cryptographic key material when
used for data encryption through a key wrapping implementation. It ensures that key material
is not visible to applications or operating systems during encryption operations.
Crypto Express adapters are tamper-responding hardware security modules1 (HSM), which
provide high-security, high-throughput cryptographic functions. The Crypto Express adapter
adds a layer of protection for the storage and use of a master key.
Note: All installed crypto coprocessors cards must be loaded with the same level of code.
Otherwise, unpredictable results can occur.
Note: For z/OS data set encryption, the Crypto Express adapters must be configured as
Common Cryptographic Architecture (CCA) coprocessors.
CCA is an architecture and a set of application programming interfaces (APIs) that support
cryptographic operations and key management.
To access and use the Crypto Express adapters, applications must use APIs and panel
utilities that are provided by the operating system. For z/OS, the Integrated Cryptographic
Service Facility (ICSF) provides these APIs and manages access to the hardware
cryptographic features.
Determining capacity
To determine the level of capacity that is needed to satisfy the demand on your Crypto
Express adapters, the following tasks should be performed:
Assess your workloads and their behavior during peak periods
Define thresholds that adhere to your capacity policies and monitor usage
Ensure that enough capacity is available for backup situations
A minimum of two Crypto Express adapters are recommended so that if one adapter must be
taken offline (for example, MCL upgrade), the second adapter (loaded with the same AES
master key [MK] as the first) can handle the same number of requests. In this case, the
utilization threshold for each Crypto Express adapter should not exceed 50%.
1
An HSM is a physical computing device that safeguards and manages digital keys for strong authentication and
provides cryptographic processing.
Monitoring utilization
The following options are available for viewing or monitoring Crypto Express adapter usage:
z/OS IBM Resource Measurement Facility (IBM RMF)
The option creates post-processed Crypto Hardware Activity reports that show the
utilization percentage for each Crypto Express adapter. For more information, see
CRYPTO - Crypto Hardware Activity report.
Monitors Dashboard on the Support Element (SE)
This option shows Crypto Express adapter type and monitors usage in real time.
Measurements are taken every 15 seconds and the value is displayed. Histograms also
can be created to show adapter usage as a line graph over time. For more information,
see Hardware Management Console Operations Guide - Version 2.15.0.
Consider that a z14 supports up to 16 Crypto Express6S adapters, each of which can include
85 domains2 and a duplicate environment for disaster recovery. In this environment, master
key management on the coprocessors is not a trivial endeavor.
TKE 9.0 and newer includes a secure hardware-based workstation (FC 0085 or FC 0086) and
4768 Crypto Express adapter, with smartcard-controlled key management, which provides
secure, fast, and accurate deployments of new cryptographic material across production, test,
and disaster recovery (DR) systems.
For more information about other TKE workstation versions that can be used with earlier
generations of the IBM Z platform, see TKE Hardware Support Info For TKE 9.2v1.
2
The Z platform uses the concept of a cryptographic domain to virtualize the physical coprocessor of the
CryptoExpress adapter. A Crypto Express coprocessor can be shared by multiple logical partitions (LPARs) and
different operating systems. Z firmware enforces domain usage. The Crypto Express coprocessor manages
assignment of master keys to cryptographic domains. Cryptographic key material for one domain is not usable by
another domain with a distinct master key.
Officially released as a product in April 2020, it was developed out of the IBM's Crypto
Competence Center in Copenhagen, Denmark, which has also developed EKMF
Workstation. Both EKMF Web and EKMF Workstation use the same EKMF Agent, which
communicates with ICSF through APIs.
EKMF Web edition runs in a z/OS LPAR (image) and is accessible through a Web
browser. EKMF Web has much lighter functionality. Currently, EKMF Web supports
generation and management of keys used in data set encryption, as well as setting up
keys for cloud deployments.
Both the EKMF workstation and EKMF Web provide the following key management services:
Generate operational keys
Facilitate backup and recovery of key material
Provide monitoring, auditing, and planning capabilities
For additional information, see Chapter 10, “IBM Enterprise Key Management Foundation
Web Edition” on page 217.
The operating system requirements which must be met are listed in Table 2-3:
Table 2-3 Supported data set type requirements for z/OS Data Set Encryption
Data set type z/OS V2.3 z/OS V2.4
Tip: For more information about identifying fixes for z/OS data set encryption, see IBM Fix
Category Values and Descriptions.
For z/OS data set encryption, DFSMS supports the creation of and access to encrypted data
sets, in addition to backup, migration, and replication of encrypted data sets. Applications that
use the access method APIs can transparently access encrypted data if the user has the
appropriate authorization to access the key label.
Note: Applications that use EXCP to access encrypted basic and large format data sets
cannot transparently access the encrypted data. In this case, they require modifications to
successfully open the data set and perform encryption and decryption of the data.
Before converting any basic or large format data sets to encrypted basic or large format
data sets, research is required to determine if the data sets are candidates for basic and
large format encryption. Restrictions must be evaluated. In addition, if the data sets are
accessed by any application using EXCP, they should not be converted to encryption
unless the application is modified to support encrypted basic and large format data sets.
Otherwise, application failures may result. For information on how to identify candidates for
basic and large format encryption, refer to section "Candidates for encrypted basic and
large format data sets" in publication z/OS DFSMS Using Data Sets. To understand how to
modify EXCP applications to support encrypted basic and large format data sets, refer to
section "Encrypting and Decrypting with the IGGENC Macro" in publication z/OS
DFSMSdfp Advanced Services. If you find that no EXCP applications access the data sets,
consider converting the data set to sequential extended format encrypted data set. One
benefit is that sequential extended format data sets support access method compression,
while basic and large format data sets do not.
For more information about DFSMS, see Understanding the DFSMS Environment.
For an overview of z/OS data set encryption, refer to section 'Data set encryption' in
publication IBM z/OS DFSMS Using Data Sets, SC23-6855.
For z/OS data set encryption, DFSMS calls ICSF services to retrieve a protected key that is
used to encrypt/decrypt data. Therefore, ICSF must be available to access any encrypted
data set. For more information, see 3.4.2, “Starting ICSF early in the IPL process” on
page 46.
ICSF starts the System Authorization Facility (SAF) interface to verify user authorization to
APIs and Time-Sharing Option (TSO) Interactive System Productivity Facility (ISPF) panels.
SAF policies (such as RACF profiles) control access to ICSF keys and services.
For more information about the use of SAF policies to protect ICSF keys and services, see
z/OS Cryptographic Services ICSF Administrator's Guide.
ICSF HCR77C1
Although levels of ICSF before HCR77C1 support core functionality, new features in
HCR77C1 are available for viewing and managing keys, and provide more audit information.
For example, HCR77C1 includes the CKDS KEYS utility, which is an ISPF-based browser for
the CKDS. It is useful for a common record format (KDSR) CKDS.
The browser shows the state of the record in CKDS (for example, Active or Archived) and
options to display the key attributes and metadata. HCR77C1 also includes enhanced SMF
formatting, with which you monitor cryptographic usage statistics and reveal compliance
warning events.
Notes:
z/OS 2.4 includes ICSF HCR77D0. The latest version of ICSF (HCR77D1) is available
for download at z/OS Downloads.
z/OS 2.3 includes ICSF HCR77C0. ICSF (HCR77C1) is also available for download at
z/OS Downloads.
SAF is required for z/OS data set encryption. It provides the authorization interfaces for ICSF
callable services and controls user access to keys and services.
SAF processes security authorization requests directly or works with RACF, or other
third-party security products, such as CA Top Secret or ACF2 for z/OS.
For more information about z/OS data set encryption support with Top Secret and ACF2, see
Pervasive Encryption Compatibility Matrix.
A key feature of RACF is its hierarchical management structure. The RACF security
administrator is defined at the top of the hierarchy and can issue any RACF command or
change any RACF profile (except for some auditing specific operands).
With z/OS data set encryption, you can define RACF profiles to assign ICSF key labels to
data sets and authorize users and groups to ICSF keys and services.
For more information about the use of RACF commands, see z/OS Security Server RACF.
Certain system user IDs include powerful access privileges, which might warrant more
security protection. Without some form of multi-factor authentication, the security of the
system might be relying solely on a user ID and password combination to protect access to
sensitive resources.
The user ID and password combination can become a weak link that is vulnerable to various
threats, including social engineering and password cracking. These risks can be minimized by
using a multi-factor authentication product, such as IBM Multi-Factor Authentication for z/OS.
By using MFA software, you can define more authentication factors for users of IBM z/OS
systems. It works with IBM RACF to authenticate users with multiple factors and define
policies for these factors and apply them to specific IDs. IBM MFA integrates directly with the
security server, and not any specific authentication factor. Therefore, factors can be added
without changes to the RACF/MFA infrastructure. For more information, see IBM Z
Multi-Factor Authentication.
This suite aids in the detection of concealed and complex risks by using a built-in technology
base to perform extensive automated analysis of the operating system, security system, and
major subsystems. It integrates security event information from critical IBM z/OS subsystems
and applications.
IIBM Security zSecure Suite was enhanced with many new features to assist with the secure
management of z/OS data set encryption and network encryption. These features include
audit capabilities for data at-rest and data in-flight.
In its most basic respect, RACF and other SAF products are designed to protect resources by
answering the question of is this access to be permitted.
However, modern z/OS installations must review their security setup from a number of
different perspectives, including the following examples:
Automated compliance capability; for example, prove every month that only these specific
user IDs can access a particular sensitive resource and prove that the protection is still in
place.
Automated Audit capability, such as, How many people can access this resource? How
many accessed it this week?
Lockdown protects the system from dangerous intended or accidental changes.
Alerting highlights that immediately a violation is occurring or is attempted.
Safe housekeeping; for example, ensuring least-privilege access, that no redundant
entities exist and are assisting with role-based access requirements.
Analysis of how vulnerable a system might be with the ability to perform routine or ad hoc
health checks.
IBM Security zSecure Suite provides these capabilities. IBM Security zSecure also includes
the following capabilities to assist with the systems management of a z/OS data set
encryption implementation:
DFP segment administration
Audit of the ICSF
Enforcement and configuration options
Key label reporting that is associated with sensitive data sets
Verification whether a data set can be used (decrypted) on the system
Key label information
System input to IBM Security zSecure can include SMF records, the RACF (or SAF)
databases, and a proprietary zSecure Freeze data set that includes system information from
z/OS control blocks, among other sources.
For more information about zSecure, see IBM Security zSecure Suite.
This solution supports consolidating event data from thousands of devices and applications
across the infrastructure, including z/OS, and uncovering suspected security incidents in near
real time to support compliance and threat management. It uses the advanced IBM Sense
Analytics Engine to baseline normal behavior, detect anomalies, uncover advance threats,
and remove false positives.
Typically, many records are written to these repositories and managing these records (such
as alert, response, and archiving) can be difficult because the consumers of such information
can include a technical, management, security, planning, compliance, and audit audience.
Collating and aggregating such information might not be sufficient. A SIEM must efficiently
provide threat and urgency capabilities. The IBM QRadar SIEM offering adds analytics and
intelligence to IBM Z-sourced event notifications. Also, layering zSecure adds considerably to
the capability of QRadar to manage security events.
zBNA uses SMF workload data (SMF records 113 are required) to generate graphical and
text-based reports. zBNA also requires SMF record type 42 subtype 6. New fields were
added to the SMF record type and require DFSMS APARs (z/OS V2.3 requires OA52734).
zBNA can help your capacity planners estimate the effect of implementing data set encryption
by using your own performance data on current and projected hardware and software.
For more information, see IBM Z Batch Network Analyzer (zBNA) Tool.
The cost of widespread data set encryption on a z15 and z14 (compared to not encrypting on
the same systems might be a low single-digit percentage increase. On a z13, the cost might
be significantly greater and should be investigated carefully as part of any z13 data set
encryption project planning. Performance cost can be considerably higher on all generations
of processors before z14.
The use of IBM Z Data Compression (zEDC)3 for compression before encryption can
significantly reduce encryption costs. The less data (compressed data) that is encrypted and
decrypted means less CPU utilization; therefore, compress the data first, if possible.
3
Sequential extended-format data sets support zEDC compression, in addition to generic and tailored compression.
For VSAM extended-format data sets, only generic compression for a KSDS is supported.
Note: The zEDC compression with dataset encryption measurements were completed in a
controlled environment. Your results can vary, depending on individual workload,
configuration, and software levels.
The performance capability of the Crypto Express7S (new with z15) and Crypto Express6S
(available for the z14 and as carry forward to z15) co-processors also increased significantly,
compared to the Crypto Express5S and previous versions. Other functional improvements
were made in the Crypto Express7S and 6S, in addition to performance.
Security Administrator Identify data sets that must be Updates key label Encrypts sensitive
encrypted in RACF data set data
Tie encryption to user access profile Prevents
Create RACF profiles, assigning Modifies data set unauthorized
access to key labels profiles with key access to data
Permit the creation of encrypted data labels and access based on profiles
sets permissions to files Prevents
Provides access unauthorized
permission to access to creating
FACILITY class encrypted data
resource to allow sets
data set encryption
Storage Administrator Assign encryption to specific data Sets key labels for Manages SMS
(data set manager) classes data class by using constructs that
Manage backup, migration, and storage enable encryption
replication of encrypted data management Manages HA/DR
Manage backup, migration, and panels (ISMF) of data and keys
replication of keys Updates ACS
routines
Key Manager Manage keys (defining keys and Generates Manages the key
creating key labels); works with key encryption keys lifecycle from creation
management Defines key labels to destruction
Manage key changes, including in CKDS that are
encryption key transportation to other associated with
systems secure AES256
DATA or CIPHER
keys
ICSF Administrator Manage ICSF, CKDS Creates and Manages the ICSF
maintains CKDS environment
Security Auditor Update audit reports Lists the catalog, Determines encryption
Ensure audit and reporting and so on, to status to meet
compliance display encryption compliance
status
Uses zSecure for
audit
System Programmer Ensure system hardware and Ensures that all Manages hardware
software supports encryption systems that might and software level on
Work with Security Administrator to need to access the systems to support
determine whether migration action is data include the CKDS encryption
needed to allow creation of encrypted
data sets
User (data owner) Automatically create encrypted data Adds key label to JCL Automates creating
sets or IDCAMS DEFINE encrypted files and
Run applications, submits jobs CLUSTER accessing clear text
without code changes
To identify that PDSEs are to be viewed as a supported data set type on the system, define
the following FACILITY class resource as a discrete profile:
STGADMIN.SMS.ALLOW.PDSE.ENCRYPT
To identify that basic and large format data sets are to be viewed as a supported data set type
on the system, define the following FACILITY class resource as a discrete profile:
STGADMIN.SMS.ALLOW.DATASET.SEQ.ENCRYT
For more information about restrictions and dependencies for z/OS data set encryption, see
Data Set Encryption.
The following additional rules apply when encrypting basic and large format data sets:
Basic and large format data sets with an LRECL of less than 16 bytes for RECFM F(B(S))
or less than 12 bytes for RECFM V(B(S)) cannot be encrypted.
Basic and large format data sets with user blocks less than 16 bytes cannot be encrypted.
Basic and large format data sets with hardware keys (non-zero DCBKEYLE) cannot be
encrypted.
Basic and large format data sets opened for BDAM processing cannot be encrypted.
Checkpoint/restart will fail if an encrypted data set is open at the time of checkpoint, or if
the checkpoint data set is created as an encrypted data set.
EXCP applications that access encrypted basic and large format data sets must be
modified to successfully open the data set and to perform encryption/decryption of the
data.
Applications that provide the data set block size as input to the TRKCALC macro may
need to be modified to take into account the length of the block prefix added for encrypted
basic and large format data sets. For more information regarding the block prefix, refer to
section " Specifying a key label for a basic or large format data set" in publication IBM
z/OS DFSMS Using Data Sets, SC23-6855.
Note: As a best practice, for basic and large format data sets that are not accessed by
any EXCP application, consider converting them to encrypted sequential extended
format. Sequential extended format data sets support access method compression,
while basic and large format data sets do not.
If extended format data sets are to be used with data set encryption, complete the following
steps to prepare for requesting extended format on new data set allocation:
1. Set up an SMS policy to request extended format. A storage administrator can update
specific data classes through Interactive Storage Management Facility (ISMF) to request
extended format by using the DSNTYPE option with EXTR or EXTP.
2. A storage administrator can update automatic class selection (ACS) routines through
ISMF to select data classes that are enabled for extended format.
For more information about allocating extended format data sets, including guidelines and
restrictions, see Data Set Encryption.
Note: Only sequential extended format data sets and VSAM extended format KSDSs can
be compressed.
The following considerations apply when z/OS encrypted data sets are compressed:
When a data set is allocated as compressed format, DFSMS first compresses the data;
then, it encrypts the data.
If compressed format data sets are not yet used, complete the following steps to prepare for
compression on new data set allocation:
1. Set up an SMS policy to request compression. A storage administrator can update specific
data classes through the Interactive Storage Management Facility (ISMF) to request
compression by using the COMPACTION option.
2. A storage administrator can update automatic class selection (ACS) routines through
ISMF to select data classes that are enabled for compression.
For more information about allocating compressed format data sets, including guidelines and
restrictions, see Data Set Encryption.
For z/OS data set encryption, key labels can be associated with the generic profiles that are
protecting the data sets. Therefore, data set readability is determined by access to the
generic profile.
During planning, you might want to revisit your data set naming convention to ensure that you
can separate access to the data set to only those users that must access the data.
For more information about role separation considerations, see 3.3.1, “Organizing DATASET
resource profiles” on page 44.
When you are choosing which data sets to encrypt, you must ensure that those data sets are
not accessed during IPL before ICSF is started.
3.2.5 Using z/OS data set encryption with Db2, IMS, IBM MQ, CICS, and zFS
The following sections describe the use of z/OS data set encryption with IBM Db2, IBM IMS,
IBM MQ, IBM CICS, and IBM z/OS File System (zFS).
More support for Db2 data set encryption is available at Db2 v11 and Db2 v12.
For more information about planning and using data set encryption,see Data Set Encryption.
3.2.6 Copying, backing up, migrating, and replicating encrypted data sets
The following system services that manage the data set (as opposed to the data) ensure that
data remains in encrypted form:
During DFSMSdss1 functions, COPY, DUMP, and RESTORE.
During DFSMShsm functions, Migrate/Recall, Backup/Recover, Abackup/Arecover,
Dump/Data Set Restore, and FRBACKUP/FRRECOV DSNAME.
1
The backup, migration, and restore functions are performed by DFSMSdss and DFSMShsm. DFSMSdss and
DFSMShsm are priced features of z/OS.
The recovery system must include the same master keys and data set encryption keys.
Storage administrators (or others) that perform these system services do not require access
to the key label.
Note: The key material must be available on the target systems to access the encrypted
data sets.
When you use ADRDSSU, the program does not drive any ACS routines. Your data set
ITSO1.MY.DATASET includes the correct SMS and allocation attributes, but is not encrypted.
For more information, see ACS routines invoked for copying and importing data sets.
With z/OS data set encryption, you can reuse DATASET resource profiles or create more
granular resource profiles so that you can assign different keys to different applications or
business areas.
For example, if you have a resource profile PROD.APP1.*, you can assign a single key label
to cover all data sets that are protected by that profile. However, if you want to ensure that
certain information is available to only a subset of users, granularity can be added. You define
more granular resource profiles (such as PROD.APP1.ACCOUNTS.* and
PROD.APP1.BANKING.*) and associate a different key label with each resource profile to
enforce separation of access to information associated with the application.
However, if the storage administrator has NONE access to the key label that is protecting the
data set (by using the CSFKEYS class), the storage administrator cannot view the contents of
the data set.
When using EKMF, keys in the CKDS are managed by the EKMF key management system,
as a proxy for the key managers. This reduces the need to grant key managers full access to
all keys.
The security administrator must verify whether a user requires access to the data set or the
contents within the data set. Consider the following points:
If the user requires access to the data set to run a storage backup, they require access to
only the data set profile that protects it.
If the user needs access to read the encrypted data, they also need access to the key
label and CSFKEYS entry that is protecting it.
Only a small subset of users should have access to the key label.
2
A key data set (KDS) can be a cryptographic key data set (CKDS), public key data set (PKDS), or token data set
(TKDS).
You can think of ICSF as having the same essential role as other system components, such
as RACF or CATALOG. Would you expect CATALOG A/S or RACF to fail? This issue has
serious implications in terms of continuous availability and resiliency.
For more information about the best place in the IPL process for ICSF to start, see z/OS
Encryption Supports Requires ICSF to Start Early in IPL (FLASH10882).
Flash states: Customers who are planning to use the z/OS data set encryption function
must ensure that ICSF is started early in the IPL process. This requirement is especially
true if customers plan to encrypt SMF data sets or other data sets that are used during
z/OS initialization. As such, it is highly recommended that the following command is placed
early in the COMMNDxx member to ensure that a minimum delay occurs in the z/OS
initialization process:
S ICSF,SUB=MSTR (OR APPROPRIATE PROC NAME)
Specifying SUB=MSTR is necessary to allow ICSF to start before JES. Also, during z/OS
system shutdown, ICSF should be one of the last features to be stopped so that dependent
functions are not affected.
It is highly recommended ICSF be brought down after the JES address space is ended and
after SMF halt processing is started. Because ICSF is brought down after SMF is halted,
an SMF record might not be cut for the ending of ICSF.
For more information, see z/OS Cryptographic Services Integrated Cryptographic Service
Facility System Programmer's Guide, SC14-7508 (for ICSF FMID HCR77D1).
After you start ICSF with SUB=MSTR, you cannot access the ICSF job log by using the
System Display and Search Facility (SDSF) or vendor products, such as (E)JES. In that case,
you cannot browse the content of the ICSF job log (JCT not available) (see Figure 3-1).
Not having access to the ICSF job log has operational implications in that you can no longer
easily view the status of the ICSF startup, except by completing the following steps:
1. Search for ICSF startup messages in the system log (SYSLOG).
2. Check the time window where the ICSF messages were issued.
3. Determine whether a problem occurred during startup.
Typically, messages can be found in the ICSF job log, as shown in Figure 3-2.
3.4.3 Using the Common Record Format (KDSR) cryptographic key data set
The following cryptographic key data set (CKDS) formats are available:
A fixed-length record format with LRECL=252 (supported by all releases of ICSF).
A variable-length record format with LRECL=1024 (supported by HCR7780 and later
releases).
The common record format (KDSR) that is common to all key data sets with LRECL=2048
(supported by ICSF FMID HCR77C0 and newer).
You should use the newest format, the common record format (KDSR), for all your key data
sets. The KDSR format supports more functions to manage cryptographic keys, such as
tracking key reference dates, archiving keys, and setting cryptoperiods. For more information
about creating a common record format CKDS, see 4.3.2, “Creating a Common Record
Format (KDSR) CKDS” on page 81.
For more information about converting your CKDS to KDSR format, see the following
resources:
“Converting a CKDS” on page 82
Migrating to the common record format (KDSR)
You must plan the allocation, size, and format of the CKDS. If the data set is defined, you
should verify the size allocation and formatting. Consider reallocating the CKDS to a larger
size. For more information, see 8.3, “Refreshing the CKDS” on page 172.
Also, consider reformatting it to the recommended common record format (KDSR) with an
LRECL of 2048. For more information, see 4.3.2, “Creating a Common Record Format
(KDSR) CKDS” on page 81.
The KDSR format supports the functions and fields that are used for metadata. A sample of
this procedure is available in z/OS Cryptographic Services Integrated Cryptographic Service
Facility System Programmer's Guide, SC14-7508 (for ICSF FMID HCR77D1).
The amount of primary space required for the CKDS depends on the number of keys the
data set will initially contain.
The maximum record size of a DATA
Primary Space = initial key count * record size key = 140 byte header + 40 byte
For example: metadata section + 64 byte key token
Initial load of 10K keys, all fixed length tokens + 500 bytes of metadata = 744 bytes
The amount of secondary space depends on how many keys will be added.
3.4.5 Calculating the virtual storage that is needed for the CKDS
You must understand and plan for the system resources that are required for managing the
CKDS copy in virtual storage, particularly when the installation is deploying a large CKDS.
Note: “Very large” is a relative assessment (depending on the installation) and might be
expressed, for example, in terms of tens or hundreds of thousands of symmetric keys in
the CKDS or even millions of keys.
An in-storage copy of a CKDS that is not experiencing significant dynamic key creation or
deletion activity uses a stable amount of virtual storage by using a stable amount of system
backing resources. However, occasional but unavoidable ICSF functions (such as CKDS
refresh) generate a significant spike in the amount of virtual storage that is used, which
causes a greater temporary demand for system resources that are backing up that virtual
storage.
Because of these circumstances, it is important to calculate and plan for the system main
storage and auxiliary paging space that is required to support an active in-storage copy. For a
CKDS shared across a sysplex environment, every active ICSF in the sysplex includes an
equivalent resource requirement.
Tip: A preferred practice is to always allocate enough main storage to avoid the use of
auxiliary paging.
Each symmetric key in the CKDS is managed with one VSAM record. You must plan for the
appropriate amount of combined main storage and auxiliary paging space for each VSAM
record, per active ICSF.
A formula that can be used to calculate the required system virtual storage backing resource
for an active in-storage CKDS is shown in Example 3-3 on page 48.
All members of the CKDS sysplex must share the master key and key data set. With this
configuration, the following conditions are inherent:
Updates are automatically propagated across the sysplex (by way of signaling) to maintain
cache coherency.
Keystore management operations are coordinated across the sysplex.
Cryptographic key management for high availability with a single system image view of
cryptographic key material is shown in Figure 3-3 .
The various key management areas are briefly explained in the following sections.
For more information, see 1.2.4, “Regulations” on page 3, and 1.5.1, “Encrypting above and
beyond compliance requirements” on page 10.
For z/OS data set encryption, only 256-bit AES keys are supported. However, your
organization might include other crypto applications. If so, are those applications using strong
keys?
As of this writing, the National Institute for Standards and Technology (NIST) approves only
TDES and AES for symmetric encryption. For more information, see NIST.
We recommend the use of secure keys. A secure key is a data key that is encrypted by using
a master key. Therefore, all encrypted data is unreadable without a master key. The master
key should be created from two or more key parts by using a different key owner for each
master key part. By using this configuration, reading sensitive key material requires access to
the CKDS and access to all master key parts.
When clear keys are used and the CKDS is dumped, all keys are readable. By using secure
keys, dumping the CKDS does not yield any sensitive data.
Protected keys are not stored in the CKDS. They are created from secure or clear keys and
stored in memory. When ICSF is restarted, all protected keys are cleared from memory.
For more information, see 3.5.11, “Establishing a process for handling compromised
operational keys” on page 58.
The Central Processor Assist for Cryptographic Functions (CPACF) wrapping key is used to
rewrap (encrypt) a secure key after it is decrypted. The CPACF wrapping key is in a protected
area of the hardware system area (HSA), which is not visible to the operating system or
applications.
The following process is used to rewrap a secure key into a protected key3 (as shown in
Figure 3-4 ):
1. ICSF retrieves the data key (DK) that is stored as a secure key (encrypted by using a
master key [CCAMK]) in the CKDS.
2. ICSF starts rewrapping the data key by sending a command and the secure key to
Z firmware.
3. Z firmware sends the secure key with transport key4 (TK) information to Crypto
Express7S.
4. Crypto Express7S decrypts the secure key by using the master key and rewraps the data
key by using a transport key (TK).
5. The rewrapped data key (encrypted by using the transport key) is sent back to Z firmware.
6. Z firmware starts CPACF to unwrap and rewrap the data key by using a CPACF
wrapping-key5 to create a protected key.
7. Z firmware returns the CPACF wrapped-key (protected key) to ICSF.
8. ICSF caches the protected key in the ICSF address space and optionally returns the
protected key to the authorized caller.
3
The process is similar for Crypto Express6S
4 Transport keys are derived for each cryptographic domain by way of a key agreement protocol between Z firmware
and Crypto Express firmware.
5
CPACF Wrapping Key and Transport Key are in a protected area of HSA that is not visible to the operating system
or application.
With key labels, you can limit or prevent access to data through policies, as shown in the
following examples:
Storage administrators who manage data sets need access to only the data set and not to
the key label; therefore, the data is protected.
Different key labels can be used to protect different data sets, which is ideal for multiple
tenant environments or data set specific policies.
Administrators can be prevented from accessing data; utilities can process data
preserving its encrypted form.
Because creating key labels is an ongoing process, the naming convention for key labels
must be planned so that key labels are easier to maintain.
A key label can consist of up to 64 characters. The first character must be an alphabetic or a
national character (#,$, or @). The remaining characters can be alphanumeric, a national
character, or a period (.).
In your environment, you can use naming conventions that are based on the following
conditions:
LPAR that is associated with the key
Type of data that is encrypted
Owner that is associated with the key
Date that the key was created
Application that is intended to use the key
Generic profile to protect the key
Sequence number for the key
A recommendation for the naming convention of key labels is shown in the following example:
DATASET.<dataset_resource_description>.ENCRKEY.<seqno>
By using the DATASET (or other similar) keyword in the key label, the key administrator can
easily recognize that the key label is associated with a data set and be handled differently
from short-term keys (for example, archiving rather than deleting at “end of life”).
The corresponding sample RACF resource class to protect this data set generically is shown
in the following example:
CSFKEYS DATASET.<dataset_resource_description>.ENCRKEY.* ICSF(SYMCPACFWRAP(YES)
SYMCPACFRET(YES))
The reasoning is that if future data sets are allocated, they are automatically eligible to be
encrypted data sets. It is not recommended to change the ICSF segment for the generic entry
because you must ensure that the naming standards are being used before new allocations of
encrypted data sets are performed.
Also, plan how to transport an encrypted data set with a key label to another site as part of
your key label naming standard. You must ensure that the key label meets the naming
standard of that site; otherwise, you might need to rekey the data set before it is transmitted.
A simplified key lifecycle from creation (start) to deletion (destroyed) is shown in Figure 3-6 .
Keys can be defined with a valid start date and end date, which is known as the cryptoperiod.
A cryptoperiod can be used to control when a key is allowed for use in crypto operations.
The following terms also are used in referencing the key lifecycle:
Creating
Creating is the starting point for generating keys and creating key labels. You must
determine who has the authority to generated keys and create labels.
The administrators and users require access to the CSFKEYS profile entry that
corresponds to the name of the key label that is used. The administrators also require
access to the CSFSERV profiles that protect the callable services and utility panels.
Updating
The process of updating or changing key labels (rekeying) is performed in instances
where a key was determined to be compromised or a security policy states that data must
be rekeyed regularly. In both cases, a new key must be generated and a key label must be
defined. This process involves a reallocation and copy of the data set.
Deleting
In most installations the use of z/OS data set encryption is not recommended to delete key
labels that are used for data set encryption after they are created and tagged to a dataset.
Key deletion makes the data set inaccessible and unrecoverable. The preferred method to
retire a key is to use archiving.
Archiving
Archiving is the process of marking a key unusable rather than removing or deleting the
key completely. This operation is preferred over deletion because archived keys can be
recalled later, if needed.
Figure 3-7 Output of CSFSMFJ to show access to archive or inactive key labels
An option also is available to prohibit archiving for certain keys if you do not want
unexpected access errors for key labels that are associated with critical data sets.
Note: With EKMF, keys can be 'deactivated' which removes them from the CKDS, but
EKMF retains a copy of the key in the EKMF repository. EKMF can then reactivate and
restore the key to the CKDS if necessary.
Key deactivation allows removing the data set encryption key from the CKDS, while still
being able to restore the key if necessary.
Any attempts to access a deactivated key will behave similar to a deleted key and will not
produce the SMF records that attempts to access an archived key would.
See also Chapter 10, “IBM Enterprise Key Management Foundation Web Edition” on
page 217.
Based on the industry regulations for which you must comply, you might choose to use either
approach, or both. You also must consider the cost and benefit for your environment when
Approach 1 is used versus Approach 2.
Some regulations require keys to have a clearly defined cryptoperiod. When the end date is
reached, the key reached its end of life and can be revoked or destroyed. The data that is
protected by that key is destroyed or reencrypted with a new key.
ICSF enables cryptoperiods by supporting key validity start and end dates for keys that are in
the CKDS. This information can be found in the metadata view of the key. ICSF Option 5 can
be used to display the metadata of a particular key.
Attempts to use keys within their start and end dates are successful. Attempts to use keys
outside of their start and end dates fail with a S213 access error and RC8 RSND0E error code.
Cryptoperiods are supported for z/OS data set encryption; however, any data sets must be
reencrypted (or rekeyed) before the key expires. For this reason, some organizations might
decide to not establish cryptoperiods for data set encryption keys.
Note: For more information about how to rekey a data set, see Chapter 7, “Maintaining
encrypted data sets” on page 151.
To audit cryptoperiods, you can view SMF Type 82 Subtype 40 ICSF audit records. For more
information, see 6.6, “Auditing key lifecycle transitions” on page 146 for more information.
To identify expiring keys, you can regularly run the ICSF_KEY_EXPIRATION z/OS Health
Check. For more information, see “Key expiration check” on page 66.
Key handling
When a key is compromised, the key should not be available for use and any attempted use
of the key should be audited.
The following options are available to prevent a key from being used:
Set the key validity end date to the current date. For more information, see Chapter 7,
“Maintaining encrypted data sets” on page 151.
This process forces the key to expire the next day. However, the key can still be used on
the current date. SMF type 82 subtype 30 audit records shows any attempts to use the
compromised key.
Mark the key as archived and disable the use of archived keys. For more information, see
Chapter 7, “Maintaining encrypted data sets” on page 151.
This process forces the key to be unavailable the same day. Any archived keys that are
unrelated to the compromise also are unusable. SMF type 82 subtype 30 audit records
show any attempts to use the compromised key.
Delete the key.
This process forces the key to unavailable the same day. No audit records are created that
show attempts to use the compromised key.
You might decide to use a combination of these options, depending on the risk.
Data handling
When a key is compromised, any data that was protected with the compromised key should
be identified and rekeyed. For more information about how to identify encrypted data sets and
rekey data sets, see Chapter 7, “Maintaining encrypted data sets” on page 151.
New master keys are loaded into the NMK register. When the master key is set or the KDS is
initialized, the NMK register contents are moved to the CMK register. The CMK register
contents are then moved to the OMK register, and the NMK register is cleared. In this way,
keys that are encrypted by the OMK can still be used on the system.
For more information about loading a master key, see “Loading master keys” on page 60.
For more information about reenciphering the key data sets, see Chapter 7, “Maintaining
encrypted data sets” on page 151.
Note: Remember to perform a change master key operation twice to completely remove a
compromised master key from the environment.
The following types of keys must be managed in a z/OS data set encryption environment:
Master keys
These keys are stored in a Crypto Express adapter and used to encrypt operational keys.
Operational keys
These keys are stored on the host system in a keystore (such as the CKDS) or in memory.
They are used to perform various cryptography operations.
For more information about the key types that are associated with z/OS data set encryption,
see 1.6.2, “IBM Z cryptographic system” on page 15.
Available tools
The tools that are available for key management in a z/OS data set encryption environment
and which keys you can manage with them are listed in Table 3-3.
Note: TKE features limited support for operational keys. Users typically manage no more
more than 50 operational keys by using TKE.
The operational keys that are used with data set encryption are stored in the CKDS and
returned to DFSMS to perform the encryption and decryption with CPACF. Every record in the
CKDS includes a corresponding key label.
z/OS data set encryption uses symmetric key encryption and the same key to encrypt and
decrypt data.
Figure 3-9 ICSF 5.5.7 option panel to manage keys in the CKDS
6
For EKMF Web, see Chapter 10, “IBM Enterprise Key Management Foundation Web Edition” on page 217.
7 EKMF Workstation or Web Edition
Tip: EKMF manages keys on multiple systems and eliminates the need to manually
transfer keys between systems.
Note: Any keys that were created between the time of the backup and the date of recovery
are lost. Therefore, it is important that backups are taken regularly.
We recommend manually backing up the CKDS before a major operation (such as rotating
data set encryption keys or manually transporting a key from one CKDS to another). After the
operation is completed and the CKDS contents are verified, the backup can be deleted. If
verification is unsuccessful, the CKDS can be recovered from the backup and ICSF can be
refreshed to use the backup CKDS.
Tip: The EKMF key management system holds a copy (backup) of all keys managed by
EKMF in a separate key repository (Db2 database).
The CKDS can be backed up and restored by using one of the following methods:
Manual backup and restore
Automated backup and restore:
– Data set level
– Volume level
For more information about these methods and tools, see 9.1, “Backing up and restoring data
set encryption keys” on page 188.
For information about auditing and compliance see 3.6.4, “Auditing and compliance” on
page 68 and 6.9, “Auditing Key management in EKMF” on page 149.
IBM flags fixes in numerous categories, including High Impact PERvasive (HIPER), Program
temporary fix in Error (PE), and Pervasive. Security Vulnerability (SECINT) is of particular
importance. SECINT is a classification (SOURCEID) of vulnerability PTFs that are related to
Common Vulnerability Scoring System (CVSS).
Security and Integrity Vulnerability APARs address problems that are associated with
potential unauthorized access or potentially compromised system controls. Because of the
highly sensitive nature of any such identified defects, the content is classified as “IBM
Confidential” and access is restricted to those APARs. Access is permitted to authorized
customers through the IBM z Systems® Security Portal.
Access to the Portal can be requested by using the Systems integrity page on the IBM Z
website (terms and conditions apply).
The IBM Health Checker for z/OS can be accessed by way of the System Display and Search
Facility (SDSF) by using the CK command. The health checker can help identify potential
problems before they affect availability or cause outages. ICSF provides a set of health
checks to inform of potential ICSF problems.
For more information about the relevant health checks, see the following publications (log in
required):
IBM Health Checker for z/OS: User’s Guide, SC23-6843-30
z/OS Cryptographic Services ICSF Administration Guide, SC14-7506-09
z/OS Cryptographic Services ICSF Administration Guide, SC14-7506
z/OS Cryptographic Services ICSF Administration Guide, SC14-7506-07
These publications provide more information about the following health checks:
ICSF_COPROCESSOR_STATE_NEGCHANGE
ICSF_DEPRECATED_SERV_WARNINGS
ICSF_KEY_EXPIRATION
ICSF_MASTER_KEY_CONSISTENCY
ICSF_OPTIONS_CHECKS
ICSF_UNSUPPORTED_CCA_KEYS
RACF_SENSITIVE_RESOURCES
RACF_CSFSERV_ACTIVE
You can also check the health checker components that start with ICSF.
Note: The key data sets must be in the KDSR format to have key material validity dates.
If the process is followed and you have the basic knowledge of your encryption criteria, the
easiest way to backout is to copy the encrypted data set into a non-encrypted data set. If the
implementation requires a backout for all encrypted data sets, this process must be done for
each z/OS data set that was encrypted.
To ensure that no other z/OS data sets become encrypted, check that the FACILITY profile
for STGADMIN.SMS.ALLOW.DATASET.ENCRYPT includes a UACC(NONE). A backout procedure also
includes removing DATAKEY statements from the RACF data set profiles.
Attention: Deleting key labels from the CKDS makes the associated encrypted data sets
unusable.
To protect data, the means for protecting the data must also be secured.
There are several best practices that can be followed to reduce or eliminate the risk of
compromise by malicious actors. These practices are reflected in various standards and
regulations (see 1.3, “Standards and regulations overview” on page 4).
Each standard and regulation have different levels of detail and focus, but overall, their goal is
to ensure the protection of information and to reduce or eliminate the possibility of a security
compromise.
If a regulation applies to the encrypted data, the key management process may also be within
the scope of the regulation and be required to be compliant.
Having a log is important for monitoring which operations/actions that have been done and
when required to be compliant with regulations, the audit log becomes a tool which the
organization can use to demonstrate compliance.
The EKMF key management system provides an audit log which shows what actions have
been done.
In addition, EKMF key templates can be used to document compliance with a process/policy
with specific requirements for keys (see 6.9, “Auditing Key management in EKMF” on
page 149).
Auditing the z/OS data set encryption environment and the EKMF key management system is
described in Chapter 6, “Auditing z/OS data set encryption” on page 143.
Where possible, best practice for VSAM and sequential data sets is for encrypted data sets to
be created as extended format and should be compressed in the access methods before
encryption.
Note: At the time of this writing, the latest ICSF FMID available is HCR77D1. For cross
reference information see z/OS: ICSF Version and FMID Cross Reference.
We do not recommend to automatically use SMS data classes for data set encryption
because this configuration can cause all new allocations to be encrypted before the
environment is fully prepared to implement.
Also, be aware of the implications of the use of SMS data classes for the allocation of
encrypted data sets after the crypto environment is in place because it gives the storage
administrator the authority to manage encryption of data sets, which might not be intended.
For more information about other methods of implementation that reference how SMS can be
used for setting up, see Chapter 5, “Deploying z/OS data set encryption” on page 119.
Restricting non-security administrators from encrypting data sets ensures that administrators
can be sure that encryption is not enabled before the environment is fully configured.
Administrators also can be sure that a key management policy is in place, and that they have
oversight on which data sets are encrypted with which keys.
Note: The DATASET resource that protects the CKDS must not be encrypted with data
set encryption because the key is rendered inaccessible at ICSF startup. The keys in
the CKDS can be encrypted by using a master key. For more information, see 1.6.2,
“IBM Z cryptographic system” on page 15.
The RACF profile that is used for protecting the CKDS data set is listed in Table 4-1 on
page 72.
DATASET <KDS_dsname> Allow users access to the CKDS and PKDS data sets PERMIT
‘<KDS_dsname>’
ID(groupid)
ACCESS(READ)
Protecting encrypted data setsAccess to data sets is provided by the DATASET resource
class. For more information about the DATASET class, seez/OS Security Server RACF
Security Administrator’s Guide,SA23-2289-40.
For more information about data set encryption, see other resource classes that might be
needed, such as CSFKEY, CSFSERV, and FACILITY.
RACF profiles that are used for protecting encrypted data sets are listed in Figure 4-2.
DATASET <dsname> Allow users access to the data set. PERMIT ‘<dsname>’
ID(groupid)
ACCESS(READ)
DFP segment to profile Allow encryption of data set through ALTDSD ‘<dsname>’
DFSMS access methods by using a key UACC(NONE)
label that is specified in DFP segment. DFP(RESOWNER(owner)
DATAKEY(keylabel_name))
Note: For data set encryption, a key
label can also be supplied by way of
other sources, such as JCL and SMS
data class.
CSFDKCS ICSF panel utility - Load master keys using ISPF See CSFCRC
panels example
*RECOMMENDED* to turn on AUDIT(ALL)
CSFSMK ICSF panel utility - Set master keys using ISPF See CSFCRC
panels example
*RECOMMENDED* to turn on AUDIT(ALL)
CSFCMK ICSF panel utility - Change master keys using See CSFCRC
ISPF panels example
*RECOMMENDED* to turn on AUDIT(ALL)
Some RACF profiles that restrict who can issue the START, STOP, FORCE, or SETICSF operator
commands are described next (see Example 4-1).
Note: ICSF does not support the CANCEL or MODIFY operator commands.
MVS.STOP.STC.ICSF.*
MVS.STOP.STC.ICSF
MVS.FORCE.STC.ICSF.*
MVS.FORCE.STC.ICSF
MVS.SETICSF.*
Replace ICSF with your actual proc name; for example, CSF if it is different in your
installation.
Typically, RACF generic profiles are available that restrict who can issue the MVS START, STOP,
and FORCE commands. The specific PERMIT command that you must issue depends on how
your RACF administrator defined the profiles in class OPERCMDS to protect these
commands.
You must repeat the same commands and profiles for the STOP, FORCE, and SETICSF
commands.
For more information about protecting operator commands, see Planning MVS operations.
For more information about controlling the use of operator commands, see Administering the
use of operator commands.
For more information related to these services, see z/OS Cryptographic Services.
If the user is authorized from the SDSF perspective, SDSF generates and issues the
command on the user’s behalf under the users own ID, but originating from the SDSF
console. By using this method, you can authorize the console commands that are generated
by SDSF, as shown in the following example:
PERMIT JES2.STOP.ICSF CLA(OPERCMDS) ID(*) WHEN(CONSOLE(SDSF))
If the user directly issues the command on their own (you gave them console access or the /
command in SDSF), it does not originate from CONSOLE SDSF.
When a key is archived, an SMF Type 82 Subtype 30 record is created for each attempted
use and an optional job log message is displayed.
You can decide to allow or deny archived keys to be used for cryptographic operations with
the CSF.KDS.KEY.ARCHIVE.USE resource in the XFACILIT class. When that resource is defined,
ICSF allows archived keys to be used for crypto operations. When that resource is undefined,
ICSF fails any attempts to use an archived key.
For more information, see 5.3, “Generating a secure 256-bit data set encryption key” on
page 125.
CSFSERV
For all methods, the CSFSERV class must be active and RACLISTed. It should also be
enabled for generic use. To enable CSFSERV for generics, use:
SETROPTS CLASSACT(CSFSERV)
SETROPTS RACLIST(CSFSERV)
SETROPTS GENERIC(CSFSERV)
The CSFSERV class should be initially set to disallow access to all users, as shown in the
following example:
RDEFINE CSFSERV * UACC(NONE)
Granting access to CSFSERV resources depends on the key generation method. The
process includes the following steps:
1. Define the profiles.
– For ICSF KGUP:
RDEFINE CSFSERV CSFKGUP UACC(NONE)
RDEFINE CSFSERV CSFKGN UACC(NONE)
– For ICSF Panel Utilities and APIs:
RDEFINE CSFSERV CSFKGN UACC(NONE)
RDEFINE CSFSERV CSFKRC2 UACC(NONE)
RDEFINE CSFSERV CSFKRR2 UACC(NONE)
2. Grant the users (preferably groups) access permission as shown in the following example:
– For ICSF KGUP:
PERMIT CSFKGUP CLASS(CSFSERV) ID(groupid) ACCESS(READ)
PERMIT CSFKGN CLASS(CSFSERV) ID(groupid) ACCESS(READ)
– For ICSF Panel Utilities and APIs
PERMIT CSFKGN CLASS(CSFSERV) ID(groupid) ACCESS(READ)
PERMIT CSFKRC2 CLASS(CSFSERV) ID(groupid) ACCESS(READ)
PERMIT CSFKRR2 CLASS(CSFSERV) ID(groupid) ACCESS(READ)
3. Refresh the class, as shown in the following example:
SETROPTS RACLIST(CSFSERV) REFRESH
Activating the CSFKEYS class is the only preparation step. For more information about
granting access to the CSFKEYS resources, see 5.7, “Granting access to encrypted data
sets” on page 138.
For each encrypted data set, its key label is stored in the data set catalog. The key label is not
typically considered sensitive information; however, it identifies the data set encryption key,
which is sensitive. Therefore, the use of secure keys is recommended.
Data-encrypting keys are enciphered with a master key to create a secure key that is stored in
CKDS. The master key is stored securely in the HSM of an assigned Crypto Express adapter.
When a secure key is later accessed, the master key is used in the transformation to a
protected key, as described in 3.5.6, “Using protected keys for high-speed encryption” on
page 51.
Data set encryption is flexible, which allows as much granularity as wanted when key labels
are identified for data sets. The number of key labels and encryption keys that are used
across z/OS data sets is unlimited.
The data set encryption management process is provided by z/OS through SAF (interfacing
with RACF3), ICSF, DFSMS, and EKMF.
After a key label is stored in the catalog for an encrypted data set, it cannot be altered. Any
subsequent change to SAF or RACF data set profile or data class does not affect existing
data sets. This approach ensures that data cannot be tampered with.
SAF or RACF policies define the users that are authorized to use distinct key labels and ICSF
callable services. The CSFKEYS resource class controls access to cryptographic keys in the
ICSF CKDS and enables the use of protected key. The CSFSERV resource class controls
access to ICSF callable services.
2
DATA keys or CIPHER keys; CIPHER keys require z14 and later w/ Crypto Express6S or newer and ICSF
HCR77C1 or later.
3 An equivalent access control software security system, such as CA ACF2 for z/OS, also can be used.
Figure 4-1 Using a key label to retrieve a secure key from CKDS
The following key label process steps are shown in Figure 4-1:
1. At data set allocation, DFSMS checks if a key label exists in the DATASET class profile,
which protects the data set and saves the key label.
2. At data set open, DFSMS checks if the user is authorized to the class resource that
protects the saved key label.
3. DFSMS specifies the saved key label to ICSF and requests to retrieve the secure key from
the CKDS.
4. ICSF uses the key label that is specified by DFSMS to locate the secure key in the CKDS.
5. ICSF calls the Crypto Express adapter to convert the secure key to a protected key by
using the master key.
For more information about creating a protected key from a secure key, see 3.5.6, “Using
protected keys for high-speed encryption” on page 51.
The maximum number of domains matches the maximum number of LPARs that is available
on the server. For example, the z14 supports up to 85 LPARs; therefore, the Crypto Express
adapters support up to 85 domains.
For z/OS data set encryption, at least two Crypto Express adapters must be configured as
CCA coprocessors.
The sample job in SYS1.SAMPLIB(CSFCKD3) can be used as a template. Our JCL is shown
in Example 4-3.
ICSF CKDS must include a single volser that is specified in the VOLUMES parameter. Do not
code more than one volume or specify VOLUME(*).
Converting a CKDS
If CKDS is available to convert to KDSR format, the conversion can be done by calling the
CSFCRC callable service or by using the ICSF panels. While the conversion is happening, all
updates to the key data set that is converted are suspended.
At the end of the conversion, all systems in the sysplex that share the key data set use the
KDSR format key data set as the active key data set. All new updates are made to the KDSR
format key data set.
Complete the following steps to convert a key data set to KDSR format by using the ICSF
panels:
1. In the ICSF Primary Menu panel, select option 2 KDS MANAGEMENT and press Enter.
2. In the ICSF Key Data Set Management panel, select the type of key data set option 6
COORDINATED CKDS CONVERSION and press Enter.
3. In the next panel, select the COORDINATED xKDS CONVERSION option and press
Enter.
4. When the ICSF Coordinated KDS conversion panel appears, complete the required fields
and press Enter.
5. Specify the new KDSR format CKDS to switch to (see Example 4-4 on page 83) then
press Enter to perform a dynamic, nondisruptive conversion.
For more information, see Migrating to the common record format (KDSR) key data set.
If you do not intend to share the CKDS across multiple systems, the following option is used:
CKDSN($SYSNAME.NEW.SCSFCKDS)
The SYSPLEXCKDS option can be used for a single system or multi-system sysplex.
Display the current options and defaults by using the ICSF utility panel option 3.1 (OPSTAT
options) or the D ICSF,OPT command. For more information, see 8.2, “Viewing ICSF options”
on page 170.
Note: SMF must be configured to record ICSF events and set the time interval for
recording. Also, ICSF must be configured to track the wanted usage statistics.
For more information about configuring SMF, see 4.4.2, “Configuring SMF recording
options in SMFPRMxx” on page 106.
Tip: The ALG option can help you identify users that are using weak keys (such as
DES).
Limited support is available for key generation, key derivation, and key import.
STATSFILTERS controls the identifier that is used to collect usage information. Usage is
tracked by unique user and job identifiers. The user identifier consists of an address space
user ID and a task level user ID.
For applications, such as CICS that can generate a unique task level user ID for each
transaction, many SMF records can be generated. To prevent this problem, use the
STATSFILTER(NOTKUSERID) option. Specifying STATSFILTER(NOTKUSERID) ignores the task
level user ID and uses only the address space user ID when the job or user identifier is
created.
The SETICSF OPT,STATS command can be used to enable STATS, as shown in Example 4-6.
The CSFPARM DD statement points to the CSFPRMxx PARMLIB member that contains the
ICSF installation options.
Note: ICSF must be started before any components that intend to access encrypted data
sets (for example, SMF data sets or data sets that are used during z/OS initialization). For
more information, see 3.4.2, “Starting ICSF early in the IPL process” on page 46.
Review the ICSF the SYSLOG and check that you see the following messages:
CSFM126I CRYPTOGRAPHY - FULL CPU-BASED SERVICES ARE AVAILABLE
CSFM001I ICSF INITIALIZATION COMPLETE
The following high-level process is used to load the new master key registers:
1. Generate a random number for the AES master key part.
2. Generate a checksum for the AES master key part.
3. Load the first AES master key part.
4. Repeat Steps 1 -3 for the wanted number of middle key parts.
5. Load the final AES master key part.
6. Generate and load the remaining master keys.
7. Verify the new master key registers.
Attention: Although this scenario shows a change of MASTER KEY for AES, the process
is the same for all other types of master keys (DES, RSA, and ECC).
2. Check that the new master key register is empty by selecting action character to s (status)
and press Enter (see Figure 4-4).
3. View the register status on the Coprocessor Hardware status panel (see Figure 4-5).
Save
these
values
securely !
5. Press F3 to return to the Random Number Generator panel and choose Option 4 -
Checksum. The Checksum Panel with the random numbers pre-populated is shown in
Figure 4-10.
7. View the possible key type values and lengths (see Figure 4-12).
Important: It is strongly recommended to save a copy of the key value and checksum,
otherwise the master key cannot be recreated and you will not be able to decrypt your
data, if the key gets lost.
9. Press F3 to return to the Utility Panel. Press F3 to return to the ICSF Main panel.
3. Press F3 to return to the Coprocessor Management panel. Enter s next to the crypto
feature to view its status (see Figure 4-16).
The Coprocessor Hardware Status panel is shown in Figure 4-17. Notice that the new
master key register is empty.
Figure 4-17 Coprocessor Hardware Status panel with empty New Master Key register
Note: To simultaneously load multiple Crypto Express adapters (that are assigned to
the current LPAR or domain) with the same master key, enter e next to all of the
necessary cryptographic adapters and press Enter.
5. You see the Master Key Entry panel. For the Key Type, enter AES-MK; for Part, enter first;
and for Checksum enter, DA (see Figure 4-19). Then, press Enter.
Repeat the steps for each intermediate AES master key part. Each key custodian generates
and loads (and securely saves) the following individual key parts:
Generate a random key (and save the results) by using ICSF Option 5.3.
Generate a checksum, VP (and save the results) by using ICSF Option 5.4.
Load the key part into the new master key register by using ICSF Option 1.e (with part
value entered as MIDDLE).
After all intermediate (middle) key parts are generated and saved, the final AES master key
part must be loaded. This process is described next.
2. Use the Random Number Generator to generate numbers for the final part. In the Parity
Option, enter RANDOM and press Enter (see Figure 4-22).
Figure 4-23 Checksum and Verification and Hash Pattern panel before Checksum
The results of final key part generation are shown in Figure 4-24.
Figure 4-24 Checksum and Verification and Hash Pattern panel with final key part
4. In the Master Key Entry panel, enter AES-MK for the Key Type. Enter FINAL for the Part
type, and enter C2 for Checksum (see Figure 4-25 on page 98). Press Enter.
Note: If you enter an incorrect checksum value, ICSF warns you with a message
“Incorrect checksum value” in the upper right corner of the panel. Ensure that you enter
the correct value that was reported as the generated checksum value.
5. Check the Master Key Entry panel for the new master key register. Confirm that the status
is FULL and the final key part VP matches the checksum value (see Figure 4-26).
Successful !
6. Press F3 to return to the Coprocessor Management panel. Enter s next to the crypto
feature to view the status (see Figure 4-27). Press Enter.
7. Review the Coprocessor Hardware Status panel (see Figure 4-28 on page 99), which
shows the new master key register as FULL.
E457BC3E97834ACD
If other members in your sysplex share the CKDS and use a different domain number, repeat
the process for each member of the sysplex (except for steps 1 and 2).
In this scenario, these steps were not repeated for the second member (SC75) of the sysplex,
which is sharing the CKDS. When we attempted to perform the coordinated master key
change, we received the error messages that are shown in Figure 4-29.
If your system is using multiple coprocessors, they must have the same master keys. When
you load a new master key in one coprocessor, you load the same new master key in the
other coprocessors. Therefore, to reencipher a key data set under a new master key, the new
master key registers in all coprocessors must contain the same value.
When you start or reencipher a CKDS or PKDS, ICSF places the verification pattern for the
master keys into the key data set header record.
CKDS initialization can be performed by using the CKDS Management ICSF panel (see
Example 4-10 on page 101).
1 CKDS OPERATIONS -
Initialize a CKDS, activate a different CKDS,
(Refresh), or update the header of a CKDS and make
it active
2 REENCIPHER CKDS - Reencipher the CKDS prior to changing a symmetric
master key
3 CHANGE SYM MK - Change a symmetric master key and activate the
reenciphered CKDS
4 COORDINATED CKDS REFRESH - Perform a coordinated CKDS refresh
5 COORDINATED CKDS CHANGE MK - Perform a coordinated CKDS change master key
6 COORDINATED CKDS CONVERSION - Convert the CKDS to use KDSR record format
7 CKDS KEY CHECK - Check key tokens in the active CKDS for format errors
For more information, seeSetting up and maintaining the cryptographic key data set (CKDS).
The Cryptographic Services ICSF: System Programmer’s Guide provides helpful hints for
ICSF first-time startup.
For more information about a checklist for first-time startup, see Checklist for first-time startup
of ICSF.
Note: When you start ICSF with SUB=MSTR (as recommended), you cannot access the
ICSF job log by using the System Display and Search Facility (SDSF) or vendor products,
such as (E)JES. In this instance, you cannot browse the content of the ICSF job log.
When you display the ICSF address space job log, you can expect to see the messages that
are shown in Example 4-11.
STATS
STATS information can also be obtained by issuing the Display ICSF command from the
system console. STATSFILTERS information is not displayed. All usage (engines, services,
and algorithms) that is being tracked on SC60 (also known as PLEX60) is shown in
Example 4-12.
SETICSF OPT,STATS
To change the cryptographic usage settings to monitor only crypto engine usage across a
sysplex, issue the SETICSF OPT,STATS=(ENG),SYSPLEX=YES command.
Note: STATSFILTERS is not supported. You can use SETICSF OPT,REFRESH to change the
setting of STATSFILTERS
SETICSF OPT,REFRESH
To refresh common options that were updated in the CSFPRMxx PARMLIB member, issue
the SETICSF OPT,REFRESH command. For more information about supported options for
refresh, see SETICSF.
The system displays the following information (message CSFM668I) about the active key
data sets (KDS) on the system or sysplex:
The data set name for each active KDS (CKDS, PKDS, and TKDS).
The format of the KDS (for example, KDSR is the recommended format to use).
Possible values are KDSR, FIXED, and VARIABLE.
The communication level in place for the KDS (for example, 3). This information is
displayed in a sysplex environment only.
Whether the KDS is being shared in a sysplex group (for example, Y/N).
The MKVPs initialized in the KDS (for example, DES AES).
The following values are used:
– DES, AES, or both for CKDS
– RSA, ECC, or both for PKDS
– P11, RCS, or both for TKDS
The active domain (84), number of requests (1185 for the device), and firmware level of the
device (for example, 6.0.6z) are shown in Example 4-15.
Select option 1 COPROCESSOR MGMT to see the results, as shown in Example 4-17.
CRYPTO SERIAL
FEATURE NUMBER STATUS AES DES ECC RSA P11
------- -------- -------------------- --- --- --- --- ---
6C00 DV785304 Active A A A A
6A01 N/A Active
The COPROCESSOR MGMT selection results give the status of your crypto adapters, where
“A” stands for active (which is expected).
If you select S, you see the information that is shown in Example 4-18 on page 105.
The Current Master Key register field that must be VALID and Status must be ACTIVE is
shown in Example 4-18.
4.4.1 Enabling SMF record types 14, 15, 42, 62, 70, 80, 82, and 113
This section describes the primary SMF records and subtypes that are used for data set
encryption and CKDS auditing. It also provides a brief overview of the utilities that are used
for data set encryption and audit requirements.
The SMF records, their subtypes, and descriptions are listed in Figure 4-7.
14 and 15 Encrypted sequential data sets (extended format, basic format and large
format) and PDSEs.
The following important options must be considered for z/OS data set encryption:
TYPE
For z/OS data set encryption, ensure that the SMF types include 14 (more specifically,
14:9), 15, 42 (more specifically, 42:6), 62, 70 (more specifically, 70:2), 80, and 82 (more
specifically, 82:31, 82:40, and 82:44).
INTVAL
The SMF global recording interval is used for SMF Type 82:31 and other record types. The
system default is 30 minutes of SMF recording. At the end of the interval, SMF records are
written to data sets or log streams.
SYNCVAL
The SMF global recording interval is used for SMF Type 82:31 and other record types. The
system default is an offset of 0 from the top of the hour. From the top of the hour, SMF
records for INTVAL number of minutes and then writes the SMF data to data sets or log
streams.
For critical services (for example, set master key) enable RACF to audit successes to produce
an audit record for that event. If the record is not needed, use the default and audit only the
failure.
The following CSFSERV profiles are accessed when performing a master key change, which
should be set to audit successes:
CSFDKCS: Enter Master Key Part
CSFCRC: Change Master Key
CSFSMK: Set Master Key
We recommend turning on auditing by using the following commands before the start of the
master key change process:
RALTER CSFSERV CSFDKCS UACC(NONE) AUDIT(ALL) for entering master keys with option 1.E
RALTER CSFSERV CSFCRC UACC(NONE) AUDIT(ALL) for changing master key with option 2.1.5
5 COORDINATED CKDS CHANGE MK
RALTER CSFSERV CSFSMK UACC(NONE) AUDIT(ALL) for setting master key (option 2.4)
The following Monitor I gathering options on the REPORTS control statement are available:
CRYPTO measures cryptographic hardware activity
The EKMF workstation can add a MAC to each audit record for integrity validation.
Logging: When enabled in the EKMF workstation's audit log settings, the EKMF
Workstation will send its audit log to SMF via the EKMF agent. By default, the EKMF Agent
will require that SMF logging is enabled for any workstation that connects to the EKMF
Agent.
In order for the SMF logging to be done, RACF must be setup for audit of the FACILITY
class profile for resource KMG.EKMF.SMF.
The following is an example of defining the resource with audit and permitting the EKMF task
user id:
The RACF READ access check (RACROUTE REQUEST=AUTH) on the FACILITY class
resource KMG.EKMF.SMF is done with a log-string where the content is the audit record from
the EKMF Workstation.
When EKMF logs to SMF, the records are written as type 80 (Authorized access) for
FACILITY class resource KMG.EKMF.SMF where the audit data is placed in the relocate
section variable data - data type 46 (X'2E') 1-255 bytes.
For each CKDS keystore, for which EKMF should manage keys, it is required that an EKMF
Agent is running on the same z/OS system.
When CKDS sysplex sharing is used, only one EKMF Agent is needed for a sysplex.
EKMF must be configured with information about the location of EKMF agents as well as the
keys it should create.
Keys are defined by key templates that ensures a consistent key creation process and
distribution to predefined CKDS keystores with key labels that follows a predefined key label
naming standard.
The EKMF task user ID must have READ access to this resource.
The following commands (Example 4-20) make the EKMF agent trust EKMF Web and
Workstation, using 'EKMF' as the task user ID and
8A7A87509C40A5ED228E05DED51DD690EEFAC4C49B83E0A9A288B515D6745102
Example 4-20 Establishing trust between EKMF Web and EKMF Agent
RDEFINE XFACILIT -
KMG.WS.8A7A87509C40A5ED228E05DED51DD690EEFAC4C49B83E0A9A288B515D6745102
PERMIT -
KMG.WS.8A7A87509C40A5ED228E05DED51DD690EEFAC4C49B83E0A9A288B515D6745102 -
CLASS(XFACILIT) ACC(READ) ID(EKMF)
To authorize the automatic logon, define a RACF resource profile in the XFACILIT class:
KMG.WEBCLIENT.<client user ID>
The EKMF agent task user ID must have READ access to the resource.
For a specific EKMF Web key fingerprint there must be an authorization to use the
&WEBCLIENT for logon. Define a RACF resource profile in the XFACILIT class:
KMG.LG. <64-character-hex-fingerprint>
The EKMF agent task user ID must have READ access to the resource.
The following commands, shown in Example 4-21, are used to make the EKMF Web able to
logon as EKMFCLT using 'EKMF' as the EKMF agent task user ID, &WEBCLIENT
(EKMFCLT) in KMGPARM and
‘8A7A87509C40A5ED228E05DED51DD690EEFAC4C49B83E0A9A288B515D6745102’
PERMIT -
KMG.LG.8A7A87509C40A5ED228E05DED51DD690EEFAC4C49B83E0A9A288B515D6745102 -
CLASS(XFACILIT) ACC(READ) ID(EKMF)
An EKMF client user ID must be given permission to be used with an EKMF agent running
under the specific task user ID. Define a RACF resource profile in the FACILITY class:
KMG.EKMF.KMGPRACF.<task user ID>
The client user ID(s) must have READ access to the resource. Example 4-22 shows the
command used to permit client user 'EKMFCLT' to be used with an EKMF agent running as
user 'EKMF'.
Keystores
A Keystore in EKMF Web is defined by the network address of the z/OS system that holds the
CKDS and the port number of the EKMF agent running on that z/OS system. For details, see
10.3.1, “EKMF Keystores” on page 223.
Before EKMF Web can connect to an EKMF agent, the EKMF agent must be configured to
trust EKMF Web.
A keystore is defined in EKMF Web by specifying a name, a network address, a port number
and a public key hash, as shown in Figure 4-30 on page 111:
Name: The name can be chosen freely and is only used as an
identification of the keystore in the EKMF Web application.
Address or host name: The address the network address of the z/OS system where
the keystore and EKMF agent resides. This information should
be provided by the z/OS system programmer who installed the
EKMF Agent.
Port number: The port number is the port on which the EKMF Agent listens
for connections. This information should be provided by the
z/OS system programmer who installed the EKMF Agent.
Key Templates
Keys are defined by key templates, which ensures a consistent key creation process. To
create a key template (see Figure 4-31 on page 112) for a key for data set encryption, specify
the following:
The Keystore type must be set to 'Pervasive Encryption'
The Name is used as an identification of the key template within the EKMF Web
application. The Name can only use uppercase letters, digits and dashes and cannot be
longer than 30 characters.
The Key label defines the ID of the key in EKMF Web as well as the keystore label in the
CKDS. Key labels can contain tags, which are placeholders for values that can be
specified at key generation time. Using a mix of literal text and tags means that a key
template can enforce a given key label naming convention. See 10.3.3, “Key label” on
page 223.
Key size for an AES key for pervasive encryption is always 256 bits.
The Key type can be either AES CIPHER4 keys or AES DATA keys. AES CIPHER keys
are the recommended key type for z14 or later.
Key state refers to the EKMF key state model (see 10.3.6, “Key lifecycle” on page 225)
based on NIST recommendations.
4 z14 or later w/ CEX6S (and newer hardware) and minimum ICSF level HCR77C1.
Hosts
A Host in the EKMF Workstation is defined by the network address of the z/OS system that
holds the CKDS and the port number of the EKMF agent running on that z/OS system.
Before the EKMF Workstation can connect to an EKMF agent, the EKMF agent must be
configured to trust the EKMF Workstation (see Figure 4-32 on page 114):
A Host has a Host identification, which is a unique name for the host.
The description is a free-text field that can be used to provide a short description of the
host.
Host type must be set to 'Z-SERIES' to identify the host as running on a z/OS system.
IP Name is the network address of the z/OS system where the EKMF agent resides. This
information should be provided by the z/OS system programmer who installed the EKMF
Agent.
IP Address will be updated based on the value entered in the IP Name field.
Port number is the TCP port on which the EKMF Agent listens for connections. This
information should be provided by the z/OS system programmer who installed the EKMF
Agent.
The timeout value determines how long the EKMF Workstation should wait for a
response from the EKMF Agent. If the timeout is exceeded, the EKMF agent will be
considered unavailable.
The codepage name indicates which codepage the EKMF Workstation should use to
communicate with the EKMF Agent. This information should be provided by the z/OS
system programmer who installed the EKMF Agent.
Link Encryption should be set to ECDH. This will establish an AES session encryption
key using an Elliptic-Curve Diffie-Hellman key exchange. The other link-encryption options
will be removed in future version of EKMF.
The logon group is used to group hosts into groups. The EKMF workstation will only ask
for credentials once per logon group and will reuse those credentials for all Hosts in the
logon group.
Having defined all relevant hosts, update the EKMF Workstation device configuration to
enable EKMF to distribute keys to the CKDS keystores on the hosts.
Key Templates
Keys are defined by key templates, which ensures a consistent key creation process.
The following paragraphs describe the fields required in a key template to create an AES
CIPHER key or an AES DATA key that can be used for data set encryption. It is recommended
to fill out all fields of a key template. Additional descriptions of key template fields are in the
EKMF documentation.
CIPHER KEYS
To create a key template for an AES CIPHER key, the fields in the key template in Figure 4-33
on page 115 must be specified as follows:
The Title is a short description of the purpose of the key template
The Number is the unique identifier for the key template. Once set, it cannot be changed.
Valid characters are a-z, 0-9 and underscore (_).
Set the status to active, to be able to use the key template to generate keys.
The Key label is the label that identifies the key in EKMF (The keystore label for the CKDS
is defined in the key template instances below). Key labels can contain tags, which are
placeholders for values that can be specified at key generation time. Using a mix of literal
text and tags means that a key template can enforce a given key label naming convention
(see 10.3.3, “Key label” on page 223).
Key state refers to the EKMF key state model (see 10.3.6, “Key lifecycle” on page 225)
based on NIST recommendations.
– A key that is created as active will be distributed to keystores as part of the key
generation process.
– A key that is created as pre-active will not be distributed. It can later be activated and
distributed to keystores.
Key size for an AES key for data set encryption is always 256 bits.
The selected origins in a key template controls the origin of the key material for the key.
Specify 'Generate' to be able to generate a key using the key template.
Key instances describe separate instances of a key in the CKDS keystore(s) - see
Figure 4-34 on page 116.
For a PE key, select Install: Yes, and the keystore type as ICSF.
The keystore label can be set to reference they key label specified above, or a different key
label can be defined.
The values to specify for application and key zone will be specific to the particular EKMF
workstation setup, because these two values combined determine the specific Hosts/CKDS
keystores the key is distributed to. Specifying KEYMNGNT for application and 'I - ICSF' for the
key zone will typically distribute a key to all configured hosts/CKDS keystores.
Select the KEK algorithm to be AES and select an AES KEK used to protect the AES
CIPHER key when stored in the EKMF repository and during transport from the EKMF
workstation to the CKDS
The Key type has a separate editor (see Figure 4-35), which is opened by using the
'magnifying-glass' button to the right of the key type field.
The key type defines the type and attributes of the key in the CKDS. For the key to be usable
as a PE key, select:
Key type: CIPHER
CPACF export control: XPRTCPAC.
Key-usage control: DECRYPT and ENCRYPT
Key-usage mode: ANY-MODE
The additional settings control key exportability and its key token format. The selection here
doesn't affect the usability of the key, but it is recommended to configure the key to be
non-exportable, as it will prevent unauthorized copying of the key.
For the DATA key specific fields (shown when selecting RSA as the KEK algorithm), set ‘KEK
location’ to UKDS7 and Token Format to PKCSOAEP (see Figure 4-36).
Select an RSA KEK used to protect the AES DATA key when stored in the EKMF repository
and during transport from the EKMF workstation to the CKDS.
Table 5-1 Checklist for determining deployment readiness for z/OS data set encryption
Checklist item Comments More information
Have you installed the required hardware z/OS data set encryption is available on 2.2, “Required and optional
and software components and z/OS V2.2a, V2.3 and V2.4. hardware features” on
prerequisites? page 25
Current support for z15 and Crypto
Express7S. Considerable 2.3, “Required and optional
improvements are made with the software features” on
cryptographic functions in z14 and page 28
Crypto Express6s, compared to earlier
generations.
Have you determined the performance effect Use the IBM Z Batch Network Analyzer 2.3.8, “IBM zBNA” on
that z/OS data set encryption might have on (zBNA) and zCP3000 to determine page 33
the CPUs? potential performance effects.
Have you determined which data sets will be Supported data set types are: 3.2.1, “Supported data set
encrypted? Virtual Storage Access Method (VSAM) types” on page 38
extended format, sequential extended
format, sequential basic and large
format, and PDSE.
Will you use data compressionb? Encrypted data is not compressible. 3.2.2, “Data set
Therefore, where possible, consider the compression” on page 39
use of access method compression with
data set encryption. When used
together, the access methods compress
the data at the server before it is
encrypted and written out. Access
method compression is only supported
with extended format data sets. For
compressing extended format
sequential data sets, zEDC offers a low
overhead solution for compression.
Have you defined the naming standards that Consider defining naming conventions 3.2.3, “Data set naming
you will use? to group data sets logically. Proper conventions” on page 40
naming standards facilitate the ease of
migrating key labels and keys to another 3.5.7, “Creating a key label
machine or Business Partner. naming convention” on
page 53
Have you identified how to supply the key To create an encrypted data set, a key “Starting z/OS data set
label to create an encrypted data set? label must be supplied at the time the encryption deployment” on
data set is initially allocated (created). page 124
Have you determined the owners of the new Fine or course grained access controls 3.3.2, “Separating duties of
tasks for administering and maintaining can limit access to data content by data owners and
encrypted data sets? personnel that can otherwise pose a administrators” on page 44
possible exposure point.
Have you determined the Resource Access Assess access controls based on your 4.2, “RACF configuration” on
Control Facility (RACF) or System security policies and how they apply to page 71
Authorization Facility (SAF) controls that you data set encryption.
will be using? Table 5-2 on page 122
Have you determined which key You can create master keys by using a 3.5, “Key management
management tools you will use? TKE workstation, which includes smart considerations” on page 50
cards and smart card readers.
Have you defined your key lifecycle Track changes to key’s parameters 3.5.14, “Determining key
management process? during its lifecycle. availability needs” on
page 63
Does your PARMLIB contain the required Parameters for ICSF setup. 4.3.3, “CSFPRMxx and
ICSF CSFPRMxx and Installation Options installation options” on
Data Set? page 83
Have you determined your ICSF storage Determine allocation size and format of 3.4.3, “Using the Common
requirements? the CKDS. Record Format (KDSR)
cryptographic key data set”
on page 47
Have you determined the best time to start ICSF must always be up and running 3.4.2, “Starting ICSF early in
ICSF during the IPL process? because all access to encrypted data the IPL process” on page 46
sets depends on calls that are made to
ICSF.
Have you considered your backup/recovery The disaster plan includes a mirrored 3.5.14, “Determining key
planning scenarios? implementation of data set encryption at availability needs” on
the backup site with the appropriate page 63
master key, ICSF release, and key data
sets. 3.6, “General
considerations” on page 65
Have you considered sysplex sharing and Consider whether systems in the 3.4.6, “Sharing the CKDS in
remote site usage, if applicable? parallel sysplex must share the master a sysplex” on page 49
key and CKDS.
Have you considered what is required to fall Any implementation requires a plan to 3.6.3, “Backing out of z/OS
back? fall back. data set encryption” on
page 67
Have you reviewed your security, audit, and In support of z/OS data set encryption, 3.6, “General
compliance practices? identify if any gaps exist in your current considerations” on page 65
practices.
Are you collecting applicable System Ensures that you are compliant and Chapter 6, “Auditing z/OS
Management Facility (SMF) records for data ready for an audit by collecting SMF data set encryption” on
set encryption? Record types 14, 15, 62, and 82. page 143
Have you considered the use of security Ensure that your security policies and Chapter 2, “Identifying
tools for your Z environment? keys are managed and monitored. components and release
Auditors can quickly determine whether levels” on page 23
files were encrypted with IBM Security
zSecure Suite.
Have you planned for test scenarios and This IBM Redbooks publication can be Review all chapters of this
education for potential users? used as a reference for building test publication.
scenarios and education.
a. Extended format only.
b. IBM z15 provides significant compression performance improvements with the (on-chip) IBM Integrated
Accelerator for zEnterprise® Data Compression.
A checklist that can be used for implementing access controls as part of data set encryption is
included in Table 5-2.
Have you determined your data set access This issue includes restricting access to 4.2, “RACF configuration” on
criteria? the ICSF data sets, which contain the page 71
encryption keys and associated key
labels for your installation.
Have you defined your RACF profiles, CSFSERV profiles control access to
including CSFSERV, CSFKEYS, and ICSF services, such as defining
XFACILIT? encryption keys.
Have you created entries in OPERCMDS? To ensure that operators do not enter
STOP ICSF or SET ICSF commands
without authorization.
Have you reviewed the Catalog LISTCAT Restricted usage of LISTCAT display of
access command? data sets (z/OS 2.3 and later feature).
If ICSF is not yet installed in your environment, see the following resources:
For more information about planning and configuration, see z/OS Cryptographic Services
ICSF Administrator's Guide.
For more information about for installation, initialization, and customization, see z/OS
Cryptographic Services ICSF System Programmer's Guide.
Note: If you plan to share encrypted data sets across multiple systems, ensure that all
z/OS data set encryption prerequisites were met on all systems before shared encrypted
data sets are created.
The Z hardware and software environment that used in this chapter is shown in Figure 5-1.
The environment consists of the following components:
z14 (with CPACF)
– Crypto Express6S adapter with a domain value of 084
Running z/OS V2R3 with:
– Resource Access Control Facility (RACF).
– Integrated Cryptographic Service Facility (ICSF) active, at HCR77C1 level, with the
Advanced Encryption Standard (AES) master key loaded. For more information about
for CSFPRMxx settings on LPAR CETUS2B (SC60), see 4.3.3, “CSFPRMxx and
installation options” on page 83.
– Cryptographic key data set (CKDS) in common record format (KDSR) to allow for
reference date tracking.
Because this scenario was built as a monoplex environment, the CKDS is not shared with
other systems. For more information about the steps to share the CKDS with other systems
as you move to production, see 4.3.3, “CSFPRMxx and installation options” on page 83.
Generating a secure
AES CIPHER key
A data set is defined as encrypted when a key label is supplied on allocation of a new data set
of a data set encryption supported data set type. A key label is supplied by way of new
keywords in any of the following sources (using order of precedence):
The Data Facility Product (DFP) segment in the RACF data set profile
JCL, Dynamic Allocation, TSO Allocate, and IDCAMS DEFINE
Storage Management Subsystem (SMS) Construct: Data Class
Although you might find it easier to use the DATACLAS keyword in your environment, a side
effect of the use of this method is that it takes control of creating encrypted data sets out of
the hands of a security administrator and puts it into the hands of the Db2 administrators,
storage administrators, or other users. One important reason to use data set encryption is to
prevent administrators from accessing sensitive data and removing them from compliance
scope.
Specifying UACC(NONE) prevents unauthorized users from encrypting data sets without
oversight by the security administrator.
From a security perspective, the security administrator controls, determines, and oversees
who can encrypt data sets. It might be said that enough security oversight is provided
because the security administrator gives users the authorization to a key label within the
CSFKEYS class. However, the recommended way to manage encrypted data sets is to use
the RACF profile. Therefore, it takes precedence over all other means of setting a key label.
Use of the RACF profile is the recommended setup for z/OS Data Set Encryption to ensure
the most secure environment.
Generating a secure 256-bit data set encryption key can be done by using one of the
following methods:
Enterprise Key Management Foundation (EKMF)
ICSF panels
ICSF APIs
CSFKGUP
Keys are created based on the key templates prepared in “Key Templates” on page 111 (for
EKMF Web) or “Key Templates” on page 114 (for the EKMF workstation).
The content of the key template will be shown (see Figure 5-3 on page 126), and input fields
will be available for the tags used in the key label.
Specify values for the tags to finalize the value of the key label.
A value for the <seqno> tag must be specified manually, but EKMF Web will display the
next available sequence number.
Click the button 'proceed to additional data' and then the 'create' button to create the key.
1 EKMF Workstation and EKMF Web are reffered to as ‘EKMF’, unless otherwise stated.
If the key template specified to create the key in the active state, the key generation process
will include distribution of the key to keystores. The keystores will be those specified by the
key template that was used to generate the key.
If the key template specifies to create the key in the pre-active state, the key will be generated
but will not be distributed.
Distribution to keystores happens when the key is activated. This activation can be done from
the key list overview (see Figure 5-4 on page 127).
At the end of each row of keys, there is a menu symbolized by three dots, arranged vertically.
Open the menu for the key that should be activated and select 'change state'.
In the next dialog, select the target state to be 'active' and click the button 'change'.
The key state will then be changed to active and the key will be distributed to the keystores
specified by the key template that was used to generate the key.
If the key template specified to create the key in the active state, the key generation process
will include distribution of the key to keystores. The keystores will be those specified by the
key template that was used to generate the key.
If the key template specified to create the key in the pre-active state, the key will be generated
but will not be distributed.
The activation is done from the (right-click) context menu of the key (see Figure 5-6), when
displayed in the list overview.
Selecting 'Activate Key' from this menu will change the key state from pre-active to active
and the key will be distributed to the keystores specified by the key template that was used to
generate the key.
For more information about the RACF commands to authorize users to the CSFSERV class,
see 4.2.2, “Defining DATASET, CSFSERV, CSFKEYS, and other resources” on page 71.
In the CKDS Generate Key panel (see Figure 5-8), enter the key (record) label and select the
AES key bit length. Press Enter to generate the key.
Important: By replacing the key, applications cannot decrypt the associated data sets.
You see a message that indicates a 256-bit AES DATA key was successfully generated (see
Figure 5-10).
No refresh of the CKDS is required when the key is generated by using this method.
Authorization
The authorization required depends on which key type is being created. Users must have
READ authority to the following resources in the CSFSERV class to perform key generation
with the associated ICSF callable service:
CSFKGN (DATA keys)
CSFKGN2 (CIPHER keys)
CSFKRC2
For more information about the RACF commands to authorize users to the CSFSERV class,
see 4.2.2, “Defining DATASET, CSFSERV, CSFKEYS, and other resources” on page 71.
Note: The sample scripts shown in Appendix B, “Sample REXX scripts for creating DATA
and CIPHER keys” on page 241 also use CSFKRR or CSFKRR2, as such the user will
need to be authorized to those resources in the CSFSERV class (unless the sample is
modified).
When KGUP generates a secure AES DATA key value, the program adds an entry in the
CKDS that is enciphered under your system’s master key. For z/OS data set encryption, a
256-bit AES DATA type key must be generated.
Authorization
Users must have READ authority to the following resources in the CSFSERV class to perform
key generation with KGUP:
ICSF running with CHECKAUTH(YES) - CSFKGUP, CSFKGN
ICSF running with CHECKAUTH(NO) - CSFKGUP
For more information about the RACF commands to authorize users to the CSFSERV and
DATASET classes, see 4.2.2, “Defining DATASET, CSFSERV, CSFKEYS, and other
resources” on page 71.
Example 5-1 JCL example to create a 256-bit AES DATA type key
//STEP10 EXEC PGM=CSFKGUP
//CSFCKDS DD DISP=OLD,DSN=SYS1.SC60NEW.SCSFCKDS
//CSFIN DD *,LRECL=80
ADD TYPE(DATA) ALGORITHM(AES),
LABEL(DATASET.PE08.ENCRYPT.DS.ENCRKEY.00000001) LENGTH(32)
/*
//CSFDIAG DD SYSOUT=*,LRECL=133
//CSFKEYS DD SYSOUT=*,LRECL=1044
//CSFSTMNT DD SYSOUT=*,LRECL=80
A JCL sample to create three 256-bit AES DATA type keys with a key label of
DATASET.PE08.ENCRYPT.DS.ENCRKEY.00000001/2/3 is shown in Example 5-2.
Example 5-2 JCL example create three 256-bit AES DATA type key
//STEP10 EXEC PGM=CSFKGUP
//CSFCKDS DD DISP=OLD,DSN=SYS1.SC60NEW.SCSFCKDS
//CSFIN DD *,LRECL=80
ADD TYPE(DATA) ALGORITHM(AES),
LABEL(DATASET.PE08.ENCRYPT.DS.ENCRKEY.00000001,
DATASET.PE08.ENCRYPT.DS.ENCRKEY.00000002,
DATASET.PE08.ENCRYPT.DS.ENCRKEY.00000003) LENGTH(32)
/*
//CSFDIAG DD SYSOUT=*,LRECL=133
//CSFKEYS DD SYSOUT=*,LRECL=1044
//CSFSTMNT DD SYSOUT=*,LRECL=80
Consider the following points regarding Example 5-1 and Example 5-2:
TYPE must be DATA.
ALGORITHM must be AES.
A key LABEL can consist of up to 64 characters.
The first character must be alphabetic or a national character (#, $, or @). The remaining
characters can be alphanumeric, a national character (#, $, or @), or a period (.). The key
label is used to identify the key in the ICSF keystore (CKDS).
LENGTH specified as 32, which generates 256-bit key.
When you update the CKDS on disk and you are sharing the CKDS in a sysplex, use the
Coordinated CKDS Refresh panel utility to refresh the CKDS so that all members of the
sysplex can see the new keys. Otherwise, the other members of the sysplex cannot decrypt
data that was encrypted by the system on which the refresh was issued.
When you update the CKDS on disk and you are not in a sysplex, you can use the Refresh
option on the Key Administration panel to replace the in-storage copy with the disk copy. You
also can start a utility program to refresh the CKDS.
Note: This refresh is only necessary when KGUP is used to generate the key as it writes
directly to the CKDS on disk. No refresh is required for keys that are generated by the ICSF
panel or callable services.
A JCL sample to refresh the in-storage copy of CKDS by using ICSF utility program
CSFEUTIL is shown in Example 5-4.
Example 5-4 Refresh in-storage copy of CKDS by using ICSF utility program CSFEUTIL
//STEP20 EXEC PGM=CSFEUTIL,
// PARM='SYS1.SC60NEW.SCSFCKDS,REFRESH'
The messages from successful refresh by using CSFEUTIL are shown in Example 5-5.
To refresh the in-storage copy of the CKDS, from the ICSF Primary menu, select Option 8
KGUP (Key Generator Utility processes) → Option 4 Refresh (Activate an existing
cryptographic key data set).
Press Enter to perform the refresh. A successful refresh results in message CSFM653I (see
Example 5-6).
The Refresh in-storage CKDS panel displays a message to indicate a successful refresh (see
Figure 5-12).
The following refresh can also be performed from Option 2.1; 1.2 from the ICSF Primary
menu:
Option 2 KDS MANAGEMENT: Master key set or change, KDS Processing
Option 1 CKDS MANAGEMENT: Perform Cryptographic Key Data Set (CKDS) functions
including master key management
Option 1 CKDS OPERATIONS: Initialize a CKDS, activate a different CKDS (Refresh), or
update the header of a CKDS and make it active
Option 2 REFRESH: Activate an updated CKDS
Note: This procedure applied regardless of whether the data-encrypting key is a DATA key
or a CIPHER key.
A key label can be supplied in any of the following options (using order of precedence):
The Data Facility Product (DFP) segment in the RACF data set profile
JCL, Dynamic Allocation, TSO Allocate, and IDCAMS DEFINE
Storage Management Subsystem (SMS) Construct: Data Class
Taking these steps helps ensure that only authorized users are allowed to use data set
encryption. Users must have at least READ authority to resource
STGADMIN.SMS.ALLOW.DATASET.ENCRYPT in the FACILITY class to create encrypted data sets
when the key label is specified by way of a method other than the DFP segment in the RACF
data set profile.
The system does not require the user to have authority to resource
STGADMIN.SMS.ALLOW.DATASET.ENCRYPT when the key label is specified in the DFP segment in
the RACF data set profile.
To create a set of SAF resources to protect new data sets (PE08.ENCRYPT.DS.*) with
encryption, complete the following steps:
1. Create a generic DATASET resource to protect a set of data sets, as shown in the
following example:
ADDSD 'PE08.ENCRYPT.DS.*' UACC(NONE)
2. Specify the encryption key label in the DFP segment (the recommended way to supply a
key label is for a security administrator to add the key label to the DFP segment), as
shown in the following example:
ALTDSD 'PE08.ENCRYPT.DS.*'
DFP(DATAKEY(DATASET.PE08.ENCRYPT.DS.ENCRKEY.00000001))
3. Non-encrypted data sets must be copied over to these new (PE08.ENCRYPT.DS.*) data
sets to be protected by encryption.
Note: This procedure applied regardless of whether the data-encrypting key is a DATA key
or a CIPHER key.
To create an encrypted data set, you must assign a key label to the data set when it is newly
allocated (data set create). In addition, an encrypted data set must be allocated as an
extended format data set in one of the following ways:
JCL, by way of DSNTYPE=EXTPREF or DSNTYPE=EXTREQ
TSO allocate, by way of DSNTYPE(EXTPREF) or DSNTYPE(EXTREQ)
IDCAMS DEFINE parameter DATACLASS references an extended format data class.
Dynamic allocation text unit DALDSNT
Note: A key label that is specified in the DFP segment in the RACF data set profile is
used regardless of the setting of ACSDEFAULTS that is specified in
SYS1.PARMLIB(IGDSMSxx).
To specify a key label by using JCL, dynamic allocation, and TSO, allocate the use the
following components:
– JCL keyword DSKEYLBL=’key-label’
– Dynamic allocation text unit DALDKYL
– TSO allocate DSKEYLBL(label-name)
DSKEYLBL is effective only if the new data set is on DASD. The key label is ignored for
a data set that is not a DASD data set.
For more information about the DSKEYLBL(key-label) keyword on the JCL DD
statement, see Abstract for MVS™ JCL Reference.
SMS data class
To specify a key label by using SMS data class, use the Data Set Key Label field in the
Interactive Storage Management Facility (ISMF) DEFINE/ALTER panel.
The system uses this key label for data set encryption supported data set types that are
created after the data set key label is added to the data class. The key label is ignored for
a data set that is not a DASD data set.
For more information about the use of the new Data Set Key Label field in the ISMF
panels, see Data Set Encryption.
IDCAMS DEFINE command
To specify a key label by using the IDCAMS DEFINE command for a Virtual Storage Access
Method (VSAM) data set, use the KEYLABEL parameter, as shown in the following
example:
KEYLABEL(MYLABEL)
Any alternative index that is associated with the VSAM base cluster is encrypted and uses
the same key label as specified for the base cluster. The key label is ignored for a data set
that is not a DASD data set.
For more information about the use of the IDCAMS DEFINE command for a VSAM data set,
see Abstract for DFSMS Access Method Services Commands.
When a key label is specified on more than one source, the key label is derived from one of
these sources only on the first data set allocation (on data set create). The key label is
derived in the following order of precedence:
1. From the DFP segment in the RACF data set profile
Note: The REFDD and LIKE JCL DD statement keywords do not cause a key label from which
the data set is referred to be used when allocating a new data set.
On successful allocation of an encrypted data set, the successful allocation message that is
shown in Example 5-7 is issued.
Note: When a key label is specified for a DASD data set that is not extended-format,
allocation fails and the message IGD17151I is issued. When IDCAMS DEFINE is used,
message IDC3009I is issued with RC48 and RSN82.
The output of LISTCAT for a data set is shown in Example 5-8. The encryption data section
indicates that the data set is encrypted and displays the key label. The attributes section
shows that the data set is in EXTENDED format.
The resulting IEC143I 213-85 message when an attempt to use a key label that includes a
RACF CSFKEYS profile that is defined with SYMCPACFWRAP(YES),
SYMCPACFRET(NO) is shown in Example 5-10.
Example 5-10 IEC143I 213-85 message when attempt to use a key label
IEC143I 213-85,mod,jjj,sss, ddname[-#],dev,volser,dsname(member),
RC=X'00000008',RSN=X'00000C04'
The resulting IEC143I 213-85 message (see Example 5-11 on page 139) when attempting
to use a key label that includes the following components:
– RACF CSFKEYS profile that is defined without ICSF data
– RACF CSFKEYS profile that is defined with ICSF data SYMCPACFWRAP(NO),
SYMCPACFRET(YES)
– RACF CSFKEYS profile that is defined with ICSF data SYMCPACFWRAP(NO),
SYMCPACFRET(NO)
Note: Authorization to the key label is checked only when the data set is opened. At
data set creation (for example, allocate by way of IEFBR14), key label authorization is
unchecked if an open operation is not performed.
The data is encrypted when it is written to DASD and decrypted when it is read from DASD.
For encrypted compressed format data sets, the access methods compress the data before
the data is encrypted on output. On input, the access methods first decrypt the data before
the data is decompressed.
To access the content of an encrypted data set, a user needs authorization to access the key
label that is associated with the data set, in addition to the normal access that is required by
way of RACF Data Set Profiles.
If the user does not have proper authority, message ICH408I is issued (see Example 5-13),
which indicates insufficient authority for a key label when attempting to access the data set.
This message indicates which profile is stopping this user from reading the key that is
associated with the particular key label. The RACF administrator must give the user read
access to the resource profile that is listed in the message.
For more information about how to set up access to a key label, see 5.4, “Protecting data sets
with secure keys” on page 134.
Sample JCL to create an encrypted sequential data set is shown in Example 5-14.
Example
To demonstrate that system functions, such as DFSMSdss COPY, DUMP, RESTORE, and
PRINT, do not require access to the key label, we ran a PRINT of the encrypted data set (see
Example 5-17).
The output of the PRINT showed garbled (encrypted) data (see Example 5-18).
We attempted to access an encrypted data set that was created on another system (by way of
DFSMSdss DUMP/RESTORE) for which the data-encrypting key and key label is not
available. Message IEC143I was issued, as shown in Example 5-19.
For more information about how to transport AES data-encrypting key between systems to
allow access to encrypted data in data sets that were created on one system and shared (by
Brief descriptions and references are provided to demonstrate specific uses and tasks that
are related to auditing the z/OS data set encryption environment. If a reporting process or
workflow for auditing purposes is not yet established, another option to create reports is IBM
Security zSecure (for more information, see 2.3.6, “IBM Security zSecure Suite” on page 31).
1
For more information about a functional overview of SMF, see Abstract for MVS™ System Management Facility
(SMF).
SMF Type 14, Subtype 9 and SMF Type 15, and Subtype 9 records provide DASD data set
encryption information. They indicate the following information:
If the data set is encrypted.The data set encryption type.The data set encryption key label.
For more information, see tDASD Data Set Encryption Information (Type 9).
SMF Type 62 records indicate the following information about the data set encryption:
Type
Key label
For more information, see Record Type 62 (3E) — VSAM Component or Cluster Opened.
In addition, overview criteria is shown for the Postprocessor in the Postprocessor Workload
Activity Report - Goal Mode (WLMGL) report. For more information, see the following
publications:
z/OS RMF Programmer's Guide (SC34-2667)
z/OS RMF User's Guide (SC34-2664)
z/OS RMF Report Analysis (SC34-2665)
For more information about SMF Type 80 records, see Record type 80: RACF processing
record.
For processing RACF SMF records, the RACF SMF Unload Utility is a good choice. Samples
are available in SYS1.SAMPLIB(IRRICE).
Post-processing of the output can be done by using DFSORT. For more information about
examples, see the IBM Systems and Technology Group presentation, As Cool as Ice:
Analyzing Your RACF Data Using DFSORT and ICETOOL.
Note: This feature is optional with ICSF FMID HCR77C1 and usage tracking algorithms
can be turned on or off, depending on your needs. For more information about enabling
crypto usage tracking, see 4.3.3, “CSFPRMxx and installation options” on page 83.
Cryptographic usage statistics are recorded in SMF data sets. Statistics are recorded for
each SMF recording interval. The usage and interval recording allows you to determine
usage over various time periods. For more information, see 4.4.2, “Configuring SMF
recording options in SMFPRMxx” on page 106.
Each ICSF instance can track the usage of cryptographic engines (ENG), cryptographic
services (SRV), and cryptographic algorithms (ALG) for the LPAR in which it runs.
SMF Type 82 Subtype 31 contains information about the cryptographic user’s HOME address
space job ID, SECONDARY address space job name, HOME address space user ID, HOME
task level user ID, and ASID.
By using Crypto Usage Statistics, you can assess your cryptographic usage and determine
any areas that might need attention. By determining which applications are using which
cryptographic engines, services, and algorithms, you can ensure that you are operating in the
most secure manner. The use of Crypto Usage Statistics can also help you tune your systems
for optimal performance.
For z/OS data set encryption, which uses Common Cryptographic Architecture (CCA)
symmetric data keys, ICSF writes SMF Type 82, Subtype 40 records to track key lifecycle
transitions.
Note: This feature is optional with ICSF and key lifecycle tracking can be turned on or off,
depending on your needs. For more information about enabling key lifecycle tracking, see
4.3.3, “CSFPRMxx and installation options” on page 83.
A subset of the SMF Type 82, Subtype 40 fields include the following information:
Key event, such as the key token that is:
– Added to KDS
– Updated in KDS
– Deleted from KDS
– Archived
– Restored
– Metadata changed
– Pre-activated
– Activated
– Deactivated
– Exported
– Generated
– Imported
Key label
Key data set
Service that is associated with the event
Key token format
Key security
Key algorithm
Key length
Key usage data is recorded in SMF data sets. Data is recorded within key usage intervals, as
defined in the CSFPRMxx member. The usage or interval recording allows you to analyze key
usage over various time periods. For more information, see 4.3.3, “CSFPRMxx and
installation options” on page 83.
For z/OS data set encryption, which uses CCA symmetric data keys, ICSF writes SMF type
82, subtype 44 records to track key usage. Usage counts are accumulated during each key
usage recording interval.
A subset of the SMF Type 82, Subtype 44 fields includes the following information:
Key label
Service that is associated with the event
Key token format
Key security
Key algorithm
Key length
Usage count
CSFSMFJ (shown in Example 6-1) reads Type 82 SMF records and formats them in a report.
An excerpt of the Crypto Usage Statistics for SMF record type 82, subtype 31 is shown in
Example 6-2.
Example 6-2 on page 126 shows that the first usage event is recorded for jobname=NET. It
occurred on system PLEX60 and used crypto domain 84.
The time interval for the event is 22:02 - 22:10 on 7 November, 2017. In the event, the
CSFKGN (key generate) service was called 12 times. In the second usage event, two calls
were made to the cryptographic card (6C00) by jobname=PE08.
The EKMF key management system provides an audit log that can be used by security
administrators, key managers, and external auditors to monitor and audit the key
management process.
EKMF will log all key management actions, performed in EKMF, to the EKMF audit log.
The audit log allows security administrators and key managers to determine the following
information:
Key generation, including the key label for the generated key
Key state changes (activation, deactivation, mark compromised, deletion, etc) (see 10.3.6,
“Key lifecycle” on page 225)
Key distribution to CKDS
Key removal from CKDS
Changes to the EKMF configuration
EKMF key templates are also relevant for audit purposes, as they document the type and
attributes of keys as well as the systems the keys are distributed to.
For audit purposes, key templates can be used to document compliance with a process/policy
with specific requirements for the keys.
For more information about EKMF logging and key templates, see Chapter 10, “IBM
Enterprise Key Management Foundation Web Edition” on page 217.
Although you might identify the source for the key label, that process does not always ensure
that the data sets that are associated with the source are encrypted. For example, you can
set a key label in a DATASET class resource that encrypts new data sets, but the old data
sets remain unencrypted. Therefore, you need more tools to determine which data sets are
encrypted.
Master key rotation involves reenciphering secure, operational keys that are in the Key Data
Sets. Reencipherment occurs in the secure boundary of the Crypto Express adapter.
Master key rotation involves decrypting secure, operational key values that are in the Key
Data Sets from under the current master key to encryption under the new master key. This
reencipherment occurs in the secure boundary of the Crypto Express adapter. After
reencipherment, the new master key is set to become the current master key.
The process for master key rotation is automated and can be run on a single system or
synchronized across a sysplex.
You can optionally allocate a backup data set for the reenciphered keys, as shown in
Example 7-2.
For more information about the steps to load the AES master key, see 4.3.5, “Loading the
AES master key” on page 86.
The following steps show how to start a coordinated CKDS master key change by using ICSF:
1. In the main ICSF panel, select Option 2 -KDS Management (see Figure 7-1). Press
Enter.
2. In the ICSF - Key Data Set Management panel, select Option 1-CKDS Management (see
Figure 7-2). Press Enter.
3. In the ICSF - CKDS Management panel, select Option 5-Perform a coordinated CKDS
change master key (see Figure 7-3). Press Enter.
4. Review the Coordinated KDS change master key panel (see Figure 7-4). Press Enter.
5. Perform the following changes on the ICSF - Coordinated KDS change master key (see
Figure 7-5 on page 156):
a. Enter Y for fields Rename Active to Archive and New to Active [Y/N} and Create a
backup of the reenciphered KDS [Y/N].
b. Update the New KDS, Archived KDS, Backup KDS names.
In our example:
• The New KDS (allocated and empty) was named PLEX75.SHARED3.SCSFCKDS
• The Archive KDS (not allocated) was named PLEX75.SHARED3.OLD.SCSFCKDS
• The Backup KDS (allocated but empty) was named PLEX75.SHARED3.COPY.SCSFCKDS
c. Press Enter.
7. Check the status message on the ICSF - Coordinated KDS change master key panel (see
Figure 7-7).
8. Check for the MVS Console messages. SYSLOG includes the messages that are shown
in Example 7-3.
Note: All of the IXC messages are sent by Sysplex Services for Data Sharing (XES) in
this scenario because we enabled CF structure encryption in our environment. XES
detected a change in the AES master key so that it drove a CF structure change in the
CFRM couple data set.
9. Press F3 to return to the CKDS Management panel. Press F3 to return to the KDS
Management panel.
2. The ICSF Coprocessor Management panel is shown in Figure 7-9. Enter s next to the
crypto feature to view its status. Press Enter.
3. View the Coprocessor Hardware Status panel (see Figure 7-10). Review the following
Master keys information:
– New Master Key register is EMPTY.
– Current Master Key register is VALID with a new Verification Pattern.
– Old Master Key register is VALID with the Verification Pattern from the previous Master
Key.
Two common approaches to rotating data set encryption keys are listed in Table 7-1. Each
approach features pros and cons.
Re-Encrypt All A new key is generated and assigned. Disruptive in most cases1
Data Recommended when a key is
Existing data is reencrypted with the compromised
new key. Affects all data (new and old)
Must identify all data encrypted
New data is encrypted with the new with the old key
key. Archiving the old key is
recommended rather than deleting
the old key
Crypto-periods can be established
to restrict key usage
Key versioning is recommended
1 For Db2 data sets, you can start an online reorganization to make the re-encryption process nondisruptive.
The first three steps for aging out and re-encrypting all data are the same for both
approaches. The later steps apply to re-encrypting all data only.
As described in 3.5.7, “Creating a key label naming convention” on page 53, you must
consider your key label naming convention in determining the key label for the new key.
Consider the following questions:
Is there an existing naming convention?
Is there a new sequence number?
What is the next sequence number?
Will the key label be protected under an existing data set profile?
After you determine your key label name, you can choose one of several methods to generate
a key label, as described in 5.3, “Generating a secure 256-bit data set encryption key” on
page 125.1
DATASET class
The DATASET class is the primary method that is used to supply a key label for data set
encryption. You can create an ICETOOL to identify which DATASET class resources include a
DATAKEY segment. Sample JCL to create such a report is shown in Example 7-4.
1 For EKMF, see 5.3.1, “Using Enterprise Key Management Foundation” on page 127.
Example 7-5 shows the output from the JCL in Example 7-4 on page 162 with the following
INCLUDE statement:
INCLUDE COND=(05,04,CH,EQ,C'0410',AND,
71,08,CH,NE,C' ')
The output lists the DATASET profiles that include a DFP segment.
Example 7-6 shows the output from the JCL inExample 7-4 on page 162 with the following
INCLUDE statement:
INCLUDE COND=(05,04,CH,EQ,C'0410',AND,
71,17,CH,EQ,C'DATASET.PE01.TEST')
The output lists the DATASET profiles that include a key label DATASET.PE01.TEST.
Step 3: Updating the key label sources with the new key label
Now that the new key is generated and the key label sources are identified, you can update
the key label sources with the new key label. From that point forward, all newly allocated data
sets are encrypted with the new key. Any data sets remain encrypted by the original key.
Note: Because the old data sets remain encrypted by the old key, the old key must remain
in the CKDS.
Step 4: Identifying data sets encrypted with the old key label
When you must reencrypt all data that is associated with a particular key, you must identify
which data sets are associated with the original key label.
You must consider every location where the data is stored, such as data that is:
Active on DASD
Migrated to tape
Replicated to DR
When the data sets are located, you can verify the key label that is associated with the data
set by issuing the LISTCAT ENTRIES(<data set name>) ALL command on the data sets.
Step 5: Allocating new data sets to replace the old data sets
Key labels are associated with data sets at data set allocation. Therefore, every data set must
include an associated data set that was allocated with the new key.
Step 6: Copying the contents of the old data sets to the new data sets
After the new data sets are created, the data set contents can be copied from the old data set
to the new data set.
Note: To perform the copy operation, the user who is performing the copy must have
READ access to the old key label and the new key label.
Standard utilities can be used to perform the copy operation, including the following standard
utilities:
ISPF 3.3 Copy data set
IDCAMS REPRO
IEBGENER
Note: Db2 and IMS provide nondisruptive migration to encryption with their Database
Online Reorganization function. For high availability, Db2 and IMS provide nondisruptive
migration to encryption with Database Online Reorganization function.
After the copy operation completes, you have the old data set encrypted with the old key and
the new data set encrypted with the new key.
Alternatively, you can choose to keep or rename the old data sets. In this case, you might
want to consider setting the old key label cryptoperiod to end on the day the data was copied
into the new data set. This process prevents applications from using the old data set. For
more information about cryptoperiods, see 9.6, “Setting key expiration dates” on page 213.
Rather than deleting the old data set encryption key, you can archive the key. The archived
key remains in the active CKDS and is disabled for active use by default. When you want to
use an archived key, you can recall it by using ICSF or you can define the
CSF.KDS.KEY.ARCHIVE.USE resource in the XFACILIT class to allow all archived keys to be
used.
Tip: With EKMF, the old key can be deactivated. Deactivating a key in EKMF will remove
the key from the CKDS but EKMF will retain a backup of the key. EKMF can use the
backup to restore the key if necessary.
The effect is similar to archiving, but reduces the overall number of keys in the CKDS.
An alternative to key archiving is setting a key expiration date. When a key expires, it can no
longer be used in cryptographic operations. The expiration date must be changed to allow use
of the key.
For more information, see 9.6, “Setting key expiration dates” on page 213.
Select option 1 COPROCESSOR MGMT to see the results, as shown in Example 8-2.
CRYPTO SERIAL
FEATURE NUMBER STATUS AES DES ECC RSA P11
------- -------- -------------------- --- --- --- --- ---
6C00 DV785304 Active A A A A
6A01 N/A Active
Selecting COPROCESSOR MGMT displays the state of your crypto adapters. The “A” stands
for “active” (which is expected). When key data sets are not initialized, the state of the crypto
adapter is marked “I” for “ignored”.
For more information about activating a master key, see 4.3.5, “Loading the AES master key”
on page 86.
As shown in Example 8-3, the Current Master Key register is VALID and the Status is
ACTIVE.
Notes:
ICSF FMID HCR77C0 and newer versions are supported for Data Set Encryption with
Crypto Express5S and newer.
z/OS V2R3 and newer are supported at the time of this writing
The D ICSF,MKS command and the status of the master key registers is shown in
Example 8-4.
The CCA feature device number (6C00), its serial number (DV785304), its status (active), and
the master keys that are loaded (AES for our purpose) are shown in Example 8-4.
The active domain (84), the number of requests that are sent to the adapter since ICSF
initialization (1185 for the device), and the firmware level of the device (for example, 6.0.6z)
also are shown in Example 8-5 on page 169.
Select option 3.1 OPSTAT to see the results, as shown in Example 8-7.
The D ICSF,OPT command and the ICSF options are shown in Example 8-8.
Note: No refresh is required for keys that are generated by the ICSF panel or callable
services.
While the coordinated refresh is in progress, all active systems in the sysplex that are sharing
the active KDS or the new KDS are affected. Updates also are suspended. For more
information about rejecting update requests, see “Disabling CKDS Updates” on page 177 and
“Re-enable CKDS Updates” on page 179.
1 CKDS OPERATIONS -
Initialize a CKDS, activate a different CKDS,
(Refresh), or update the header of a CKDS and make
it active
2 REENCIPHER CKDS - Reencipher the CKDS prior to changing a symmetric
master key
3 CHANGE SYM MK - Change a symmetric master key and activate the
reenciphered CKDS
4 COORDINATED CKDS REFRESH - Perform a coordinated CKDS refresh
You see a panel that is similar to the panel that is shown in Example 8-12.
To perform a coordinated KDS refresh to a new KDS, enter the KDS names
below and optionally select the rename option. To perform a coordinated KDS
refresh of the active KDS, simply press enter without entering anything on
this panel.
In the new KDS field, specify the name of the new KDS to which you want to refresh.
In the archived KDS field, specify the data set name to which you want the active KDS
renamed. If the rename option is specified, the active KDS is renamed to the archived
KDS name and the new KDS is renamed to the active KDS name. This action removes the
necessity to modify the ICSF startup options because the data set remains the same.
To perform a coordinated KDS refresh to a new KDS, enter the KDS names
below and optionally select the rename option. To perform a coordinated KDS
refresh of the active KDS, simply press enter without entering anything on
this panel.
If you review the SYSLOG or OPERLOG, you see a sequence of messages that were sent
by ICSF. These messages confirm the successful run of the coordinated refresh (see
Example 8-15).
Example 8-16 Refresh in-storage copy of CKDS by using ICSF utility program CSFEUTIL
//STEP20 EXEC PGM=CSFEUTIL,
// PARM='SYS1.SC60NEW.SCSFCKDS,REFRESH'
The messages from successful refresh by using CSFEUTIL are shown in Example 8-17.
Press Enter to perform the refresh. A successful refresh results in message CSFM653I, as
shown in Example 8-18.
The Refresh in-storage CKDS panel displays a message to indicate a successful refresh, as
shown in Figure 8-2.
Note: This method cannot be used to change the CKDS format (for example, non-KDSR to
KDSR).
The process to increase the CKDS size includes the following steps:
1. Disabling CKDS updates.
2. Allocating a new, larger CKDS.
3. Copying data from the existing CKDS to the new CKDS.
4. Verifying a successful copy.
5. Refreshing ICSF with the new CKDS.
6. Reenabling CKDS updates.
The easiest way to disable updates to the CKDS is to use the SETICSF
DISABLE,CKDS,SYSPLEX=YES operator command. The use of this command disables updates to
the CKDS across all members of the sysplex.
Allocate the CKDS based on the sample as described in 4.3.2, “Creating a Common Record
Format (KDSR) CKDS” on page 81. Update the primary and secondary values in the
RECORDS field based on your calculations.
The results of the REPRO command, which includes nine records that consist of eight
cryptographic key records and one header record, is shown in Example 8-22.
Use the IDCAMS utility to list the number of records in the new, larger CKDS. The JCL is
shown in Example 8-23.
Refreshing ICSF
After the new CKDS is verified, ICSF must be refreshed to process the new CKDS. For more
information, see 8.3, “Refreshing the CKDS” on page 172.
Select ICSF option 2.1.7 CKDS KEY CHECK (see Figure 8-3).
The message “CHECK SUCCESSFUL” is displayed in the upper right corner if no error was
detected, as shown in Figure 8-4.
The system displays (message CSFM668I) the following information about the active key
data sets (KDS) on the system or sysplex:
The data set name for each active KDS (CKDS, PKDS, and TKDS).
The format of the KDS (for example, KDSR is the recommended format to use). The
following values are available:
– KDSR
– FIXED
– VARIABLE
The communication level that is in place for the KDS (for example, 3). This information is
displayed in a sysplex environment only.
Whether the KDS is being shared in a sysplex group (for example, Y/N).
The MKVPs that were started in the KDS (for example, DES AES). The following values
are available:
– DES, AES, or both for CKDS
– RSA, ECC, or both for PKDS
– P11, RCS, or both for TKDS
Note: If clear keys are in your CKDS, the clear keys are made available in the dumped data
set. If you secure (encrypted) keys are in your CKDS, the keys remain encrypted in the
dumped data set. Protected keys are not applicable to the CKDS because they are stored
in ICSF protected memory only.
The results of running the REPRO command, which includes nine records that consist of eight
cryptographic key records and one header record, is shown in Example 8-26.
Note: Clear keys are never returned from the CKDS by way of any of the ICSF callable
services. Only secure (encrypted) keys are returned. This result is by design to prevent
disclosure of clear key material.
Another option to list the records in a CKDS is to run a REXX script from TSO. For more
information about a REXX script, see Rexx Sample: List Records in the CKDS.
You can generate any list that you want: full or partial record labels, use wildcard
characters, or use option 1 List and manage all records (see Figure 8-7).
3. When the list is incomplete and you want to see more labels (see Figure 8-9 on
page 184), press Enter. Press End to return to the previous menu.
The following Status characters can be displayed in the 'S' column:
– - Active
– A Archived
– I Inactive
Any other character (-) means that the key label is active.
Note: Ensure that data set encryption keys are always defined as data-encrypting keys.
Note: The ability to archive, recall, and prohibit archive require the KDSR CKDS format.
Select an action:
1 Modify one or more fields with the new values specified
2 Delete the record
-------------------------------------------------------------------------------
More: -
Select an action:
1 Modify one or more fields with the new values specified
2 Delete the record
-------------------------------------------------------------------------------
YYYYMMDD YYYYMMDD
Record creation date: 20171120
Update date: 00000000
Cryptoperiod start date: 00000000 New value:
Cryptoperiod end date: 00000000 New value:
Date the record was last used: 20171120 New value:
Service called when last used: CSFSAE
Date the record was recalled: 00000000
Date the record was archived: 00000000
Archived flag: FALSE New value:
Prohibit archive flag: FALSE New value:
Some of the metadata values can be modified. To modify a value, enter a new value in the
provided field. A value of all zeros can be used to remove a date field.
For a rekeying operation, verification includes checking that the old and new keys are
working. You can attempt to open one or more data sets that are encrypted under the old key
and new key to ensure that the old and new keys are valid. For more information about
rotating data set encryption keys, see 7.2.2, “Rotating data set encryption keys” on page 160.
For a manual key transport operation, verification includes checking that any data sets that
are referencing the new key label can be opened successfully. If a key label was intentionally
overwritten, verification includes ensuring that any data that is protected by the original key is
deleted. For more information about transporting encryption keys, see 9.2, “Transporting data
set encryption keys” on page 193.
Several tools are available to manually back up a CKDS, such as DFSMShsm and
DFSMSdss. These tools are described next.
Using DFSMShsm
DFSMShsm provides TSO commands and an ISMF utility panel. The following TSO
commands can be used for backup and recovery:
HBACKDS
Creates a backup of an SMS-managed or non-SMS-managed data set. The command
options differ based on how the data set is managed. For more information, see Syntax.
HRECOVER
Recovers a backup data set in by replacing the original or renaming the back up to a
different name such that two versions exist. For more information, see Recovering a
backup version or a dump copy of a data set.
HBDELETE
Deletes a backup version of an SMS-managed or non-SMS-managed data set. For more
information, see Using TSO.
Using DFSMSdss
DFSMSdss provides the ADRDSSU z/OS utility, which can be used to dump and restore data
sets. The following commands are available for dump and restore:
DFSMSdss Dump Dumps DASD data to basic, large format, or extended format
sequential data sets. For more information, see DUMP command
for DFSMSdss.
DFSMSdss Restore Restores data from dump volumes to DASD volumes. For more
information, see RESTORE command for DFSMSdss.
Using DFSMShsm
DFSMShsm can perform automated backups of SMS-managed and non-SMS managed data
sets and volumes. For more information about configuration and setup, see DFSMShsm
Storage Administration Guide.
You can refresh the CKDS by using the ICSF utility panels. Complete the following steps:
1. In the ICSF ISPF application, select option 2 KDS management (see Example 9-1).
1 CKDS OPERATIONS -
Initialize a CKDS, activate a different CKDS,
(Refresh), or update the header of a CKDS and make
it active
2 REENCIPHER CKDS - Reencipher the CKDS prior to changing a symmetric
master key
3 CHANGE SYM MK - Change a symmetric master key and activate the
reenciphered CKDS
4 COORDINATED CKDS REFRESH - Perform a coordinated CKDS refresh
While the coordinated refresh is in progress, all active systems in the sysplex that are sharing
the active KDS or sharing the new KDS are affected.
Note: Consider temporarily disabling dynamic CKDS updates on all sysplex members for
the CKDS that you are processing (ICSF main panel option 4, ADMINCNTL) before the
coordinated refresh.
To perform a coordinated KDS refresh to a new KDS, enter the KDS names
below and optionally select the rename option. To perform a coordinated KDS
refresh of the active KDS, press enter without entering anything on
this panel.
In the new KDS field, specify the name of the backup KDS to which to refresh. The following
process occurs while a coordinated refresh is processed on the New KDS:
1. The specified new KDS is read into memory.
2. The in-memory copy is distributed to all systems that are sharing the active KDS or new
KDS.
3. All systems are switched over to the new in-memory copy and the new KDS.
Note: The archived KDS name cannot be the same name as the active KDS name or new
KDS name.
5. Enter Y to confirm the action. The Refresh successful message at the upper right corner is
shown (see Example 9-6).
To perform a coordinated KDS refresh to a new KDS, enter the KDS names
below and optionally select the rename option. To perform a coordinated KDS
refresh of the active KDS, simply press enter without entering anything on
this panel.
If you review the SYSLOG or OPERLOG, you see a sequence of messages that was sent
by ICSF that confirms the successful execution of the coordinated refresh (see
Example 9-7).
The command D ICSF,KDS that is used to confirm the refresh is shown in Example 9-8.
The current CKDS name is still the same (PLEX75.SHARED.SCSFCKDS), but the actual
CKDS was switched over during the refresh, as confirmed by a LISTCAT or ISPF display that
shows four tracks are allocated for the data part (see Example 9-9 on page 193).
Effectively, the EKMF repository contains a copy of all keys managed by EKMF. A backup of
EKMF includes a backup of the EKMF repository, which should be backed up as part of the
regular database backup procedures.
Keys in the EKMF repository are stored encrypted in a form that is independent from any
ICSF master key. EKMF Web implements a key hierarchy (described in 10.2.1, “Key
hierarchy” on page 221), which means that data set encryption keys are stored, in the
repository, encrypted under a dedicated key encrypting key (KEK). The KEKs are also stored
in the EKMF repository. The KEKs are encrypted by the EKMF Web Disaster Recovery Key
(DRK). To be able to retrieve any key from the EKMF repository, the DRK must be in the
CKDS on the z/OS system where EKMF Web is running.
The DRK is critical to being able to access the keys in the EKMF repository and any backup
of the EKMF repository will be useless without it.
The DRK should be backed up to ensure that it can always be restored. It is recommended
that the DRK is created from key parts. The use of TKE is recommended for this purpose.
TKE can store key parts securely on smart cards.
If TKE is not available, key parts can be recorded on paper and entered into the CKDS via the
ICSF API.
Regardless of how the DRK is created, the key parts must be stored securely, such that no
single individual has knowledge of and/or access to both key parts.
It is recommended to also have a backup of the CKDS. If a full CKDS with thousands of keys
must be restored, it may be more efficient to restore the backed up CKDS, rather than using
EKMF.
If only a subset of keys in the CKDS must be restored, EKMF will be able to identify the
specific keys that are missing and can be used to restore the keys. This will likely be more
efficient than attempting to extract individual key records out of a CKDS backup.
When the sending and receiving systems share the Master Key, the AES data-encrypting key
that is transported remains protected by the Master Key during transfer.
Note: The following scenarios apply when EKMF is not used for key management. With
EKMF, keys are created outside of any CKDS and are subsequently distributed to the
relevant CKDS keystores across multiple systems. Keys are stored in the EKMF repository
from where they can be restored to the CKDS keystores on demand. Manual transfer of
keys between systems is therefore not relevant with EKMF. See 10.3, “Key management
with EKMF Web” on page 223 for more details.
The scenarios involve two sites: Site A and Site B. They focus on common situations that
must be handled in the exchange and transport of encrypted data sets and keys. The
following scenarios were used:
Scenario 1: Site A and Site B feature the same Master Key. The data set key (KeyA) that
Site A wants to send to Site B is not used or defined in Site B. The data set that is
transferred in this scenario is Data setA (at Site A) with encrypted key KeyA.
Scenario 2: Site A and Site B feature different Master Keys. Site A wants to send its key
KeyA and Data setA to Site B. The key is not used or defined in Site B.
Scenario 3: Site A and Site B feature the same key label that is defined for different key
material.
Our IT environment to run this scenario consists of the following systems, as shown in
Figure 9-1 on page 195:
Site A features system SC60.
Site B features system environment PLEX75 (with SC74 and SC75).
KEYXFER starts the following ICSF callable services to perform key transfer:
CSNBKRC: Key record create
CSNBKRR: Key record read
CSNBKRW: Key record write
CSFSERV authorization is required for the CSFKRC, CSFKRR, and CSFKRW resources.
To transport a secure AES data-encrypting key, the tool reads the key token from the active
CKDS and writes it to a data set. The data set can then be transmitted to any number of
The receiving system must include the same ICSF Master Key as the sending system. A
secure key in the CKDS is protected by the Master Key and cannot leave the CKDS in clear
form. When it is transferred to another CKDS, it remains encrypted by the Master Key on the
sending system. For the target CKDS to accept the key, the target system must include the
same Master Key.
Complete the following steps to transfer a key by using the KEYXFER tool:
Important: Create a backup of each CKDS before transporting a key by using this method.
For more information, see 9.1, “Backing up and restoring data set encryption keys” on
page 188.
1. On the sending and receiving systems, copy the KEYXFER REXX utility into a PDS in the
SYSPROC/SYSEXEC concatenation.
2. On the sending system, allocate a data set to contain the encryption key for transfer (see
Example 9-10).
3. On the sending and receiving systems, allocate a PDS (or choose an existing PDS) to
contain your code libraries for the KEYXFER operations.
4. On the sending system, add a member ($KEYXFWR) to the PDS from Step 3 to perform
the WRITE_CKDS operation that reads a key token from the CKDS and writes it to the
data set that you allocated in Step 2 (see Example 9-11).
This member (see Example 9-11) indicates that we want to retrieve the key that is
associated with key label DATASET.PE06.ICSF.ENCRYPT.ME.ENCRKEY.00000005.
5. On the sending system, run the $KEYXFWR member to write the key. You see a message
in the TSO panel (see Example 9-12 on page 197).
6. On the sending system, browse the data set to verify that the key was added (see
Example 9-13).
7. From the sending system, transmit the data set that contains the key to the receiving
system.
8. On the receiving system, add a member ($KEYXFRD) to the PDS from Step 3 to perform
the READ_CKDS operation that reads the key token from the data set you transmitted in
Step 7 and writes it to the CKDS (see Example 9-14).
This action reads the key and key label from the transmitted data set and starts ICSF to
create the corresponding entry in the active CKDS. Start the member by entering EX
before the member name.
9. On the receiving system, run the $KEYXFRD member to read the key. You see a message
in the TSO panel (see Example 9-15).
10.If the key label exists, the tool fails the operation (see Example 9-16).
12.On the receiving system, you can use the CKDS KEYS panel utility to verify that the key
label was created (see Example 9-18). For more information about the CKDS KEYS panel
utility, see 8.6, “Verifying the CKDS format” on page 180.
Our IT environment to run this scenario consists of the following systems that are shown in
Figure 9-2 on page 199:
Site A features system SC60.
Site B features system environment PLEX75 (with SC74 and SC75).
To protect the AES data-encrypting key material from being disclosed, a transporter key can
be used to encrypt the AES data-encrypting key. Transporter keys that are used to encrypt a
data-encrypting key must have equal or greater key strength than the key that is protected.
Table 9-1 on page 200 is the National Institute of Standards and Technology (NIST) table of
comparable key strengths.
DFSMS uses 256-bit AES keys for z/OS data set encryption. Therefore, comparable strength
transporter keys must be at least 256-bit AES, 15360-bit DSA or RSA, or 512-bit ECC.
Because IBM Z does not support 15360-bit RSA keys, 256-bit AES or 512-bit ECC keys can
be used for the secure transport of a 256-bit AES key.
REXX samples
REXX scripts can start z/OS ICSF callable services to transport AES data-encrypting keys
between LPARs at your site or between your site and target sites that include different Master
Keys.
For more information about REXX samples that are used to perform AES data-encrypting key
transportation between LPARs at your site or between your site and target sites that include
different Master Keys, see IBM Crypto Education.
The process that is used to transfer data sets to a separate site that have different master
keys includes the steps that are described next.
Note: The GENECC2 sample assumes that an active PKDS is available on both systems
to store the public and private key pairs.
Complete the following steps to generate the ECC private and public key pairs:
1. Update ecc_key_label in GENECC2 with a label that represents the sending system’s
key pair.
For example, we updated ecc_key_label to SC60.ECC.KEYPAIR.
2. Run GENECC2 on the sending system.
For example, on Site A - SC60, we ran GENECC2, as shown in the following example:
EX 'PE08.EXEC(GENECC2)'
3. Update ecc_key_label in GENECC2 with a label that represents the receiving system’s
key pair.
For example, we updated ecc_key_label to PLEX75.ECC.KEYPAIR.
4. Run GENECC2 on the receiving system.
For example, on Site B - PLEX75, run the GENECC2, as shown in the following example:
EX 'PE08.EXEC(GENECC2)
The output from GENECC2 on Site B - PLEX75 is shown in Example 9-20.
4. Update ecc_pubkey and ecc_pubkey_length in IMPRTEC2 of the receiving system with the
output from running GENECC2 on the sending system.
For example, we updated ecc_pubkey in IMPRTEC2 on Site B - PLEX75 with the output
from running GENECC2 on Site A - SC60 (see Example 9-23).
The ECC public keys are now stored in each system’s PKDS.
1. Update sender_key_label in DRVAESXP with the sending system’s key pair label.
For example, we updated sender_key_label to SC60.ECC.KEYPAIR.
2. Update receiver_key_label in DRVAESXP with the receiving system’s public key label.
For example, we updated receiver_key_label to PLEX75.ECC.PUBLIC.KEY.
3. Update exporter_key_label in DRVAESXP with a label that represents the AES exporter
key.
For example, we updated exporter_key_label to SC60.AES.EXPORTER.KEY.
4. Run DRVAESXP on the sending system.
For example, on Site A - SC60, we ran DRVAESXP, as shown in the following example:
EX 'PE08.EXEC(DRVAESXP)'
The resulting output on Site A - SC60 is shown in Example 9-25.
-----------------------------------------------------------------
End of Sample
-----------------------------------------------------------------
-----------------------------------------------------------------
End of Sample
-----------------------------------------------------------------
Note: The REXX sample assumes that the AES data-encrypting key is being generated
on each invocation. If you plan to use an existing AES data-encrypting key, you must
comment out the calls to CSNBKRD, CSNBKGN, and CSNBKRC2 in the REXX sample
that delete (and generate) the AES data-encrypting key.
Our IT environment that was used to run this scenario consists of the systems that are shown
in Figure 9-3 on page 208:
Site A features system SC60.
Site B features system environment PLEX75 (with SC74 and SC75).
An imported key for which the key label was changed on Site B can be used only to encrypt
new data sets on Site B. That is, it can never be used to work with data sets that were created
on Site A and then transferred to Site B. This fact is true for exchanging keys between sites
that include the same Master Key or different Master Keys.
Note: The ability to track last reference dates requires a Common Record Format Key
Data Set. For more information, see 4.3.2, “Creating a Common Record Format (KDSR)
CKDS” on page 81.
Last reference date tracking must be enabled in the ICSF Installation Options (CSFPRMxx).
For more information about enablement, see 4.3.3, “CSFPRMxx and installation options” on
page 83.
After tracking is enabled, last reference dates can be viewed in one of the following ways:
By using the ICSF CKDS keys panel utility
By using the CSFKDMR callable service
In the next panel, you see a list of key entries that match the record label criteria that you
specified (see Example 9-31).
If you enter M (metadata) or K (key attributes and metadata) in the action column before the
key entry, you see the date that the record was last used and the service name (see
Example 9-32).
Select an action:
1 Modify one or more fields with the new values specified
2 Delete the record
-------------------------------------------------------------------------------
More: +
Metadata YYYYMMDD YYYYMMDD
Record creation date: 20171114
Update date: 20171114
Cryptoperiod start date: 00000000 New value:
Cryptoperiod end date: 20171114 New value:
Date the record was last used: 20171114 New value:
Service called when last used: CSFKRR
The CSFKDSL callable service can list all key labels that match specified criteria.
For more information about a REXX sample that shows how to start CSFKDSL, see IBM
Crypto Education.
The CSFKDMR callable service can read the metadata of a record that is associated with a
key label.
For more information about a REXX sample that shows how to read the last reference date,
see IBM Crypto Education.
These two services can be combined to find and view a set of key records that matches
specific criteria.
Note: If you can read the last used date but cannot read the service name, you might need
to wait for the KDSREFDAYS interval to end (which is 1 hour by default). To modify the
interval, use the SETICSF OPT,RPSEC option. For more information, see ICSF System
Programmer’s Guide.
By default, any attempts to use an archived key fail. However, if the key archive use control is
enabled, ICSF allows the request to complete successfully. For more information, see 3.5.11,
“Establishing a process for handling compromised operational keys” on page 58. In both
cases, an SMF record is logged.
Archived keys can be recalled from the archived state. When an archived key is recalled, a
recall date is set in the key record.
Key archival and key recall can be performed in one of the following ways:
By using the ICSF CKDS Keys panel utility
By using the CSFKDMW callable service
Note: The ability to archive keys requires a Common Record Format Key Data Set. For
more information, see 4.3.2, “Creating a Common Record Format (KDSR) CKDS” on
page 81.
In the next panel, you see a list of key entries that match the record label criteria that you
specified (see Example 9-34).
You can enter A in the action column before the key entry to archive a key. Archived keys show
an “A” in the status column to indicate that the key is archived (see Example 9-35).
The CSFKDSL callable service can list all key labels that match specified criteria. For
example, you can list all key labels that were not referenced since 2018.01.01.
For more information about a REXX sample that shows how to start CSFKDSL, see IBM
Crypto Education.
The CSFKDMW callable service can write the metadata to a record that is associated with a
key label.
For more information about a REXX sample that shows how to archive a key, see IBM Crypto
Education.
These two services can be combined to find and update a set of key records that matches
specific criteria.
Deactivating keys in EKMF instead of archiving them in the CKDS will reduce the number of
keys in the CKDS.
A deactivated key can be reactivated, which will restore the key to the CKDS keystores it was
removed from when the key was deactivated. Once restored, the key can be used as any
other data set encryption key.
It is possible to combine archiving and deactivation by initially archiving the key and
subsequently deactivating it. The deactivation would be done when no attempts to access the
key have been made for a given period of time.
With z/OS ICSF, cryptoperiods can be established by setting a key validity start date and key
validity end date in the key record. Key validity dates can be set in one of the following ways:
By using the ICSF CKDS Keys panel utility
Note: The ability to set cryptoperiods requires a Common Record Format Key Data Set.
For more information, see 4.3.2, “Creating a Common Record Format (KDSR) CKDS” on
page 81.
In the next panel, you see a list of key entries that match the record label criteria you
specified. When you view a key that is out of range for its cryptoperiod, the panel shows a
status of “I” for inactive (see Example 9-38).
If you enter M (metadata) or K (key attributes and metadata) in the action column before the
key entry, you see the information that is shown in Example 9-39.
Select an action:
1 Modify one or more fields with the new values specified
2 Delete the record
-------------------------------------------------------------------------------
More: +
Metadata YYYYMMDD YYYYMMDD
Record creation date: 20171114
Update date: 20171114
Cryptoperiod start date: 00000000 New value:
Cryptoperiod end date: 20171114 New value:
Date the record was last used: 20171114 New value:
Service called when last used: CSFKRR
You can select action 1 to Modify, then, enter a new expiration date in the future (if needed) to
reactivate the key. After you refresh your ICSF browser panel, you see that the key is no
longer Inactive (I), as shown in Example 9-40.
You can use these actions to set or update key validity dates in the CKDS.
The CSFKDSL callable service can list all key labels that match specified criteria.
For more information about a REXX sample that shows how to start CSFKDSL, see IBM
Crypto Education.
The CSFKDMW callable service can write the metadata to a record that is associated with a
key label.
For more information about a REXX sample that shows how to set a key validity date, see
IBM Crypto Education.
These two services can be combined to find and update a set of key records that matches
specific criteria.
Note: The tasks described in this chapter are based on EKMF Web version 2.0. Always
check the latest product documentation for the current EKMF Web version.
EKMF serves as the foundation on which remote cryptographic solutions and analytics for the
cryptographic infrastructure can be provided. EKMF is available as EKMF Workstation and
EKMF Web:
EKMF Workstation
Implemented as a self contained hardware appliance (including a dedicated workstation
and Linux operating system), EKMF Workstation is feature rich, supporting many key
types, with authentication done using smart cards with PINs. The security controls enable
EKMF Workstation to have higher security rating and administer more complex key types.
EKMF users can log in using a RACF ID. EJB Roles define the authorization to EKMF Web
functionality. Keys are generated by EKMF Web and stored in the EKMF’s own key
repository. Keys are secured by a key hierarchy protected by the master key residing in the
HSM, which means that EKMF Web never gets to see the key in the clear.
The EKMF key repository backend is provided by Db2 database running on z/OS. Normal
resiliency, backup and recovery process and procedures for z/OS Db2 should be used to
protect the repository.
Keystores are defined to the EKMF Web for remote distribution. Based on policies defined in
key templates, keys are distributed to the keystores wherever they may be needed. If a key is
lost or deleted from a particular keystore, EKMF Web can restore the key by redistributing it.
If a key needs to be archived or deleted, EKMF Web can remove the key from the connected
keystores.
Chapter 10. IBM Enterprise Key Management Foundation Web Edition 219
– WebSphere® Liberty 18.0.0.1 or later
– A task configured on the hosting z/OS LPAR to start an instance of the WebSphere
Liberty Application Server.
– A task is configured on the relevant z/OS LPAR to start the Liberty Angel1 process.
Crypto adapter (Crypto Express5S and newer)
– A crypto adapter is assigned to the LPAR where the WebSphere Liberty is installed.
– The crypto adapter is fully initialized with master keys set. EKMF Web uses AES, RSA,
and EC keys
The CKDS is configured to use variable-length key tokens.
The required databases, tables, and views are created (Db2 for z/OS).
EKMF Agent
– KMG and KMG-PE are installed in version HKMGAS0 with PTF level KMGS006 or
later, or version HKMGAL0 with PTF level KMGL010 or later.
The user account that installs and configures the Websphere Liberty must have write
access to the configuration files.
Once logged in, the navigation tabs on the left side allow you to navigate between functions.
The Main Menu for the EKMF Web is shown in Figure 10-3 on page 221.
Trusted Key Entry Workstation (TKE) is strongly recommended as it will enable secure
generation of keys never in the clear. EKMF Web requires master keys to be loaded into the
AES, RSA and ECC registries for each cryptographic processor for each LPAR.
Chapter 10. IBM Enterprise Key Management Foundation Web Edition 221
Use TKE: When using TKE (recommended, especially for production systems), these key
parts can be securely generated and stored on smart cards. Subsequently, the key parts
can be loaded from the smart cards and can installed in the CKDS keystore using ICSF.
Restoring the DRK follows the same key loading process using the existing key parts on
smart cards.
Use ICSF and the ICSF API: If TKE isn't available, key parts and their corresponding key
check values can be created and calculated using ICSF and then recorded on paper. Note
that key part creation for the EKMF Web DRK using ICSF isn't considered secure.
Keeping track of the paper copies of the key parts and storing them securely will be critical
to prevent data loss in case the CKDS is corrupted. Each key part should be stored
separately, such that no single individual has access to all parts.
Entry of these key parts to build the EKMF Web DRK will require the use of the ICSF API.
Use the EKMF Web DRK utility: EKMF Web provides a utility that can be used to create a
known, fixed-value Disaster Recovery Key that can be used for initial testing and isolated
proof-of-concepts.
The tool will create a 256 bit AES Importer key with the key value
3DF4B30AE33ED6E22EEBA06359512ACB2B7F9AA006105943C93E8BF30EACF700
and ENC-ZERO key check value '5D7DDC'.
In case the DRK is lost from the CKDS, re-running the utility will recreate the key and
allowing recovery of the keys stored in the EKMF repository.
As the key value is known, this utility is only appropriate to use for functional testing and
proof-of-concepts. A setup based on this key should not be considered secure. Do not use
this key in production.
These are: Key Administrator, Key Custodian 1, Key Custodian 2, and Auditor. The function
of each role is introduced in the following list:
Key Admin: sets up key hierarchy, controls key stores, creates key templates, as well as
performs special key state actions
– EJBROLE access: templates:write
Key Custodian 1: can generate keys in Pre-Activation state, but cannot activate and
distribute them. Can also destroy keys and mark keys as compromised.
– EJBROLE access: keys:generate
Key Custodian 2: cannot generate keys, but can activate and distribute them into key
stores. Can also destroy keys and mark keys as compromised.
– EJBROLE access: keys:active:install
Auditor: can view the audit log as well as keystores, templates, key list, data set
dashboard
– EJBROLE access: auditlog:read
On each LPAR, EKMF has an agent that listens for request and issues the underlying ICSF
API calls to load the keys into the CKDS (see Figure 10-5). This requires an EKMF agent to
be installed on each system that has a unique CKDS. If you are sharing a CKDS in a sysplex
you need one agent up per sysplex.
Chapter 10. IBM Enterprise Key Management Foundation Web Edition 223
typically describes the type of key, area where the key would be used, application key that
would be used, and the sequence number.
It is considered a best practice to have a sequence number as a tag. EKFM Web will provide
the next sequence number during request.
In the key label shown in Figure 10-6, an AES256 bit key on system TEC2MVS is used in a
Db2 subsystem DB1A with a sequence number.
In addition, custom tags can be added that need to be resolved during key generation. If for
example the tags <ENV> and <APPID> are defined, those two need to be specified as
parameters during every key generation based on this key template.
Using custom tags in the key label in a key template means that a key label can be used to
enforce a key label naming convention.
means that the resulting key label used for the key in the CKDS will begin with the literal string
'AES256.TEC2MVSF.' but will be followed by three variable values (separated by dots). The
last will always be 'SEQ' followed by the (5 digit) key sequence number.
10.3.4 Keystores
The key template will have a drop down listing all available keystores (see Figure 10-7). By
checking the keystore, EKMF Web will install the keys generated by this template into all
specified keystores.
EKMF Web provides the functionality to manage the key lifecycle. Figure 10-9 on page 226
depicts the EKMF Web lifecycle. The key actions are:
Activate: install the key in the keystore first time.
Restore: will ensure key is in all defined keystores.
Deactivate: removes the key from all keystores.
Compromised: marks the key as compromised.
Destroy: removes permanently the key from EKMF Web Centralized Key repository.
Chapter 10. IBM Enterprise Key Management Foundation Web Edition 225
Figure 10-9 Key lifecycle
Generate key
The template is the basis for any key generation. A key can be generated from the template
(Figure 10-10) or from an existing key (Figure 10-11).
When generating a key, the base naming convention and key characteristics are set by the
key template. Based on the template definition, you can create tags that can be changed
each time a key is generated.
The following example (Figure 10-12 on page 227) shows a cipher key with an active period
of one (1) year starting today that will be created in pre-activation state to be installed in the
TEC2MVS keystore.
The inputs allowed are the application ID and the sequence number. EKMF Web provides a
recommendation on the next available sequence number.
Activate key
Key activation means that the key will be installed into the key stores defined by the template.
This can be done upon generation, or, if a key is generated in the pre-activation state, it can
be done in the key view.
The pre-activation state provides the ability to have separation of duties where a key
custodian can have ability to generate key but is not allowed to install it in key stores.
Figure 10-13 shows a screen shot of a key in pre-activation st ate, and how to install it into the
keystore(s).
To load a key into the keystore, you must first select (1) Change state and (2) then select the
ACTIVE option.
Chapter 10. IBM Enterprise Key Management Foundation Web Edition 227
Deactivate
When a key is deactivated it is removed from the keystore. The key, however, is not deleted
from EKFM Web key repository so it can be reactivated or reinstalled.
If you uninstall a key, it will be uninstalled from keystores it was distributed to and it can be
restored upon request. The key can stay active though. If you deactivate a key, it will uninstall
the key as well.
To deactivate a key you can select change state for key and click deactivate or you can click
“Uninstall” as indicated in the screen shown in Figure 10-14.
To reactivate or restore a missing key from a keystore, you can either change the state of the
key to ACTIVE or restore the key as shown in Figure 10-15. This will restore the key into the
key store defined in template.
A compromised key can only be destroyed. Once a key is destroyed, it is removed from the
EKMF Web Centralized Key repository and cannot be recovered. As such, all data encrypted
with a key which has been destroyed should be considered cryptographically erased.
EKMF Web has a function called 'Generate Again'. This function allows generation of a new
key based on the parameters of an existing key. At the end of each row of keys in the key list
overview, there is a menu symbolized by three dots, arranged vertically.
To generate a key again, find the key in the key list overview and open the menu for the key
and select 'Generate Again' (as shown in Figure 10-16).
This will start a key generation (see “Key generation with EKMF Web” on page 125) with the
key template and values for key label tags pre-filled based on the values used for the selected
key. The key label tag <seqno> will be incremented to the next available key sequence
number, to make the key label unique
Complete the key generation, then return to z/OS to complete the key rotation, as described
in 7.2.2, “Rotating data set encryption keys” on page 160.
Note: For users of the EKMF workstation, the corresponding function is called 'renew key',
which is available from functions menu and the right click context menu for a key in the key
list overview.
Chapter 10. IBM Enterprise Key Management Foundation Web Edition 229
The first job reads the master catalog to create a detailed extract of datasets on system.
The second job takes this extract and loads into Db2.
These jobs should be run on each LPAR (z/OS image) at an interval which is agreed upon by
the business. Once a day should be sufficient for most reporting requirements.
In EKMF Web you can review results by going to the dashboard found in the datasets tab.
Datasets are viewed at sysplex level. You can refine the search by specifying:
Creation after date
Data set state
Data set name
Key label
Figure 10-17 provides a view of the data sets and their encryption status.
Additional details for individual data sets can be viewed by clicking on the data set name.
Figure 10-18 on page 231 provides detailed view of a data set (EKMFWEB.DATA.LAB01).
The data set is identified as “encryptable”. However, the Reason provided at the bottom of
the screen informs that, to enable encryption, this data set needs to be changed prior to
allocating a key label.
10.5 Summary
This chapter covers the basics of EKMF Web and the capabilities it has for key management
lifecycle. NIST 800-57 defines the capabilities need for a key manager which was
incorporated into the design. There are deeper topics that can be explored such as the
roles/responsibilities, EJBROLE definitions for key management function authorizations,
availability design, and audit.
Chapter 10. IBM Enterprise Key Management Foundation Web Edition 231
232 Getting Started with z/OS Data Set Encryption
A
Appendix A. Troubleshooting
This appendix describes some of the common error situations you might encounter when
working with data set encryption. Errors and their symptoms (error messages, unexpected
result, or behavior) also are described, including how to remedy or bypass the problem.
Note: The errors that are described in this appendix include attempting to access an
encrypted data set with specific characteristics.
A.1.1 Accessing a data set without proper access to the key label
Error messages that can occur when attempting to access a data set without proper access
to the key label are shown in Example A-1.
Example: A-1 Attempting to access a data set without proper key label access
IEC150I 913-84,IGG0193V,PE02,TSOPROC,ISP14455,9642,CONSM3,
ICH408I USER(PE02 ) GROUP(SYS1 ) NAME(PERVASIVE ENCRYPTION)
DATASET.PE06.ICSF.ENCRYPT.ME.ENCRKEY.00000005
CL(CSFKEYS )
INSUFFICIENT ACCESS AUTHORITY
ACCESS INTENT(READ ) ACCESS ALLOWED(NONE )
PE06.ICSF.ENCRYPT.ME.DATA5,
RC=X'00000008',RSN=X'00000000'
***
The remedy to perform is to permit the user READ access to the profile
DATASET.PE06.ICSF.ENCRYPT.ME.ENCRKEY.00000005 in CLASS(CSFKEYS). For more
information, see 5.7, “Granting access to encrypted data sets” on page 138.
A.1.2 Accessing data set with a key but key label is missing in the CKDS
Attempting to access a data set encrypted with a key, but the key label is not available in your
CKDS, is shown in Example A-2.
Example: A-2 Attempting to access a data set encrypted with a key without the key label in CKDS
IEC143I 213-85,IGG0193V,PRICHAR,IKJACCNT,ISP08467,9642,CONSM3,
PE06.ICSF.ENCRYPT.ME.DATA5,
RC=X'00000008',RSN=X'0000271C'
***
The messages that you receive for a VSAM data set are shown in Example A-3.
The remedy to take is to define the key label in your CKDS or import the missing key.
For more information about importing a missing key, see 9.2, “Transporting data set
encryption keys” on page 193.
A.1.3 Accessing a data set but key label is not defined in the CSFKEYS class
Attempting to access an encrypted data set with a key where the key label is in CKDS, but the
key is not defined in the CSFKEYS class, is shown in Example A-4.
The remedy is to define the CSFKEYS profile for your key, as shown in Example A-5.
For more information, see 5.7, “Granting access to encrypted data sets” on page 138.
A.1.4 Accessing a data set with a key but attributes are missing
Attempting to access an encrypted data set that includes a key and key label that is in CKDS
is shown in Example A-6. Also, the key is defined in the CSFKEYS class, but is missing
attributes.
SYMCPACFWRAP = YES
SYMCPACFRET = NO
IEC143I 213-85,IGG0193V,PRICHAR,IKJACCNT,ISP08490,96C2,CONSM4,
PE06.ICSF.ENCRYPT.ME06.DATA,
The action is to ensure that the key is defined in the CSFKEYS class with attributes (see
Example A-7).
For more information, see 5.7, “Granting access to encrypted data sets” on page 138.
The message CSFM401I CRYPTOGRAPHY - SERVICES ARE NO LONGER AVAILABLE indicates that a
problem exists because the ICSF address space was ended. Your automation should monitor
this message and take any necessary action to remedy the problem.
If the key is required, you can attempt to recover the key from a backup. (For more
information, see 9.1, “Backing up and restoring data set encryption keys” on page 188.)
Otherwise, the message can be ignored.
Example: A-12 Error when accessing a data set that is associated with an invalid key
IEC143I 213-85,IGG0193V,PRICHAR,IKJACCNT,ISP09234,9642,CONSM3,
PE06.ICSF.ENCRYPT.ME07.DATA,
RC=X'00000008',RSN=X'0000085E'
***
The ICSF CKDS browser also shows you at a quick glance the key type and for data set
encryption (see Example A-13). You must define them as DATA keys (Data-encrypting key for
the CSNBDEC, CSNBENC, CSNBSAD, CSNBSAE, CSNBSYD, and CSNBSYE services).
A.3 Keys
In this section, we describe issues you might encounter with expiring, expired, and archived
keys.
If you browse the check record, you receive the information that is shown in Example A-15.
If your key is expected to expire soon, consider whether the key validity date should be
extended or if the key should be rotated. For more information, see 3.5.10, “Establishing
cryptoperiods” on page 57.
Consider whether the key validity date should be extended or the key should be rotated. For
more information, see 9.6, “Setting key expiration dates” on page 213.
For more information about recalling an archived key, see 9.4, “Archiving data set encryption
keys” on page 211.
Important:
To avoid losing the generated keys, it is important to always keep an up-to-date backup
of the CKDS and the corresponding master keys.
Without a backup, there is a risk of losing encrypted data as a result of a lost key, e.g.
as a result of accidental key deletion.
aes_key_label = ,
/*-------------------------------------------------------------------*/
/* Check if the key exists in the CKDS (to prevent overwriting) */
/*-------------------------------------------------------------------*/
KRR2_rc = 'FFFFFFFF'X;
KRR2_label = aes_key_label;
KRR2_token = COPIES('00'X,725);
CALL CSNBKRR2; /* If key is found, print and exit */
IF (KRR2_rc = '00000000'X) THEN
DO;
SAY 'Secure key label: '||STRIP(aes_key_label);
SAY ' already exists. Stopping.';
EXIT;
END;
/*-------------------------------------------------------------------*/
/* Build a skeleton with the correct key usage and key management */
/*-------------------------------------------------------------------*/
KTB2_rule_array_count = '0000000C'X;
KTB2_rule_array =,
'INTERNALAES CIPHER XPRTCPACANY-MODE'||,
'NOEX-SYMNOEX-RAWNOEXUASYNOEXAASYNOEX-DESNOEX-AESNOEX-RSA';
KTB2_target_key_token_length = '000002D5'X;
KTB2_target_key_token = COPIES('DD'X,725);
CALL CSNBKTB2;
SAY 'Skeleton token created.';
/*-------------------------------------------------------------------*/
/* Generate a 256-bit AES CIPHER key */
/*-------------------------------------------------------------------*/
KGN2_rule_array_count = '00000002'x;
KGN2_rule_array = 'AES '||,
'OP ';
KGN2_clear_bit_length = '00000100'x; /* 256-bit */
KGN2_key_type_1 = 'TOKEN ';
KGN2_key_type_2 = '';
KGN2_generated_key_id_1_length = '000002D5'x;
KGN2_generated_key_id_1 = LEFT(KTB2_target_key_token,725);
KGN2_generated_key_id_2_length = '00000000'x;
KGN2_generated_key_id_2 = '';
Call CSNBKGN2;
SAY 'Random secure key token generated.';
/*-------------------------------------------------------------------*/
/* Store the key in the CKDS */
/*-------------------------------------------------------------------*/
KRC2_label = aes_key_label;
KRC2_token_length = KGN2_generated_key_id_1_length;
KRC2_token = KGN2_generated_key_id_1;
CALL CSNBKRC2;
SAY 'Successfully written to the CKDS.';
/*-------------------------------------------------------------------*/
/* Read the key from the CKDS */
SAY "-----------------------------------------------------------------"
SAY "End of Sample"
SAY "-----------------------------------------------------------------"
EXIT;
/* --------------------------------------------------------------- */
/* CSNBKRR2 - Key Record Read (CKDS) */
/* */
/* Reads a key token from the CKDS. */
/* */
/* See the ICSF Application Programmer's Guide for more details. */
/* --------------------------------------------------------------- */
CSNBKRR2:
KRR2_rc = 'FFFFFFFF'X;
KRR2_rs = 'FFFFFFFF'X;
KRR2_exit_data_length = '00000000'X;
KRR2_exit_data = '';
KRR2_rule_count = '00000000'X;
KRR2_rule_array = '';
KRR2_token_len = D2C(725,4);
KRR2_token = COPIES('00'X,725);
ADDRESS LINKPGM "CSNBKRR2",
"KRR2_rc",
"KRR2_rs",
"KRR2_exit_data_length",
"KRR2_exit_data",
"KRR2_rule_count",
"KRR2_rule_array",
"KRR2_label",
"KRR2_token_len",
"KRR2_token";
RETURN;
Appendix B. Sample REXX scripts for creating DATA and CIPHER keys 243
/* --------------------------------------------------------------- */
/* CSNBKTB2 - Key Token Build2 */
/* */
/* Builds a variable-length AES skeleton token. */
/* */
/* See the ICSF Application Programmer's Guide for more details. */
/* --------------------------------------------------------------- */
CSNBKTB2:
KTB2_return_code = 'FFFFFFFF'X;
KTB2_reason_code = 'FFFFFFFF'X;
KTB2_exit_data_length = '00000000'X;
KTB2_exit_data = '';
KTB2_clear_key_bit_length = '00000000'X;
KTB2_clear_key_value = '00000000'X;
KTB2_key_name_length = '00000000'X;
KTB2_key_name = '';
KTB2_user_associated_data_length = '00000000'X;
KTB2_user_associated_data = '';
KTB2_token_data_length = '00000000'X;
KTB2_token_data = '';
KTB2_service_data_length = '00000000'X;
KTB2_service_data = '';
KTB2_target_key_token_length = '000002D5'X;
KTB2_target_key_token = COPIES('DD'X,725);
ADDRESS LINKPGM "CSNBKTB2" ,
"KTB2_return_code" ,
"KTB2_reason_code" ,
"KTB2_exit_data_length" ,
"KTB2_exit_data" ,
"KTB2_rule_array_count" ,
"KTB2_rule_array" ,
"KTB2_clear_key_bit_length" ,
"KTB2_clear_key_value" ,
"KTB2_key_name_length" ,
"KTB2_key_name" ,
"KTB2_user_associated_data_length" ,
"KTB2_user_associated_data" ,
"KTB2_token_data_length" ,
"KTB2_token_data" ,
"KTB2_service_data_length" ,
"KTB2_service_data" ,
"KTB2_target_key_token_length" ,
"KTB2_target_key_token" ;
IF (KTB2_return_code /= '00000000'x) THEN
DO;
SAY 'KTB2: RC='||C2X(KTB2_return_code)||,
' RS='||C2X(KTB2_reason_code);
EXIT;
END;
RETURN;
/* --------------------------------------------------------------- */
/* CSNBKGN - Key Generate */
/* */
/* Generates either one or two DES or AES keys encrypted under a */
/* --------------------------------------------------------------- */
/* CSNBKRC2 - Key Record Create2 */
/* */
/* Adds a key token to the CKDS. */
/* */
/* See the ICSF Application Programmer's Guide for more details. */
/* --------------------------------------------------------------- */
CSNBKRC2:
KRC2_rc = 'FFFFFFFF'X;
Appendix B. Sample REXX scripts for creating DATA and CIPHER keys 245
KRC2_rs = 'FFFFFFFF'X;
KRC2_exit_data_length = '00000000'X;
KRC2_exit_data = '';
KRC2_rule_count = '00000000'X;
KRC2_rule_array = '';
ADDRESS LINKPGM "CSNBKRC2",
"KRC2_rc",
"KRC2_rs",
"KRC2_exit_data_length",
"KRC2_exit_data",
"KRC2_rule_count",
"KRC2_rule_array",
"KRC2_label",
"KRC2_token_length",
"KRC2_token";
IF (KRC2_rc /= '00000000'X) THEN
DO;
SAY 'KRC2 Failed (rc=' C2X(KRC2_rc)' rs='C2X(KRC2_rs)')' ;
EXIT;
END;
RETURN;
/* --------------------------------------------------------------- */
/* Debug */
/* --------------------------------------------------------------- */
NOVALUE:
SAY 'Condition NOVALUE was raised.';
SAY CONDITION('D')||' variable was not initialized.';
SAY SOURCELINE(sigl)
EXIT;
aes_key_label = ,
LEFT('keylabel.to.be.created',64);
/*-------------------------------------------------------------------*/
/* Generate a 256-bit AES DATA key */
/*-------------------------------------------------------------------*/
KGN_key_form = 'OP ';
KGN_key_length = 'KEYLN32 ';
KGN_key_type_1 = 'AESDATA ';
KGN_key_type_2 = '';
KGN_kek_identifier_1 = COPIES('00'X,64);
KGN_kek_identifier_2 = '';
KGN_generated_key_identifier_1 = COPIES('00'X,64);
KGN_generated_key_identifier_2 = '';
CALL CSNBKGN;
/*-------------------------------------------------------------------*/
/* Store the key in the CKDS */
/*-------------------------------------------------------------------*/
KRC2_label = aes_key_label;
KRC2_token_length = '00000040'X;
KRC2_token = KGN_generated_key_identifier_1;
CALL CSNBKRC2;
/*-------------------------------------------------------------------*/
/* Read the key from the CKDS */
/*-------------------------------------------------------------------*/
KRR_label = aes_key_label;
KRR_token = COPIES('00'X,64);
CALL CSNBKRR;
IF (KRR_rc \= '00000000'X) THEN
DO;
SAY 'KRR Failed (rc=' C2X(KRR_rc)' rs='C2X(KRR_rs)')' ;
SAY 'Secure key label: '||STRIP(aes_key_label);
SAY ' was not successfully created';
EXIT;
END;
IF (KRR_token \= KGN_generated_key_identifier_1) THEN
DO;
SAY 'Secure key label: '||STRIP(aes_key_label);
SAY ' returned from KRR does not match!';
EXIT;
END;
Appendix B. Sample REXX scripts for creating DATA and CIPHER keys 247
SAY 'Secure key label: '||STRIP(aes_key_label);
SAY ' was successfully created';
SAY "-----------------------------------------------------------------"
SAY "End of Sample"
SAY "-----------------------------------------------------------------"
EXIT;
/* --------------------------------------------------------------- */
/* CSNBKGN - Key Generate */
/* */
/* Generates either one or two DES or AES keys encrypted under a */
/* master key (internal form) or KEK (external form). */
/* */
/* See the ICSF Application Programmer's Guide for more details. */
/* --------------------------------------------------------------- */
CSNBKGN:
KGN_rc = 'FFFFFFFF'X;
KGN_rs = 'FFFFFFFF'X;
KGN_exit_data_length = '00000000'X;
KGN_exit_data = '';
ADDRESS linkpgm "CSNBKGN",
'KGN_rc' 'KGN_rs' ,
'KGN_exit_data_length' 'KGN_exit_data' ,
'KGN_key_form' 'KGN_key_length' ,
'KGN_key_type_1' 'KGN_key_type_2' ,
'KGN_kek_identifier_1' 'KGN_kek_identifier_2' ,
'KGN_generated_key_identifier_1' 'KGN_generated_key_identifier_2';
IF (KGN_rc /= '00000000'X) THEN
DO;
SAY 'KGN Failed (rc=' C2X(KGN_rc)' rs='C2X(KGN_rs)')' ;
EXIT;
END;
RETURN;
/* --------------------------------------------------------------- */
/* CSNBKRC2 - Key Record Create2 */
/* */
/* Adds a key token to the CKDS. */
/* */
/* See the ICSF Application Programmer's Guide for more details. */
/* --------------------------------------------------------------- */
CSNBKRC2:
KRC2_rc = 'FFFFFFFF'X;
KRC2_rs = 'FFFFFFFF'X;
KRC2_exit_data_length = '00000000'X;
KRC2_exit_data = '';
KRC2_rule_count = '00000000'X;
KRC2_rule_array = '';
ADDRESS LINKPGM "CSNBKRC2",
"KRC2_rc",
"KRC2_rs",
"KRC2_exit_data_length",
"KRC2_exit_data",
/* --------------------------------------------------------------- */
/* CSNBKRR - Key Record Read (CKDS) */
/* */
/* Reads a key token from the CKDS. */
/* */
/* See the ICSF Application Programmer's Guide for more details. */
/* --------------------------------------------------------------- */
CSNBKRR:
KRR_rc = 'FFFFFFFF'X;
KRR_rs = 'FFFFFFFF'X;
KRR_exit_data_length = '00000000'X;
KRR_exit_data = '';
KRR_token = COPIES('00'X, 64);
ADDRESS LINKPGM "CSNBKRR",
"KRR_rc",
"KRR_rs",
"KRR_exit_data_length",
"KRR_exit_data",
"KRR_label",
"KRR_token";
RETURN;
/* --------------------------------------------------------------- */
/* Debug */
/* --------------------------------------------------------------- */
NOVALUE:
SAY 'Condition NOVALUE was raised.'
SAY CONDITION('D')||' variable was not initialized.'
SAY SOURCELINE(sigl)
EXIT;
Appendix B. Sample REXX scripts for creating DATA and CIPHER keys 249
250 Getting Started with z/OS Data Set Encryption
Related publications
The publications listed in this section are considered particularly suitable for a more detailed
discussion of the topics covered in this book.
IBM Redbooks
The following IBM Redbooks publications provide additional information about the topic in this
document. Note that some publications referenced in this list might be available in softcopy
only.
IBM z15 Technical Introduction, SG24-8850
IBM z15 (8561) Technical Guide, SG24-8851
Leveraging ICSF, REDP-5431
You can search for, view, download or order these documents and other Redbooks,
Redpapers, Web Docs, draft and additional materials, at the following website:
ibm.com/redbooks
Online resources
The following websites are also relevant as further information sources:
Getting started with IBM Pervasive Encryption:
https://www.ibm.com/support/z-content-solutions/pervasive-encryption/
IBM Z Pervasive Encryption Frequently Asked Questions:
https://www.ibm.com/common/ssi/cgi-bin/ssialias?htmlfid=ZSQ03116USEN
For z/OS V2.4: Introduction to z/OS Data Set Encryption:
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.izsp1
00/introdsencrypt.htm
OA56622 APAR: z/OS Data Set Encryption documentation (most current information DS
encryption):
https://www.ibm.com/support/pages/apar/OA56622
Video: How to Implement Pervasive Dataset Encryption on IBM z/OS:
https://www.youtube.com/watch?v=zdSXRUSmkb4
Video: Pervasive encryption in z/OS: What about my CF structures and logstreams?:
https://www.youtube.com/watch?v=lTmsFWuJwJU
SG24-8410-01
ISBN 0738460222
Printed in U.S.A.
®
ibm.com/redbooks