-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added webserver.net and nolocal.net network filters
- Loading branch information
netblue30
committed
Nov 20, 2015
1 parent
e4f67ae
commit a039bce
Showing
8 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
*filter | ||
:INPUT DROP [0:0] | ||
:FORWARD DROP [0:0] | ||
:OUTPUT ACCEPT [0:0] | ||
|
||
################################################################### | ||
# Client filter rejecting local network traffic, with the exception of DNS traffic | ||
# | ||
# Usage: | ||
# firejail --net=eth0 --netfilter=/etc/firejail/nolocal.net firefox | ||
# | ||
################################################################### | ||
|
||
|
||
-A INPUT -i lo -j ACCEPT | ||
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | ||
-A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT | ||
-A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT | ||
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT | ||
|
||
-A OUTPUT -p udp --dport 53 -j ACCEPT | ||
-A OUTPUT -d 192.168.0.0/16 -j DROP | ||
-A OUTPUT -d 10.0.0.0/8 -j DROP | ||
-A OUTPUT -d 172.16.0.0/12 -j DROP | ||
COMMIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
*filter | ||
:INPUT DROP [0:0] | ||
:FORWARD DROP [0:0] | ||
:OUTPUT DROP [0:0] | ||
|
||
################################################################### | ||
# Simple webserver filter | ||
# | ||
# Usage: | ||
# firejail --net=eth0 --ip=192.168.1.105 --netfilter=/etc/firejail/webserver.net /etc/init.d/apache2 start | ||
# firejail --net=eth0 --ip=192.168.1.105 --netfilter=/etc/firejail/webserver.net /etc/init.d/nginx start | ||
# | ||
################################################################### | ||
|
||
# allow webserver traffic | ||
-A INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT | ||
-A OUTPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT | ||
-A INPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT | ||
-A OUTPUT -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT | ||
|
||
# allow incoming ping | ||
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT | ||
-A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT | ||
|
||
# allow outgoing DNS | ||
-A OUTPUT -p udp --dport 53 -j ACCEPT | ||
-A INPUT -p udp --sport 53 -j ACCEPT | ||
|
||
COMMIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,10 @@ _firejail() | |
_filedir | ||
return 0 | ||
;; | ||
--netfilter) | ||
_filedir | ||
return 0 | ||
;; | ||
--shell) | ||
_filedir | ||
return 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters