mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-13 17:02:02 -05:00
Support certificate login after installation and upgrade
Add necessary steps which set SSSD and set SELinux boolean during installation or upgrade. Also create new endpoint in apache for login using certificates. https://pagure.io/freeipa/issue/6225 Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com> Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
1 parent
8980f4098e
commit
75c592d3b9
6 files changed
+59
-2
No files matched your search
@@ -255,6 +255,7 @@ Requires: mod_wsgi
|
||||
Requires: mod_auth_gssapi >= 1.5.0
|
||||
Requires: mod_nss >= 1.0.8-26
|
||||
Requires: mod_session
|
||||
Requires: mod_lookup_identity
|
||||
Requires: python-ldap >= 2.4.15
|
||||
Requires: python-gssapi >= 1.2.0
|
||||
Requires: acl
|
||||
|
||||
+31
-2
@@ -1,11 +1,16 @@
|
||||
#
|
||||
# VERSION 23 - DO NOT REMOVE THIS LINE
|
||||
# VERSION 24 - DO NOT REMOVE THIS LINE
|
||||
#
|
||||
# This file may be overwritten on upgrades.
|
||||
#
|
||||
|
||||
ProxyRequests Off
|
||||
# Load lookup_identity module in case it has not been loaded yet
|
||||
# The module is used to search users according the certificate.
|
||||
<IfModule !lookup_identity_module>
|
||||
LoadModule lookup_identity_module modules/mod_lookup_identity.so
|
||||
</IfModule>
|
||||
|
||||
ProxyRequests Off
|
||||
|
||||
#We use xhtml, a file format that the browser validates
|
||||
DirectoryIndex index.html
|
||||
@@ -70,6 +75,7 @@ WSGIScriptReloading Off
|
||||
SessionMaxAge 1800
|
||||
GssapiSessionKey file:/etc/httpd/alias/ipasession.key
|
||||
|
||||
GssapiImpersonate On
|
||||
GssapiDelegCcacheDir /var/run/ipa/ccaches
|
||||
GssapiDelegCcachePerms mode:0660 gid:ipaapi
|
||||
GssapiUseS4U2Proxy on
|
||||
@@ -97,6 +103,29 @@ Alias /ipa/session/cookie "/usr/share/ipa/gssapi.login"
|
||||
Allow from all
|
||||
</Location>
|
||||
|
||||
# Login with user certificate/smartcard configuration
|
||||
# This configuration needs to be loaded after <Location "/ipa">
|
||||
<Location "/ipa/session/login_x509">
|
||||
AuthType none
|
||||
GssapiDelegCcacheDir /var/run/ipa/ccaches
|
||||
GssapiDelegCcachePerms mode:0660 gid:ipaapi
|
||||
NSSVerifyClient require
|
||||
NSSUserName SSL_CLIENT_CERT
|
||||
LookupUserByCertificate On
|
||||
WSGIProcessGroup ipa
|
||||
WSGIApplicationGroup ipa
|
||||
GssapiImpersonate On
|
||||
|
||||
GssapiUseSessions On
|
||||
Session On
|
||||
SessionCookieName ipa_session path=/ipa;httponly;secure;
|
||||
SessionHeader IPASESSION
|
||||
SessionMaxAge 1800
|
||||
GssapiSessionKey file:/etc/httpd/alias/ipasession.key
|
||||
|
||||
Header unset Set-Cookie
|
||||
</Location>
|
||||
|
||||
<Location "/ipa/session/change_password">
|
||||
Satisfy Any
|
||||
Order Deny,Allow
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
cred_store = keytab:$HTTP_KEYTAB
|
||||
cred_store = client_keytab:$HTTP_KEYTAB
|
||||
allow_protocol_transition = true
|
||||
allow_constrained_delegation = true
|
||||
cred_usage = both
|
||||
euid = $HTTPD_USER
|
||||
|
||||
|
||||
@@ -846,6 +846,9 @@ def configure_sssd_conf(
|
||||
sssdconfig.new_config()
|
||||
domain = sssdconfig.new_domain(cli_domain)
|
||||
|
||||
if options.on_master:
|
||||
sssd_enable_service(sssdconfig, 'ifp')
|
||||
|
||||
if (
|
||||
(options.conf_ssh and file_exists(paths.SSH_CONFIG)) or
|
||||
(options.conf_sshd and file_exists(paths.SSHD_CONFIG))
|
||||
@@ -948,6 +951,23 @@ def configure_sssd_conf(
|
||||
return 0
|
||||
|
||||
|
||||
def sssd_enable_service(sssdconfig, service):
|
||||
try:
|
||||
sssdconfig.new_service(service)
|
||||
except SSSDConfig.ServiceAlreadyExists:
|
||||
pass
|
||||
except SSSDConfig.ServiceNotRecognizedError:
|
||||
root_logger.error(
|
||||
"Unable to activate the %s service in SSSD config.", service)
|
||||
root_logger.info(
|
||||
"Please make sure you have SSSD built with %s support "
|
||||
"installed.", service)
|
||||
root_logger.info(
|
||||
"Configure %s support manually in /etc/sssd/sssd.conf.", service)
|
||||
|
||||
sssdconfig.activate_service(service)
|
||||
|
||||
|
||||
def change_ssh_config(filename, changes, sections):
|
||||
if not changes:
|
||||
return True
|
||||
|
||||
@@ -53,6 +53,7 @@ SELINUX_BOOLEAN_SETTINGS = dict(
|
||||
httpd_can_network_connect='on',
|
||||
httpd_manage_ipa='on',
|
||||
httpd_run_ipa='on',
|
||||
httpd_dbus_sssd='on',
|
||||
)
|
||||
|
||||
HTTPD_USER = constants.HTTPD_USER
|
||||
|
||||
@@ -23,6 +23,7 @@ from ipalib.install import certmonger, sysrestore
|
||||
import SSSDConfig
|
||||
import ipalib.util
|
||||
import ipalib.errors
|
||||
from ipaclient.install.client import sssd_enable_service
|
||||
from ipaplatform import services
|
||||
from ipaplatform.tasks import tasks
|
||||
from ipapython import ipautil, version, certdb
|
||||
@@ -1771,6 +1772,10 @@ def upgrade_configuration():
|
||||
|
||||
set_sssd_domain_option('ipa_server_mode', 'True')
|
||||
|
||||
sssdconfig = SSSDConfig.SSSDConfig()
|
||||
sssdconfig.import_config()
|
||||
sssd_enable_service(sssdconfig, 'ifp')
|
||||
|
||||
krb = krbinstance.KrbInstance(fstore)
|
||||
krb.fqdn = fqdn
|
||||
krb.realm = api.env.realm
|
||||
|
||||
Reference in new issue
Block a user