Foreman has the ability to automatically enroll clients into a realm when configured as a realm capsule.
When foreman is being configured with the realm capsule it will create
- a privilege object named 'Smart Proxy Host Management'
- a role object named 'Smart Proxy Host Manager'
The default permissions of the privilege are listed here
[archy@ipa02 ~]$ ipa privilege-show 'Smart Proxy Host Management'
Privilege name: Smart Proxy Host Management
Description: Smart Proxy Host Management
Permissions: Retrieve Certificates from the CA, System: Add DNS Entries, System: Read DNS Entries, System: Remove DNS Entries, System: Update DNS Entries,
System: Manage Host Certificates, System: Manage Host Enrollment Password, System: Manage Host Keytab, System: Modify Hosts, System: Remove
Hosts, System: Manage Service Keytab, System: Modify Services, Add Host Enrollment Password
Granting privilege to roles: Smart Proxy Host Manager
If you are working with principals such as 'smtp/mx01.archyslife.lan' on these automatically provisioned and foreman-managed hosts, you'll notice they won't be deleted once you delete them in foreman.
This is caused by insufficient permissions on the privilege object's permissions since it lacks the permission to delete the 'krbprincipalname' attributes. The error message can be found in '/var/log/foreman-proxy/proxy.log' and it should read something like this
/var/log/foreman-proxy/proxy.log:2021-10-14T08:16:59 9b19320a [W] Insufficient access: Insufficient 'delete' privilege to delete the entry 'krbprincipalname=smtp/mx01.archyslife.lan@ARCHYSLIFE.LAN,cn=services,cn=accounts,dc=archyslife,dc=lan'.:
<XMLRPC::FaultException>: Insufficient access: Insufficient 'delete' privilege to delete the entry 'krbprincipalname=smtp/mx01.archyslife.lan@ARCHYSLIFE.LAN,cn=services,cn=accounts,dc=archyslife,dc=lan'.
The solution is fairly simple it's just two commands. First create the permission to to delete the 'krbprincipalname' attribute
[archy@ipa02 ~]$ ipa permission-add 'delete krbPrincipalName from a Host' --right 'delete' --type 'service' --attrs 'krbprincipalname'
Next, add the permission to the privilege object
[archy@ipa02 ~]$ ipa privilege-add-permission 'Smart Proxy Host Management' --permission 'delete krbPrincipalName from a Host'
That's it, now hosts should be deleted if you remove them from foreman even if they have service principals assigned in idm.
Feel free to comment and / or suggest a topic.
Comments
Post a Comment