![Lead Image © scanrail, 123RF.com Lead Image © scanrail, 123RF.com](/var/ezflow_site/storage/images/archive/2019/49/cryptographic-key-access-in-the-cloud/123rf_14238280_key-in-cloud_scanrail_resized.png/159634-1-eng-US/123rf_14238280_Key-in-cloud_scanrail_resized.png_medium.png)
Lead Image © scanrail, 123RF.com
Cryptographic key access in the cloud
Gimme the Key
Cryptographic keys are usually stored on the hard disk, a smart card, a hardware security module (HSM), or a USB token. Applications that typically use such cryptographic keys are SSH, GnuPG, and crypto frameworks like OpenSSL, NSS, or GnuTLS.
Agent Forwarding
To begin, I'll take a look at SSH. If a user wants to log on to a remote computer by way of public key authentication, the user's public key must be available on the remote computer, usually provided with the help of the ssh-copy-id
application. Of course, the user's private key does not leave the local computer, but what happens if the user needs to move on from the remote computer, for example, because it is only a kind of jump host from which you can then log on to other systems in the back end?
Access to the user's private SSH key is required, then, on the remote computer, which is what ssh-agent
can deliver. Any private SSH key can be passed to this agent by ssh-add
, which then stores the key in memory. If access to one of these keys is necessary, the agent can be addressed through a socket file. The name of this file can be found in the SSH_AUTH_SOCK
variable:
# echo "$SSH_AUTH_SOCK" /tmp/ssh-j3OzPSWatFUl/agent.2395
Agent forwarding allows remote computers to access these agents. When establishing a connection over SSH, you can use the -A
option. Alternatively, the option can be stored in the SSH configuration file; the option here is ForwardAgent
, which is set to no
by default. If you activate forwarding by changing no
to yes
, all keys known by the SSH agent are displayed after logging in on a remote computer and calling ssh-add -l
. Now you can establish another SSH connection by public key-based authentication simply by accessing the key material of the SSH
Buy this article as PDF
(incl. VAT)