capable.bt(8)

πŸ“¦ version 0.17.0, in debian bookworm

πŸ’– capable.bt β€” ok so here's the tea πŸ’–

bestie. this is capable.bt(8), from the System Manager's Manual, and it's giving "I can see everything the kernel is checking" energy. buckle up πŸŽ€


✨ NAME ✨

capable.bt β€” trace security capability checks (aka cap_capable()). that's it. that's the whole job. πŸ’…


🌸 SYNOPSIS 🌸

capable.bt

literally just run it. no args, no drama, no flags. iconic. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's what's happening: this thing traces security capability checks inside the kernel, and prints the deets for every single call. 🫢

why do you care? two reasons, bestie:

  • general debugging β€” you know, the usual detective work πŸ”
  • security enforcement β€” you can use it to figure out a white list of capabilities that an application actually needs πŸ‘‘

and the big caveat, no cap: since this uses BPF, only the root user can run this tool. sorry babe, that's just how it is. πŸ™ˆ


πŸ’œ REQUIREMENTS πŸ’œ

  • CONFIG_BPF
  • bpftrace

that's the whole guest list. πŸŽ€


πŸ”₯ EXAMPLES πŸ”₯

trace all capability checks system-wide:

# capable.bt

one line. one command. main character energy. 😌


πŸ‘‘ FIELDS πŸ‘‘

here's what each column is serving:

  • TIME(s) β€” time of the capability check, formatted HH:MM:SS. ⏰
  • UID β€” user ID. who dis. πŸͺͺ
  • PID β€” process ID. 🏷️
  • COMM β€” process name. πŸ’¬
  • CAP β€” capability number. πŸ”’
  • NAME β€” capability name. for the descriptions, go peek at capabilities(7). πŸ“–
  • AUDIT β€” whether this was an audit event. πŸ‘€

🌈 OVERHEAD 🌈

okay so this adds low-overhead instrumentation to capability checks β€” and capability checks are expected to be low frequency, so like, usually fine?? but lowkey that totally depends on the application, so don't come for me. 😭

⚠️ test in a lab environment before use. fr fr. do not skip this step bestie. 🚨

πŸ“ SOURCE πŸ“

this is from bpftrace.

https://github.com/iovisor/bpftrace

also, go look inside the bpftrace distribution for a companion _examples.txt file β€” it's got example usage, output, and commentary for this tool. it's a whole vibe. πŸ’–

this is a bpftrace version of the bcc tool of the same name. (the bcc tool has options to customize the output, if you're into that.) πŸŽ€

https://github.com/iovisor/bcc

πŸ’… OS πŸ’…

Linux 🐧


⭐ STABILITY ⭐

Unstable β€” in development. she's a work in progress, and that's okay. 🧚


πŸ’œ AUTHOR πŸ’œ

Brendan Gregg πŸ‘‘


🫢 SEE ALSO 🫢


and that's the whole page, bestie!! πŸ’– this was USER COMMANDS, version dated 2018-09-08, living its life as capable.bt(8). go trace some capabilities. slay. βœ¨πŸ’…πŸŒˆ

πŸ“¦ where this page comes from