When I remount root filesystem to read-only, while gradm is running, suddenly the RBAC rules affecting symlinks stop working
An example for illustration:
On my system (Debian), /bin/sh is a symlink to /bin/dash. In my policy, I only have rules for the target (/bin/dash) and not for the symlink (/bin/sh). This is the way the learning process generates the rules.
suppose this is my subject for /bin/bash:
subject /bin/bash o {
...
/bin/dash x
...
}
steps to reproduce:
1. log in bash terminal
2. start RBAC (gradm -E)
3. start /bin/sh - everything works now
4. remount root to read-only (mount -o remount,ro /)
5. start sh again (/bin/sh) - /bin/sh no such file or directory
and in my logs, I see: grsec: denied access to hidden file /bin/sh by /bin/bash
6. repeat step 5 (/bin/sh) - now all works again
--- END OF EXAMPLE ---
same problem is with the symlinks to .so libraries in /lib/x86_64-linux-gnu/ and /usr/lib/x86_64-linux-gnu/
I am using gradm v3.0