Configuring and Tuning SSH/SFTP on z/os



Similar documents
Using SFTP on the z/os Platform

Sharing Secrets Using Encryption Facility

IBM Ported Tools for z/os: OpenSSH - Using Key Rings

Implementing SSL Security on a PowerExchange Network

z/os Firewall Technology Overview

Install and configure SSH server

SMF Digital Signatures in z/os 2.2. Anthony Sofia Software Engineer at IBM August 14 th 2015

Overview SSL/TLS HTTPS SSH. TLS Protocol Architecture TLS Handshake Protocol TLS Record Protocol. SSH Protocol Architecture SSH Transport Protocol

Secure Socket Layer (SSL) and Transport Layer Security (TLS)

Tools for Managing Big Data Analytics on z/os

Secure Shell SSH provides support for secure remote login, secure file transfer, and secure TCP/IP and X11 forwarding. It can automatically encrypt,

ERserver. iseries. Secure Sockets Layer (SSL)

Network Security Essentials Chapter 5

Digital Certificates Demystified

z/os Cryptographic Services - ICSF Best Practices

ERserver. iseries. Securing applications with SSL

How to Secure Mainframe FTP

FL EDI SECURE FTP CONNECTIVITY TROUBLESHOOTING GUIDE. SSL/FTP (File Transfer Protocol over Secure Sockets Layer)

Accellion Secure File Transfer Cryptographic Module Security Policy Document Version 1.0. Accellion, Inc.

Chapter 17. Transport-Level Security

FL EDI SECURE FTP CONNECTIVITY TROUBLESHOOTING GUIDE. SFTP (Secure File Transfer Protocol)

Secure Sockets Layer (SSL ) / Transport Layer Security (TLS) Network Security Products S31213

Chapter 7 Transport-Level Security

Transport Level Security

Secure Managed File Transfer with Connect:Direct

Understanding Digital Certificates on z/os Vanguard Las Vegas, NV Session AST3 June 26th 2012

SBClient SSL. Ehab AbuShmais

WS_FTP Professional 12. Security Guide

IBM Crypto Server Management General Information Manual

Complying with PCI Data Security

What IT Auditors Need to Know About Secure Shell. SSH Communications Security

Experian Secure Transport Service

3.2: Transport Layer: SSL/TLS Secure Socket Layer (SSL) Transport Layer Security (TLS) Protocol

How-to Access RACF From Distributed Platforms

Co:Z SFTP - User's Guide

Security. Contents. S Wireless Personal, Local, Metropolitan, and Wide Area Networks 1

TS-800. Configuring SSH Client Software in UNIX and Windows Environments for Use with the SFTP Access Method in SAS 9.2, SAS 9.3, and SAS 9.

CRYPTOGRAPHY AS A SERVICE

Implementing Secure Shell

Using etoken for SSL Web Authentication. SSL V3.0 Overview

Secure Socket Layer/ Transport Layer Security (SSL/TLS)

Centers for Medicare and Medicaid Services. Connect: Enterprise Secure Client (SFTP) Gentran. Internet Option Manual

State of Wisconsin DET File Transfer Protocol Service Offering Definition (FTP & SFTP)

z/tpf FTP Client Support

Application Note: Onsight Device VPN Configuration V1.1

WS_FTP Professional 12

Communication Security for Applications

Secure Shell (SSH) Protocol

Obtaining a user account and password: To obtain a user account, please submit the following information to AJRR staff:

TELE 301 Network Management. Lecture 16: Remote Terminal Services

WS_FTP Professional 12. Security Guide

Network FAX Driver. Operation Guide

Configuring SSH and Telnet

TIBCO MFT Platform Server for IBM i User Guide. Software Release April 2013

Communication Systems 16 th lecture. Chair of Communication Systems Department of Applied Sciences University of Freiburg 2009

FIPS Security Policy LogRhythm Log Manager

Einführung in SSL mit Wireshark

SMPTE Standards Transition Issues for NIST/FIPS Requirements v1.1

Secure Network Communications FIPS Non Proprietary Security Policy

