I installed the latest vault and ssh-helper but things don't seem to work.
All of the hostnames are fqdn's resolving to the external ip, the vault and helper run in the same vm.
The
vault is unsealed, the
tutorial(
https://www.vaultproject.io/docs/secrets/ssh/index.html)
commands have all been executed. PAM is clearly configured, the error
comes from the application.
root@vault:~# vault version
Vault v0.6.5 ('5d8d702f33b5fd965cbe8d6d0728295de813a196')
root@vault:~# /usr/local/bin/vault-ssh-helper -version
vault-ssh-helper v0.1.3
Verify says everything is ok:
root@vault:~# /usr/local/bin/vault-ssh-helper -verify-only -config=/etc/vault-ssh-helper.d/config.hcl
2017/03/02 12:48:04 [INFO] using SSH mount point: ssh
2017/03/02 12:48:04 [INFO] vault-ssh-helper verification successful!
Using sshpass I get:
# vault ssh -role otp_key_role root@vault
Failed to establish SSH connection: "exit status 5"
Without it I can enter the OTP myself:
root@vault:~# vault ssh -role otp_key_role root@vault
OTP for the session is d247980b-0371-c318-0e5d-aaa9aaa6d549
[Note: Install 'sshpass' to automate typing in OTP]
Password:
Password:
Password:
Error while running ssh command: "exit status 255"
At first in the log I saw :
2017/03/02 12:28:46 [INFO] using SSH mount point: ssh
2017/03/02 12:28:46 [ERROR]: uuid is improperly formatted
Then I tried an older version of vault-ssh-helper, v0.1.2 and I am getting:
2017/03/02 12:39:04 [INFO] using SSH mount point: ssh
2017/03/02 12:39:04 [ERROR]: Error making API request.
URL: PUT
https://vault:8200/v1/ssh/verify Code: 400. Errors:
* OTP not found
Config files:
Vault:
backend "file" {
path = "/mnt/storage-pool/"
}
listener "tcp" {
address = "
0.0.0.0:8200"
tls_disable = 0
tls_cert_file = "/etc/letsencrypt/live/vault/fullchain.pem"
tls_key_file = "/etc/letsencrypt/live/vault/privkey.pem"
}
Helper:
vault_addr = "
https://vault:8200"
ssh_mount_point = "ssh"
ca_path = "/etc/ssl/certs/"
tls_skip_verify = false
allowed_roles = "*"
Manually generating and requesting:
root@vault:~# vault write ssh/creds/otp_key_role ip=a.a.a.a
Key Value
--- -----
lease_id ssh/creds/otp_key_role/ffa183a5-7b65-5d22-0358-ae43ad45c20b
lease_duration 768h0m0s
lease_renewable false
ip a.a.a.a
key 752f4886-6a56-a033-48e7-26b47f62cf8f
key_type otp
port 22
username root
root@vault:~# curl -s -X PUT -H 'Content-Type: application/json' -d @otp.json
https://vault:8200/v1/ssh/verify{"errors":["OTP not found"]}
What should I do? The vault side doesn't throw any errors but the OTP isn't accessible from API.