Utilities for Key Generation in IPsec
The IKE protocol provides automatic key management for IPv4 and IPv6 addresses. See
Chapter 23, Configuring IKE (Tasks) for instructions on how to set up IKE. The manual keying utility
is the ipseckey command, which is described in the ipseckey(1M) man page.
You use the ipseckey command to manually populate the security association databases (SADBs)
when automated key management is not used. When you invoke the ipseckey command
with no arguments, the command enters an interactive mode and displays a prompt
that enables you to make entries. Some commands require an explicit security association (SA)
type, while others permit you to specify the SA type and act
on all SA types.
While the ipseckey command has only a limited number of general options, the
command supports a rich command language. You can specify that requests be delivered
by means of a programmatic interface specific for manual keying. For additional information,
see the pf_key(7P) man page.
Security Considerations for ipseckey
The ipseckey command enables superuser or a role with the Network Security profile
to enter sensitive cryptographic keying information. If an adversary gains access to this
information, the adversary can compromise the security of IPsec traffic. You should consider
the following issues when you handle keying material and use the ipseckey command:
Have you refreshed the keying material? Periodic key refreshment is a fundamental security practice. Key refreshment guards against potential weaknesses of the algorithm and keys, and limits the damage of an exposed key.
Is the TTY going over a network? Is the ipseckey command in interactive mode?
In interactive mode, the security of the keying material is the security of the network path for this TTY's traffic. You should avoid using the ipseckey command over a clear-text telnet or rlogin session.
Even local windows might be vulnerable to attacks by a concealed program that reads window events.
Have you used the -f option? Is the file being accessed over the network? Can the file be read by the world?
An adversary can read a network-mounted file as the file is being read. You should avoid using a world-readable file that contains keying material.
Protect your naming system. If the following two conditions are met, then your host names are no longer trustworthy:
Security weaknesses often arise from the misapplication of tools, not from the actual
tools. You should be cautious when using the ipseckey command. Use a console
or other hard-connected TTY for the safest mode of operation.