跳过导航链接 | |
退出打印视图 | |
在 Oracle Solaris 11.1 中保护网络安全 Oracle Solaris 11.1 Information Library (简体中文) |
在进行适当配置后,家庭办公室和手提电脑可以使用 IPsec 和 IKE 与其公司的中央计算机进行通信。利用与公钥证书验证方法组合的综合 IPsec 策略,离站系统可以保护它们传输到中心系统的流量。
IPsec 和 IKE 要求用唯一 ID 标识源和目标。对于没有唯一 IP 地址的站点外系统或移动系统,必须使用其他 ID 类型。可以使用诸如 DNS、DN 或 email 之类的 ID 类型唯一地标识系统。
对于具有唯一 IP 地址的站点外系统或移动系统,最好也应使用其他 ID 类型进行配置。例如,如果系统尝试从 NAT 盒 (NAT box) 之后连接到中心站点,则不会使用它们的唯一地址。NAT 盒 (NAT box) 指定一个中心系统无法识别的任意 IP 地址。
预先共享的密钥也不太适合用作移动系统的验证机制,因为预先共享的密钥需要固定的 IP 地址。使用自签名证书或来自 PKI 的证书,移动系统可以与中心站点进行通信。
开始之前
您必须承担 root 角色。有关更多信息,请参见《Oracle Solaris 11.1 管理:安全服务》中的"如何使用指定给您的管理权限"。如果您以远程方式登录,请使用 ssh 命令实现安全的远程登录。有关示例,请参见示例 7-1。
中心系统需要一个允许很宽的 IP 地址范围的策略。随后,IKE 策略中的证书确保进行连接的系统是合法的。
# /etc/inet/ipsecinit.conf on central # Keep everyone out unless they use this IPsec policy: {} ipsec {encr_algs aes encr_auth_algs sha256 sa shared}
DNS 标识中心系统。证书用于验证该系统。
## /etc/inet/ike/ike.config on central # Global parameters # # Find CRLs by URI, URL, or LDAP # Use CRL from organization's URI use_http # # Use web proxy proxy "http://somecache.domain:port/" # # Use LDAP server ldap_server "ldap-server1.domain.org,ldap2.domain.org:port" # # List CA-signed certificates cert_root "C=US, O=Domain Org, CN=Domain STATE" # # List self-signed certificates - trust server and enumerated others #cert_trust "DNS=central.domain.org" #cert_trust "DNS=mobile.domain.org" #cert_trust "DN=CN=Domain Org STATE (CLASS), O=Domain Org #cert_trust "email=root@central.domain.org" #cert_trust "email=user1@mobile.domain.org" # # Rule for mobile systems with certificate { label "Mobile systems with certificate" local_id_type DNS # CA's public certificate ensures trust, # so allow any remote_id and any remote IP address. remote_id "" remote_addr 0.0.0.0/0 p2_pfs 5 p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256 } }
/etc/hosts 文件不需要移动系统的地址,但是可以提供一个地址。该文件必须包含中心系统的公共 IP 地址。
# /etc/hosts on mobile central 192.xxx.xxx.x
移动系统需要按照中心系统的公共 IP 地址来查找中心系统。这些系统必须配置相同的 IPsec 策略。
# /etc/inet/ipsecinit.conf on mobile # Find central {raddr 192.xxx.xxx.x} ipsec {encr_algs aes encr_auth_algs sha256 sa shared}
标识符不能是 IP 地址。以下标识符对移动系统有效:
DN=ldap-directory-name
DNS=domain-name-server-address
email=email-address
证书用于验证移动系统。
## /etc/inet/ike/ike.config on mobile # Global parameters # # Find CRLs by URI, URL, or LDAP # Use CRL from organization's URI use_http # # Use web proxy proxy "http://somecache.domain:port/" # # Use LDAP server ldap_server "ldap-server1.domain.org,ldap2.domain.org:port" # # List CA-signed certificates cert_root "C=US, O=Domain Org, CN=Domain STATE" # # Self-signed certificates - trust me and enumerated others #cert_trust "DNS=mobile.domain.org" #cert_trust "DNS=central.domain.org" #cert_trust "DN=CN=Domain Org STATE (CLASS), O=Domain Org #cert_trust "email=user1@domain.org" #cert_trust "email=root@central.domain.org" # # Rule for off-site systems with root certificate { label "Off-site mobile with certificate" local_id_type DNS # NAT-T can translate local_addr into any public IP address # central knows me by my DNS local_id "mobile.domain.org" local_addr 0.0.0.0/0 # Find central and trust the root certificate remote_id "central.domain.org" remote_addr 192.xxx.xxx.x p2_pfs 5 p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256 } }
# svcadm enable svc:/network/ipsec/ike
示例 10-4 将中心计算机配置为接受来自移动系统的 IPsec 流量
IKE 可以从 NAT 盒 (NAT box) 之后启动协商。但是,IKE 的理想设置是在 NAT 盒 (NAT box) 没有介入的情况下进行的。在以下示例中,CA 的公共证书放置在移动系统和中心系统上。中心系统接受来自 NAT 盒 (NAT box) 之后的系统的 IPsec 协商。main1 是可以接受来自站点外系统的连接的公司系统。有关如何设置站点外系统,请参见示例 10-5。
## /etc/hosts on main1 main1 192.168.0.100
## /etc/inet/ipsecinit.conf on main1 # Keep everyone out unless they use this IPsec policy: {} ipsec {encr_algs aes encr_auth_algs sha256 sa shared}
## /etc/inet/ike/ike.config on main1 # Global parameters # # Find CRLs by URI, URL, or LDAP # Use CRL from organization's URI use_http # # Use web proxy proxy "http://cache1.domain.org:8080/" # # Use LDAP server ldap_server "ldap1.domain.org,ldap2.domain.org:389" # # List CA-signed certificate cert_root "C=US, O=ExamplePKI Inc, OU=PKI-Example, CN=Example PKI" # # Rule for off-site systems with root certificate { label "Off-site system with root certificate" local_id_type DNS local_id "main1.domain.org" local_addr 192.168.0.100 # CA's public certificate ensures trust, # so allow any remote_id and any remote IP address. remote_id "" remote_addr 0.0.0.0/0 p2_pfs 5 p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256} p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256} p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256} p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256} }
示例 10-5 使用 IPsec 配置 NAT 之后的系统
在以下示例中,CA 的公共证书放置在移动系统和中心系统上。mobile1 将从本部连接到公司总部。Internet 服务提供商 (Internet service provider, ISP) 网络使用 NAT 盒 (NAT box) ,以允许 ISP 为 mobile1 指定专用地址。然后,NAT 盒 (NAT box) 将专用地址转换为与其他 ISP 网络节点共享的公共 IP 地址。公司总部不在 NAT 之后。有关如何在公司总部设置计算机,请参见示例 10-4。
## /etc/hosts on mobile1 mobile1 10.1.3.3 main1 192.168.0.100
## /etc/inet/ipsecinit.conf on mobile1 # Find main1 {raddr 192.168.0.100} ipsec {encr_algs aes encr_auth_algs sha256 sa shared}
## /etc/inet/ike/ike.config on mobile1 # Global parameters # # Find CRLs by URI, URL, or LDAP # Use CRL from organization's URI use_http # # Use web proxy proxy "http://cache1.domain.org:8080/" # # Use LDAP server ldap_server "ldap1.domain.org,ldap2.domain.org:389" # # List CA-signed certificate cert_root "C=US, O=ExamplePKI Inc, OU=PKI-Example, CN=Example PKI" # # Rule for off-site systems with root certificate { label "Off-site mobile1 with root certificate" local_id_type DNS local_id "mobile1.domain.org" local_addr 0.0.0.0/0 # Find main1 and trust the root certificate remote_id "main1.domain.org" remote_addr 192.168.0.100 p2_pfs 5 p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256 } }
示例 10-6 接受来自移动系统的自签名证书
在以下示例中,自签名证书已经颁发,并存放在移动系统和中心系统上。main1 是可以接受来自站点外系统的连接的公司系统。有关如何设置站点外系统,请参见示例 10-7。
## /etc/hosts on main1 main1 192.168.0.100
## /etc/inet/ipsecinit.conf on main1 # Keep everyone out unless they use this IPsec policy: {} ipsec {encr_algs aes encr_auth_algs sha256 sa shared}
## /etc/inet/ike/ike.config on main1 # Global parameters # # Self-signed certificates - trust me and enumerated others cert_trust "DNS=main1.domain.org" cert_trust "jdoe@domain.org" cert_trust "user2@domain.org" cert_trust "user3@domain.org" # # Rule for off-site systems with trusted certificate { label "Off-site systems with trusted certificates" local_id_type DNS local_id "main1.domain.org" local_addr 192.168.0.100 # Trust the self-signed certificates # so allow any remote_id and any remote IP address. remote_id "" remote_addr 0.0.0.0/0 p2_pfs 5 p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256 } }
示例 10-7 使用自签名证书联系中心系统
在以下示例中,mobile1 将从本部连接到公司总部。证书已经颁发,并放置在移动系统和中心系统上。ISP 网络使用 NAT 盒 (NAT box) ,以允许 ISP 为 mobile1 指定专用地址。然后,NAT 盒 (NAT box) 将专用地址转换为与其他 ISP 网络节点共享的公共 IP 地址。公司总部不在 NAT 之后。有关如何在公司总部设置计算机,请参见示例 10-6。
## /etc/hosts on mobile1 mobile1 10.1.3.3 main1 192.168.0.100
## /etc/inet/ipsecinit.conf on mobile1 # Find main1 {raddr 192.168.0.100} ipsec {encr_algs aes encr_auth_algs sha256 sa shared}
## /etc/inet/ike/ike.config on mobile1 # Global parameters # Self-signed certificates - trust me and the central system cert_trust "jdoe@domain.org" cert_trust "DNS=main1.domain.org" # # Rule for off-site systems with trusted certificate { label "Off-site mobile1 with trusted certificate" local_id_type email local_id "jdoe@domain.org" local_addr 0.0.0.0/0 # Find main1 and trust the certificate remote_id "main1.domain.org" remote_addr 192.168.0.100 p2_pfs 5 p1_xform {auth_method rsa_sig oakley_group 5 encr_alg aes auth_alg sha256 } }
接下来的步骤
如果建立 IPsec 策略未完成,请返回到 IPsec 过程以启用或刷新 IPsec 策略。