Legal Notes. Regarding Trademarks. Models supported by the KX printer driver KYOCERA MITA Corporation

Network Management Card Security Implementation

2 Advanced Session... Properties 3 Session profile... wizard. 5 Application... preferences. 3 ASCII / Binary... Transfer

Crypto and Disaster Recovery. Greg Boyd

Secure File Multi Transfer Protocol Design

Understanding Digital Certificates on z/os Share Anaheim, CA Session 8349 March 2nd 2011

From Centralization to Distribution: A Comparison of File Sharing Protocols

How To Run A Hybrid Batch Processing Job On An Z/Os V1.13 V1 (V1) V1-R13 (V2) V2.1 (R13) V3.1.1

Digital Certificate Goody Bags on z/os

SSH Secure Shell. What is SSH?

A guide for creating a more secure, efficient managed file transfer methodology

Using sftp in Informatica PowerCenter

CS z/os Application Enhancements: Introduction to Advanced Encryption Standards (AES)

Security Protocols HTTPS/ DNSSEC TLS. Internet (IPSEC) Network (802.1x) Application (HTTP,DNS) Transport (TCP/UDP) Transport (TCP/UDP) Internet (IP)

Pulse Secure, LLC. January 9, 2015

Secure Data Transfer

Network Security - Secure upper layer protocols - Background. Security. Question from last lecture: What s a birthday attack? Dr.

Implementing Secure Sockets Layer on iseries

FIPS Non- Proprietary Security Policy. McAfee SIEM Cryptographic Module, Version 1.0

SSH! Keep it secret. Keep it safe

XFTP 5 User Guide. The Powerful SFTP/FTP File Transfer Program. NetSarang Computer Inc.

7 Network Security. 7.1 Introduction 7.2 Improving the Security 7.3 Internet Security Framework. 7.5 Absolute Security?

DRAFT Standard Statement Encryption

IBM WebSphere Application Server Version 7.0

An Overview of the Secure Shell (SSH)

Overview. Remote access and file transfer. SSH clients by platform. Logging in remotely

MySQL Security: Best Practices

Decision Support System to MODEM communications

McAfee Firewall Enterprise 8.3.1

Lecture 9: Application of Cryptography

McAfee Firewall Enterprise 8.2.1

CASHNet Secure File Transfer Instructions

Secure Transfers. Contents. SSL-Based Services: HTTPS and FTPS 2. Generating A Certificate 2. Creating A Self-Signed Certificate 3

Secure Socket Layer (SSL) and Trnasport Layer Security (TLS)

WebSphere DataPower Release FIPS and NIST SP a support.

Contents. Part 1 SSH Basics 1. Acknowledgments About the Author Introduction

Authentication applications Kerberos X.509 Authentication services E mail security IP security Web security

Secure Shell. The Protocol

For the protocol access paths listed in the following table, the Sentry firmware actively listens on server ports to provide security for the CDU.

Transcription:

Configuring and Tuning SSH/SFTP on z/os Kirk Wolf / Steve Goetze Dovetailed Technologies info@dovetail.com dovetail.com Monday, March 10, 2014, 1:30PM Session: 14787 www.share.org Session Info/Eval link

Dovetailed Technologies We provide z/os customers world wide with innovative solutions that enhance and transform traditional mainframe workloads: Co:Z Co-Processing Toolkit for z/os z/os Enabled SFTP, z/os Hybrid Batch, z/os Unix Batch integration JZOS acquired by IBM in 2005 and now part of the z/os Java SDK 2

Agenda What is SSH and how does it work with SFTP? IBM Ported Tools for z/os OpenSSH Service planning and installation Language environment tuning Exploiting crypto hardware on z/os Using /dev/random Hardware accelerated Ciphers and MACs Using IBM Ported Tools OpenSSH with Co:Z SFTP This presentation will cover selected topics from: Dovetailed Technologies: P.T. OpenSSH Quick Install Guide 3

