question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an extra check for capabilities when executing the commands

See original GitHub issue

Besides 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:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
thombashicommented, Apr 8, 2018

@dastergon Sorry to keep you waiting. I had released tcconfig 0.18.0 that supported Linux capabilities.

1reaction
thombashicommented, Mar 10, 2018

@dastergon Thank you for your feedback. I will fix the issue in the future release by considering Linux capabilities at permission-check.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found