Skip to content

Commit

Permalink
Clean up default security domain params
Browse files Browse the repository at this point in the history
The default security domain params in CS.cfg have been moved
into PKIDeployer.setup_security_domain_manager() such that
they will be added only if security domain setup is enabled
in pkispawn.
  • Loading branch information
edewata committed Dec 5, 2023
1 parent f793f0a commit 370fb9b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/kra-standalone-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,9 @@ jobs:
- name: Check CA security domain
run: |
# security domain should be disabled (i.e. no securitydomain.select=new)
cat > expected << EOF
securitydomain.checkIP=false
securitydomain.checkinterval=300000
securitydomain.flushinterval=86400000
securitydomain.source=ldap
EOF
# security domain should be disabled
docker exec ca pki-server ca-config-find | grep ^securitydomain. | sort | tee actual
diff expected actual
diff /dev/null actual
docker exec ca pki-server cert-export ca_signing --cert-file ${SHARED}/ca_signing.crt
docker exec ca pki client-cert-import ca_signing --ca-cert ${SHARED}/ca_signing.crt
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/ocsp-standalone-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,9 @@ jobs:
- name: Check CA security domain
run: |
# security domain should be disabled (i.e. no securitydomain.select=new)
cat > expected << EOF
securitydomain.checkIP=false
securitydomain.checkinterval=300000
securitydomain.flushinterval=86400000
securitydomain.source=ldap
EOF
# security domain should be disabled
docker exec ca pki-server ca-config-find | grep ^securitydomain. | sort | tee actual
diff expected actual
diff /dev/null actual
docker exec ca pki-server cert-export ca_signing --cert-file ${SHARED}/ca_signing.crt
docker exec ca pki client-cert-import ca_signing --ca-cert ${SHARED}/ca_signing.crt
Expand Down
4 changes: 0 additions & 4 deletions base/ca/shared/conf/CS.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ authType=pwd
admin.interface.uri=ca/admin/console/config/wizard
ee.interface.uri=ca/ee/ca
agent.interface.uri=ca/agent/ca
securitydomain.checkIP=false
securitydomain.flushinterval=86400000
securitydomain.source=ldap
securitydomain.checkinterval=300000
machineName=[pki_hostname]
instanceId=[pki_instance_name]
pidDir=/var/run/pki/tomcat
Expand Down
9 changes: 9 additions & 0 deletions base/server/python/pki/server/deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,8 @@ def setup_security_domain_manager(self, subsystem):

subsystem.create_security_domain(name=sd_name)

domain_manager = True

logger.info('Adding security domain manager')
subsystem.add_security_domain_subsystem(
self.mdict['pki_subsystem_name'],
Expand All @@ -2633,6 +2635,13 @@ def setup_security_domain_manager(self, subsystem):
secure_port=proxySecurePort,
domain_manager=True)

if domain_manager:
logger.info('Adding security domain sessions')
subsystem.config['securitydomain.checkIP'] = 'false'
subsystem.config['securitydomain.checkinterval'] = '300000'
subsystem.config['securitydomain.flushinterval'] = '86400000'
subsystem.config['securitydomain.source'] = 'ldap'

def pki_connect(self):

ca_cert = os.path.join(self.instance.nssdb_dir, "ca.crt")
Expand Down

0 comments on commit 370fb9b

Please sign in to comment.