Closed rmetrich closed 10 months ago
Note: "deny" rules are only available with CIL, hence the new module. Additionally Petr Lautrbach seems to prefer having a new module which may be disabled if needed.
We should use optional block for this to make sure the new module will not block removal of fapolicyd module. With the following syntax the module will work the same as the plain rule, as long as fapolicyd module is installed and enabled, but will have no effect in case fapolicyd module is removed.
(optional fapolicyd_deny_optional
(typeattributeset cil_gen_require fapolicyd_t)
(deny domain fapolicyd_t (process (sigkill sigstop ptrace)))
)
What about the module name? fapolicyd_deny
or fapolicy_hardening
?
We should use optional block for this to make sure the new module will not block removal of fapolicyd module. With the following syntax the module will work the same as the plain rule, as long as fapolicyd module is installed and enabled, but will have no effect in case fapolicyd module is removed.
(optional fapolicyd_deny_optional (typeattributeset cil_gen_require fapolicyd_t) (deny domain fapolicyd_t (process (sigkill sigstop ptrace))) )
OTOH does it make sense to have fapalicyd_deny
module installed when there's no fapolicyd
module?
We should use optional block for this to make sure the new module will not block removal of fapolicyd module. With the following syntax the module will work the same as the plain rule, as long as fapolicyd module is installed and enabled, but will have no effect in case fapolicyd module is removed.
(optional fapolicyd_deny_optional (typeattributeset cil_gen_require fapolicyd_t) (deny domain fapolicyd_t (process (sigkill sigstop ptrace))) )
OTOH does it make sense to have
fapalicyd_deny
module installed when there's nofapolicyd
module?
No, this is just safer. We can install or remove the modules in any order we want and don't have to worry about special cases.
Receiving any of these signals or starting to ptrace the process leads to a system hang. This hardening module prevents such thing to happen.
Without the module (example for ptrace):
With the module:
Note: requires policycoreutils >= -3.6-0.rc2.1 ("deny" functionality)