forked from netblue30/firejail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
netblue30
committed
Nov 18, 2017
1 parent
eb4b505
commit ead4ec3
Showing
20 changed files
with
633 additions
and
33 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
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,27 @@ | ||
*filter | ||
:INPUT DROP [0:0] | ||
:FORWARD DROP [0:0] | ||
:OUTPUT DROP [0:0] | ||
|
||
################################################################### | ||
# Simple tcp filter template. $ARG1 is the port number. | ||
# | ||
# Usage: $ARG1 in this template is replaced by 5001 from command line below | ||
# | ||
# firejail --net=eth0 --ip=192.168.1.105 --netfilter=/etc/firejail/tcpserver.net,5001 server-program | ||
# | ||
################################################################### | ||
|
||
# allow server traffic | ||
-A INPUT -p tcp --dport $ARG1 -m state --state NEW,ESTABLISHED -j ACCEPT | ||
-A OUTPUT -p tcp --sport $ARG1 -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
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,37 @@ | ||
#!/usr/bin/expect -f | ||
# This file is part of Firejail project | ||
# Copyright (C) 2014-2017 Firejail Authors | ||
# License GPL v2 | ||
|
||
set timeout 10 | ||
spawn $env(SHELL) | ||
match_max 100000 | ||
|
||
send -- "fnetfilter\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 1\n";exit} | ||
"Usage:" | ||
} | ||
after 100 | ||
|
||
send -- "fnetfilter -h\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 2\n";exit} | ||
"Usage:" | ||
} | ||
after 100 | ||
|
||
send -- "fnetfilter -h a b c d\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 2\n";exit} | ||
"Usage:" | ||
} | ||
after 100 | ||
|
||
send -- "fnetfilter a b c d\r" | ||
expect { | ||
timeout {puts "TESTING ERROR 2\n";exit} | ||
"Usage:" | ||
} | ||
after 100 | ||
puts "\nall done\n" |
Oops, something went wrong.