What is SSH? The IETF SSH-2 standard protocol (RFC 4251 etc) Features: A secure (encrypted) connection over one TCP/IP socket between a client and a server Authentication of the user and host. (optional) LZ compression Support for one or more simultaneous application channels over the same connection: terminal, sftp, command, port fwd,... There are many compatible implementations OpenSSH is by far the most popular; it is a default package on all Unix/Linux distributions PuTTY is a popular free Windows client Many commercial implementations 4

What is SFTP? It's not FTP It's not FTPS (FTP with SSL/TLS) It's the Secure Shell (SSH2 specification) for file transfer A packet/message spec, not a command/api spec Most SSH implementations include an sftp command that has subcommands familiar to FTP users The SFTP and FTPS wire protocols are not compatible SFTP is an SSH application/subsystem 5

SFTP as an SSH Application/Subsystem sftp sftp-server child process child process ssh -s sftp tcp/ip sshd 6

IBM Ported Tools for z/os - OpenSSH IBM s port of OpenSSH for z/os z/os Unix commands: ssh, sshd, sftp, sftp-server, etc. Supports password and key authentication No sftp support for MVS datasets, spool files, etc. Release 1.2 added support for: SSH keys in SAF/RACF keyrings SMF logging (new SMF 119 record subtypes) PTF UA63842 added: ICSF hardware acceleration for Ciphers and MACs A no-charge z/os product; normal IBM support 7

Co:Z SFTP Enhanced versions of OpenSSH sftp and sftp-server commands for z/os. Relies on IBM Ported Tools OpenSSH for ssh layer. Compatible with non-z/os implementations of SSH SFTP (follows the ssh-filexfer spec) Adds support for z/os datasets and spool files, with flexible control over: Dataset allocation, DCB attributes, etc Codepage conversion, Line-termination rules, Record padding, overflow, etc. Support for listing catalogs, PDS directories, and JES spool files SMF 119 records that are compatible with IBM FTP IBM FTP-compatible user exits Free to use under our Community License Enterprise License and Support agreements are also available 8

SFTP tuning and crypto HW exploitation When using SFTP + SSH, often 90% of the CPU time is in SSH. After all, that is where all of the encryption and TCP/IP processing occurs. This is true regardless of whether you use IBM P.T. sftp or Co:Z SFTP 9 We need to focus on IBM Ported Tools OpenSSH tuning and crypto hardware exploitation in order to save CPU and optimize throughput. With tuning, SSH/SFTP resource consumption is about the same as FTPS.

