How could I give sshd access to the required files in /proc, and also .ssh config files in users homes?
I don't understand what's the deal with the CAP_KILL problem.
you add to your /usr/bin/sshd subject
- Code: Select all
/proc/*/oom_score_adj rw
/home/*/.ssh r
+CAP_KILL
if you want to allow just one (or few) users instead of all, you would use "/home/myusername/.ssh r" instead of "/home/*/.ssh r", of course. CAP_KILL is needed as sshd tries to kill some of it children sometimes (proxycommand, privseparation child etc)
Also, is there another way to use gradm than authenticate as root and then authenticate as a RBAC admin with a password? This doesn't seem very convenient for automating these tasks.
That is intentional.You should not use allmighty admin role for automating tasks (it would simply create another almighy account, which kills the whole point of removing priviileges from almighty "root" you had before grsec). If you need elevated privileges for some tasks, you should use:
- special admin user role - for example for "webadmin" user can change apache configs:
- Code: Select all
role webadmin u
subject /
/etc/apache2 rwcdl
- use subject inheritance - for example
- Code: Select all
/usr/local/sbin/add_virtualhost:
echo blablabla > /etc/apache2/sites-available/$1.conf
/usr/bin/a2ensite $1
/etc/grsec/policy:
subject /usr/local/sbin/add_virtualhost
/etc/apache2 rwcdl
/usr/bin rxi
(in this case /usr/bin/a2ensite too would run with rwcdl access to /etc/apache2 directory)
- use non-authenticated role for automation ["N" role flag, along with "s"]
use "gradm -n role_name" to temporarily activate it without any password, and "gradm -u" to deactivate it. You should use role_transitions to define which roles may use that (you don't want to allow all users to change to role which does not require password!!)
In short, admin role should really never be used for regular system operation (much less automation!), but rather for unprecedented maintenance tasks and changing RBAC policy itself (adding new roles, etc).