All Projects → dev2lead → uppersafe-osfw

dev2lead / uppersafe-osfw

Licence: other
UPPERSAFE Open Source Firewall

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
shell
77523 projects
CSS
56736 projects

Projects that are alternatives of or similar to uppersafe-osfw

UnboundBL
🛑 DNSBL (adblock) on OPNsense with UnboundBL & Unbound DNS
Stars: ✭ 63 (+200%)
Mutual labels:  firewall, iptables, unbound
Toriptables2
Tor Iptables script is an anonymizer that sets up iptables and tor to route all services and traffic including DNS through the Tor network.
Stars: ✭ 287 (+1266.67%)
Mutual labels:  dns, iptables
Nps
一款轻量级、高性能、功能强大的内网穿透代理服务器。支持tcp、udp、socks5、http等几乎所有流量转发,可用来访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析、内网socks5代理等等……,并带有功能强大的web管理端。a lightweight, high-performance, powerful intranet penetration proxy server, with a powerful web management terminal.
Stars: ✭ 19,537 (+92933.33%)
Mutual labels:  dns, firewall
arp-dns-attacks
ARP spoofing, HTTP redirection, DNS spoofing and DNS forging using pcap library
Stars: ✭ 25 (+19.05%)
Mutual labels:  dns, netfilter
AdGuard-WireGuard-Unbound-Cloudflare
The Ultimate Network Security Guide 🔒 Protection | 🔎 Privacy | 🚀 Performance on home network 24/7 🕛 Accessible anywhere 🌏
Stars: ✭ 160 (+661.9%)
Mutual labels:  dns, unbound
noddos
Noddos client
Stars: ✭ 78 (+271.43%)
Mutual labels:  dns, firewall
Hosts Blocklists
Automatically updated, moderated and optimized lists for blocking ads, trackers, malware and other garbage
Stars: ✭ 1,749 (+8228.57%)
Mutual labels:  dns, unbound
Net Shield
An Easy and Simple Anti-DDoS solution for VPS,Dedicated Servers and IoT devices - Beta
Stars: ✭ 202 (+861.9%)
Mutual labels:  firewall, iptables
ddos-mitigation
Tips to mitigate and secure your large-scale server against DDoS attacks.
Stars: ✭ 58 (+176.19%)
Mutual labels:  firewall, iptables
Mignis
Mignis is a semantic based tool for firewall configuration.
Stars: ✭ 43 (+104.76%)
Mutual labels:  firewall, iptables
unbound-dns-firewall
DNS-Firewall Python script for UNBOUND
Stars: ✭ 23 (+9.52%)
Mutual labels:  dns, unbound
nDPI
Open Source Deep Packet Inspection Software Toolkit
Stars: ✭ 92 (+338.1%)
Mutual labels:  iptables, netfilter
Iptables Boilerplate
rock solid default firewall-rules for webhosts
Stars: ✭ 249 (+1085.71%)
Mutual labels:  firewall, iptables
dns-resolver-infra
Privacy DNS infrastructure
Stars: ✭ 39 (+85.71%)
Mutual labels:  dns, unbound
Polycube
eBPF/XDP-based software framework for fast network services running in the Linux kernel.
Stars: ✭ 217 (+933.33%)
Mutual labels:  firewall, iptables
Kubernetes Pfsense Controller
Integrate Kubernetes and pfSense
Stars: ✭ 100 (+376.19%)
Mutual labels:  dns, firewall
Config
Various program configuration files and scripts
Stars: ✭ 173 (+723.81%)
Mutual labels:  firewall, iptables
Ipset asus
Skynet - Advanced IP Blocking For ASUS Routers Using IPSet.
Stars: ✭ 186 (+785.71%)
Mutual labels:  firewall, iptables
Rethink App
DNS over HTTPS / DNS over Tor / DNSCrypt client, firewall, and connection tracker for Android.
Stars: ✭ 188 (+795.24%)
Mutual labels:  dns, firewall
docker-nfqueue-scapy
Docker container for intercepting packets with scapy from a netfilter queue (nfqueue)
Stars: ✭ 78 (+271.43%)
Mutual labels:  iptables, netfilter

UPPERSAFE

UPPERSAFE Open Source Firewall

Build status Python 3.4|3.5|3.6

