Configuring Vault SSH Secret Engine
This guide demonstrates how to configure HashiCorp Vault's SSH Secret Engine to sign SSH certificates using ED25519 keys instead of RSA, specifically for z/OS Unix System Services (USS) environments.
Prerequisites
Note: This guide is compatible with HashiCorp Vault version 1.19.12.
The SSH Secret Engine allows Vault to act as a Certificate Authority (CA) for SSH certificates.
- Vault CLI configured.
- HashiCorp Vault installed and running (can be on distributed platform).
- Appropriate permissions to enable secret engines and configure roles.
- z/OS USS with OpenSSH installed and configured.
- Network connectivity between Vault server and z/OS USS.
Before you begin
Ensure you have the following ready before starting:
On your local machine:
- Vault CLI installed and configured.
- Valid Vault authentication token with appropriate permissions.
- SSH client installed (OpenSSH recommended).
- Your SSH public key generated (preferably ED25519:
ssh-keygen -t ed25519).
On Vault Server:
- Vault server running and unsealed.
- Network access to Vault API (typically port 8200).
- Permissions to enable secret engines and create roles.
On z/OS USS Target Server:
- SSH access with administrative privileges.
- OpenSSH 7.4 or later installed (for ED25519 support).
- z/OS V2R3 or later (for ED25519 support).
- Write access to /etc/ssh/ directory.
- Ability to restart SSH daemon.
Information You'll Need:
- Vault server address (e.g.,
http://vault.example.com:8200). - z/OS USS hostname or IP address.
- Your z/OS USS username.
- Your Vault token or authentication credentials.
Procedure
- Vault Server Steps (Steps 1-7): Perform these on a machine with Vault CLI access.
- z/OS USS steps (See "z/OS USS Target Server Configuration" section): Perform these on the z/OS mainframe.
- Client steps (Steps 8-9): Perform these on your local machine.
Automation example
For automated certificate signing, use the Vault CLI instead of Curl:
#!/bin/bash
# Sign the user's public key
vault write -field=signed_key \
ssh-client-signer/sign/sshrole \
public_key=@$HOME/.ssh/id_ed25519.pub \
valid_principals="<username>" > signed-key
# Set proper permissions
chmod 600 signed-key
# Connect to server
ssh -o CertificateFile=signed-key <username>@<target-server>