Changes between Version 1 and Version 2 of Web/SecureProfileDelivery
- Timestamp:
- Mar 21, 2010, 10:16:22 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Web/SecureProfileDelivery
v1 v2 9 9 Administering a CA is a complex task. Here we'll only sketch how to set a mini-CA, with the help of OpenSSL. 10 10 If you are using a Red Hat variant, the easiest way is to use the package openss-perl for this. It contains a script called CA.pl, which will do everything we need. 11 /etc/pki/tls/misc/CA.pl -newca 12 Then, answer all the questions it will prompt. You'll find your generated CA on ../../CA. 11 {{{ 12 /etc/pki/tls/misc/CA.pl -newca 13 }}} 14 Then, answer all the questions it will prompt. You'll find your generated CA on `../../CA`. 13 15 14 16 == Generating certificates for each node == … … 21 23 == Generating the CA == 22 24 Install the package SINDES-ca, which is available at CERN's repository. **I need a link here!!** Then, edit /etc/sindes/ca.config; make sure to set O, OU and CN. 23 25 {{{ 24 26 [ req_distinguished_name ] 25 27 O = IIHE 26 28 OU = GRID 27 29 CN = Local BEgrid client CA 28 29 Edit /etc/sindes/sindesrc: in[MISC], set correctly domain (and use it correctly in sindessh !).30 }}} 31 Edit `/etc/sindes/sindesrc`: in ![MISC], set correctly domain (and use it correctly in sindessh !). 30 32 Next, set the default validity of the certificates, f.i, 10 years: 31 33 {{{ 32 34 default_days = 3650 33 34 Run "sindes-bootstrap-ca -a" to generate all certificates etc, and check the output carefully. This also generates a rpm with the CA certifi actecalled {{eg}}.35 Now, edit /etc/httpd/conf.d/sindes-ssl.conf, and make sure your profile directory is not readable by any other virtual host.35 }}} 36 Run "sindes-bootstrap-ca -a" to generate all certificates etc, and check the output carefully. This also generates a rpm with the CA certificat called {{eg}}. 37 Now, edit `/etc/httpd/conf.d/sindes-ssl.conf`, and make sure your profile directory is not readable by any other virtual host. 36 38 37 39 == Configuring the AII server == 38 Edit /etc/aii/aii-shellfe.confto ensure it uses the correct certificates, too:39 40 Edit `/etc/aii/aii-shellfe.conf` to ensure it uses the correct certificates, too: 41 {{{ 40 42 cdburl = https://f.q.d.n/profiles 41 43 cert_file = /etc/sindes/certs/apache.crt 42 44 key_file = /etc/sindes/keys/apache.key 43 45 ca_file = /etc/sindes/certs/ca.crt 46 }}} 44 47 45 48 == Node configuration == … … 49 52 50 53 You'll have to include somewhere on your profile: 51 52 include {'components/sindes_getcert/config'};53 54 {{{ 55 include {'components/sindes_getcert/config'}; 56 }}} 54 57 Next, you have to install the SINDES-client package: 55 58 {{{ 56 59 "/software/packages"=pkg_repl("SINDES-client","1.0.0-3","noarch"); 57 60 }}} 58 61 (check that package is already present on your repositories!!). Now, we choose the X.509 fields for our certificate and assign them to the component's tree: 59 62 {{{ 60 63 "/software/components/sindes_getcert/x509_O" = "desired crt /o field"; 61 64 "/software/components/sindes_getcert/x509_OU" = "desired crt /ou field"; 62 65 }}} 63 66 Next, decide where to store the certificate, key and CA information: 64 67 {{{ 65 68 "/software/components/sindes_getcert/cert_dir" = "/etc/sindes/certs"; 66 69 "/software/components/sindes_getcert/client_key" = "client_key.pem"; … … 69 72 "/software/components/sindes_getcert/ca_cert" = SINDES_SITE_CA_CERT_NAME; 70 73 "/software/components/sindes_getcert/ca_cert_rpm" = SINDES_SITE_CA_RPM_NAME; 71 74 }}} 72 75 73 76 === Configuring AII === 74 77 75 78 During the node's installation, it must use the values of the sindes_getcert component to generate the certificates. We said we want to download the profile only if there is a certificate. How do we solve this? 76 Easy: let AII configure SINDES first, then generate the certificates and finally, download the profile. We handle this with a simple AII hook, present in SVN. Its name is <tt>aii-sindes</tt>.77 79 Easy: let AII configure SINDES first, then generate the certificates and finally, download the profile. We handle this with a simple AII hook, present in SVN. Its name is `aii-sindes`. 80 {{{ 78 81 "/system/aii/hooks/post_reboot/0/module" = "aii_sindes"; 79 82 "/system/aii/hooks/remove/0/module" = "aii_sindes"; 80 83 "/system/aii/hooks/boot/0/module" = "aii_sindes"; 81 84 }}} 82 85 The {{remove}} hook will make all actions needed to revoke the host's certificate. The {{boot}} hook will open the time window. The {{post_reboot}} hook will generate the bash script that will request the certificates during the node's installation. 83 86 84 87 = Configuring CCM = 85 88 No matter the way you choose for generating your certificates, you need to tell CCM to use them to download the profile. Just set the following on the profile: 86 89 {{{ 87 90 "/software/components/ccm/key_file" = "/path/to/key/file"; 88 91 "/software/components/ccm/cert_file" = "/path/to/cert/file"; … … 90 93 "/software/components/ccm/ca_dir" = "/path/to/ca/dir"; 91 94 "/software/components/ccm/world_readable"= 0; 92 95 }}} 93 96 If you use SINDES, those paths can be automatically derived, like this: 94 97 {{{ 95 98 "/software/components/ccm/key_file" = 96 99 value("/software/components/sindes_getcert/cert_dir") + "/" + … … 105 108 value("/software/components/sindes_getcert/cert_dir"); 106 109 "/software/components/ccm/world_readable"= 0; 110 }}} 107 111 108 112 = Configuring Apache = 109 113 Make sure your profile directory is not readable by any other virtual host. We will need to check that the certificate belongs to the node that presents it, so we allow DNS lookups: 110 114 {{{ 111 115 HostnameLookups On 112 116 }}} 113 117 Now, restrict the access to the profiles directory: 114 118 {{{ 115 119 <Directory "/var/www/https/profiles"> 116 120 Options +Indexes … … 123 127 SSLRequire %{SSL_CLIENT_S_DN_CN} eq %{REMOTE_HOST} 124 128 </Directory> 125 129 }}} 126 130 Finally, the installation server is special: it must be allowed to download all profiles, to generate the appropriate Kickstarts: 127 131 {{{ 128 132 RewriteMap ACLmap txt:/var/www/acl/ACLmap.txt 129 133 RewriteCond ${ACLmap:%{REMOTE_HOST}|NO} NO 130 134 RewriteRule ^/profiles/.*$ /profiles/profile_%{REMOTE_HOST}.xml 131 135 }}} 132 136 And to let the install server to download all profiles, edit /var/www/acl/ACLmap.txt: 133 137 {{{ 134 138 echo aii-server.my.domain YES > /var/www/acl/ACLmap.txt 139 }}} 135 140 136 141 = References =