mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add permission for bypassing CA ACL enforcement
Add the "Request Certificate ignoring CA ACLs" permission and associated ACI, initially assigned to "Certificate Administrators" privilege. Update cert-request command to skip CA ACL enforcement when the bind principal has this permission. Fixes: https://fedorahosted.org/freeipa/ticket/5099 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
6b978d74ae
commit
6fa14fd21e
@@ -345,8 +345,6 @@ class cert_request(VirtualCommand):
|
||||
else:
|
||||
principal_type = SERVICE
|
||||
|
||||
caacl_check(principal_type, principal_string, ca, profile_id)
|
||||
|
||||
bind_principal = split_any_principal(getattr(context, 'principal'))
|
||||
bind_service, bind_name, bind_realm = bind_principal
|
||||
|
||||
@@ -361,6 +359,15 @@ class cert_request(VirtualCommand):
|
||||
# Can the bound principal request certs for another principal?
|
||||
self.check_access()
|
||||
|
||||
try:
|
||||
self.check_access("request certificate ignore caacl")
|
||||
bypass_caacl = True
|
||||
except errors.ACIError:
|
||||
bypass_caacl = False
|
||||
|
||||
if not bypass_caacl:
|
||||
caacl_check(principal_type, principal_string, ca, profile_id)
|
||||
|
||||
try:
|
||||
subject = pkcs10.get_subject(csr)
|
||||
extensions = pkcs10.get_extensions(csr)
|
||||
@@ -469,7 +476,7 @@ class cert_request(VirtualCommand):
|
||||
raise errors.ACIError(info=_(
|
||||
"Insufficient privilege to create a certificate "
|
||||
"with subject alt name '%s'.") % name)
|
||||
if alt_principal_string is not None:
|
||||
if alt_principal_string is not None and not bypass_caacl:
|
||||
caacl_check(
|
||||
principal_type, alt_principal_string, ca, profile_id)
|
||||
elif name_type in (pkcs10.SAN_OTHERNAME_KRB5PRINCIPALNAME,
|
||||
|
||||
Reference in New Issue
Block a user