-
Notifications
You must be signed in to change notification settings - Fork 674
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 support for NFLOG groups and "Operation not permitted" error #1169
Conversation
…descriptor, so it doesn't happen for NFLOG
Codecov Report
@@ Coverage Diff @@
## dev #1169 +/- ##
==========================================
- Coverage 82.18% 82.16% -0.03%
==========================================
Files 154 154
Lines 19927 19929 +2
Branches 7523 7540 +17
==========================================
- Hits 16377 16374 -3
+ Misses 3042 3039 -3
- Partials 508 516 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hey! I don't understand what failed on the workflow and how I can fix it. Besides that, are there any additional steps I need to take to merge the changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a more general question: is it possible to add tests for this feature? Our Linux CI currently uses docker containers so I guess this would be hard because nflog is driven by the kernel, am I wrong? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is possible to add tests for this feature. But we would need a few things:
- Run with elevated privileges so we can open
nflog
nflog
events are generated by netfilter
when an IPTables rule is triggered:
- Create an IPTables rule inside the container
- Trigger the rule
I am not familiar with the testing infrastructure in the project, do you think it would be possible to implement the aforementioned steps in the CI workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PcapPlusPlus uses GitHub Actions as the CI platform. You can see the workflow file here: https://github.com/seladb/PcapPlusPlus/blob/master/.github/workflows/build_and_test.yml
Currently all Linux jobs run on a docker container, but maybe we can add a new job that runs in a VM and not in a docker container. This should be pretty easy, here are some docs that explain how to do it. When we create this job we can add the IP table rules etc. This should be the easy part...
The more complex part is how to run the test only in the new "nflog" job and not in the other tests. In order to do that you need to understand the PcapPlusPlus testing infrastructure. Each test has 1 or more "tags" that can be included or excluded in test runs. You can see these tags here: https://github.com/seladb/PcapPlusPlus/blob/master/Tests/Pcap%2B%2BTest/main.cpp
What we can do is add a new "nflog" tag for this test, and run all other tests with -x "nflog"
. Then in this job we can run it with -t "nflog"
.
As I think more about it, it seems like a lot of work... maybe we can skip tests for now and keep it as a future enhancement. @egecetin @MrPeck what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think separate PR for tests is a better idea. So, we can merge this PR to fix error. Since it also needs configuration of VM, testing the workflow locally is not easy, it will probably take some time, you have to push and wait again, again and again...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that keeping tests for the future would be a better idea. And I would gladly take that task upon myself whenever it comes up :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, thanks! 👍
Thank you @MrPeck for adding this great feature to PcapPlusPlus, very much appreciated! 🙏 ❤️ |
This pull requests comes to solve two issues: #1166 and #1167