-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not set recursive ACLs on dhcp #621
Conversation
The cause for this change is the correct chaining. Previously there was no guarantee when the ACL was applied. In practice it was often done as: File[/etc/dhcp] -> Exec[setfacl] -> File[/etc/dhcp/dhcpd.conf] This meant the dhcpd.conf file didn't receive the ACL anyway. After chaining to Class['dhcp'] (to guarantee all files existed) it turns out that /etc/dhcp/dhcpd.conf would become executable. That resulted in idempotency problems. The Proxy needs to read dhcpd.conf, but that's guaranteed to be mode 0644 by theforeman/dhcp. Only the DHCP dir itself can have mode 0750 (owned by root:root) which is why the ACL is needed. By making it non-recursive and done after Class[dhcp] these problems are avoided.
@ekohl can you add a reference the issue on redmine: https://projects.theforeman.org/issues/30962 |
I think it doesn't really refer to that issue. 30962 only affects the stable branch, but this is not the cherry pick. |
I can recall only the context that https://projects.theforeman.org/issues/20683 and the associated RH bugzilla provide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my limited knowledge, and looking at the code
The cause for this change is the correct chaining. Previously there was no guarantee when the ACL was applied. In practice it was often done as: File[/etc/dhcp] -> Exec[setfacl] -> File[/etc/dhcp/dhcpd.conf]
This meant the dhcpd.conf file didn't receive the ACL anyway. After chaining to Class['dhcp'] (to guarantee all files existed) it turns out that /etc/dhcp/dhcpd.conf would become executable. That resulted in idempotency problems.
The Proxy needs to read dhcpd.conf, but that's guaranteed to be mode 0644 by theforeman/dhcp. Only the DHCP dir itself can have mode 0750 (owned by root:root) which is why the ACL is needed. By making it non-recursive and done after Class[dhcp] these problems are avoided.
This is an alternative to #620. Once merged to master, it should be cherry picked. In 14.1-stable it should also create a specific ACL on dhcpd.conf since there the mode is set to 0640.
My test env is still running so currently a draft.