Changes between Version 1 and Version 2 of Web/SecureProfileDelivery


Ignore:
Timestamp:
Mar 21, 2010, 10:16:22 AM (16 years ago)
Author:
loomis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Web/SecureProfileDelivery

    v1 v2  
    99Administering a CA is a complex task. Here we'll only sketch how to set a mini-CA, with the help of OpenSSL.
    1010If 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}}}
     14Then, answer all the questions it will prompt. You'll find your generated CA on `../../CA`.
    1315
    1416== Generating certificates for each node ==
     
    2123== Generating the CA ==
    2224Install 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{{{
    2426 [ req_distinguished_name ]
    2527 O = IIHE
    2628 OU = GRID
    2729 CN = Local BEgrid client CA
    28 
    29 Edit /etc/sindes/sindesrc: in [MISC], set correctly domain (and use it correctly in sindessh !).
     30}}}
     31Edit `/etc/sindes/sindesrc`: in ![MISC], set correctly domain (and use it correctly in sindessh !).
    3032Next, set the default validity of the certificates, f.i, 10 years:
    31 
     33{{{
    3234 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 certifiacte called {{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}}}
     36Run "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}}.
     37Now, edit `/etc/httpd/conf.d/sindes-ssl.conf`, and make sure your profile directory is not readable by any other virtual host.
    3638
    3739== Configuring the AII server ==
    38 Edit /etc/aii/aii-shellfe.conf to ensure it uses the correct certificates, too:
    39 
     40Edit `/etc/aii/aii-shellfe.conf` to ensure it uses the correct certificates, too:
     41{{{
    4042 cdburl = https://f.q.d.n/profiles
    4143 cert_file = /etc/sindes/certs/apache.crt
    4244 key_file = /etc/sindes/keys/apache.key
    4345 ca_file = /etc/sindes/certs/ca.crt
     46}}}
    4447
    4548== Node configuration ==
     
    4952
    5053You'll have to include somewhere on your profile:
    51 
    52  include {'components/sindes_getcert/config'};
    53 
     54{{{
     55include {'components/sindes_getcert/config'};
     56}}}
    5457Next, you have to install the SINDES-client package:
    55 
     58{{{
    5659 "/software/packages"=pkg_repl("SINDES-client","1.0.0-3","noarch");
    57 
     60}}}
    5861(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{{{
    6063 "/software/components/sindes_getcert/x509_O" = "desired crt /o field";
    6164 "/software/components/sindes_getcert/x509_OU" = "desired crt /ou field";
    62 
     65}}}
    6366Next, decide where to store the certificate, key and CA information:
    64 
     67{{{
    6568 "/software/components/sindes_getcert/cert_dir" = "/etc/sindes/certs";
    6669 "/software/components/sindes_getcert/client_key" = "client_key.pem";
     
    6972 "/software/components/sindes_getcert/ca_cert" = SINDES_SITE_CA_CERT_NAME;
    7073 "/software/components/sindes_getcert/ca_cert_rpm" = SINDES_SITE_CA_RPM_NAME;
    71 
     74}}}
    7275
    7376=== Configuring AII ===
    7477
    7578During 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 
     79Easy: 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{{{
    7881 "/system/aii/hooks/post_reboot/0/module" = "aii_sindes";
    7982 "/system/aii/hooks/remove/0/module" = "aii_sindes";
    8083 "/system/aii/hooks/boot/0/module" = "aii_sindes";
    81 
     84}}}
    8285The {{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.
    8386
    8487= Configuring CCM =
    8588No 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{{{
    8790 "/software/components/ccm/key_file" = "/path/to/key/file";
    8891 "/software/components/ccm/cert_file" = "/path/to/cert/file";
     
    9093 "/software/components/ccm/ca_dir" = "/path/to/ca/dir";
    9194 "/software/components/ccm/world_readable"= 0;
    92 
     95}}}
    9396If you use SINDES, those paths can be automatically derived, like this:
    94 
     97{{{
    9598 "/software/components/ccm/key_file" =
    9699     value("/software/components/sindes_getcert/cert_dir") + "/" +
     
    105108     value("/software/components/sindes_getcert/cert_dir");
    106109 "/software/components/ccm/world_readable"= 0;
     110}}}
    107111
    108112= Configuring Apache =
    109113Make 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{{{
    111115 HostnameLookups On
    112 
     116}}}
    113117Now, restrict the access to the profiles directory:
    114 
     118{{{
    115119 <Directory "/var/www/https/profiles">
    116120     Options +Indexes
     
    123127     SSLRequire %{SSL_CLIENT_S_DN_CN} eq %{REMOTE_HOST}
    124128 </Directory>
    125 
     129}}}
    126130Finally, the installation server is special: it must be allowed to download all profiles, to generate the appropriate Kickstarts:
    127 
     131{{{
    128132 RewriteMap ACLmap txt:/var/www/acl/ACLmap.txt
    129133 RewriteCond ${ACLmap:%{REMOTE_HOST}|NO} NO
    130134 RewriteRule ^/profiles/.*$ /profiles/profile_%{REMOTE_HOST}.xml
    131 
     135}}}
    132136And to let the install server to download all profiles, edit /var/www/acl/ACLmap.txt:
    133 
     137{{{
    134138 echo aii-server.my.domain YES > /var/www/acl/ACLmap.txt
     139}}}
    135140
    136141= References =