aboutsummaryrefslogtreecommitdiffstats
path: root/config/ftpproxy
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2015-10-12 11:02:44 -0400
committerjim-p <jimp@pfsense.org>2015-10-12 11:03:21 -0400
commitb7603875ac7121f963ec5a41c49de42ceb2e249f (patch)
treeb85a79f27894a892b9fe2b889982ca572f18ecf9 /config/ftpproxy
parent962d6b0bbe07c96776950a24a06043cd295ce26c (diff)
downloadpfsense-packages-b7603875ac7121f963ec5a41c49de42ceb2e249f.tar.gz
pfsense-packages-b7603875ac7121f963ec5a41c49de42ceb2e249f.tar.bz2
pfsense-packages-b7603875ac7121f963ec5a41c49de42ceb2e249f.zip
Add an option to the FTP proxy package to allow the firewall rule anchor to be placed before all other rules.
Diffstat (limited to 'config/ftpproxy')
-rw-r--r--config/ftpproxy/ftpproxy.inc7
-rw-r--r--config/ftpproxy/ftpproxy.xml9
2 files changed, 14 insertions, 2 deletions
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 @@
]]>
</copyright>
<name>FTP Client Proxy</name>
- <version>0.2.2</version>
+ <version>0.3</version>
<title>FTP Client Proxy</title>
<aftersaveredirect>pkg_edit.php?xml=ftpproxy.xml</aftersaveredirect>
<include_file>/usr/local/pkg/ftpproxy.inc</include_file>
@@ -87,6 +87,13 @@
<multiple/>
</field>
<field>
+ <fielddescr>Early Firewall Rule</fielddescr>
+ <fieldname>earlyrule</fieldname>
+ <description>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.</description>
+ <type>checkbox</type>
+ <default_value>off</default_value>
+ </field>
+ <field>
<fielddescr>Anonymous Only</fielddescr>
<fieldname>anononly</fieldname>
<description>Only permit anonymous FTP connections using the &quot;ftp&quot; or &quot;anonymous&quot; users.</description>