Capabilities (POSIX 1003.1e, setuid attribute in a system binary with a more minimal set of capabilities. Many packages make use of capabilities, such as
CAP_NET_RAW being used for the
ping binary provided by . This enables e.g.
ping to be run by a normal user (as with the setuid method), while at the same time limiting the security consequences of a potential vulnerability in
Capabilities are implemented on Linux using extended attributes ( ) in the security namespace. Extended attributes are supported by all major Linux file systems, including Ext2, Ext3, Ext4, Btrfs, JFS, XFS, and Reiserfs. The following example prints the capabilities of ping with
getcap, and then prints the same data in its encoded form using
$ getcap /usr/bin/ping
/usr/bin/ping = cap_net_raw+ep
$ getfattr -d -m "^security\\." /usr/bin/ping
# file: usr/bin/ping security.capability=0sAQAAAgAgAAAAAAAAAAAAAAAAAAA=
Extended attributes are copied automatically by
cp -a, but some other programs require a special flag:
Capabilities are set by package install scripts on Arch (e.g.
Administration and maintenance
It is considered a bug if a package has overly permissive capabilities, so these cases should be reported rather than listed here. A capability essentially equivalent to root access (
CAP_SYS_ADMIN) or trivially allowing root access (
CAP_DAC_OVERRIDE) does not count as a bug since Arch does not support any MAC/RBAC systems.
Other programs that benefit from capabilities
The following packages do not have files with the setuid attribute but require root privileges to work. By enabling some capabilities, regular users can use the program without privilege elevation.
# setcap cap_dac_override,cap_sys_tty_config+ep /usr/bin/beep
# setcap cap_dac_read_search,cap_sys_tty_config+ep /usr/bin/chvt
# setcap cap_net_raw+ep /usr/bin/iftop
# setcap cap_net_admin+ep /usr/bin/mii-tool
# setcap cap_net_raw+ep /usr/bin/mtr-packet
# setcap cap_net_admin,cap_net_raw+ep /usr/bin/nethogs
Find setuid-root files:
$ find /usr/bin /usr/lib -perm /4000 -user root
Find setgid-root files:
$ find /usr/bin /usr/lib -perm /2000 -group root