Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bootbool/simplefirewall
https://github.com/bootbool/simplefirewall
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/bootbool/simplefirewall
- Owner: bootbool
- Created: 2024-04-26T04:39:30.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-25T12:44:03.000Z (7 months ago)
- Last Synced: 2024-08-02T04:12:08.779Z (5 months ago)
- Language: C
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simplefirewall
# Overview
A simple firewall aiming to filter network packages, impletemented by hooking netfilter mechanism and loaded by kernel module and ebpf. You can choose one running mechanism depending on your run kernel version. Reconmmend kernel module for low version, versus ebpf for high kernel version.# Features
## IP filter
- IP blacklist
- IP whitelist
- CIDR format support
- Single IP address support## Port filter
- Port blacklist
- Port whitelist
- Port range support, e.g.[4-55]
- Single port support## Flexible configure
- Runtime configure firewall by writing to file under /proc/net/simplefirwall/
- File names including ip_blacklist, ip_whitelist, port_whitelist, port_blacklist, as the function hinted by the file name.
- Runtime switch to disable firewall by commit "echo 0 > /proc/net/simplefirwall/enable"## Log
- Realtime filter action is displayed by /proc/net/simplefirewall/log file# Principle
## Kernel module
### hook location
Firewall filter is hooked in Netfilter **INPUT** chain
IP address is organized under a radix tree, port number is mapped into a bitmap structure.## Ebpf
todo