zCEE Customization Security With MVS Batch PDF
zCEE Customization Security With MVS Batch PDF
Customization -
Security and
MVS Batch
Table of Contents
Overview .................................................................................................................................................... 4
Creating RACF resources ........................................................................................................................... 5
Test the connection from the batch job to the zCEE server............................................................................. 9
Configure the AT-TLS policy ..................................................................................................................... 14
Activating the AT-TLS configuration ......................................................................................................... 36
Summary ................................................................................................................................................. 41
Appendix – AT-TLS Policy Agent Configuration File .................................................................................. 42
Important: On the desktop there is a file named Security CopyPaste.txt. This file contains
commands and other text used in this workshop. Locate that file and open it. Use the copy-and-
paste function (Ctrl-C and Ctrl-V) to enter commands or text. It will save time and help avoid
typo errors. As a reminder text that appears in this file will be highlighted in yellow.
Overview 2 of 43
© Copyright IBM Corporation 2020 All rights reserved
Mitch Johnson ([email protected])
ZCONEE- z/OS Connect EE V3.Customization – Security and MVS Batch
This exercise requires the completion of the zCEE Basic Configuration and zCEE Basic Security
Configurations exercises before it can be performed.
This exercise requires using z/OS user identities FRED and USER1. The password for these
users will be provided by the lab instructions.
There are examples of server.xml scattered through this exercise. Your server.xml may differ
depending on which exercises have been previously performed. Be sure the red lines in these
examples re either added or already present.
The acronyms RACF (resource access control facility) and SAF (system authorization facility)
are used in this exercise. RACF is the IBM security manager product whereas SAF is a generic
term for any security manager product, e.g. ACF2 or Top Secret or RACF. An attempt has been
to use SAF when referring to information appropriate for any SAF product and to use RACF
when referring to specific RACF commands or examples.
Any time you have any questions about the use of IBM z/OS Explorer, 3270 screens, features or
tools, do not hesitate to ask the instructor for assistance.
Text in bold and highlighted in yellow in this document should be available for copying and
pasting in a file named Security CopyPaste file on the desktop.
Please note that there may be minor differences between the screen shots in this exercise versus
what you see when performing this exercise. These differences should not impact the completion
of this exercise.
Overview 3 of 43
© Copyright IBM Corporation 2020 All rights reserved
Mitch Johnson ([email protected])
ZCONEE- z/OS Connect EE V3.Customization – Security and MVS Batch
Overview
This exercise demonstrates the steps required to enable TLS security between an MVS batch region and
a z/OS Connect EE (zCEE) server. TLS security between these two endpoints requires the use of AT-
TLS (Application Transparent-TLS). This document is only intended to be an introduction to AT-TLS,
not an all-encompassing description of what can be done by AT-TLS. Therefore, only a simple AT-TLS
outbound policy will be used in this exercise. Hopefully performing this exercise will provide the
foundation required to fully exploit AT-TLS in other scenarios.
First the RACF resources, e.g. digital certificates, keyrings will be defined and configured.
The exercise will begin by submitting an API requester batch application that invokes an API using
HTTP. This is done to become familiar with the application.
z/OSMF will then be used to configure a simple AT-TLS outbound policy.
The AT-TLS policy will be activated and messages and traces etc. will be reviewed to confirm the
policy has been installed.
Finally, the client API requester batch application will be executed again showing how HTTPS is
used to encrypt the message and provide an authentication identity.
Overview 4 of 43
© Copyright IBM Corporation 2020 All rights reserved
Mitch Johnson ([email protected])
ZCONEE- z/OS Connect EE V3.Customization – Security and MVS Batch
In this section, the required RACF resources will be created. Note that the digital certificates used by
the batch client application were created in a previous exercise. Review member ZCEERCF4 to see the
commands used to create USER1’s personal certificate and the certificate authority (CA) certificate used
to sign the personal certificates used in this exercise.
___1. Browse data set USER1.ZCEE30.CNTL. You should see the members in that data set.
___2. Next browse member ZCEERCF6, you should see the RACF commands below. Submit the job for
execution.
RACDCERT ID(USER1) ADDRING(Liberty.KeyRing)
PERMIT IRR.DIGTCERT.LISTRING +
CLASS(FACILITY) ID(USER1) ACCESS(READ)
PERMIT IRR.DIGTCERT.LIST +
CLASS(FACILITY) ID(USER1) ACCESS(READ)
These commands
Define a key ring for USER1
Connect USER1’s personal certificate (created earlier by job ZCEERCF4) to this key ring
Connect the certificate authority (CA) public certificate used to sign USER1’s personal certificate
to this key ring.
USER1 is given the required authority to access the key ring and certificate
The in-storage profile for digital certificates resources are refreshed.
N.B. The same CA was used to sign the server certificate that will be sent by the zCEE server this
is the only CA certificate required on this key ring.
Tech-Tip: In this example the digital certificates had been already present in the RACF data base.
But if they had been provided by an external CA authority and stored in MVS data sets, they could
have been added to RACF with these commands:
___3. Next browse member ZCEESRCF7. You should see the RACF commands below. Submit the job for
execution if this job has not been previously submitted in another exercise.
/* Create personal certificate for zCEE outbound client request */
racdcert id(libserv) gencert subjectsdn(cn('zCEE Client Cert') +
ou('ATS') o('IBM')) withlabel('zCEE Client Cert') signwith(certauth +
label('zCEE CA')) notafter(date(2022/12/31))
These commands
Define a personal certificate for the zCEE server for use during outbound handshakes
Define a key ring to be used for outbound handshakes
Connect the zCEE server personal certificate to this key ring
Connect the CA public certificate used to sign the zCEE server’s outbound personal certificate to
this key ring.
Connect the CA public certificate used to sign the API provider server’s certificate to this key ring.
Connects the CA public certificate used to sign the zCEE server’s outbound personal certificate to
the API provider’s key ring
User LIBSERV is given the required authority to access their key ring and certificate
The in-storage profile for digital certificates resources are refreshed.
User LIBSERV is connected to the groups that provide access to this zCEE instance.
___4. Edit the server.xml configuration file for the myServer server found in directory.
/var/zosconnect/servers/myServer and change the include for keyringMutual.xml to an include of
keyringOutboundMutua.xml (see below) and add include statements for apiRequesterHTTPS.xml and
shared.xml, see below:
<include location="/${server.config.dir}/includes/keyingOutboundMutual.xml"/>
<include location="${server.config.dir}/includes/apiRequesterHTTPS.xml" />.
<include location="/${server.config.dir}/includes/shared.xml"/>
These include statement may not be required if another exercise has already been performed this action.
<include location="/${server.config.dir}/includes/safSecurity.xml"/>
<include location="/${server.config.dir}/includes/ipic.xml"/>
<include location="/${server.config.dir}/includes/keyringOutboundMutual.xml"/>
<include location="/${server.config.dir}/includes/apiRequesterHTTPS.xml"/>
<include location="/${server.config.dir}/includes/groupAccess.xml"/>
<include location="/${server.config.dir}/includes/shared.xml"/>
<sslDefault sslRef="DefaultSSLSettings"
outboundSSLRef="OutboundSSLSettings" />
<ssl id="DefaultSSLSettings"
keyStoreRef="CellDefaultKeyStore"
trustStoreRef="CellDefaultKeyStore"
clientAuthenticationSupported="true"
clientAuthentication="true"/>
<keyStore id="CellDefaultKeyStore"
location="safkeyring:///Keyring.LIBERTY"
password="password" type="JCERACFKS"
fileBased="false" readOnly="true" />
<ssl id="OutboundSSLSettings"
keyStoreRef="OutboundKeyStore"
trustStoreRef="OutboundKeyStore"/>
<keyStore id="OutboundKeyStore"
location="safkeyring:///zCEE.KeyRing"
password="password" type="JCERACFKS"
fileBased="false" readOnly="true" />
Test the connection from the batch job to the zCEE server
The JCL to execute the batch client can be found in USER1.ZCEE30.CNTL, the member name is
GETAPI.
___2. It should complete with a return code of 5. The job’s return code was derived from the value of the BAQ-
ERROR-IN-STUB field. This return code indicated that the attempt to communicate with the z/OS
Connect EE server using the z/OS client web enablement toolkit (HWT) failed.
There is a simple explanation on why this error occurred. The z/OS Connect server was configured to
require all client requests use HTTPS (requireSecure=”true”) for communications When the request
from the batch job arrived, the server attempted to redirect the inbound request to a HTTPS port. Since
the batch job did not have support for SSL, the redirect request failed (HTTP code 302),
___3. To test a non-TTL connection, HTTPS security for the cscvinc_1.0.0 needs to be turned off temporarily.
Edit file apiRequesterHTTPS.xml and change requireSecure attribute of the cscvincapi_1.0.0
apiRequester element to false as shown below. This disables the requirement for inbound HTTPS traffic
for this specific API requester element.
Test the connection from the batch job to the zCEE server 9 of 43
© Copyright IBM Corporation 2020 All rights reserved
Mitch Johnson ([email protected])
ZCONEE- z/OS Connect EE V3.Customization – Security and MVS Batch
<zosconnect_apiRequesters location="/var/zcee/shared/apiRequesters"
idAssertion="ASSERT_ONLY">
<apiRequester name="cscvincapi_1.0.0" requireSecure="false" />
</zosconnect_apiRequesters>
___6. The job should complete with a condition code of 200 and have the following output for SYSPRINT.
NUMB: 111111
NAME: C. BAKER
ADDRX: OTTAWA, ONTARIO
PHONE: 51212003
DATEX: 26 11 81
AMOUNT: $0011.00
EIBRESP: 00000000
EIBRESP2: 00000000
USERID: LIBSERV
HTTP CODE: 0000000200
___7.
Tech-Tip: An HTTP code of 200 indicates success. For an explanation of HTTP codes see URL
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes ___3.
___4. Change the PARM=’111111’ to PARM=’000000’ and resubmit. This time the output should look
something like this:
Test the connection from the batch job to the zCEE server 10 of 43
© Copyright IBM Corporation 2020 All rights reserved
Mitch Johnson ([email protected])
ZCONEE- z/OS Connect EE V3.Customization – Security and MVS Batch
The CEIBRESP and CEIBRESP2 values are from a CICS program (a CICS program is the ultimate
target of the API provider) and the response codes received is returned when an EXEC CICS READ
fails with a Not Found (EIBRESP 13, EIBRESP2 80) condition.
___5. Change the PARM= value back to ’111111’ or some other valid value and change the USER value on the
job card to USER2, e.g. USER=USER2. Resubmit the job with the new user value. This time the job
should fail with a return code of 403. An HTTP 403 indicates the request is Forbidden.
Error code: 0000000403
Error msg:{"errorMessage":"BAQR7115E: The asserted user ID USER2 is not
authorized to invoke the API requester on resource
/zosConnect/apiRequesters/cscvincapi_1.0.0."}
This is demonstrating API requester security as shown in the z/OS Connect EE Knowledge Center,
https://www.ibm.com/support/knowledgecenter/SS4SVW_3.0.0/securing/requester_id_assertion.html
Referencing the above diagram. For MVS Batch (or for an IMS BMP) the value for ID1 is the identity
under which is the job executes. This identity is specified by the value of the USER parameter on the
job card or defaults to the user submitting the job. The value for ID2 is the value of the
BAQUSERNAME environment variable.
___6. Change the USER parameter on the job card to USER1 and change the value for BAQPASSWORD to
any other value, e.g. password. Resubmit the job for execution. This time the job should fail with a
return code of 401. An HTTP 401 indicates the request is Unauthorized.
Error code: 0000000401
Error msg: Unauthorized
Tech-Tip: This will be accompanied by these messages in the SYSLOG and the JES messages
of the server’s started task.
Test the connection from the batch job to the zCEE server 12 of 43
© Copyright IBM Corporation 2020 All rights reserved
Mitch Johnson ([email protected])
ZCONEE- z/OS Connect EE V3.Customization – Security and MVS Batch
___7. Change the value for BAQUSERNMAE to USERX. Resubmit the job for execution. This time the job
should fail with a return code of 3.
RACF authentication failed because the provided ID2 identity is not known in RACF.
___8. Reenable TLS security for the cscvinc_1.0.0 by editing the apiRequesterHTTPS.xml and changing
requireSecure attribute of the cscvincapi_1.0.0 apiRequester element to true as shown below. This
require all inbound request for this API requester to use HTTPS.
<zosconnect_apiRequesters location="/var/zcee/shared/apiRequesters"
idAssertion="ASSERT_ONLY">
<apiRequester name="cscvincapi_1.0.0" requireSecure="true" />
</zosconnect_apiRequesters>
Test the connection from the batch job to the zCEE server 13 of 43
© Copyright IBM Corporation 2020 All rights reserved
Mitch Johnson ([email protected])
ZCONEE- z/OS Connect EE V3.Customization – Security and MVS Batch
___2. Enter USER1 as the z/OS USER ID and USER1’s password and click the LOG IN button.
___3. The Welcome screen should be displayed. On the left-hand side expand the Configuration tab to expose
the Network Configuration Assistance option. Select this option to expose the Network Configuration
tab.
___4. Select the radio button beside Create or transfer a new backing store option and click the Proceed
button.
___5. On the next screen select the radio button beside Create a New Backing Store File and enter USER1 in
the area beside File Name. Press the OK button and press the OK button on the Information pop-up.
___6. On the Network Configuration tab use the pull-down arrow to select AT-TLS as the TCP/IP technology
to configure.
___7. Select the radio button beside the Default - System Group and use the Action pull-down button to select
Add z/OS System Image option.
___8. On the Add z/OS System Image window enter WG31 for the image Name and check the radio button
beside Simple name (as in an SAF product…) and enter Liberty.KeyRing as the default AT-TLS key ring
name. Click OK to continue.
Tech Tip: The value for the key ring will be used if an explicit key ring is not provided for a
policy.
We recommend establishing a naming convention for key rings with each SAF identity using the
same key ring name in the same context. Using this name as an example you could create a
unique key ring named Liberty.KeyRing for SAF identities USER1, USER2, FRED, etc. Each
user’s key ring would have the same name but a different set of connected certificates. One
default key ring specified at the image level covers all users.
___9. On the Proceed to the Next Step? pop-up click the Proceed button.
___10. The Add TCP/IP Stack screen should be displayed. Select this option to expose the Network
Configuration tab. Enter TCPIP1 as the name of the stack. Click OK to continue.
Tech-Tip: The value for the stack name was determine by the TCPIP Name display by entering the
MVS command D TCPIP.
___11. Before any TCP/IP stack rules can be added, Traffic Descriptors, Address Groups and Requirement
Maps need to be defined. Click Cancel on the Proceed to the Next Step? displayed at this time.
___13. Select the radio button beside WG31 and use the Actions pull-down to select Properties. On the Modify
z/OS System Image window select the System Image Level Settings tab and check all the trace level
boxes as shown below. This is being done so we can confirm AT-TLS is being invoked and identify
issues. Press OK to continue.
___14. Select the Traffic Descriptors tab and use the Actions pull-down to select New.
___15. On the New Traffic Descriptor window enter zCEEClient as the name and use the Actions pull-down
and select New to start the definition of a new traffic descriptor type.
___16. On the New Traffic Type – TCP window select the radio button beside Ephemeral ports under Local
port. Select the radio button Single port under Remote port and enter 9443 as the port number.
Select the radio button beside Outbound only under Indicate the TCP connection direction. Enter
USER1GET in the area under Jobname and finally select the radio button beside Client under AT-TLS
Handshake Role. Click OK to continue.
Tech-Tip: This traffic definition is triggered when job name USER1GET running on the local TCP/IP
stack opens a temporary or ephemeral port and tries to connect to port 9443, e.g. outbound. A further
requirement could be to require that SAF identity associated with the job be a specific value. If all the
defined conditions are met, AT-TLS will act as a surrogate for the client during a TLS handshake. Note
the KeyRing tab can be used to specify the name of the key ring to be used for this handshake. Otherwise
the default is to use the same key ring name defined for the z/OS System image, e.g. Liberty.KeyRing.
___18. Next click the Security Levels tab and use the Actions pull-down button and to select the New option.
On the New Security Level windows, enter zCEESecurity for the Name and check the box beside TLS
V1.2 and uncheck the other boxes. Click Next to display the Cipher selection options. Click Next to
display the Advanced Settings options exploring as you like but there is no need to make any changes.
Click Finish to continue.
___19. Next click the Requirement Maps tab. Use the Actions pull-down button and to select the New option.
___20. On the New Requirement Map window enter zCEERequirementMap as the Name and use the pull-down
arrows to select zCEEClient as the Traffic Descriptor and zCEESecurity as the Security Level for this
map. Click OK to continue.
___21. Select the radio button beside zCEERequirementMap and use the Actions pull-down to select the View
Details options to display the window below. Review the details and click the Close button to continue.
___23. When the save has complete click on the Systems tab to return to this window.
___24. Select the radio button beside TCPIP1 and use the Actions pull-down to select Rules. This is where
these definitions will be tied together. Use the Actions pull-down and select New to create a new
connectivity rule. Enter zCEEClientRule for the Connectivity rule name and press Next to continue.
___25. On the New Connectivity Rule – Requirement Map window select the radio button beside Select an
existing requirement map and use the pull-down to select zCEERequirementMap. This should
automatically populate the mapping table with zCEEClient as the traffic descriptor and zCEESecurity as
the security level. Press Next and then Finish to continue.
___26. Press Close to return to this window. Note that the status of the configuration is now complete.
___27. Select the radio button beside TCPIP1 and use the Actions pull-down to select Install All Files for This
Group.
___28. On the List of Configuration Files for All Systems Images in Group Default window, select WG31 and
use the Actions pull-down to select Install.
___29. On the Install File for Default.WG31.TCPIP1 window click the GO button to continue.
___31. Next click on AT-TLS as shown below to return to the primary window.
___32. The AT-TLS configuration has been completed and is installed. But not active yet.
___1. This instance of the policy agent has been configured to use the SYSLOGD daemon task to log messages
___2. The SYSLOGD daemon has been configured to write all log messages to file /var/syslogd/syslogall.log
(see the syslog.conf file in the /etc subdirectory).
#####################################################################
#
# Write all messages with priority err and higher to log file errors.
#
#*.err /var/log/%Y/%m/%d/errors
*.* /var/syslogd/syslogall.log
#
___3. Use ISPF option 3.4 to access directory /var/syslogd and the v line command to view syslogall.log. Go
to the bottom of the file and you will something like what is shown below:
___4. Start the policy agent task using MVS command S PAGENT.
___5. Exit the syslogall.log view session and reopen the file do a find for a subset of string EZZ8431I
PAGENT STARTING and you should see these messages.
___6. Do a find for the character string zCEE, e.g. f zcee, and you see multiple occurrences where the AT-TLS
configuration elements added earlier are being processed.
___7. Go the bottom of this file and you see these messages
Tech-Tip: If a policy or otherwise changed the new or updated policy can be installed with an MVS
modify command, F PAGENT,REFRESH
___8. The policy agent is active. The policies have been loaded, but there is one remaining step. The TCPIP
stack has not been modified to enable TTLS. AT-TLS has been configured on this image so is disabled
by default and must be explicitly enabled. This is done by using an MVS VARY command,
V TCPIP,,OBEY,SYS1.TCPPARMS(TTLS)
When you issue this command you should see these messages in the console log.
V TCPIP,,OBEY,SYS1.TCPPARMS(TTLS)
EZZ0060I PROCESSING COMMAND: VARY TCPIP,,OBEY,SYS1.TCPPARMS(TTLS)
EZZ0300I OPENED OBEYFILE FILE 'SYS1.TCPPARMS(TTLS)'
EZZ0309I PROFILE PROCESSING BEGINNING FOR 'SYS1.TCPPARMS(TTLS)'
EZZ0316I PROFILE PROCESSING COMPLETE FOR FILE 'SYS1.TCPPARMS(TTLS)'
EZZ0053I COMMAND VARY OBEY COMPLETED SUCCESSFULLY
TCPCONFIG NOTTLS
___9. Edit member GETAPI in USER1.ZCEE30.CNTL, change the port to 9443 and be sure the PARM is set
to 111111. Submit the job for execution.
___12. It should complete with a return code 200 with the record displayed as before.
NUMB: 111111
NAME: C. BAKER
ADDRX: OTTAWA, ONTARIO
PHONE: 51212003
DATEX: 26 11 81
AMOUNT: $0011.00
EIBRESP: 00000000
EIBRESP2: 00000000
USERID: LIBSERV
HTTP CODE: 0000000200
___13. The results raise a question. Why is the user identity LIBSERV and not USER1? For an explanation see
below.
The diagram below shows the identity that flows from the API requester. The API requester identity
does not flow to the API provider. Since it is an TLS connection and mutual authentication being
enabled, the RACF identity mapped to the zCEE server client certificate (LIBSERV) is used for
authorization checks and, in this case, propagated to the API provider (a CICS application).
___14. Close and view the syslogall.log file again. At the bottom of the file you should see messages like these:
EZD1281I TTLS Map CONNID: 00001E0C LOCAL: 192.168.17.201..7419 REMOTE:
192.168.17.201..9443 JOBNAME: USER1GET USERID: USER1 TYPE: OutBound STATUS:
Enabled RULE: zCEEClientRule~1 ACTIONS: gAct1~zCEEClient eAct1~zCEEClient
cAct1~zCEEClient
EZD1283I TTLS Event GRPID: 00000001 ENVID: 00000001 CONNID: 00001E0C RC:
0 Initial Handshake 00000050115258D0 0000005011522750 TLSV1.2 F0F0F3F5
These messages are recording the role of AT-TLS in the handshake with the zCEE server.
___15. Change the jobname to something else and submit the job again for execution. This time the job should
terminate with a return code of 5 and these messages in the SYSOUT
Error origin:STUB
The messages.log file for the server will have this message.
A connection attempt was made to a HTTPS port using HTTP. The AT-TLS policy that acts as a
surrogate client was not trigger because AT-TLS will only be triggered when the job name matches the
value in the traffic descriptor configuration element.
Summary
An AT-TLS policy has been created and used to encrypt traffic from a batch API requester client
application. Be introducing intentional errors we have confirmed the TLS handshakes are taking place
and/or failing as expected.
Summary 41 of 43
© Copyright IBM Corporation 2020 All rights reserved
Mitch Johnson ([email protected])
ZCONEE- z/OS Connect EE V3.Customization – Security and MVS Batch
##
## AT-TLS Policy Agent Configuration file for:
## Image: WG31
## Stack: TCPIP1
##
## Created by the IBM Configuration Assistant for z/OS Communications Server
## Version 2 Release 3
## Backing Store = USER1
## Install History:
## 2020-06-12 14:18:57 : Save To Disk
## 2020-06-12 14:12:36 : Save To Disk
## 2020-06-12 13:29:32 : Save To Disk
## 2020-06-12 13:15:40 : Save To Disk
##
## End of Network Configuration Assistant information
TTLSRule zCEEClientRule~1
{
LocalAddrSetRef addr1
RemoteAddrSetRef addr1
LocalPortRangeRef portR1
RemotePortRangeRef portR2
Jobname USER1GET
Direction Outbound
Priority 255
TTLSGroupActionRef gAct1~zCEEClient
TTLSEnvironmentActionRef eAct1~zCEEClient
TTLSConnectionActionRef cAct1~zCEEClient
}
TTLSGroupAction gAct1~zCEEClient
{
TTLSEnabled On
Trace 7
}
TTLSEnvironmentAction eAct1~zCEEClient
{
HandshakeRole Client
EnvironmentUserInstance 0
TTLSKeyringParmsRef keyR~WG31
}
TTLSConnectionAction cAct1~zCEEClient
{
HandshakeRole Client
TTLSConnectionAdvancedParmsRef cAdv1~zCEEClient
CtraceClearText Off
Trace 7
}
TTLSConnectionAdvancedParms cAdv1~zCEEClient
{
SSLv3 Off
TLSv1 Off
TLSv1.1 Off
SecondaryMap Off
TLSv1.2 On
}
TTLSKeyringParms keyR~WG31
{
Keyring Liberty.KeyRing
}
IpAddrSet addr1
{
Prefix 0.0.0.0/0
}
PortRange portR1
{
Port 1024-65535
}
PortRange portR2
{
Port 9443