Add an extra check for capabilities when executing the commands
See original GitHub issueBesides the execution of the commands as a root user, you can also employ Linux capabilities and apply CAP_NET_ADMIN
and CAP_NET_RAW
to tc
and iptables
in order to use them as a regular user.
In your root check , you could implement an extra check for those two capabilities and permit the execution or else raise an Exception or print an informative error. Currently, I am unable to use tcconfig
tools due to that check and I have to modify the code and run it again.
How to use capabilities
Get the capabilities of a command:
getcap /sbin/tc
Set capabilities to a command:
setcap cap_net_raw,cap_net_admin+ep /sbin/tc
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
capabilities(7) - Linux manual page
Inheritable This is a set of capabilities preserved across an execve(2). Inheritable capabilities remain inheritable when executing any program, and ...
Read more >Capabilities | dockerlabs
In this lab you'll learn the basics of capabilities in the Linux kernel. You'll learn how they work with Docker, some basic commands...
Read more >Run Your Applications with Necessary Privileges: Linux ... - adil
Some additional commands that are related to the Capabilities module: capsh —-print : You can check the current privileges of the user.
Read more >Linux Capabilities - HackTricks
It's very easy to check which capabilities are these by running: ... Which means that it's possible to use the command insmod to...
Read more >DISM Capabilities Package Servicing Command-Line ...
Use DISM to search multiple sources like Windows Update or your corporate servers to find and install the latest version.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dastergon Sorry to keep you waiting. I had released
tcconfig 0.18.0
that supported Linux capabilities.@dastergon Thank you for your feedback. I will fix the issue in the future release by considering Linux capabilities at permission-check.