OSFW is a firewall written in Python that provides an IP / domain filtering based on a collection of threat intelligence public feeds. It relies on underlying dependencies like iptables (netfilter) and unbound.

It blocks in real time incoming and outcoming traffic considered as malicious (matching the filtering rules automatically set up for each threat).

It also provides a secure DNS service that blocks different kind of malicious servers (phishing websites, malware hosting, malvertising, C&C servers, etc).

Summary

Firewall components

OSFW includes 3 main components:

Name Description
osfw-sensor In charge of monitoring and logging the requests blocked by the firewall
osfw-syncfw In charge of collecting and syncing the threat intelligence feeds
osfw-webapp In charge of managing the web interface (work in progress)

Screenshot

Quick start

Install the dependencies with your package manager (for example apt on Ubuntu or yum on Fedora):

apt install python3 virtualenv iptables unbound systemd supervisor screen

Install the virtual environment:

cd uppersafe-osfw
virtualenv -p python3 venv
source venv/bin/activate && pip install -r requirements.txt

Start the firewall components:

bash run.sh

Attach a screen:

screen -r osfw-sensor
screen -r osfw-syncfw
screen -r osfw-webapp

Automatically launch the firewall at startup (supervisorctl will be used instead of screen):

ln -s "$PWD/assets/supervisord.conf" /etc/supervisor/conf.d/osfw.conf

Configuration

It is possible to customize the behaviour of the firewall by copying the default config.default.yml file and editing your own config.yml file:

cp config.default.yml config.yml && chmod 600 config.yml

DNS service

To enable the secure DNS service, simply create a symbolic link of the unbound.conf file to the Unbound configuration directory with the following command:

ln -s "$PWD/assets/unbound.conf" /etc/unbound/unbound.conf.d/osfw.conf

Remote access

To securely enable remote access to the web interface, you need to install a web server with reverse proxy capabilities with your package manager (for example apt on Ubuntu or yum on Fedora):

apt install nginx ssl-cert

Then, create a symbolic link of the nginx.conf file to the Nginx configuration directory with the following command:

ln -s "$PWD/assets/nginx.conf" /etc/nginx/sites-enabled/osfw.conf

If you want to use your own SSL certificates instead of those provided by the ssl-cert package, don't forget to update the default nginx.conf file.

Launch mode

There are 3 ways to launch the firewall:

Mode Description
standalone This is the default mode of the firewall, in this mode the firewall works on his own without interacting with a server or a client
server In server mode the firewall dumps the threats, after processing them, to a file (by default /tmp/threats.txt) intended to be shared through an HTTP(S) server and fetched by the client
client In client mode the firewall does not process the threats, so it is recommended to only fetch the file generated by the server instead of all the feeds

Filter mode

Filtering can be achieved through 2 different methods:

Mode Description
classic Filtering is based on the INPUT chain and OUTPUT chain of iptables
forward Filtering is only based on the FORWARD chain of iptables

Miscellaneous

It happens that some legit and top ranked websites got blocked because of different reaspns, most of the time one of the following cases:

  • Their users can upload files on the main domain (file transfer providers or cloud storage providers)
  • Their users can upload files or even web pages on a subdomain (hosting providers)
  • Their users can perform URL redirect (link shortener websites)

To prevent these websites from being blocked, you can specify them as a list in the configuration file.

In case you want to edit the default list, you can use a magic keyword tld that will match any top level domain and some specific second level domain names. For example, domain.tld will match all of the following cases:

  • domain.uk
  • domain.co.uk
  • domain.com.uk
  • domain.net.uk
  • domain.org.uk
  • domain.edu.uk
  • domain.gov.uk
  • domain.jp
  • domain.co.jp
  • domain.com.jp
  • domain.net.jp
  • domain.org.jp
  • domain.edu.jp
  • domain.gov.jp

There is a way to perform a subdomain wildcard, to do so you need to use a *? instead of the subdomain (for example *?.domain.com will match domain.com and a.domain.com but not b.a.domain.com).

Dependencies

  • python3 (see also requirements.txt)
  • virtualenv
  • iptables
  • unbound
  • systemd
  • supervisor
  • screen
  • nginx
  • ssl-cert

Support

Nicolas THIBAUT (nicolas[@]uppersafe[.]com)

https://www.patreon.com/dev2lead/memberships

License

This software is provided under a GNU AGPLv3 License.

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].