Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. ·...

15
box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program Support of IBM Common Cryptographic Architecture (CCA) interface for IBM z Platform Revision 1.0

Transcript of Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. ·...

Page 1: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

box_CCA_interface_v3r23.docx Edition 2019-12-30

Version 3 Release 23 (V3R23) BOX Customer Security Program

Support of IBM Common Cryptographic Architecture (CCA) interface for IBM z Platform

Revision 1.0

Page 2: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program
Page 3: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Table of Contents i

Table of Contents

1 INTRODUCTION .............................................................................................................................. 1

1.1 PREREQUISITES .......................................................................................................................... 1

2 CERTIFICATE CREATION CONTROLLED BY ICSF .................................................................... 2

2.1 CREATION OF A SIGNED CERTIFICATE ............................................................................................ 2 2.1.1 Testing IBMJCECCA Configuration ................................................................................... 2 2.1.2 Requesting a certificate ..................................................................................................... 3

2.1.2.1 Keyring......................................................................................................................................... 3 2.1.2.2 Hwkeytool .................................................................................................................................... 3

2.1.3 RACF ................................................................................................................................. 4 2.1.4 Requesting the Signed Configuration Certificate ............................................................... 6

2.2 TEST FILE SIGNING ...................................................................................................................... 8 2.3 RE-ENCRYPTION OF BSL WITH A NEW MEK ................................................................................. 8 2.4 REINITIALIZATION OF BSL ............................................................................................................ 9

3 APPENDIX ..................................................................................................................................... 10

3.1 SECURITY TOOL OPTIONS SUPPORTING IBM COMMON CRYPTOGRAPHIC ARCHITECTURE (CCA) INTERFACE FOR IBM Z PLATFORM ......................................................................................................... 10

4 DISCLAIMER ................................................................................................................................. 11

Page 4: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program
Page 5: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Introduction 1

1 Introduction

The following manual is designed to give a comprehensive overview of the base security creation for IBM z® Platforms and BOX V3R23 in compliance with the SWIFT Customer Security Project (SWIFT CSP).

1.1 Prerequisites

➢ To use a hardware cryptographic device on IBM z® Platforms, the appropriate card

must be installed and configured according to the specifications that are provided with the

card. On some platforms it is also necessary for the user or application to set up the

cryptographic environment and provide access control (log into the card).

➢ On the z/OS platform, access to hardware cryptographic devices is controlled by the

Integrated Cryptographic Service Facility (ICSF). ICSF must be configured and

running before the hardware cryptographic device is accessed.

➢ To use the IBMJCECCA provider, you must add it to the 'java.security' file in the

$JAVA_HOME/lib/security directory on z/OS and the

$JAVA_HOME/jre/lib/security directory on Linux. If you add it as the first JCE provider

in the list, it will be selected automatically for any service and algorithm that it supports if no

provider (option -ksprovider) is specified. To add the IBMJCECCA provider as the first JCE

provider, add the following to the java.security file:

#

# List of providers and their preference orders:

#

security.provider.1=com.ibm.crypto.hdwrCCA.provider.IBMJCECCA

security.provider.2=com.ibm.crypto.provider.IBMJCE

Page 6: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Certificate Creation controlled by ICSF 2

2 Certificate Creation controlled by ICSF

The IBMJCECCA provider extends Java Cryptography Extension (JCE) and Java Cryptography Architecture (JCA) seamlessly to add the capability to use hardware cryptography using IBM Common Cryptographic Architecture (CCA) interfaces on both Linux for IBM z® and z/OS operating systems. IBM CCA is a set of software elements that provide common application interfaces to secure, high-speed cryptographic services on various platforms using hardware cryptographic devices. On the z/OS platform, access to hardware cryptographic devices is controlled by the Integrated Cryptographic Service Facility (ICSF). On IBM z® servers running Linux, access to hardware cryptographic devices is controlled by the IBM PCIe.

2.1 Creation of a signed certificate

2.1.1 Testing IBMJCECCA Configuration

java -jar icopesecurity.jar -testracfcca -ringownerid MYDEVKEYRINGOWNER

-ringid mydevkeyring

Remark: If the exception 'Hardware error from call CSNDPKB returnCode 12 reasonCode 0' has been thrown then the ICSF is not available. IMPORTANT Make sure that the CSF subsystem is started and ICSF is configured correctly, such as

tso %ICSFPAN

Page 7: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Certificate Creation controlled by ICSF 3

2.1.2 Requesting a certificate

There are two possibilities to request a certificate :

➢ RACF

➢ Hwkeytool

2.1.2.1 Keyring

Certificates are bound to a keyring. First create or identify the keyring you would like to use.

2.1.2.2 Hwkeytool

The easiest and most convenient way is to create the certificate with hwkeytool .

hwkeytool -genkeypair -keysize 2048 -dname "CN=Dev. CCA Testing, OU=BOX