IBM Ported Tools OpenSSH Prerequisites for crypto exploitation z/os 1.10 or later CPACF - processor feature 3083 (free and enabled by default in most countries) ICSF installed and running (even if you don't have a coprocessor card) CPACF instructions are used by ICSF for Ciphers and MACS HCR77A0 ("A0" level) and later has support for /dev/random without crypto card. Requires z/os 1.12 or later. 10

Service Planning "IBM Ported Tools for z/os" 5665-M23 1.2.0 HOS1120 See Upgrade: PORTED4ZOS Subset: HOS1120 Be sure to include PTF UA63842 If running on z/os 1.10 or z/os 1.11, check that the PTFs for APARs PK86329 and OA29401 have been applied Review and install as appropriate ICSF and its required service. 11

LE Tuning Recommendations Ported Tools OpenSSH uses LE XPLINK runtime libraries (like Java, WebSphere, etc) See: Placing Language Environment Modules in LPA.. Add SCEELPA to LPALST Add SCEERUN and SCEERUN2 to LNKLST SCEERUN and SCEERUN2 should be program controlled Implement samples CEE.SCEESAMP(CEEWLPA) and (EDCWLPA) as shipped 12

SSH2 Crypto at-a-glance Key Exchange At start of session, RSA or DSS server key pair is used with Diffie-Hellman exchange and MAC (usually SHA-1) Authenticates the identity of the server Generates and exchanges a secret session key The session can be rekeyed. Typically once/hour or GB. User Auth At start of session, a password or user public key can be used to authenticate the user to the server. Key Exchange and User Auth are covered in detail in two Webinar recordings - see References. 13

SSH2 Crypto at-a-glance (cont.) Transport A MAC algorithm (typically SHA-1) is used to generate a hash of each packet. A symmetric Cipher uses the shared session key to encrypt the packet + MAC. Since this happens for each packet, it can be expensive. This session will focus on tuning the Transport 14

Using ICSF and /dev/random Each SSH client or server session requires secure random numbers (a.k.a entropy ) Ported Tools OpenSSH will use /dev/random if the ICSF CSFRNG service is available. The alternative (ssh-randhelper) is slow and not particularly secure. using /dev/random can save a couple of seconds at the beginning of each SSH or SFTP session. Prior to ICSF HCR77A0, ICSF CSFRNG required a coprocessor card, but this is no longer true 15

Using ICSF and /dev/random (cont.) Simply need to allow required users access to ICSF CSFRNG service. For most environments, this can be granted to all: RDEFINE CSFSERV CSFRNG UACC(NONE) PERMIT CSFRNG CLASS(CSFSERV) ID(*) ACCESS(READ) SETROPTS RACLIST(CSFSERV) REFRESH Note: You must authorize both SSHD server userids. To test (from a normal z/os user UNIX shell): $ head /dev/random od -x 16

Enabling ICSF Ciphers and MACs Cryptographic Ciphers (encryption) and MACs are where lots of CPU cycles can be spent. P.T. OpenSSH will use ICSF and CPACF instructions if available, which can reduce overall CPU usage by > 50%. The following CSFSERV profiles control access: CSFIQA - ICSF Query Algorithm CSF1TRC - PKCS #11 Token record create CSF1TRD - PKCS #11 Token record delete CSF1SKE - PKCS #11 Secret key encrypt CSF1SKD - PKCS #11 Secret key decrypt CSFOWH - One-Way Hash Generate 17

Enabling ICSF Ciphers and MACs (cont.) RDEFINE CSFIQA CLASS(CSFSERV) UACC(NONE) RDEFINE CSF1TRC CLASS(CSFSERV) UACC(NONE) RDEFINE CSF1TRD CLASS(CSFSERV) UACC(NONE) RDEFINE CSF1SKE CLASS(CSFSERV) UACC(NONE) RDEFINE CSF1SKD CLASS(CSFSERV) UACC(NONE) RDEFINE CSFOWH CLASS(CSFSERV) UACC(NONE) /* permit all, some users, or a group: */ PERMIT CSFIQA CLASS(CSFSERV) ID(*) ACCESS(READ)... SETROPTS CLASSACT(CSFSERV) SETROPTS RACLIST(CSFSERV) REFRESH Note: You must authorize both SSHD server userids. 18

Enabling ICSF Ciphers and MACs (cont.) To configure client and server to use ICSF Ciphers and MACs support, update both /etc/ssh/zos_ssh_config and /etc/ssh/zos_sshd_config: # Use either software or ICSF for Ciphers and MACs CiphersSource any MACsSource any 19

SSH Cipher and MAC negotiation The default Ciphers and MACs list supported by P.T. OpenSSH (commented out in /etc/ssh/ssh_config and /etc/ssh/sshd_config ) # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256, arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc, aes192-cbc,aes256-cbc,arcfour, rijndael-cbc@lysator.liu.se # MACs hmac-md5,hmac-sha1,umac-64@openssh.com, hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96, hmac-md5-96 20

SSH Cipher and MAC negotiation (cont.) The following Ciphers and MACs will be accelerated by ICSF and CPACF Ciphers aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc MACs hmac-sha1,hmac-sha1-96 Note: Some older z machines do not support aes-192 and aes-256 (see below). 21

SSH Cipher and MAC negotiation (cont.) SSH client and server negotiate which Cipher and MAC to use for the session. RULE: Use the first algorithm in the client list that appears anywhere in the server list. 22

Configure z/os SSH client Ciphers and MACs Update /etc/ssh/ssh_config Strategy #1: Only support accelerated Ciphers. SHA-1 is fine for MACs. Ciphers aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc MACs hmac-sha1,hmac-sha1-96 Strategy #2: Prefer accelerated Ciphers; fall back to all others. (move preferred to front of list) Ciphers aes128-cbc,aes192-cbc,aes256- cbc,3des-cbc,<others from default list> MACs hmac-sha1,hmac-sha1-96 23

Configure z/os SSHD server Ciphers and MACs Update /etc/ssh/sshd_config Strategy #1: Only allow accelerated Ciphers; others will fail. SHA-1 is fine for MACs. Ciphers aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc MACs hmac-sha1,hmac-sha1-96 Strategy #2: Allow any Cipher; coordinate with client to use an accelerated Cipher. SHA-1 is fine for MACs. # Ciphers <use default config> MACs hmac-sha1,hmac-sha1-96 24

Verify ICSF setup Login remotely to an z/os ssh shell session so that we can use the ssh client (which is not allowed under TSO OMVS) zos$ ssh vvv myuser@127.0.0.1 debug2: ----------------------------------- debug2: CRYPTO SIZE KEY SOURCE debug2: ----------------------------------- debug2: AES 256 SECURE COP debug2: AES 256 SECURE CPU debug2: DES 56 SECURE COP debug2: DES 56 SECURE CPU 25

Verify ICSF setup (cont.) debug2: MD5 128 NA SW debug2: SHA-1 160 NA CPU debug2: TDES 168 SECURE COP Debug2: TDES 168 SECURE CPU Note: SOURCE=CPU means CPACF, which is what ICSF uses for SSH Cipher and MAC acceleration. Note: The strength/size is the largest bit length supported by the facility. In the display above, AES- 128, AES-192, and AES-256 are supported via ICSF with CPACF. 26

Verify ICSF setup (cont.) debug3: RNG is ready, skipping seeding Note: This message implies that /dev/random was used for initializing random numbers. 27

Verify ICSF setup (cont.) debug1: mac_setup_by_id: hmac-sha1 from source ICSF debug2: mac_setup: found hmac-sha1 debug1: zsshicsfmacinit (402): CSFPTRC successful: return code = 0, reason code = 0, handle = 'SYSTOK- SESSION-ONLY 00000000S ' Note: These messages indicate that ICSF was used for MAC hmac-sha1 28

Verify ICSF setup (cont.) debug1: cipher_init: aes128-cbc from source ICSF debug1: zsshicsfcipherinit (930): CSFPTRC successful: return code = 0, reason code = 0, handle = 'SYSTOK- SESSION-ONLY 00000001S ' Note: These messages indicate that ICSF was used for Cipher aes128-cbc 29

Measuring resource consumption With cozsftp client, COZ_LOG=D will print ssh CPU time -omacssource=openssl -ocipherssource=openssl can be used to disable ICSF for a single client session (harder): look at SMF30 completion records Client: AS #1: (JES init) + COZBATCH + Co:Z SFTP AS #2: (OMVS) /bin/ssh Server: AS #1: (OMVS) sshd process for the session AS #2: (OMVS) /bin/sh -c sftp-server.sh AS #3: (OMVS) sftp-server (P.T. or Co:Z version) 30

Using Co:Z SFTP client with IBM Ported Tools OpenSSH Simply invoke the cozsftp command instead of sftp : cozsftp sftp-server child process child process ssh -s sftp tcp/ip sshd 31

Using Co:Z SFTP server with IBM Ported Tools SSHD Update /etc/ssh/sshd_config #Subsystem sftp /usr/lib/ssh/sftp-server Subsystem sftp /u/vendor/coz/bin/sftp-server.sh The Co:Z supplied sftp-server.sh shell script will by default still invoke the IBM sftp-server unless user has a Co:Z SFTP server profile. Sites can make Co:Z SFTP the default via this change: # file: /etc/ssh/sftp-server.rc USE_COZ_SFTP=true 32

References IBM Ported Tools for z/os: OpenSSH User s Guide http://www-03.ibm.com/systems/resources/fot4os02.pdf IBM Ported Tools OpenSSH - Quick Install Guide http://dovetail.com/docs/pt-quick-inst/index.html Dovetail webinar recordings: IBM Ported Tools OpenSSH Key Authentication IBM Ported Tools OpenSSH Using Key Rings 33