⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 ike协商阶段证书认证补丁 for freeswan
💻
📖 第 1 页 / 共 3 页
字号:
please refer to section 7.2.If you don't want to mess with subjectAltNames, you can use the certificate'sDistinguished Name (DN) instead, which is an identifier of type DER_ASN1_DNand which can be written e.g. in the LDAP-type formatconn rw     right=%any     leftid="C=CH, O=strongSec GmbH, CN=pulpo.strongsec.com"Since the subject's DN is part of the certificate, the leftid does not have tobe declared explicitly. Thus the entryconn rw     right=%anyautomatically assumes the subject DN of leftcert to be the host ID.4.2 Multiple certificates    ---------------------The X.509 patch supports multiple local host certificates and correspondingRSA private keys:conn rw1     right=%any     rightid=@peer1.domain1     leftcert=myCert1.pem     # leftid is DN of myCert1conn rw2     right=%any     rightid=@peer2.domain2     leftcert=myCert2.pem     # leftid is DN of myCert2When peer1 initiates a connection then FreeS/WAN will send myCert1 and willsign with myKey1 defined in /etc/ipsec.secrets (see section 6.2) whereasmyCert2 and myKey2 will be used in a connection setup started from peer2.4.3 Configuring the peer side using CA certificates    -----------------------------------------------Now we can proceed to define our connections. In many applications we mighthave dozens of mostly Windows-based road warriors connecting to a centralFreeS/WAN security gateway. The following most simple statement:conn rw     right=%anydefines the general roadwarrior case. The line right=%any literally means thatany IPSec peer is accepted, regardless of its current IP source address and itsID, as long as the peer presents a valid X.509 certificate signed by a CA theFreeS/WAN security gateway puts explicit trust in. Additionally the signatureduring IKE main mode gives proof that the peer is in possession of the privateRSA key matching the public key contained in the transmitted certificate.The ID by which a peer is identifying itself during IKE main mode can by any ofthe ID types IPV4_ADDR, FQDN, USER_FQDN or DER_ASN1_DN. If one of the firstthree ID types is used, then the accompanying X.509 certificate of the peermust contain a matching subjectAltName field of the type ipAddress (IP:),dnsName (DNS:) or rfc822Name (email:), respectively. With the fourth typeDER_ASN1_DN the identifier must completely match the subject field of thepeer's certificate. One of the two possible representations of aDistinguished Name (DN) is the LDAP-type format     rightid="C=CH, O=strongSec GmbH, CN=wroclaw.strongsec.com"Additional whitespace can be added everywhere as desired since it will beautomatically eliminated by the X.509 parser. An exception is the singlewhitespace between individual words , like e.g. in strongSec GmbH, which ispreserved by the parser.The Relative Distinguished Names (RDNs) can alternatively be separated by aslash '/' instead of a comma ','     rightid="/C=CH/O=strongSec GmbH/CN=wroclaw.strongsec.com"This is the representation extracted from the certificate by the OpenSSLcommand line option     openssl x509 -in wroclawCert.pem -noout -subjectThe following RDNs are supported by the X.509 patch+-----------------------------------------------+| DC           Domain Component                 ||-----------------------------------------------|| C            Country                          ||-----------------------------------------------|| ST           State or province                ||-----------------------------------------------|| L            Locality or town                 ||-----------------------------------------------|| O            Organisation                     ||-----------------------------------------------|| OU           Organisational Unit              ||-----------------------------------------------|| CN           Common Name                      ||-----------------------------------------------|| ND           NameDistinguisher, used with CN  ||-----------------------------------------------|| N            Name                             ||-----------------------------------------------|| G            Given name                       ||-----------------------------------------------|| S            Surname                          ||-----------------------------------------------|| I            Initials                         ||-----------------------------------------------|| T            Personal title                   ||-----------------------------------------------|| E            E-mail                           ||-----------------------------------------------|| Email        E-mail                           ||-----------------------------------------------|| emailAddress E-mail                           ||-----------------------------------------------|| SN           Serial number                    ||-----------------------------------------------|| serialNumber Serial number                    ||-----------------------------------------------|| D            Description                      ||-----------------------------------------------|| ID           X.500 Unique Identifier          ||-----------------------------------------------|| UID          User ID                          ||-----------------------------------------------|| TCGID        [Siemens] Trust Center Global ID |+-----------------------------------------------+With the roadwarrior connection definition listed above, an IPsec SA forthe FreeS/WAN security gateway pulpo.strongsec.com itself can be established.If any roadwarrior should be able to reach e.g. the two subnets 10.0.1.0/24and 10.0.3.0/24 behind the security gateway then the following connectiondefinitions will make this possibleconn rw1     right=%any     leftsubnet=10.0.1.0/24conn rw3     right=%any     leftsubnet=10.0.3.0/24If not all peers in possession of a X.509 certificate signed by a specificcertificate authority shall be given access to the Linux security gateway,then either a subset of them can be barred by listing the serial numbers oftheir certificates in a certificate revocation list (CRL) as specified insection 5.2 or as an alternative, access can be controlled by explicitlyputting a roadwarrior entry for each eligible peer into ipsec.conf:conn soggy     right=%any     rightid=@soggy.strongsec.comconn ewa     right=%any     rightid=ewa@strongsec.comconn wroclaw     right=%any     rightid="C=CH, O=strongSec GmbH, CN=wroclaw.strongsec.com"When the IP address of a peer is known to be stable, it can be specified aswell. This entry is mandatory when the FreeS/WAN host wants to act as theinitiator of an IPSec connection.conn soggy     right=160.85.22.3     rightid=@soggy.strongsec.comconn ewa     right=160.85.22.8     rightid=ewa@strongsec.comconn wroclaw     right=160.85.22.8     rightid="C=CH, O=strongSec GmbH, CN=wroclaw.strongsec.com"conn frosch     right=160.85.22.5In the last example the ID types FQDN, USER_FQDN, DER_ASN1_DN and IPV4_ADDR,respectively, were used. Of course all connection definitions presented so farhave included the lines in the conn %defaults section, comprising among othera left and leftcert entry, as well as a  rightrsasigkey parameter set to themagic value %cert , signifying that the public key will be extracted from aX.509 certificates sent by the peer.4.4 Handling Virtual IPs and wildcard subnets    -----------------------------------------Often roadwarriors are behind NAT-boxes with IPsec passthrough, which causesthe inner IP source address of an IPsec tunnel to be different from theouter IP source address usually assigned dynamically by the ISP.Whereas the varying outer IP address can be handled by the right=%anyconstruct, the inner IP address or subnet must always be declared in aconnection definition. Therefore for the three roadwarriors rw1 to rw3connecting to a FreeS/WAN security gateway the following entries arerequired in /etc/ipsec.conf:conn rw1     right=%any     righsubnet=10.0.1.5/32conn rw2     right=%any     rightsubnet=10.0.1.5.47/32conn rw3     right=%any     rightsubnet=10.0.1.128/28With the wildcard parameter rightsubnetwithin these three entries can bereduced to the single connection definitionconn rw     right=%any     rightsubnetwithin=10.0.1.0/24Any host will be accepted (of course after successful authentication based onthe peer's X.509 certificate only) if it declares a client subnet lying totallywithin the brackets defined by the wildcard subnet definition (in our example10.0.1.0/24). For each roadwarrior a connection instance tailored to thesubnet of the particular client will be created,based on the genericrightsubnetwithin template.This feature of the X.509 patch can also be helpful with VPN clients getting adynamically assigned inner IP from a DHCP server located on the NAT router box.4.5 Protocol and Port Selectors    ---------------------------The X.509 patch has been combined with the selectors patch to offer thepossibility to restrict the protocol and optionally the ports in an IPsecSA using the rightprotoport and leftprotoport parameter. Some examples:conn icmp     right=%any     rightprotoport=icmp     left=%defaultroute     leftid=@pluto.strongsec.com     leftprotoport=icmpconn http     right=%any     rightprotoport=6     left=%defaultroute     leftid=@pluto.strongsec.com     leftprotoport=6/80conn l2tp       # with port wildcard for Mac OS X Panther interoperability     right=%any     rightprotoport=17/%any     left=%defaultroute     leftid=@pluto.strongsec.com     leftprotoport=17/1701conn dhcp     right=%any     rightprotoport=udp/bootpc     left=%defaultroute     leftid=@pluto.strongsec.com     leftsubnet=0.0.0.0/0  #allows DHCP discovery broadcast     leftprotoport=udp/bootps     rekey=no     keylife=20s     rekeymargin=10s     auto=addProtocols and ports can be designated either by their numerical valuesor by their acronyms defined in /etc/services.    ipsec auto --statusshows the following connection definitions:"icmp": 160.85.106.10[@pulpo.strongsec.com]:1/0...%any:1/0"http": 160.85.106.10[@pulpo.strongsec.com]:6/80...%any:6/0"l2tp": 160.85.106.10[@pulpo.strongsec.com]:17/1701...%any:17/%any"dhcp": 0.0.0.0/0===160.85.106.10[@pulpo.strongsec.com]:17/67...%any:17/68Based on the protocol and port selectors appropriate eroutes will be setup, so that only the specified payload types will pass through the IPsectunnel.4.6 IPsec policies based on wildcards    ---------------------------------In large VPN-based remote access networks there is often a requirement thataccess to the various parts of an internal network must be granted selectively,e.g. depending on the group membership of the remote access user. Version 0.9.24of the X.509 patch makes this possible by applying wildcard filtering on theVPN user's distinguished name (ID_DER_ASN1_DN).Let's make a practical example: An organization has a sales department (OU=Sales) and a research group(OU=Research). In the company intranet there are separate subnets for Sales(10.0.0.0/24) and Research (10.0.1.0/24) but both groups share a common webserver (10.0.2.100). The VPN clients use Virtual IP addresses that are eitherassigned statically or via DHCP-over-IPsec. The sales and research departmentsuse IP addresses from separate DHCP address pools (10.1.0.0/24) and (10.1.1.0/24),

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -