summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-03-18 11:23:30 -0400
committerPetr Viktorin <pviktori@redhat.com>2014-08-22 09:59:31 +0200
commita25fe00c62117cb11a1e75fbcc4960a0cfa72aab (patch)
treee68182a6cd474c034fc14d83c3a9a4ce840b35c6 /ipapython
parent981b399c4e6938b4ab096dee9411cb025e221703 (diff)
downloadfreeipa-a25fe00c62117cb11a1e75fbcc4960a0cfa72aab.tar.gz
freeipa-a25fe00c62117cb11a1e75fbcc4960a0cfa72aab.tar.xz
freeipa-a25fe00c62117cb11a1e75fbcc4960a0cfa72aab.zip
Add a KRA to IPA
This patch adds the capability of installing a Dogtag KRA to an IPA instance. With this patch, a KRA is NOT configured by default when ipa-server-install is run. Rather, the command ipa-kra-install must be executed on an instance on which a Dogtag CA has already been configured. The KRA shares the same tomcat instance and DS instance as the Dogtag CA. Moreover, the same admin user/agent (and agent cert) can be used for both subsystems. Certmonger is also confgured to monitor the new subsystem certificates. To create a clone KRA, simply execute ipa-kra-install <replica_file> on a replica on which a Dogtag CA has already been replicated. ipa-kra-install will use the security domain to detect whether the system being installed is a replica, and will error out if a needed replica file is not provided. The install scripts have been refactored somewhat to minimize duplication of code. A new base class dogtagintance.py has been introduced containing code that is common to KRA and CA installs. This will become very useful when we add more PKI subsystems. The KRA will install its database as a subtree of o=ipaca, specifically o=ipakra,o=ipaca. This means that replication agreements created to replicate CA data will also replicate KRA data. No new replication agreements are required. Added dogtag plugin for KRA. This is an initial commit providing the basic vault functionality needed for vault. This plugin will likely be modified as we create the code to call some of these functions. Part of the work for: https://fedorahosted.org/freeipa/ticket/3872 The uninstallation option in ipa-kra-install is temporarily disabled. Reviewed-By: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/dogtag.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/ipapython/dogtag.py b/ipapython/dogtag.py
index 14824b994..bd92fe65c 100644
--- a/ipapython/dogtag.py
+++ b/ipapython/dogtag.py
@@ -24,10 +24,9 @@ import ConfigParser
from urllib import urlencode
import nss.nss as nss
-from nss.error import NSPRError
from ipalib import api, errors
-from ipalib.errors import NetworkError, CertificateOperationError
+from ipalib.errors import NetworkError
from ipalib.text import _
from ipapython import nsslib, ipautil
from ipaplatform.paths import paths
@@ -42,6 +41,7 @@ from ipapython.ipa_log_manager import *
# The configured_constants() function below provides constants relevant to
# the configured version.
+
class Dogtag10Constants(object):
DOGTAG_VERSION = 10
UNSECURE_PORT = 8080
@@ -63,6 +63,7 @@ class Dogtag10Constants(object):
SERVICE_PROFILE_DIR = '%s/ca/profiles/ca' % PKI_ROOT
ALIAS_DIR = paths.PKI_TOMCAT_ALIAS_DIR.rstrip('/')
SYSCONFIG_FILE_PATH = '%s/%s' % (paths.ETC_SYSCONFIG_DIR, PKI_INSTANCE_NAME)
+ KRA_CS_CFG_PATH = '%s/conf/kra/CS.cfg' % PKI_ROOT
SERVICE_NAME = 'pki_tomcatd'
@@ -165,7 +166,8 @@ def get_ca_certchain(ca_host=None, dogtag_constants=None):
if dogtag_constants is None:
dogtag_constants = configured_constants()
chain = None
- conn = httplib.HTTPConnection(ca_host,
+ conn = httplib.HTTPConnection(
+ ca_host,
api.env.ca_install_port or dogtag_constants.UNSECURE_PORT)
conn.request("GET", "/ca/ee/ca/getCertChain")
res = conn.getresponse()
@@ -244,7 +246,7 @@ def https_request(host, port, url, secdir, password, nickname, **kw):
body = urlencode(kw)
return _httplib_request(
- 'https', host, port, url, connection_factory, body)
+ 'https', host, port, url, connection_factory, body)
def http_request(host, port, url, **kw):
@@ -291,7 +293,8 @@ def _httplib_request(
root_logger.debug('request body %r', request_body)
try:
conn = connection_factory(host, port)
- conn.request('POST', uri,
+ conn.request(
+ 'POST', uri,
body=request_body,
headers={'Content-type': 'application/x-www-form-urlencoded'},
)