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

As a developer, I want to implement a simple firewall for mina node in order to test network split #39

Open
vlad9486 opened this issue Apr 3, 2023 · 3 comments
Assignees

Comments

@vlad9486
Copy link
Collaborator

vlad9486 commented Apr 3, 2023

Add some REST endpoints for setup firewall with whitelist. Use XDP to implement the firewall.

@vlad9486 vlad9486 self-assigned this Apr 3, 2023
@vlad9486
Copy link
Collaborator Author

Added a tool topology-tool in debugger docker image. Added a test in drone file.

Problem:

XDP module doesn't work on kata-clh runtime. The module is loaded and attached to the eth0 interface. We can check it:

$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1430 xdp qdisc fq state UP mode DEFAULT group default qlen 1000
    link/ether 56:d9:60:8d:6f:f0 brd ff:ff:ff:ff:ff:ff
    prog/xdp id 35 tag 17ceab131057819d jited 

dmesg shows no errors and no relevant information. But packets are not blocked, nodes can still communicate.

However, XDP only works on the kata-qemu runtime.

@vlad9486
Copy link
Collaborator Author

vlad9486 commented May 1, 2023

This is fixed by using the `genaric' mode for XDP attach. It will not be the best performance, but it will be good enough.

@vlad9486
Copy link
Collaborator Author

vlad9486 commented May 1, 2023

Remove unsafe impl Send. I should do a little refactoring of the event loop to avoid most of the unsafe code.

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

1 participant