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

📄 readme

📁 ike协商阶段证书认证补丁 for freeswan
💻
📖 第 1 页 / 共 3 页
字号:
respectively. An X.509 certificate is issued to each employee, containing in itssubject distinguished name the country (C=CH), the company (O=ACME),the group membership(OU=Sales or OU=Research) and the common name (e.g.CN=Bart Simpson).The IPsec policy defined above can now be enforced with the following threeIPsec security associations:conn sales     right=%any     rightid="C=CH, O=ACME, OU=Sales, CN=*"     rightsubnetwithin=10.1.0.0/24  # Sales DHCP range     leftsubnet=10.0.0.0/24         # Sales subnetconn research     right=%any     rightid="C=CH, O=ACME, OU=Research, CN=*"     rightsubnetwithin=10.1.1.0/24   # Research DHCP range     leftsubnet=10.0.1.0/24          # Research subnetconn web     right=%any     rightid="C=CH, O=ACME, OU=*, CN=*"     rightsubnetwithin=10.1.0.0/23   # Remote access DHCP range     leftsubnet=10.0.2.100/32        # Web server     rightprotoport=tcp              # TCP protocol only     leftprotoport=tcp/http          # TCP port 80 onlyOf course group specific tunneling could be implemented on thebasis of the Virtual IP range specified by the rightsubnetwithinparameter alone, but the wildcard matching mechanism guarantees thatonly authorized user can access the corresponding subnets.The '*' character is used as a wildcard in relative distinguished names (RDNs).In order to match a wildcard template, the ID_DER_ASN1_DN of a peer must containthe same number of RDNs (selected from the list in section 4.3) appearing in theexact order defined by the template.    "C=CH, O=ACME, OU=Research, OU=Special Effects, CN=Bart Simpson"matches the templates    "C=CH, O=ACME, OU=Research, OU=*, CN=*"    "C=CH, O=ACME, OU=*, OU=Special Effects, CN=*"    "C=CH, O=ACME, OU=*, OU=*, CN=*"but not the template    "C=CH, O=ACME, OU=*, CN=*"which doesn't have the same number of RDNs.4.7 IPsec policies based on CA certificates    ---------------------------------------As an alternative to the wildcard based IPsec policies described in section 4.6,access to specific client host and subnets can abe controlled on the basis ofthe CA that issued the peer certificateconn sales     right=%any     rightca="C=CH, O=ACME, OU=Sales, CN=Sales CA"     rightsubnetwithin=10.1.0.0/24  # Sales DHCP range     leftsubnet=10.0.0.0/24         # Sales subnetconn research     right=%any     rightca="C=CH, O=ACME, OU=Research, CN=Research CA"     rightsubnetwithin=10.1.1.0/24   # Research DHCP range     leftsubnet=10.0.1.0/24          # Research subnetconn web     right=%any     rightca="C=CH, O=ACME, CN=ACME Root CA"     rightsubnetwithin=10.1.0.0/23   # Remote access DHCP range     leftsubnet=10.0.2.100/32        # Web server     rightprotoport=tcp              # TCP protocol only     leftprotoport=tcp/http          # TCP port 80 onlyIn the example above, the connection "sales" can be used by peerspresenting certificates issued by the Sales CA, only. In the same way,the use of the connection "research" is restricted to owners of certificatesissued by the Research CA. The connection "web" is open to both "Sales" and"Research" peers because the required "ACME Root CA" is the issuer of theResearch and Sales intermediate CAs. If no rightca parameter is presentthen any valid certificate issued by one of the trusted CAs in/etc/ipsec.d/cacerts can be used by the peer.The leftca parameter usually doesn't have to be set explicitly becauseby default it is set to the issuer field of the certificate loaded vialeftcert. The statement     rightca=%samesets the CA requested from the peer to the CA used by the left side itselfas e.g. inconn sales     right=%any     rightca=%same     leftcert=mySalesCert.pem4.8 Sending certificate requests    ----------------------------The presence of a rightca parameter also causes the CA to be sent aspart of the certificate request message when FreeS/WAN is the initiator.A special case occurs when FreeS/WAN responds to a roadwarrior. If severalroadwarrior connections based on different CAs are defined then all eligibleCAs will be listed in Pluto抯 certificate request message.5. Configuring certificates and CRLs   ---------------------------------5.1 Installing the CA certificates    ------------------------------X.509 certificates received by FreeS/WAN during the IKE protocol areautomatically authenticated by going up the trust chain until a self-signedroot CA certificate is reached. Usually host certificates are directly signedby a root CA, but the X.509 patch also supports multi-level hierarchies withintermediate CAs in between. All CA certificates belonging to a trust chainmust be copied in either binary DER or base64 PEM format into the directory     /etc/ipsec.d/cacerts/5.2 Installing optional certificate revocation lists (CRLs)    -------------------------------------------------------By copying a CA certificate into /etc/ipsec.d/cacerts/, automatically all useror host certificates issued by this CA are declared valid. Unfortunatelyprivate keys might get compromised inadvertently or intentionally, personalcertificates of users leaving a company have to be blocked immediately, etc.To this purpose certificate revocation lists (CRLs) have been created. CRLscontain the serial numbers of all user or host certificates that have beenrevoked due to various reasons.After successful verification of the X.509 trust chain, Pluto searches itslist of CRLs either obtained by loading them from the /etc/ipsec.d/crls/directory or fetching them dynamically from a HTTP or LDAP server for thepresence of a CRL issued by the CA that has signed the certificate.If the serial number of the certificate is found in the CRL then the public keycontained in the certificate is declared invalid and the IPSec SA will not beestablished. If no CRL is found or if the deadline defined in the nextUpdatefield of the CRL has been reached, a warning is issued but the public key willnevertheless be accepted. CRLs must be stored either in binary DER or base64 PEMformat in the crls directory. Section 7.3 will explain in detail how CRLs canbe created using OpenSSL.5.3 Dynamic update of certificates and CRLs    ---------------------------------------Pluto reads certificates and CRLs from their respective files during systemstartup and keeps them in memory in the form of chained lists. X.509certificates have a finite life span defined by their validity field. Thereforeit must be possible to replace CA or OCSP certificates kept in system memorywithout disturbing established ISAKMP SAs. Certificate revocation lists shouldalso be updated in the regular intervals indicated by the nextUpdate field inthe CRL body. The following interactive commands allow the manual replacementof the various files:+---------------------------------------------------------------------------+| ipsec auto --rereadsecrets    reload file /etc/ipsec.secrets              ||---------------------------------------------------------------------------|| ipsec auto --rereadcacerts    reload all files in /etc/ipsec.d/cacerts/   ||---------------------------------------------------------------------------|| ipsec auto --rereadocspcerts  reload all files in /etc/ipsec.d/ocspcerts/ ||---------------------------------------------------------------------------|| ipsec auto --rereadcrls       reload all files in /etc/ipsec.d/crls/      ||---------------------------------------------------------------------------|| ipsec auto --rereadall        ipsec auto --rereadsecrets                  ||                                          --rereadcacerts                  ||                                          --rereadocspcerts                ||                                          --rereadcrls                     ||---------------------------------------------------------------------------|| ipsec auto --purgeocsp        purge the OCSP cache and fetching requests  |+---------------------------------------------------------------------------+CRLs can also be automatically fetched from an HTTP or LDAP server by usingthe CRL distribution points contained in X.509 certificates. The command    ipsec auto --listcrls    shows any pending fetch requests:  Oct 31 00:29:53 2002, trials: 2         issuer:  'C=CH, O=strongSec GmbH, CN=strongSec Root CA'         distPts: 'http://www.strongsec.com/ca/cert.crl'	          'ldap://ldap.strongsec.com/o=strongSec GmbH, c=CH		     ?certificateRevocationList?base		     ?(objectClass=certificationAuthority)'In the example above, an http and an ldap URL were extracted from a receivedend certificate. An independent thread then tries to fetch a CRL from thedesignated distribution points. The same thread also periodically checksif any loaded CRLs are about to expire. The check interval can be defined inthe "config setup" section of the ipsec.conf file:config setup       crlcheckinterval=600In our example the thread wakes up every 600 seconds or 10 minutes in orderto check the validity of the CRLs or to retry any pending fetch requests:  List of X.509 CRLs:    Dec 19 09:35:31 2002, revoked certs: 40         issuer:  'C=CH, O=strongSec GmbH, CN=strongSec Root CA'         distPts: 'http://www.strongsec.com/ca/cert.crl'         updates:  this Dec 19 09:35:00 2002                   next Dec 19 10:35:00 2002 warning (expires in 19 minutes)  List of fetch requests:  Dec 19 10:15:31 2002, trials: 1        issuer:  'C=CH, O=strongSec GmbH, CN=strongSec Root CA'        distPts: 'http://www.strongsec.com/ca/cert.crl'The first trial to update a CRL is started 2*crlcheckinterval before thenextUpdate time, i.e. when less than 20 minutes are left in our practicalexample. When crlcheckinterval is set to 0 (this is also the default valuewhen the parameter is not set in ipsec.conf) then the CRL checking and updating thread is not started and dynamic CRL fetching is disabled.5.4 Online Certificate Status Protocol (OCSP)    -----------------------------------------The Online Certificate Status Protocol is defined by RFC 2560. It can beused to query an OCSP server about the current status of an X.509 certificateand is often used as a more dynamic alternative to a static CertificateRevocation List (CRL). Both the OCSP request sent by the client and the OCSPresponse messages returned by the server are transported via a standardTCP/HTTP connection. Therefore cURL support must be enabled in pluto/Makefile:  # Uncomment this line to enable OCSP fetching using HTTP  LIBCURL=1In the simplest OCSP setup, a default URI under which the OCSP server for agiven CA can be accessed is defined in ipsec.conf:   config setup        crlcheckinterval=600   ca strongsec        cacert=caCert.pem        ocspuri=http://ocsp.strongsec.com:8880        auto=addThe HTTP port can be freely chosen. In our example we have assumed TCP port 8880.The crlcheckinterval must be set to a value different from zero. Otherwise theOCSP fetching thread will not be started.The well-known openssl-0.9.7 package from http://www.openssl.org implementsan OCSP server that can be used in conjunction with an openssl-based PublicKey Infrastructure. The OCSP client integrated into Pluto does not containany OpenSSL code though, but is based on the existing ASN.1 functionality ofthe X.509 patch.    The OpenSSL-based OCSP server is started with the following command:        openssl ocsp -index index.txt -CA cacert.pem -port 8880 \                 -rkey ocspkey.pem -rsigner ocspcert.pem \                 -resp_no_certs -nmin 60 -textThe command consists of the parameters -index  index.txt is a copy of the OpenSSL index file containing the list of         all issued certificates. The certificate status in indext.txt         is designated either by V for valid or R for revoked. If         a new certificate is added or if a certificate is revoked         using the openssl ca command, the OCSP server must be restarted         in order for the changes in index.txt to take effect. -CA     the CA certificate -port   the HTTP port the OCSP server is listening on. -rkey    the private key used to sign the OCSP response. The use of the         sensitive CA private key is not recommended since this could         jeopardize the security of your production PKI if the OCSP         server is hacked. It is much better to generate a special         RSA private key just for OCSP signing use instead.-rsigner the certificate of the OCSP server containing a public key which         matches the private key defined by -rkey and which can be used by         the client to check the trustworthiness of the signed OCSP response.-resp_no_certs  With this option the OCSP signer certificate defined by                -rsigner is not included in the OCSP response.-nmin    the validity interval of an OCSP response given in minutes.         2*crlcheckinterval before the expiration of the OCSP responses,         a new query will by pro-actively started by the Pluto fetching thread.         If nmin is missing or set to zero then the default validity interval         compiled into Pluto will be 2 minutes, leading to a quasi one-time         use of the OCSP status response which will not be periodically          refreshed by the fetching thread. In conjunction with the parameter        setting 憇trictcrlpolicy=yes

⌨️ 快捷键说明

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