Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an extra check for capabilities when executing the commands #98

Closed
dastergon opened this issue Mar 8, 2018 · 6 comments
Closed
Assignees

Comments

@dastergon
Copy link
Contributor

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 
@thombashi
Copy link
Owner

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

@thombashi thombashi self-assigned this Mar 10, 2018
@dastergon
Copy link
Contributor Author

Hey @thombashi,

Is there an ETA for the new release?

Thanks

@thombashi
Copy link
Owner

@dastergon
I could not promise the exact release date, but probably within several weeks.
I had limited time for now, the modification itself would relatively small.

@thombashi
Copy link
Owner

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

@dastergon
Copy link
Contributor Author

@thombashi thanks a lot! cheers

@thombashi
Copy link
Owner

I'll close the issue.
Feel free to reopen if you have any problem with capabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants