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



Similar documents
Configuring and Tuning SSH/SFTP on z/os

Using SFTP on the z/os Platform

Digital Certificate Goody Bags on z/os

Getting Started with Digital Certificates Part II (RACDCERT)

Digital Certificates Demystified

Digital Certificates Management

Implementing SSL Security on a PowerExchange Network

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

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.

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

The Digital Certificate Journey from RACF to PKI Services Part 2 Session J10 May 11th 2005

SSSD and OpenSSH Integration

Sharing Secrets Using Encryption Facility

How Secure are your Channels? By Morag Hughson

IBM Security Key Lifecycle Manager for z/os: Deployment and Migration Considerations

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

[RUNNING OPEN SOURCE ETL ON A MAINFRAME]

How to Secure Mainframe FTP

z/os Hybrid Batch Processing and Big Data

z/os Hybrid Batch Processing and Big Data Session zba07

Tighter SSH Security with Two-Factor

Secure Shell. The Protocol

SSH The Secure Shell

Cryptography: RSA and Factoring; Digital Signatures; Ssh

File transfer clients manual File Delivery Services

Co:Z SFTP - User's Guide

Secure Managed File Transfer with Connect:Direct

Secure Transport Service (STS) Certificate Update Information

z/os Firewall Technology Overview

Using z/os to Access a Public Cloud - Beyond the Hand-Waving

Medical School: Diagnosing SSL/TLS and AT-TLS Problems in z/os Communications Server

SSH. Introduction. SSH Private Key

Secure File Transfer Installation. Sender Recipient Attached FIles Pages Date. Development Internal/External None 11 6/23/08

Nessus Training Session 2 - Scanning and Reporting

SSH, SCP, SFTP, Denyhosts. Süha TUNA Res. Assist.

Secure Transport Service (STS) US Certificate Update Information (SHA2) For External Client Facing Users

fåíéêåéí=péêîéê=^çãáåáëíê~íçêûë=dìáçé

Implementing Secure Sockets Layer on iseries

Automated Offsite Backup with rdiff-backup

CreationDirect. Clearstream file transfer connectivity solutions

/ Preparing to Manage a VMware Environment Page 1

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

How-to Access RACF From Distributed Platforms

Using OpenSSH in a Single Sign-On Corporate Environment with z/os, Windows and Linux

Deploying PGP Encryption and Compression for z/os Batch Data Protection to (FIPS-140) Compliance

OS/390 Firewall Technology Overview

Securing Windows Remote Desktop with CopSSH

SBClient SSL. Ehab AbuShmais

Java on z/os. Agenda. Java runtime environments on z/os. Java SDK 5 and 6. Java System Resource Integration. Java Backend Integration

SSH with private/public key authentication

DB2 for z/os: Configuring TLS/SSL for Secure Client/Server Communications

Connectivity using ssh, rsync & vsftpd

Pro OpenSSH. Michael Stahnke. Apress* =# # w^ l&l ## frsft. *,«.,*

Know your tools SSH. Dariusz Puchalak Dariusz_Puchalak < at > ProbosIT.pl

WhiteWave's Integrated Managed File Transfer (MFT)

Configure Managed File Transfer Endpoints

Agenda. How to configure

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

Install and configure SSH server

SSH! Keep it secret. Keep it safe

Public Key Infrastructure for a Higher Education Environment

HP NonStop SFTP API Reference Manual

If you prefer to use your own SSH client, configure NG Admin with the path to the executable:

State of Michigan Data Exchange Gateway. SSLFTP/SFTP client setup

Angel Dichev RIG, SAP Labs

PKI Services: The Best Kept Secret in z/os

Universal Content Management Version 10gR3. Security Providers Component Administration Guide

This presentation introduces you to the new call home feature in IBM PureApplication System V2.0.

CASHNet Secure File Transfer Instructions

z/os 2.1 Security Updates

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

Implementing Secure Shell

TELE 301 Network Management. Lecture 16: Remote Terminal Services

BMC CONTROL-M Agentless Tips & Tricks TECHNICAL WHITE PAPER

Configuring SSH and Telnet

Securing Windows Remote Desktop with CopSSH

WS_FTP Professional 12. Security Guide

ERserver. iseries. Secure Sockets Layer (SSL)

SolarWinds Technical Reference

StreamServe Persuasion SP5 Control Center

IBM Cloud Manager with OpenStack. REST API Reference, version 4.1

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast.

Deploying CA-signed SSL certificates to the LGI scenario

Enabling SSL and Client Certificates on the SAP J2EE Engine

Implementing Secure Sockets Layer (SSL) on i

IBM Crypto Server Management General Information Manual

FTP Secured With SSL on z/os

IBM WebSphere Application Server Version 7.0

Using WinSCP to Transfer Data with Florida SHOTS

5. At the Windows Component panel, select the Internet Information Services (IIS) checkbox, and then hit Next.

Single Sign-On for Kerberized Linux and UNIX Applications

Safe and Secure Transfers with z/os FTP

Configuring Secure Socket Layer and Client-Certificate Authentication on SAS 9.3 Enterprise BI Server Systems That Use Oracle WebLogic 10.

Ciphermail Gateway Separate Front-end and Back-end Configuration Guide

Reflection Desktop Deployment Guide. Version 16.0

AWS Quick Start Guide. Launch a Linux Virtual Machine Version

Transcription:

IBM Ported Tools for z/os: OpenSSH - Using Key Rings June 19, 2012 Kirk Wolf Steve Goetze http://dovetail.com info@dovetail.com Note: This webinar is a follow-on to: IBM Ported Tools for z/os: OpenSSH Key Authentication see: http://dovetail.com/webinars.html Copyright 2012 Dovetailed Technologies LLC Slide 1

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 T:Z Quickstart for Tomcat and z/os JZOS - acquired by IBM in 2005 and now part of the z/os Java SDK Copyright 2012 Dovetailed Technologies LLC Slide 2

Co:Z Components Co:Z SFTP ** - OpenSSH SFTP with z/os exploitation Co:Z Batch - full featured BPXBATCH replacement Co:Z Dataset Pipes - convert datasets to streams / streams to datasets - other z/os Unix commands / utilities Co:Z Launcher ** - z/os hybrid batch processing (distributed apps+data) Co:Z Target System Toolkit ** - used with Co:Z Launcher and Dataset Pipes ** Requires IBM Ported Tools OpenSSH Copyright 2012 Dovetailed Technologies LLC Slide 3

Ported Tools for z/os OpenSSH (review) A port of OpenSSH for z/os - z/os Unix commands: ssh, sshd, sftp, sftp-server, etc. No support for MVS datasets, spool files, etc. Release 1.2 added support for: - SSH keys in SAF/RACF key rings - SMF logging (new SMF 119 record types) PTF UA63842 added: - ICSF hardware acceleration for ciphers and MACs Co:Z Toolkit requires IBM Ported Tools OpenSSH: - Co:Z SFTP client invokes ssh - Co:Z SFTP server is invoked by sshd - Co:Z Launcher invokes ssh - Co:Z Dataset Pipes can be used remotely via sshd Copyright 2012 Dovetailed Technologies LLC Slide 4

Agenda Review SSH key authentication - protecting key material - benefits of using digital certificates with SSH Creating RACF digital certificates - for either server host key or a user key - exporting the OpenSSH public key - using the certificate's private key with OpenSSH - required permissions for using certificates ICSF/hardware-protected User keys - Using the private key without reading it - Co:Z saf-ssh-agent key ring support Best practices for z/os SSH keys Copyright 2012 Dovetailed Technologies LLC Slide 5

Other security packages In this presentation, we will illustrate RACF commands for managing key rings and digital certificates IBM Ported Tools OpenSSH uses standard SAF and R_datalib interfaces to key rings and certificates Other security packages (CA-ACF2, CA-TSS) also support certificates and will work with IBM Ported Tools OpenSSH - RACF commands must be translated to commands in your security package Copyright 2012 Dovetailed Technologies LLC Slide 6

SSH Key Authentication Review Host (server) authentication - Server (SSHD) has host private key(s) - Clients have matching host public key - known_hosts is a list of: <host -> public key> User key authentication - User has private key - Server has matching public key - $HOME/.ssh/authorized_keys is a list of the user's public keys Copyright 2012 Dovetailed Technologies LLC Slide 7

Safeguarding private key material Only root (UID=0) should be able to read the host private key. Only the client userid should be able to read the User private key - better yet: even the user can't read it, only use it Copyright 2012 Dovetailed Technologies LLC Slide 8

