fwknopd.lua 3.5 KB

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