summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-11-28 23:29:18 +0100
committermakefu <github@syntax-fehler.de>2016-11-28 23:29:18 +0100
commitab5b81b0b4a6396ca3b53fbe414a7aad2845d8bc (patch)
treed5493e9f9e9dff67107e6c62943dbbae24af92d6 /krebs/3modules
parent70dd1341b37e70866e811ab787031e4e74e98b09 (diff)
parentd8da51621e44f6577e6d725b6263837cfa70f2bd (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/iptables.nix30
1 files changed, 5 insertions, 25 deletions
diff --git a/krebs/3modules/iptables.nix b/krebs/3modules/iptables.nix
index a4a4de6f9..09b493c20 100644
--- a/krebs/3modules/iptables.nix
+++ b/krebs/3modules/iptables.nix
@@ -29,9 +29,10 @@ let
tables = mkOption {
type = with types; attrsOf (attrsOf (submodule ({
options = {
+ #TODO: find out good defaults.
policy = mkOption {
type = str;
- default = "-";
+ default = "ACCEPT";
};
rules = mkOption {
type = nullOr (listOf (submodule ({
@@ -133,30 +134,9 @@ let
#=====
rules = iptables-version:
- let
- #TODO: find out good defaults.
- tables-defaults = {
- nat.PREROUTING.policy = "ACCEPT";
- nat.INPUT.policy = "ACCEPT";
- nat.OUTPUT.policy = "ACCEPT";
- nat.POSTROUTING.policy = "ACCEPT";
- filter.INPUT.policy = "ACCEPT";
- filter.FORWARD.policy = "ACCEPT";
- filter.OUTPUT.policy = "ACCEPT";
-
- #if someone specifies any other rules on this chain, the default rules get lost.
- #is this wanted beahiviour or a bug?
- #TODO: implement abstraction of rules
- filter.INPUT.rules = [
- { predicate = "-m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
- ];
- };
- tables = tables-defaults // cfg.tables;
-
- in
- pkgs.writeText "krebs-iptables-rules${iptables-version}" ''
- ${buildTables iptables-version tables}
- '';
+ pkgs.writeText "krebs-iptables-rules${iptables-version}" ''
+ ${buildTables iptables-version cfg.tables}
+ '';
startScript = pkgs.writeDash "krebs-iptables_start" ''
set -euf