-
Notifications
You must be signed in to change notification settings - Fork 1
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
Modes supported #10
Comments
It uses default one - Generic (SKB) mode;
|
hmm.. any ideas why I'm getting this then?
|
Not sure 🤔 never tested with ARM How did you build the application? |
|
Looks similar cilium/ebpf#783 |
Can you check this doc https://trying2adult.com/what-is-xdp-and-how-do-you-use-it-in-linux-amazon-ec2-example/ |
Unfortunately, no luck:
|
Not sure if it helps, but https://github.com/ahsifer/goxdp is working (even without the MTU modification) |
P.S. If you want to test on ARM, Oracle offers free instances: https://mrbluecoat.blogspot.com/2021/06/oracle-cloud-arm-most-generous-free-tier.html |
interesting Can you try to change eBPF-go version in go.mod file
|
Sorry, no luck:
|
you have root while running the program, right? I set up ARM CI here: https://github.com/boratanrikulu/durdur/actions/runs/10126646992/job/28003538415
Attach/Detach just works fine. But drop not working. Probably some bugs in eBPF code. |
Turns out MTU 3818 was still too high. cilium/cilium#25453 (comment) indicated 3498 which worked! |
https://docs.cilium.io/en/stable/network/kubernetes/kubeproxy-free/#nodeport-xdp-on-aws |
Aha, nice! What about
|
Yes, appears to be (using the new MTU and the new go.mod). I'll do a bit more testing.. |
Awesome, it passed the stress test! <3
|
Nice, but somehow it's not working with arm ci 😄 #11 |
LOL, I'll reopen so you can figure that one out 😄 |
Also, drop works for IP addresses (src) but not DNS:
|
What's the MTU on ens3? |
Can you test DNS like this, without using DNS cache;
DNS/DROP only working for DNS record checkings |
1400 |
Oh, I see.
I guess this is only useful if the server has no upstream recursive DNS servers, right? (e.g. exclusively localhost DNS authoritative server) |
I guess should be fine with local dns servers too. But DoH is not supported, if you have enabled DoH inside your local DNS server, durdur can't catch it. |
If durdur is running on a proxy and I want to block a domain but not the IP (e.g. for situations where a shared host is using a single IP for hosting multiple domains) is it possible? I see the dig is blocked but curl can still access the website and devices connecting to the proxy server can still access the website. For example, |
It should be working with durdur too
Are you using DoH? |
|
Maybe there are some logic issues, not sure if (ip->protocol == IPPROTO_UDP)
{
struct udphdr *udp;
if (data + sizeof(struct ethhdr) + sizeof(struct iphdr) + sizeof(struct udphdr) > data_end)
{
return XDP_PASS;
}
udp = data + sizeof(struct ethhdr) + sizeof(struct iphdr);
if (udp->source == bpf_htons(53))
{
if (data + sizeof(*eth) + sizeof(*ip) + sizeof(*udp) + sizeof(struct dnshdr) > data_end)
{
return XDP_PASS;
}
struct dnshdr *dns = data + sizeof(*eth) + sizeof(*ip) + sizeof(*udp);
if (dns->opcode == 0) // it's a dns query.
{
void *query_start = (void *)dns + sizeof(struct dnshdr);
struct dnsquery query;
if (!parse_query(data_end, query_start, &query))
{
return XDP_PASS;
}
long *pkt_count = bpf_map_lookup_elem(&drop_dns, &query.name);
if (pkt_count)
{
printk("[BLOCK] DNS QUERY TO %s", &query.name);
__sync_fetch_and_add(pkt_count, 1);
return XDP_DROP;
}
printk("[ALLOW] DNS QUERY TO %s", &query.name);
}
}
} |
Do you use different port for your local DNS server? |
|
I'm using Tailscale, so that may be affecting it... https://tailscale.com/kb/1054/dns?tab=linux |
As a completely random aside, I see you're developing an observability and monitoring agent at Sematext. Is durdur the spiritual successor to https://github.com/sematext/oxdpus ? |
No it's not. These are different projects. Durdur is not directly related to Sematext |
Maybe they have DoH enabled. I'm not sure if we can catch DNS in that case |
I figured it out. For IP blocking (src), I have to attach to the WAN NIC but for DNS blocking I have to attach to the
Makes sense in hindsight. Can I run two instances of durdur concurrently on different interfaces? |
Right now we don't have support for multiple interfaces. But I guess it would be easy to add that feature. |
That would be awesome. A comma-separated option would be fine for my needs, like: https://github.com/ahsifer/goxdp/blob/main/README.md?plain=1#L75-L78 |
Out of curiosity, which modes does durdur support? https://man.archlinux.org/man/xdp-loader.8.en#-m,_--mode
(my use case requires SKB mode)
The text was updated successfully, but these errors were encountered: