Skip to content

Commit 46de8d9

Browse files
committed
fallback knockd sequence when sops placeholder is absent
1 parent d555f8e commit 46de8d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/networking/firewall-knockd.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{ config, pkgs, lib, ... }:
22

33
let
4+
knockSequence =
5+
lib.attrByPath [ "sops" "placeholder" "knockd/sequence" ] [ "7000" "8000" "9000" ] config;
6+
47
# Port knocking sequence will be loaded from sops
58
# This is just the module structure
69
knockdConfig = ''
710
[options]
811
UseSyslog
912
1013
[openSSH]
11-
sequence = ${builtins.concatStringsSep "," config.sops.placeholder."knockd/sequence"}
14+
sequence = ${builtins.concatStringsSep "," knockSequence}
1215
seq_timeout = 15
1316
tcpflags = syn
1417
command = ${pkgs.iptables}/bin/iptables -I INPUT -s %IP% -p tcp --dport 22 -j ACCEPT

0 commit comments

Comments
 (0)