Safeguarding public key registries There is no danger in allowing anyone to read a public key - but the registry files that contain them must be write protected. On the client: - ~/.ssh/known_hosts - only updateable by the client userid - /etc/ssh/ssh_known_hosts only updateable by root (but readable by everyone) On the server: - ~/.ssh/authorized_keys - only updateable by server userid See Common Pitfalls in Part 1 or Co:Z SFTP User's Guide for a detailed list of file permission settings Copyright 2012 Dovetailed Technologies LLC Slide 9

Digital certificate advantages The private key is not in a file. SAF profiles/rules are used to protect access. Private keys can be stored in ICSF / hardware - The userid can use the private key, but can't read it - IBM Ported Tools doesn't currently support this directly - Co:Z saf-ssh-agent can be used as an agent to IBM Ported Tools OpenSSH client for User keys (more later) Ported Tools SSH can also use public keys from certificates - known_hosts or authorized_keys files still need to point to them Note: The SSH standard does not use X.509 cert chains - z/os digital certificate is only used as a keys container - self-signed certificates are fine Copyright 2012 Dovetailed Technologies LLC Slide 10

Creating a RACF key ring and certificate RACDCERT ID(ALICE) GENCERT SUBJECTSDN(CN('Alice Kingsleigh')) SIZE(2048)NOTAFTER(DATE(2015-01-01)) WITHLABEL('SSH01') RACDCERT ID(ALICE) ADDRING(SSH-RING) RACDCERT ID(ALICE) CONNECT ( ID(ALICE) RING(SSH-RING) LABEL('SSH01') DEFAULT USAGE(PERSONAL)) This generates a self-signed certificate with RSA key pair Key ring and cert labels must be unique within a userid Default expiry is one year if NOTAFTER is not specified Other SUBJECTSDN keywords may be specified The certificate ALICE/SSH-RING SSH01 has the RSA public key; the private key is held in the RACF database. (more later on storing private key in ICSF/hardware) Copyright 2012 Dovetailed Technologies LLC Slide 11

Exporting the public key from a certificate On the client z/os system: export _ZOS_SSH_KEY_RING_LABEL= ALICE/SSH-RING SSH01 ssh-keygen -e > ssh01.pub Transfer text file ssh01.pub to the target system and import it: ssh-keygen -i -f ssh01.pub >> ~/.ssh/authorized_keys -e exports the public key in the RFC-4716 text file format. -i converts a RFC-4716 format key to OpenSSH format Alternatively, the following Co:Z command directly exports the OpenSSH format public key: saf-ssh-agent -x -f ssh01.pub ALICE/SSH-RING:SSH01 Copyright 2012 Dovetailed Technologies LLC Slide 12

User authentication using RACF key ring z/os ssh ruser@myserver myserver ssh sshd # ~ruser/.ssh/authorized_keys ~/.ssh/ssh01.pub ssh-rsa AAA123...=... # ~/.ssh/zos_user_ssh_config IdentityKeyRingLabel= SSH-RING SSH01 Note: The client file ssh01.pub is not actually used; the certificate has the public key and the private key is in the RACF database. IdentityKeyRingLabel may also be specified as an option to the ssh or sftp client commands Copyright 2012 Dovetailed Technologies LLC Slide 13

