capable(8)
β¨ capable(8) β¨
System Manager's Manual π Manual name: capable(8)
π NAME π
capable, trace security capability checks (cap_capable()) πβ¨
π SYNOPSIS π
capable [-h] [-v] [-p PID] [-K] [-U] [-x] [--cgroupmap MAPPATH]
[--mntnsmap MAPPATH] [--unique]
π DESCRIPTION π
okay so this one traces security capability checks in the kernel and prints details for every single call π it's giving detective energy. It's super useful for general debugging, and also for security enforcement, like figuring out a white list of capabilities an application actually needs π₯
Since this uses BPF, only the root user can use this tool π no cap, not everyone gets to run it.
π§° REQUIREMENTS π§°
CONFIG_BPF, bcc. πΈ
ποΈ OPTIONS ποΈ
-hβ the main character move here: prints theUSAGEmessage π£-vβ include non-audit capability checks too π these are the ones deemed not interesting and not necessary to audit, likeCAP_SYS_ADMINchecks on memory allocation that affect overcommit behavior π-Kβ adds kernel stack traces to the output π§-Uβ adds user-space stack traces to the output π¦-xβ shows extra fields in the TID and INSETID columns β¨--cgroupmap MAPPATHβ only traces cgroups in this BPF map (filtered in-kernel) π--mntnsmap MAPPATHβ only traces mount namespaces in this BPF map (filtered in-kernel) π--uniqueβ don't repeat stacks for the same PID or cgroup π
π EXAMPLES π
Trace all capability checks system-wide:
# capable
Trace capability checks for PID 181:
# capable -p 181
Trace capability checks in a set of cgroups only (see special_filtering.md from bcc sources for more details):
# capable --cgroupmap /sys/fs/bpf/test01
π FIELDS π
TIME(s)β time of the capability check, inHH:MM:SSformat β°UIDβ user ID π«ΆPIDβ process ID πCOMMβ process name πCAPβ capability number π’NAMEβ capability name. Seecapabilities(7)for descriptions πAUDITβ whether this was an audit event. Use-vto include non-audit events πINSETIDβ whether the INSETID bit was set (Linux >= 5.1) π¦
β οΈ OVERHEAD β οΈ
This adds low-overhead instrumentation to capability checks. They're expected to be low frequency, but that really depends on the application, so bestie, test in a lab environment before use π₯Ί
Heads up: the overhead depends on your application, so test in a lab environment before using this anywhere real π
π SOURCE π
This is from bcc π«Ά
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _examples.txt file with example usage, output, and commentary for this tool πβ¨
π§ OS π§
Linux π§
π§ͺ STABILITY π§ͺ
Unstable, still in development π§
π©βπ» AUTHOR π©βπ»
Brendan Gregg π
π SEE ALSO π
capabilities(7) π
Bye bestie, you're officially a capable(8) expert now π This page came from the USER COMMANDS section, sourced from bcc and dated 2020-03-08 π π
π¦ where this page comes from
- alpine 3.24: bcc-doc 0.36.1-r1 Β· Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms