Replies: 1 comment 2 replies
-
As a quick bit of terminology - Bottlerocket's SELinux policy refers to "subjects" (labeled processes) and "objects" (labeled inodes). To allow containers to use the "watch_with_perm" action - which is the fanotify mode that supports permission checks and blocking access - we'd need to write a rule like:
The reason why a rule like this has never been added is that it's not scoped to just containers. Since there's no way to refer to the subject label of the process attempting access, this rule would allow any container to block any process from accessing those files, even host components (like What I'd really prefer is a set of rules like:
Since the time I wrote that comment in a5e8a59, Bottlerocket has added support for MCS constraints, which allows for more fine-grained restrictions. MCS constraints allow for (2) and (3), but not (1) as far as I know. That's because the SELinux check applies when the watch is added, rather than when the access is attempted, so there's no useful information about the subject available. I'm tentatively willing to try an implementation that doesn't satisfy (1), but it would need some careful testing to ensure that an unprivileged container can't prevent |
Beta Was this translation helpful? Give feedback.
-
Hello everyone!
I'd like to understand a bit more about the reasons behind imposing this specific selinux policy:
There are usecases where fanotify perm events are particularly useful in trapping file accesses within the container, especially when allowing execution of only known binaries. Is there any specific reason this has to be disabled? If not, it'll be great to enable it!
Beta Was this translation helpful? Give feedback.
All reactions