Development, O=Development, L=Hamburg, S=Hamburg, C=DE" -alias DEV -

keystore safkeyring://OLAF/devkeyring -storetype JCECCARACFKS -

providerName IBMJCECCA -J-

Djava.protocol.handler.pkgs=com.ibm.crypto.hdwrCCA.provider

Example

List of all certificates of one keyring:

Page 8: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Certificate Creation controlled by ICSF 4

2.1.3 RACF

The RACF menu gives you the possibility to work with certificates. Start with the option 7.1

In our example we are creating a new certificate with key pair.

IMPORTANT

Don’t specify a Label in this page or a signing certificate on this page.

➢ Press PF8 for more information:

Page 9: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Certificate Creation controlled by ICSF 5

IMPORTANT

Please make sure that the decimal key size of the private key is 2048.

➢ Press PF8 for more information.

➢ Specify a label in quotes for the new certificate. This name will be used by the

icopesecurity.jar. The usage should be Dataencrypt.

➢ Start the generation of the certificate with “Enter”.

The output should be similar to

IRRD175I The new profile for DIGTCERT will not be in effect until a

SETROPTS RE

FRESH has been issued.

***

Page 10: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Certificate Creation controlled by ICSF 6

➢ The new certificate needs to be bound to the customers’ keyring.

2.1.4 Requesting the Signed Configuration Certificate

In order to change the customer’s configuration, the public key must be signed by Intercope.

Please export the public key to a data set and upload it to the Intercope Ticket System.

➢ Export the Public Key

Page 11: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Certificate Creation controlled by ICSF 7

The new certificate should look like

Page 12: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Certificate Creation controlled by ICSF 8

➢ Copy the Public key to BOX installation directory

cp -fT "//'OLAF.UATBOX1'" UATBOX1

➢ Convert the Public Key to ASCII codepage

iconv -f IBM-1047 -t ISO8859-1 UATBOX1 >CustomerCertificate.xml

➢ Generate The Signed Configuration Certificate Envelope

• Generate the SigendConfigurationCertificate with the following command:

java -jar lib/icopesecurity.jar -gencertenvelopecca -certtype PEM

-certfile CustomerCertificate.xml -ringownerid -ringid devkeyring

-keyalias -cfgcertfile mySignedConfigurationCertificate.sig.xml

• Send the mySignedConfigurationCertificate.sig.xml to the Intercope Implementation

team to have this signed.

• Verify the new certificate envelope mySignedConfigurationCertificate.sig.xml java -jar icopesecurity.jar -verifycertenvelope -cfgcertfile

mySignedConfigurationCertificate.sig.xml

2.2 Test File Signing

➢ Test file signing

java -jar icopesecurity.jar -genfilesignaturecca -kstype JCECCARACFKS

-cfgcertfile mySignedConfigurationCertificate.sig.xml -file test.txt

➢ Verify file signature

java -jar icopesecurity.jar -verifyfilesignature -datafile test.txt -

signaturefile test.txt.sig.xml -cfgcertfile

mySignedConfigurationCertificate.sig.xml

2.3 Re-Encryption of BSL with a new MEK

➢ Generate new encrypted MEK by using IBMJCECCA [Output: mymek.enc]

java -jar icopesecurity.jar -encryptmekcca -cfgcertfile

mySignedConfigurationCertificate.sig.xml -emekfile mymek.enc

➢ Extract current BaseSecretList.enc, mek.enc and SignedConfigurationCertificate.sig.xml from

security.zip [Output: BaseSecretList.enc, mek.enc, SignedConfigurationCertificate.sig.xml]

java -jar icopesecurity.jar -extractseczipentries -securityzipfile

security.zip -zipentrynames BaseSecretList.enc mek.enc

SignedConfigurationCertificate.sig.xml

➢ Re-encrypt the BSL [input/output: BaseSecretList.enc, output: BaseSecretList.xml.sig.xml]

java -jar icopesecurity.jar -reencryptbslcca -kstype JCECCARACFKS -

encbslfile BaseSecretList.enc -emekfile mek.enc -cfgcertfile

SignedConfigurationCertificate.sig.xml -newemekfile mymek.enc -

newcfgcertfile mySignedConfigurationCertificate.sig.xml

➢ Rename

• mymek.enc -> mek.enc

• mySignedConfigurationCertificate.sig.xml ->

SignedConfigurationCertificate.sig.xml

Page 13: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Certificate Creation controlled by ICSF 9

➢ Insert mek.enc, BaseSecretList.enc, BaseSecretList.xml.sig.xml, and

SignedConfigurationCertificate.sig.xml to security.zip [input/output: security.zip]

java -jar icopesecurity.jar -insertseczipentries -securityzipfile

security.zip -files mek.enc BaseSecretList.enc

BaseSecretList.xml.sig.xml SignedConfigurationCertificate.sig.xml

➢ Verify the reencrypted BSL

java -jar icopesecurity.jar -testbsl -securityzipfile security.zip

