1 .TH "reducecap" "8" "0.1.0" "Klavs Klavsen <kl@vsen.dk>" "System Administration"
4 reducecap \- The reducecap utility is used to lower the capability ceiling of a process and child process.
7 reducecap [\fIoptions\fP] <\fIcommand arguments\fP>
10 The reducecap utility is used to lower the capability ceiling of a process and child process. Even setuid program won't be able to grab more capabilities.
14 \fB\-\-secure\fR Removes all dangerous capabilities from the process executed.Specificly it removes:
15 CAP_LINUX_IMMUTABLE CAP_NET_BROADCAST CAP_NET_ADMIN, CAP_NET_RAW CAP_IPC_LOCK CAP_IPC_OWNER CAP_SYS_MODULE CAP_SYS_RAWIO CAP_SYS_PACCT CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_NICE CAP_SYS_RESOURCE CAP_SYS_TIME CAP_MKNOD.
17 Leaving the following capabilities:
18 CAP_CHOWN CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_FSETID CAP_KILL CAP_SETGID CAP_SETUID CAP_NET_BIND_SERVICE CAP_SYS_CHROOT CAP_SYS_PTRACE CAP_SYS_TTY_CONFIG CAP_LEASE CAP_QUOTACTL
20 \fB\-\-show\fR Shows the current process capabilities.
23 sets the security context flags. The option may be repeated
24 several times. Here are the values:
26 lock: The security context can't be changed. The process is trapped
27 in this context. This is generally used for vservers because yoy
28 do not want them to hide in new security context.
30 sched: Each process in a security context contribute (lower) to the general
31 priority of every processes in the context. Mostly, all processes
32 in a security context take as much CPU together as one process
33 not bound to this flag. Said again differently, a vserver having
34 100 active processes won't get more CPU than another vserver
35 with a single active process.
38 nproc: The "ulimit -u N" setting becomes global to the security context. It means
39 the security context is not allowed to have more than N processes.
41 private: No other processes, even root in security context 0, is allowed to
42 enter this security context. Once a security context is setup
43 with this flag, it is on its own. This also means that root
44 in security context 0 won't be able to kill or interact with those
47 hideinfo: Hides various information in /proc.
50 \fB--LINUX_IMMUTABLE\fR
52 \fB--NET_BIND_SERVICE\fR
82 All these options remove one capability. These options may be used
85 option to remove more capabilities.
90 \fI/usr/sbin/reducecap\fP
95 # You are not root now
96 # What is the current capability ceiling
98 # The capBset line presents mostly 1s.
99 /usr/sbin/reducecap \-\-secure /bin/sh
100 cat /proc/self/status
101 # The capBset now shows many more 0s.
102 # The capEff shows all 0s, you have no privilege now
105 cat /proc/self/status
106 # capEff is much better now, but there are still many 0s
107 # Now we try to see if we are really root
108 tail /var/log/messages
109 # So far so good, we see the content
111 /sbin/ifconfig eth0 down
112 # No way, we can't configure the interface. In fact
113 # we have lost most privilege normally assigned to root
116 Please contribute some more, if you feel it's important.
119 This Man page was written by Klavs Klavsen <kl@vsen.dk> and based upon the helpful output from the program itself and the documentation on the Virtual Server site <http://www.solucorp.qc.ca/miscprj/s_context.hc?prjstate=1&nodoc=0>
122 chcontext(8) rebootmgr(8) chbind(8)
123 vps(8) vpstree(8) vrpm(8) vserver(8)
124 vserver\-stat(8) vtop(8)