From b7603875ac7121f963ec5a41c49de42ceb2e249f Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 12 Oct 2015 11:02:44 -0400 Subject: Add an option to the FTP proxy package to allow the firewall rule anchor to be placed before all other rules. --- config/ftpproxy/ftpproxy.inc | 7 ++++++- config/ftpproxy/ftpproxy.xml | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'config/ftpproxy') diff --git a/config/ftpproxy/ftpproxy.inc b/config/ftpproxy/ftpproxy.inc index 386a1d84..cc2aa27a 100644 --- a/config/ftpproxy/ftpproxy.inc +++ b/config/ftpproxy/ftpproxy.inc @@ -125,6 +125,11 @@ function ftpproxy_generate_rules($type) { global $config; $cf = $config['installedpackages']['ftpclientproxy']['config'][0]; $interface_list = explode(",", $cf['localints']); + if ($cf['earlyrule']) { + $ruletype = "pfearly"; + } else { + $ruletype = "filter"; + } /* Proxy is not enabled, therefore, no rules/anchors. */ if ($cf["proxy_enable"] != "on") { @@ -164,7 +169,7 @@ function ftpproxy_generate_rules($type) { $rules .= "rdr pass on {$interface} inet proto tcp from any to any port 21 -> 127.0.0.1 port " . ftpproxy_get_port() . "\n"; } break; - case "filter": + case $ruletype: $rules .= "anchor \"ftp-proxy/*\"\n"; // $rules = "pass out proto tcp from any to any port 21\n"; break; diff --git a/config/ftpproxy/ftpproxy.xml b/config/ftpproxy/ftpproxy.xml index 53740832..d45e4eb6 100644 --- a/config/ftpproxy/ftpproxy.xml +++ b/config/ftpproxy/ftpproxy.xml @@ -41,7 +41,7 @@ ]]> FTP Client Proxy - 0.2.2 + 0.3 FTP Client Proxy pkg_edit.php?xml=ftpproxy.xml /usr/local/pkg/ftpproxy.inc @@ -86,6 +86,13 @@ + + Early Firewall Rule + earlyrule + Check this box to move the automatically added FTP rules higher in the ruleset to bypass explicit blocks. Helps allow passive FTP to arbitrary destinations, but FTP will always be allowed outbound when checked. + checkbox + off + Anonymous Only anononly -- cgit v1.2.3