Virtual Key Rings All certificates are automatically connected to the userid's virtual key ring May be referred to as key ring * - For example: ALICE/* SSH01 (Alice's cert with label SSH01) * SSH01 (The current user's cert with label SSH01) Copyright 2012 Dovetailed Technologies LLC Slide 14

Demo: User key auth with RACF certificate Copyright 2012 Dovetailed Technologies LLC Slide 15

Creating a RACF certificate for host auth RACDCERT ID(SSHD) GENCERT SUBJECTSDN(CN('SSHD myserver.myco.com')) SIZE(2048) NOTAFTER(DATE(2015-01-01)) WITHLABEL('SSHD01') This is really no different than creating a User key The certificate can be referred to as SSHD/* SSHD01 using virtual key ring syntax. (virtual rings also work with User keys ) Exporting the OpenSSH-format public key: saf-ssh-agent -x -f sshd01.pub SSHD/*:SSHD01 (Note: saf-ssh-agent uses a colon to separate the label) Copyright 2012 Dovetailed Technologies LLC Slide 16

Server authentication using RACF key ring myclient ssh myuser@myserver myserver ssh # file: /etc/ssh/ssh_known_hosts # or ~/.ssh/known_hosts myserver ssh-rsa AA123...= sshd # /etc/ssh/zos_sshd_config HostKeyRingLabel SSHD/* SSHD01 /etc/ssh/sshd01.pub Notes: public key file on the server is not actually used by sshd This file is exported from the RACF certificate SSHD/* SSHD01 in case you want to pre-distribute to your client known_host files Copyright 2012 Dovetailed Technologies LLC Slide 17

Permissions for using a Key Ring Ring-specific profiles CLASS(RDATALIB) <userid>.<ring-name>.lst ACCESS(READ) - userid's own key ring ACCESS(UPDATE) - another user's key ring For the virtual key ring (any certificate for the user): <userid>.irr_virtual_keyring.lst Note: CLASS RDATALIB must be active and RACLIST refreshed Copyright 2012 Dovetailed Technologies LLC Slide 18

Permissions for using a Key Ring (cont.) Global profiles - used if there isn't a matching specific profile CLASS(FACILITY) IRR.DIGTCERT.LISTRING ACCESS(READ) - userid's own key rings ACCESS(UPDATE) - all user's key rings (Yikes!) Note: CLASS FACILITY must be active and RACLISTed Copyright 2012 Dovetailed Technologies LLC Slide 19

Creating a certificate with ICSF private key RACDCERT ID(ALICE) GENCERT SUBJECTSDN(CN('Alice Kingsleigh')) SIZE(2048)NOTAFTER(DATE(2015-01-01)) WITHLABEL('SSH01') PCICC Can also use ICSF in place of PCICC check doc for details By default, the private key is stored in PKDS with same label Key difference: A user can not read the private key from his own certificate But: Ported Tools OpenSSH can not (on its own) use a certificate private key unless it can read it. Copyright 2012 Dovetailed Technologies LLC Slide 20

Using Co:Z saf-ssh-agent for User key auth Uses the OpenSSH ssh-agent protocol to act as a user key authentication agent for Ported Tools ssh client ssh client uses a private Unix-domain socket to communicate with saf-ssh-agent: - agent tells ssh which public key is has - ssh sends agent a signature request - agent signs the data using the certificate private key - without actually reading the private key saf-ssh-agent is managed automatically by Co:Z - - cozsftp -k ring:label myuser@myhost - Co:Z Launcher option: saf-cert=ring:label - or manually as a command wrapper : saf-ssh-agent -c ring:label ssh user@host Copyright 2012 Dovetailed Technologies LLC Slide 21

Co:Z sftp with saf-ssh-agent with ssh client saf-ssh-agent *:SSH01 gsk_open_keyring( * ) gsk_get_record_by_label( SSH01 ) gsk_sign_data(ssh auth data) /tmp/sshauth.userid.nnnn (socket) starts SSH_AUTH_SOCK=/tmp/sshauth... ssh -S sftp myuser@myhost cozsftp -k *:SSH01 myuser@myhost Copyright 2012 Dovetailed Technologies LLC Slide 22

Additional permissions for hardware keys To use private keys in ICSF/hardware: CLASS(CSFSERV) CSFDSG ACCESS(READ) CLASS(CSFSERV) CSFDSV ACCESS(READ) Note: CLASS CSFSERV must be active and RACLIST refreshed Note: Actually, these permissions are always required for saf-ssh-agent, even if the private key is not in hardware since it uses these ICSF APIs for signatures (and exploits a co-processor if you have one). Also see: SA22-7521 - ICSF Administrator's Guide - Using RACF to protect Keys and Services Copyright 2012 Dovetailed Technologies LLC Slide 23

Best Practices with z/os SSH keys Consider using digital certificates for security-sensitive SSH private keys - z/os Ported Tools sshd Host keys - z/os Ported Tools ssh User keys Implement procedures to manage expired certificates - either renew certificates before they expire - or, transition with two authorized keys at once the old, and the new Use ICSF managed hardware for best SSH private key security, using Co:Z saf-ssh-agent (User keys only) Implement procedures to manage and distribute host public keys Copyright 2012 Dovetailed Technologies LLC Slide 24

More information IBM Ported Tools for z/os: OpenSSH User's Guide Co:Z SFTP User's Guide http://dovetail.com/forum (public bulletin board) Our webinar archives: http://dovetail.com/webinars Previous webinar (part 1): IBM Ported Tools for z/os: OpenSSH - Key Authentication Copyright 2012 Dovetailed Technologies LLC Slide 25