fwknopd.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. -- Copyright 2015 Jonathan Bennett <jbennett@incomsystems.biz>
  2. -- Licensed to the public under the GNU General Public License v2.
  3. m = Map("fwknopd", translate("Firewall Knock Operator"))
  4. s = m:section(TypedSection, "global", translate("Enable Uci/Luci control")) -- Set uci control on or off
  5. s.anonymous=true
  6. s:option(Flag, "uci_enabled", translate("Enable config overwrite"), translate("When unchecked, the config files in /etc/fwknopd will be used as is, ignoring any settings here."))
  7. qr = s:option(DummyValue, "note0", "dummy")
  8. qr.template = "fwknopd-qr"
  9. qr:depends("uci_enabled", "1")
  10. s = m:section(TypedSection, "access", translate("access.conf stanzas")) -- set the access.conf settings
  11. s.anonymous=true
  12. s.addremove=true
  13. s.dynamic=true
  14. s:option(Value, "SOURCE", "SOURCE", translate("Use ANY for any source ip"))
  15. k1 = s:option(Value, "KEY", "KEY", translate("Define the symmetric key used for decrypting an incoming SPA packet that is encrypted by the fwknop client with Rijndael."))
  16. k1:depends("keytype", translate("Normal Key"))
  17. k2 = s:option(Value, "KEY_BASE64", "KEY_BASE64", translate("Define the symmetric key used for decrypting an incoming SPA \
  18. packet that is encrypted by the fwknop client with Rijndael."))
  19. k2:depends("keytype", translate("Base 64 key"))
  20. l1 = s:option(ListValue, "keytype", "Key type")
  21. l1:value("Normal Key", "Normal Key")
  22. l1:value("Base 64 key", "Base 64 key")
  23. k3 = s:option(Value, "HMAC_KEY", "HMAC_KEY", "The hmac key")
  24. k3:depends("hkeytype", "Normal Key")
  25. k4 = s:option(Value, "HMAC_KEY_BASE64", "HMAC_KEY_BASE64", translate("The base64 hmac key"))
  26. k4:depends("hkeytype", "Base 64 key")
  27. l2 = s:option(ListValue, "hkeytype", "HMAC Key type")
  28. l2:value("Normal Key", "Normal Key")
  29. l2:value("Base 64 key", "Base 64 key")
  30. s:option(Value, "OPEN_PORTS", "OPEN_PORTS", translate("Define a set of ports and protocols (tcp or udp) that will be opened if a valid knock sequence is seen. \
  31. If this entry is not set, fwknopd will attempt to honor any proto/port request specified in the SPA data \
  32. (unless of it matches any “RESTRICT_PORTS” entries). Multiple entries are comma-separated."))
  33. s:option(Value, "FW_ACCESS_TIMEOUT", "FW_ACCESS_TIMEOUT", translate("Define the length of time access will be granted by fwknopd through the firewall after a \
  34. valid knock sequence from a source IP address. If “FW_ACCESS_TIMEOUT” is not set then the default \
  35. timeout of 30 seconds will automatically be set."))
  36. s:option(Value, "REQUIRE_SOURCE_ADDRESS", "REQUIRE_SOURCE_ADDRESS", translate("Force all SPA packets to contain a real IP address within the encrypted data. \
  37. This makes it impossible to use the -s command line argument on the fwknop client command line, so either -R \
  38. has to be used to automatically resolve the external address (if the client behind a NAT) or the client must \
  39. know the external IP and set it via the -a argument."))
  40. s:option(DummyValue, "note1", translate("Enter custom access.conf variables below:"))
  41. s = m:section(TypedSection, "config", translate("fwknopd.conf config options"))
  42. s.anonymous=true
  43. s.dynamic=true
  44. s:option(Value, "MAX_SPA_PACKET_AGE", "MAX_SPA_PACKET_AGE", translate("Maximum age in seconds that an SPA packet will be accepted. defaults to 120 seconds"))
  45. s:option(Value, "PCAP_INTF", "PCAP_INTF", translate("Specify the ethernet interface on which fwknopd will sniff packets."))
  46. s:option(Value, "ENABLE_IPT_FORWARDING", "ENABLE_IPT_FORWARDING", translate("Allow SPA clients to request access to services through an iptables firewall instead of just to it."))
  47. s:option(DummyValue, "note2", translate("Enter custom fwknopd.conf variables below:"))
  48. return m