2.4 Reinitialization of BSL

➢ Extract current BaseSecretList.enc, BaseSecretList.xml.sig.xml, mek.enc and

SignedConfigurationCertificate.sig.xml from security.zip

[Output: BaseSecretList.enc, BaseSecretList.xml.sig.xml, mek.enc,

SignedConfigurationCertificate.sig.xml]

java -jar icopesecurity.jar -extractseczipentries -securityzipfile

security.zip -zipentrynames BaseSecretList.enc

BaseSecretList.xml.sig.xml mek.enc

SignedConfigurationCertificate.sig.xml

➢ Reinitialize BSL by using IBMJCECCA

[Input/Output: BaseSecretList.enc/BaseSecretList.xml.sig.xml]

java -jar icopesecurity.jar -reinitializeencryptbslcca -encbslfile

BaseSecretList.enc -bslsigfile BaseSecretList.xml.sig.xml -emekfile

mek.enc -cfgcertfile SignedConfigurationCertificate.sig.xml -comment

"Reinit by John Doe" -reinitencryptionkeylist -kstype JCECCARACFKS

➢ Insert BaseSecretList.enc, and BaseSecretList.xml.sig.xml to security.zip again

[input/output: security.zip]

java -jar icopesecurity.jar -insertseczipentries -securityzipfile

security.zip -files BaseSecretList.enc BaseSecretList.xml.sig.xml

➢ Verify the reinitialized BSL

java -jar icopesecurity.jar -testbsl -securityzipfile security.zip

Page 14: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Appendix 10

3 Appendix

3.1 Security Tool options supporting IBM Common Cryptographic Architecture (CCA) interface for IBM z Platform

icopesecurity.jar

For all options of icopesecurity that need the information about custom's private key, there are corresponding IBMJCECCA-options (with suffix 'cca'):

-showkeystoreinfocca Show details about the given

JCE keystore by using IBM

Common Cryptographic

Architecture (CCA) interface

-gencertenvelopecca Generate the INTERCOPE

certificate envelope file for

IBM Common Cryptographic

Architecture (CCA) Environment

-genfilesignaturecca Generate digital signature of

the given file by using IBM

Common Cryptographic

Architecture (CCA) interface

-generatemekcca Generate Master Encryption Key

(MEK) by using IBM Common

Cryptographic Architecture

(CCA) interface

-encryptmekcca Encrypt Master Encryption Key

(MEK) by using IBM Common

Cryptographic Architecture

(CCA) interface

-reencryptbslcca Reencrypt Base Secert List

(BSL) by using IBM Common

Cryptographic Architecture

(CCA) interface

-reinitializeencryptbslcca Reinitialize the Encrypted Base

Secret List (E-BSL) by using

IBM Common Cryptographic

Architecture (CCA) interface

-testracfcca Testing of RACF/CCA environment

To obtain the private key information the following IBMJCECCA-specific option parameters must be specified:

[-kstype <type of key store supported by IBMJCECCA e.g. JCECCARACFKS>

[-ksprovider <key store provider (optional, default 'IBMJCECCA')>

[-ringownerid <ID of user that owns the RACF keyring>]

[-ringid <name of the RACF keyring>]

[-keyalias <alias of the key itself>]

Page 15: Version 3 Release 23 (V3R23) BOX Customer Security Program · 2020. 3. 17. · box_CCA_interface_v3r23.docx Edition 2019-12-30 Version 3 Release 23 (V3R23) BOX Customer Security Program

Disclaimer 11

4 Disclaimer

INTERCOPE International Communication Products Engineering GmbH (Intercope) and the stylized logo is the registered trademark of Intercope and its subsidiaries, in Germany and certain other countries. All other trademarks mentioned in this document are the acknowledged property of their respective owners. Intercope provides this publication "as is" without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of non-infringement, merchantability or fitness for a particular purpose. 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. Intercope may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. This information may contain sample application programs in source language, which illustrate programming and implementation techniques. You may copy, modify, and distribute these samples programs in any form without payment to Intercope, for the purposes of developing, using, marketing or distributing application programs for which the sample programs are written. These examples have not been thoroughly tested under all conditions. Intercope, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. The sample programs are provided "AS IS", without warranty of any kind. Intercope shall not be liable for any damages arising out of use of the sample programs. Intercope grants the right to reproduce, distribute and display these publications solely within your enterprise provided that all proprietary notices are preserved. Intercope does not allow derivative works of these publications, or to reproduce, distribute or display these publications or any portion thereof outside your enterprise, without the express consent of Intercope. Without written permission of Intercope no part of this publication may be modified and/or reproduced in any way.

INTERCOPE GmbH Himmelstrasse 12-16, 22299 Hamburg, Germany +49 40 514 52 0 [email protected] https://www.intercope.com Copyright © 2019 INTERCOPE International Communication Products Engineering GmbH. All Rights Reserved.