Skip Navigation Links | |
Exit Print View | |
Securing the Network in Oracle Solaris 11.1 Oracle Solaris 11.1 Information Library |
1. Using Link Protection in Virtualized Environments
2. Tuning Your Network (Tasks)
3. Web Servers and the Secure Sockets Layer Protocol
4. IP Filter in Oracle Solaris (Overview)
6. IP Security Architecture (Overview)
How to Secure Traffic Between Two Systems With IPsec
How to Use IPsec to Protect a Web Server From Nonweb Traffic
Examples of Protecting a VPN With IPsec by Using Tunnel Mode
Description of the Network Topology for the IPsec Tasks to Protect a VPN
How to Protect a VPN With IPsec in Tunnel Mode
How to Manually Create IPsec Keys
How to Configure a Role for Network Security
How to Manage IPsec and IKE Services
How to Verify That Packets Are Protected With IPsec
8. IP Security Architecture (Reference)
9. Internet Key Exchange (Overview)
This section provides procedures that enable you to secure traffic between two systems and to secure a web server. To protect a VPN, see Protecting a VPN With IPsec. For additional procedures to manage IPsec and to use SMF commands with IPsec and IKE, see Managing IPsec and IKE.
The following information applies to all IPsec configuration tasks:
IPsec and zones – To manage IPsec policy and keys for a shared-IP non-global zone, create the IPsec policy file in the global zone, and run the IPsec configuration commands from the global zone. Use the source address that corresponds to the non-global zone that is being configured. For an exclusive-IP zone, you configure IPsec policy in the non-global zone.
IPsec and RBAC – To use roles to administer IPsec, see Chapter 9, Using Role-Based Access Control (Tasks), in Oracle Solaris 11.1 Administration: Security Services. For an example, see How to Configure a Role for Network Security.
IPsec and SCTP – IPsec can be used to protect Streams Control Transmission Protocol (SCTP) associations, but caution must be used. For more information, see IPsec and SCTP.
IPsec and Trusted Extensions labels – On systems that are configured with the Trusted Extensions feature of Oracle Solaris, labels can be added to IPsec packets. For more information, see Administration of Labeled IPsec in Trusted Extensions Configuration and Administration.
IPv4 and IPv6 addresses – The IPsec examples in this guide use IPv4 addresses. Oracle Solaris supports IPv6 addresses as well. To configure IPsec for an IPv6 network, substitute IPv6 addresses in the examples. When protecting tunnels with IPsec, you can mix IPv4 and IPv6 addresses for the inner and outer addresses. Such a configuration enables you to tunnel IPv6 over an IPv4 network, for example.
The following task map points to procedures that set up IPsec between one or more systems. The ipsecconf(1M), ipseckey(1M), and ipadm(1M) man pages also describe useful procedures in their respective Examples sections.
|
This procedure assumes the following setup:
The two systems are named enigma and partym.
Each system has an IP address. This can be an IPv4 address, an IPv6 address, or both.
Each system requires ESP encryption with the AES algorithm, which requires a key of 128 bits, and ESP authentication with a SHA-2 message digest, which requires a key of 512 bits.
Each system uses shared security associations.
With shared SAs, only one pair of SAs is needed to protect the two systems.
Note - To use IPsec with labels on a Trusted Extensions system, see the extension of this procedure in How to Apply IPsec Protections in a Multilevel Trusted Extensions Network in Trusted Extensions Configuration and Administration.
Before You Begin
IPsec policy can be configured in the global zone or in an exclusive-IP stack zone. The policy for a shared-IP stack zone must be configured in the global zone. For an exclusive-IP zone, you configure IPsec policy in the non-global zone.
To run configuration commands, you must become an administrator who is assigned the Network IPsec Management rights profile. To edit system files and create keys, you must assume the root role. For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.
If you log in remotely, use the ssh command for a secure remote login. For an example, see Example 7-1.
This step enables the Service Management Facility (SMF) to use the system names without depending on nonexistent naming services. For more information, see the smf(5) man page.
# Secure communication with enigma 192.168.116.16 enigma
# Secure communication with partym 192.168.13.213 partym
The file name is /etc/inet/ipsecinit.conf. For an example, see the /etc/inet/ipsecinit.sample file.
{laddr enigma raddr partym} ipsec {encr_algs aes encr_auth_algs sha512 sa shared}
{laddr partym raddr enigma} ipsec {encr_algs aes encr_auth_algs sha512 sa shared}
For the syntax of IPsec policy entries, see the ipsecconf(1M) man page.
Configure IKE by following one of the configuration procedures in Configuring IKE (Task Map). For the syntax of the IKE configuration file, see the ike.config(4) man page.
# ipsecconf -f -c /etc/inet/ipsecinit.conf
Fix any errors, verify the syntax of the file, and continue.
# svcadm refresh svc:/network/ipsec/policy:default
IPsec policy is enabled by default, so you refresh it. If you have disabled IPsec policy, enable it.
# svcadm enable svc:/network/ipsec/policy:default
# svcadm enable svc:/network/ipsec/ike:default
# svcadm restart svc:/network/ipsec/ike:default
If you manually configured keys in Step 4, complete How to Manually Create IPsec Keys to activate the keys.
For the procedure, see How to Verify That Packets Are Protected With IPsec.
Example 7-1 Adding IPsec Policy When Using an ssh Connection
In this example, the administrator in the root role configures IPsec policy and keys on two systems by using the ssh command to reach the second system. The administrator is defined identically on both systems. For more information, see the ssh(1) man page.
First, the administrator configures the first system by performing Step 1 through Step 5 of the preceding procedure.
Then, in a different terminal window, the administrator uses the identically defined user name and ID to log in remotely with the ssh command.
local-system $ ssh -l jdoe other-system other-system $ su - root Enter password: other-system #
In the terminal window of the ssh session, the administrator configures the IPsec policy and keys of the second system by completing Step 1 through Step 7.
Then, the administrator ends the ssh session.
other-system # exit local-system $ exit
Finally, the administrator enables IPsec policy on the first system by completing Step 6 and Step 7.
The next time the two systems communicate, including by using an ssh connection, the communication is protected by IPsec.
A secure web server allows web clients to talk to the web service. On a secure web server, traffic that is not web traffic must pass security checks. The following procedure includes bypasses for web traffic. In addition, this web server can make unsecured DNS client requests. All other traffic requires ESP with AES and SHA-2 algorithms.
Before You Begin
You must be in the global zone to configure IPsec policy. For an exclusive-IP zone, you configure IPsec policy in the non-global zone.
You have completed How to Secure Traffic Between Two Systems With IPsec so that the following conditions are in effect:
Communication between the two systems is protected by IPsec.
Keying material is being generated by IKE.
You have verified that packets are being protected.
To run configuration commands, you must become an administrator who is assigned the Network IPsec Management rights profile. To edit system files, you must assume the root role. For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.
If you log in remotely, use the ssh command for a secure remote login. For an example, see Example 7-1.
For a web server, these services include TCP ports 80 (HTTP) and 443 (Secure HTTP). If the web server provides DNS name lookups, the server might also need to include port 53 for both TCP and UDP.
Add the following lines to the /etc/inet/ipsecinit.conf file:
# Web traffic that web server should bypass. {lport 80 ulp tcp dir both} bypass {} {lport 443 ulp tcp dir both} bypass {} # Outbound DNS lookups should also be bypassed. {rport 53 dir both} bypass {} # Require all other traffic to use ESP with AES and SHA-2. # Use a unique SA for outbound traffic from the port {} ipsec {encr_algs aes encr_auth_algs sha512 sa shared}
This configuration allows only secure traffic to access the system, with the bypass exceptions that are described in Step 1.
# ipsecconf -f -c /etc/inet/ipsecinit.conf
# svcadm refresh svc:/network/ipsec/policy:default
Restart the ike service.
# svcadm restart svc:/network/ipsec/ike
If you manually configured the keys, follow the instructions in How to Manually Create IPsec Keys.
Your setup is complete. Optionally, you can perform Step 6.
Add the following lines to a remote system's /etc/inet/ipsecinit.conf file:
# Communicate with web server about nonweb stuff # {laddr webserver} ipsec {encr_algs aes encr_auth_algs sha512 sa shared}
Verify the syntax then refresh the IPsec policy to activate it.
remote-system # ipsecconf -f -c /etc/inet/ipsecinit.conf remote-system # svcadm refresh svc:/network/ipsec/policy:default
A remote system can communicate securely with the web server for nonweb traffic only when the systems' IPsec policies match.
You can see the policies that are configured in the system when you issue the ipsecconf command without any arguments.
Before You Begin
You must run the ipsecconf command in the global zone. For an exclusive-IP zone, you run the ipsecconf command in the non-global zone.
You must become an administrator who is assigned the Network IPsec Management rights profile. For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.
$ ipsecconf
The command displays each entry with an index followed by a number.
$ ipsecconf -l -n
$ ipsecconf -L -n