diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-09-10 16:15:14 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-09-15 10:01:08 -0400 |
commit | 49b36583a50e7f542e0667f3e2432ab1aa63924e (patch) | |
tree | 1c11b906018784db6e9415c17f116db4a1fd49e0 /install/tools/ipa-replica-install | |
parent | bb09db2228694cd78b5e4e281109e55df9de97be (diff) | |
download | freeipa-49b36583a50e7f542e0667f3e2432ab1aa63924e.tar.gz freeipa-49b36583a50e7f542e0667f3e2432ab1aa63924e.tar.xz freeipa-49b36583a50e7f542e0667f3e2432ab1aa63924e.zip |
Add external CA signing and abstract out the RA backend
External CA signing is a 2-step process. You first have to run the IPA
installer which will generate a CSR. You pass this CSR to your external
CA and get back a cert. You then pass this cert and the CA cert and
re-run the installer. The CSR is always written to /root/ipa.csr.
A run would look like:
# ipa-server-install --ca --external-ca -p password -a password -r EXAMPLE.COM -u dirsrv -n example.com --hostname=ipa.example.com -U
[ sign cert request ]
# ipa-server-install --ca --external-ca -p password -a password --external_cert_file=/tmp/rob.crt --external_ca_file=/tmp/cacert.crt -U -p password -a password -r EXAMPLE.COM -u dirsrv -n example.com --hostname=ipa.example.com
This also abstracts out the RA backend plugin so the self-signed CA we
create can be used in a running server. This means that the cert plugin
can request certs (and nothing else). This should let us do online replica
creation.
To handle the self-signed CA the simple ca_serialno file now contains
additional data so we don't have overlapping serial numbers in replicas.
This isn't used yet. Currently the cert plugin will not work on self-signed
replicas.
One very important change for self-signed CAs is that the CA is no longer
held in the DS database. It is now in the Apache database.
Lots of general fixes were also made in ipaserver.install.certs including:
- better handling when multiple CA certificates are in a single file
- A temporary directory for request certs is not always created when the
class is instantiated (you have to call setup_cert_request())
Diffstat (limited to 'install/tools/ipa-replica-install')
-rwxr-xr-x | install/tools/ipa-replica-install | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install index 0571f94c..1584dd58 100755 --- a/install/tools/ipa-replica-install +++ b/install/tools/ipa-replica-install @@ -32,6 +32,7 @@ from ipaserver.install import bindinstance, httpinstance, ntpinstance, certs from ipaserver import ipaldap from ipapython import version from ipalib import api, util +from ipalib.constants import DEFAULT_CONFIG CACERT="/usr/share/ipa/html/ca.crt" @@ -130,7 +131,17 @@ def set_owner(config, dir): os.chown(dir, pw.pw_uid, pw.pw_gid) def install_ca(config): + # FIXME, need to pass along the CA plugin to use cafile = config.dir + "/ca.p12" + + # Just initialize the environment. This is so the installer can have + # access to the plugin environment + api.env._bootstrap() + default_config = dict(DEFAULT_CONFIG) + if ipautil.file_exists(cafile): + default_config['ra_plugin'] = 'dogtag' + api.env._finalize_core(**default_config) + if not ipautil.file_exists(cafile): return None @@ -140,6 +151,12 @@ def install_ca(config): print >> sys.stderr, "Import failed: %s" % sys.exc_value sys.exit(1) + if not cainstance.check_inst(): + print "A CA was specified but the dogtag certificate server" + print "is not installed on the system" + print "Please install dogtag and restart the setup program" + sys.exit(1) + cs = cainstance.CADSInstance() cs.create_instance(config.ds_user, config.realm_name, config.host_name, config.domain_name, config.dirman_password) @@ -348,9 +365,10 @@ def main(): fd.write("realm=" + config.realm_name + "\n") fd.write("domain=" + config.domain_name + "\n") fd.write("xmlrpc_uri=https://%s/ipa/xml\n" % config.host_name) - fd.write("ldap_uri=ldapi://%%2fvar%%2frun%%2fslapd-%s.socket\n" % dsinstance.realm_to_serverid(realm_name)) + fd.write("ldap_uri=ldapi://%%2fvar%%2frun%%2fslapd-%s.socket\n" % dsinstance.realm_to_serverid(config.realm_name)) if ipautil.file_exists(config.dir + "/ca.p12"): fd.write("enable_ra=True\n") + fd.write("ra_plugin=dogtag\n") fd.close() # Apply any LDAP updates. Needs to be done after the replica is synced-up |