Configure s4u2proxy during installation.

This creates a new container, cn=s4u2proxy,cn=etc,$SUFFIX

Within that container we control which services are allowed to
delegate tickets for other services. Right now that is limited
from the IPA HTTP to ldap services.

Requires a version of mod_auth_kerb that supports s4u2proxy

https://fedorahosted.org/freeipa/ticket/1098
This commit is contained in:
Rob Crittenden
2012-01-10 22:39:26 -05:00
parent 74857a8ee4
commit c08296adff
6 changed files with 51 additions and 2 deletions

View File

@@ -103,7 +103,7 @@ Requires: cyrus-sasl-gssapi%{?_isa}
Requires: ntp Requires: ntp
Requires: httpd Requires: httpd
Requires: mod_wsgi Requires: mod_wsgi
Requires: mod_auth_kerb Requires: mod_auth_kerb >= 5.4-9
Requires: mod_nss >= 1.0.8-10 Requires: mod_nss >= 1.0.8-10
Requires: python-ldap Requires: python-ldap
Requires: python-krbV Requires: python-krbV
@@ -621,6 +621,9 @@ fi
%ghost %attr(0644,root,apache) %config(noreplace) %{_sysconfdir}/ipa/default.conf %ghost %attr(0644,root,apache) %config(noreplace) %{_sysconfdir}/ipa/default.conf
%changelog %changelog
* Wed Jan 11 2012 Rob Crittenden <rcritten@redhat.com> - 2.99.0-14
- Set min for mod_auth_kerb to 5.4-9 to pick up s4u2proxy support
* Fri Dec 9 2011 Alexander Bokovoy <abokovoy@redhat.com> - 2.99.0-13 * Fri Dec 9 2011 Alexander Bokovoy <abokovoy@redhat.com> - 2.99.0-13
- Fix dependency for samba4-devel package - Fix dependency for samba4-devel package

View File

@@ -1,5 +1,5 @@
# #
# VERSION 2 - DO NOT REMOVE THIS LINE # VERSION 3 - DO NOT REMOVE THIS LINE
# #
# LoadModule auth_kerb_module modules/mod_auth_kerb.so # LoadModule auth_kerb_module modules/mod_auth_kerb.so
@@ -42,6 +42,7 @@ WSGIScriptReloading Off
SetHandler None SetHandler None
</Location> </Location>
KrbConstrainedDelegationLock ipa
# Protect /ipa with Kerberos # Protect /ipa with Kerberos
<Location "/ipa"> <Location "/ipa">
@@ -53,6 +54,7 @@ WSGIScriptReloading Off
KrbAuthRealms $REALM KrbAuthRealms $REALM
Krb5KeyTab /etc/httpd/conf/ipa.keytab Krb5KeyTab /etc/httpd/conf/ipa.keytab
KrbSaveCredentials on KrbSaveCredentials on
KrbConstrainedDelegation on
Require valid-user Require valid-user
ErrorDocument 401 /ipa/errors/unauthorized.html ErrorDocument 401 /ipa/errors/unauthorized.html
</Location> </Location>

View File

@@ -161,6 +161,28 @@ objectClass: nsContainer
objectClass: top objectClass: top
cn: posix-ids cn: posix-ids
dn: cn=s4u2proxy,cn=etc,$SUFFIX
changetype: add
objectClass: nsContainer
objectClass: top
cn: s4u2proxy
dn: cn=ipa-http-delegation,cn=s4u2proxy,cn=etc,$SUFFIX
changetype: add
objectClass: ipaKrb5DelegationACL
objectClass: groupOfPrincipals
objectClass: top
cn: ipa-http-delegation
memberPrincipal: HTTP/$HOST@$REALM
ipaAllowedTarget: cn=ipa-ldap-delegation-targets,cn=etc,$SUFFIX
dn: cn=ipa-ldap-delegation-targets,cn=s4u2proxy,cn=etc,$SUFFIX
changetype: add
objectClass: groupOfPrincipals
objectClass: top
cn: ipa-ldap-delegation-targets
memberPrincipal: ldap/$HOST@$REALM
dn: uid=admin,cn=users,cn=accounts,$SUFFIX dn: uid=admin,cn=users,cn=accounts,$SUFFIX
changetype: add changetype: add
objectClass: top objectClass: top

View File

@@ -0,0 +1,18 @@
dn: cn=s4u2proxy,cn=etc,$SUFFIX
default: objectClass: nsContainer
default: objectClass: top
default: cn: s4u2proxy
dn: cn=ipa-http-delegation,cn=s4u2proxy,cn=etc,$SUFFIX
default: objectClass: ipaKrb5DelegationACL
default: objectClass: groupOfPrincipals
default: objectClass: top
default: cn: ipa-http-delegation
default: memberPrincipal: HTTP/$HOST@$REALM
default: ipaAllowedTarget: 'cn=ipa-ldap-delegation-targets,cn=etc,$SUFFIX'
dn: cn=ipa-ldap-delegation-targets,cn=s4u2proxy,cn=etc,$SUFFIX
default: objectClass: groupOfPrincipals
default: objectClass: top
default: cn: ipa-ldap-delegation-targets
default: memberPrincipal: ldap/$HOST@$REALM

View File

@@ -18,6 +18,7 @@ app_DATA = \
20-user_private_groups.update \ 20-user_private_groups.update \
20-winsync_index.update \ 20-winsync_index.update \
21-replicas_container.update \ 21-replicas_container.update \
30-s4u2proxy.update \
40-delegation.update \ 40-delegation.update \
40-dns.update \ 40-dns.update \
40-automember.update \ 40-automember.update \

View File

@@ -136,6 +136,9 @@ class HTTPInstance(service.Service):
pent = pwd.getpwnam("apache") pent = pwd.getpwnam("apache")
os.chown("/etc/httpd/conf/ipa.keytab", pent.pw_uid, pent.pw_gid) os.chown("/etc/httpd/conf/ipa.keytab", pent.pw_uid, pent.pw_gid)
# Clean up existing ccache
installutils.remove_file('/tmp/krb5cc_%d' % pent.pw_uid)
def __configure_http(self): def __configure_http(self):
target_fname = '/etc/httpd/conf.d/ipa.conf' target_fname = '/etc/httpd/conf.d/ipa.conf'
http_txt = ipautil.template_file(ipautil.SHARE_DIR + "ipa.conf", self.sub_dict) http_txt = ipautil.template_file(ipautil.SHARE_DIR + "ipa.conf", self.sub_dict)