All Projects → mbertrone → Bpf Iptables

mbertrone / Bpf Iptables

An #eBPF and #XDP iptables firewall

Projects that are alternatives of or similar to Bpf Iptables

Polycube
eBPF/XDP-based software framework for fast network services running in the Linux kernel.
Stars: ✭ 217 (+274.14%)
Mutual labels:  iptables, ebpf
Cilium
eBPF-based Networking, Security, and Observability
Stars: ✭ 10,256 (+17582.76%)
Mutual labels:  ebpf
Kube Iptables Tailer
A service for better network visibility for your Kubernetes clusters.
Stars: ✭ 413 (+612.07%)
Mutual labels:  iptables
Tracee
Linux Runtime Security and Forensics using eBPF
Stars: ✭ 788 (+1258.62%)
Mutual labels:  ebpf
Ipsum
Daily feed of bad IPs (with blacklist hit scores)
Stars: ✭ 577 (+894.83%)
Mutual labels:  iptables
Ebpf exporter
Prometheus exporter for custom eBPF metrics
Stars: ✭ 829 (+1329.31%)
Mutual labels:  ebpf
Bpfd
Framework for running BPF programs with rules on Linux as a daemon. Container aware.
Stars: ✭ 396 (+582.76%)
Mutual labels:  ebpf
Iptables Essentials
Iptables Essentials: Common Firewall Rules and Commands.
Stars: ✭ 1,057 (+1722.41%)
Mutual labels:  iptables
Miniupnp
UPnP IGD implementation
Stars: ✭ 974 (+1579.31%)
Mutual labels:  iptables
Docker Host
A docker sidecar container to forward all traffic to local docker host or any other host
Stars: ✭ 769 (+1225.86%)
Mutual labels:  iptables
Vps setup
linux vim bash 脚本学习笔记 by 蘭雅sRGB https://262235.xyz/
Stars: ✭ 678 (+1068.97%)
Mutual labels:  iptables
Pixie
Instant Kubernetes-Native Application Observability
Stars: ✭ 589 (+915.52%)
Mutual labels:  ebpf
Yipfilter
A wrapper script over iptables/ipset to manage host based IP dynamic blacklists and whitelists
Stars: ✭ 18 (-68.97%)
Mutual labels:  iptables
Jshielder
Hardening Script for Linux Servers/ Secure LAMP-LEMP Deployer/ CIS Benchmark
Stars: ✭ 483 (+732.76%)
Mutual labels:  iptables
Nipe
An engine to make Tor network your default gateway
Stars: ✭ 1,032 (+1679.31%)
Mutual labels:  iptables
Ntopng
Web-based Traffic and Security Network Traffic Monitoring
Stars: ✭ 4,313 (+7336.21%)
Mutual labels:  ebpf
Goebpf
Library to work with eBPF programs from Go
Stars: ✭ 666 (+1048.28%)
Mutual labels:  ebpf
Totp Ssh Fluxer
Take security by obscurity to the next level (this is a bad idea, don't really use this please)
Stars: ✭ 811 (+1298.28%)
Mutual labels:  iptables
Ebpf exporter
A Prometheus exporter which uses eBPF to measure block IO request latency / size
Stars: ✭ 56 (-3.45%)
Mutual labels:  ebpf
Kube Netc
A Kubernetes eBPF network monitor
Stars: ✭ 48 (-17.24%)
Mutual labels:  ebpf

bpf-iptables

Introduction

bpf-iptables is an eBPF and XDP based firewall, providing same iptables syntax.

Thanks to efficient matching algorithms, eBPF and XDP driver level optimizations, is able to provide high performances. No kernel modification are required, bpf comes at zero cost with recent Linux kernels.

Research papers

Securing Linux with a Faster and Scalable Iptables

Draft, 1 December 2018
This paper presents an eBPF-based firewall, bpf-iptables, which emulates the iptables filtering semantic while guaranteeing higher throughput outperforming other Linux-based firewalls particularly when a high number of rules is involved. PDF

Accelerating Linux Security with eBPF iptables

ACM SIGCOMM 2018 Conference Posters and Demos, Budapest (H), 20-25 August 2018
This paper presents an eBPF-based prototype that emulates the iptables filtering semantic and exploits a more efficient matching algorithm, without requiring custom kernels or invasive software frameworks. PDF

Toward an eBPF-based clone of iptables

Netdev 0x12, The Technical Conference on Linux Networking, Montréal (Canada), 11-13 July 2018
This paper reports the first results of a project that aims at creating a eBPF-based (partial) clone of iptables. This project assumes unmodified Linux kernel and guarantees the full compatibility with current iptables. PDF

How to use?

bpf-iptables is part of PolyCube framework. We use pcn-iptables syntax (pcn=PolyCubeNetwork).

Docker

# Pull docker image (PolyCube & pcn-iptables)
docker pull polycubenetwork/polycube:latest

# Run the Polycube Docker and launch polycubed (the polycube daemon) inside it.
# The Docker container is launched in the host networking stack (--network host),
# privileged mode (--privileged) is necessary to use eBPF features.
docker run  -it --rm --privileged --network host \
-v /lib/modules:/lib/modules:ro -v /usr/src:/usr/src:ro -v /etc/localtime:/etc/localtime:ro \
polycubenetwork/polycube:latest /bin/bash -c 'polycubed -d && /bin/bash'

Refer to Polycube Quickstart for bare metal install mode. Quickstart

# Initialize pcn-iptables
pcn-iptables-init
# pcn-iptables provides same iptables syntax. Please ref#er to iptables online docs for more info.
# Following are just few examples of available commands.

# E.g.
pcn-iptables -A INPUT -s 10.0.0.1 -j DROP # Append rule to INPUT chain
pcn-iptables -D INPUT -s 10.0.0.1 -j DROP # Delete rule from INPUT chain
pcn-iptables -I INPUT -s 10.0.0.2 -j DROP # Insert rule into INPUT chain

# Example of a complex rule
pcn-iptables -A INPUT -s 10.0.0.0/8 -d 10.0.0.2 -p tcp --sport 9090 --dport 80 --tcpflags SYN,ACK ACK -j DROP

# Example of a conntrack rule
pcn-iptables -A OUTPUT -m conntrack --ctstate=ESTABLISHED -j ACCEPT

# Show rules
pcn-iptables -S # dump rules
pcn-iptables -L INPUT # dump rules for INPUT chain

pcn-iptables -P FORWARD DROP # set default policy for FORWARD chain

# Stop and clean pcn-iptables
pcn-iptables-clean

Q&A

Q:Can I still use iptables?
A:Yes, iptables will not be affected.

Q:Advantages?
A:Performance (especially with a large amount of rules); Low CPU utilization (especially with XDP mode)

Q:How to use XDP mode?
A:run pcn-iptables-init-xdp

Q:Limitations of XDP mode?
A:pcn-itpables will be atached only to XDP compatible interfaces.

Links

pcn-iptables Source Code
pcn-iptables Documentation
PolyCube Network

Demo

asciicast

Disclaimer

bpf-iptables is not related to bpfilter (https://lwn.net/Articles/747551/).
Right now bpf-iptables uses a different mechanism to intercept iptables rules.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].