`
Jony.Hwong
  • 浏览: 116709 次
  • 来自: ...
社区版块
存档分类
最新评论

Firewall rules for FTP+SSL Explicit

阅读更多

Firewall rules for FTP+SSL Explicit
Asked by Rouchie in FTP Servers, Network Software Firewalls
Tags: ftp, ssl, firewall, explicit
Hi

I would like to enable FTP+SSL Explicit on my server.  I have downloaded a trial version of Ability FTP Server, as this supports "file banning" functionality which I need.  My problem is that (I think) my firewall is preventing users being able to log in to this FTP server.  Connections are simply timing out, and Ability FTP Server shows no evidence of users being connected.
My firewall is hosted so I can't edit the rules directly, however, the hosts can do this for me.

Can somebody please tell me what I need my firewall to allow, to enable FTP+SSL Explicit to work correctly? 

Many thanks.

********************************************************************************
Which firewall do you have?

The problem is that FTP uses two connections, the command/control connections and the data connection.  The ports that are used for the data connection depend on if you are using active or passive data transfers, but the data ports for the data connection are not fixed.  SSL FTP typically uses passive FTP.

Which port that is to be used for the data connection is sent as data on the command/control session using the PORT (active FTP) or PASV (passive) command.  Normally a firewall will inspect each packet on the command/controll session looking for the PORT/PASV command so that is can see which port to use.  Then the firewall will dynamicall setup a rule that allows the traffic between the two hosts using the port.

The problem with SSL ftp is that command/control session is encrypted and so the firewall can't see the PORT/PASV command. 

There are two options.

1)  If your SSL FTP server and SSL FTP client supprots it, use the CCC command on the client side before you issue the PUT/GET/MPUT/MGET command.  This will cause the PORT/PASV command to be sent in clear text.

2) Define your SSL FTP server to use specific port(s) (you may want a few, no more than 10 though) for the data connection and then setup your firewall to allow traffic inbound to those ports.  If the client side is behind a firewall it will need to define rules to allow those ports outbound to your IP address.  If you are doing NAT  you should also use the EPSV option, extended passive.  Normal passive will pass the servers IP address and the port it is listening on on the PASV command.  The firewall will replace the IP address with the NATed one.   However, once again, since the connection is encrypted the firewall can't do this.  The EPSV option will only pass the port number and the client assumes that the IP address for the data connection is the same as the server for the command/control connection.
********************************************************************************
Thank you for the detailed responses.  You might have to excuse my lack of knowledge here while I try to digest your points.

>> Are you using NAT or is the server address public?
The server is public, well at least I presume so.  It's a fixed IP anyway that I can access directly from any client machine.  My ftp domain name is mapped to that IP also.

>> Define your SSL FTP server to use specific port(s)
I think for convenience (to the clients) this is going to be the most straightforward option.  The FTP server software has an option where I can set the PASV PORT RANGE.  The default values are 1024-5000, but these are greyed out at present because the range option is not active. 

Should I therefore reduce this number to 10 ports, as you suggest?

>> If the client side is behind a firewall it will need to define rules to allow those ports outbound to your IP address.
I've checked in certain client titles (FileZilla/FireFTP) and there is only one box to specify the FTP port.  Would clients be instructed to input a port range into that single box?  Is that even possible to do?
********************************************************************************
Just to point out that the IP address and port are sent in the PASV response. If the server is NATted behind a public IP address then you configure the server General settings with the Router (public) IP address and the ports used will have to mapped to the actual server address, otherwise you simply allow the ports used to the server public address.

The server will use it's next available port and pass this to the client as the port to connect to for the data transfer. If you're going to restrict the ports used then I'd suggest using something outside the default range of 1024 - 5000, since this is the source port range used by the server for outgoing connections. The number of ports should at least allow the maximum number of concurrent data connections you expect, so 10 may not be enough. I'd suggest 50 and adjust from there, for example, 5000 - 5049.

The FTP port specified on the client is the command port. The port range you specify is for data connections and would need to be allowed by the client firewall if there are restrictions on outgoing connections - most home router/firewalls do not have these restrictions but company/corporate firewalls probably will.

If you use the default FTP port and the range I've suggested above, then your firewall will need to allow ports TCP 21 and TCP 5000 to 5049.
********************************************************************************
NAT:  You really need to verify if there is a device that is doing NAT or not.  Just because you can get to it with a public IP address, does not mean that there is not a device doing NAT in front of it.  Is the IP address hard coded on the FTP server?

SSL Ports:  You can leave the port range as is, IMHO it is really overkill, but I tend to leave the defaults asis unless they do not fit my needs or cause security issues.

Client side firewall:  There is nothing you can change in the ftp client itself.  It must be done in the firewall.  What you would need to tell the people that will be using your FTP server is:

"You need to configure your firewall to allow outbound TCP connection to the destination IP address of X and destination ports of 1024-5000."

Where X is your public IP address.
********************************************************************************
Okay thanks again.  Just one more thing...

A while back I set up standard FTP using Ability FTP server and it worked fine.  The firewall on my server was set to use Port 21, which I gather from your replies is the command channel.  Please tell me, does standard (non secure) FTP still require the port range that FTPS uses (i.e. 5000-5049)?
********************************************************************************
Passive FTP uses all ports 1024 and above.  The difference is that the firewall can see what port the server told the client it will be listening on and so the firewall can dynamically create a permit rule to all it. 

As the firewall can't see the encrypted session you must predefine permit rules for the ports you are going to use.  If you do not limit it, that means that you have to allow ALL ports.

分享到:
评论

相关推荐

    vsftp+ssl配置文档

    通过与SSL/TLS协议相结合,可以实现对FTP传输过程中的数据加密,从而提高数据的安全性。本文将详细介绍如何在CentOS 5.4系统上配置vsftpd服务,并使其支持SSL加密连接。 #### 二、环境准备 1. **操作系统:** ...

    Windows Firewall Control v5.3.1+语言包+注册器.zip

    Windows Firewall Control是一款为Windows 7和Vista用户提供了更简单直观的防火墙增强设置使用方法,你可以一键设定过滤规则。

    Comodo+Firewall+Pro+2.4中文终身免费版

    Comodo+Firewall+Pro+2.4中文终身免费版

    FTP For Windows (FTPServer)

    在Windows环境下,为了实现安全的FTP服务,通常会使用FTPS,即FTP over TLS/SSL,它能提供加密的传输,确保数据在传输过程中不被窃取或篡改。本篇文章将详细介绍如何在CentOS 6.8 64位系统上安装和配置一个非常安全...

    Advanced Firewall Features for ScreenOS.pdf

    Advanced Firewall Features for ScreenOS.pdf

    ISA 2004 防火墙 firewall

    ISA 2004 ISA 2004 firewall 防火墙

    Fortigate Firewall VM For VMware 5.6.3

    Fortigate Firewall VM 包含 韌體升級 5.6.3「FOS_VM64-v5-build1547-FORTINET.out」

    IBM Firewall for AIX 用户指南(GA31-1829-02)

    IBM Firewall for AIX 用户指南(GA31-1829-02)

    nginx-letsencrypt-multisite:Linode + Ubuntu 16.04 LTS + UFW + Nginx(多站点)+ MySQL + phpMyAdmin + PHP 7 +让我们加密(A + SSL)+ Cloudflare + Wordpress

    安装并配置Uncomplicated Firewall (UFW),它是Ubuntu中的一个用户友好的防火墙管理工具。通过UFW,我们可以轻松地开启或关闭端口,以增强服务器的安全性。 3. **安装Nginx**: 安装Nginx,这是一个高性能的HTTP...

    Bulletproof SSL and TLS

    engineer, and author, known especially for his contributions to the web application firewall field and development of ModSecurity, an open source web application firewall, and for his SSL/TLS and PKI...

    Fedora FTP服务器的搭建

    rsa_private_key_file=/etc/ssl/private/ftp_server.key ``` 别忘了,你还需要修改防火墙设置,允许FTP流量通过。使用`firewalld`服务,添加FTP端口: ```bash sudo firewall-cmd --permanent --add-service=ftp ...

    Look ‘n’ Stop Firewall 2.07 Crack for Win7 注册

    Look ‘n’ Stop Firewall 2.07 Crack for Win7 Rate This Look ‘n’ Stop Firewall 被誉为全球最牛X的防火墙,功能强大,在同类产品中评测第一。体积小巧,占用内存小。XP下网上已提供注册机,但在WIN7下无法...

    Linux创建ftp及服务开启

    在实际应用中,可能还需要考虑SSL/TLS加密以增强FTP服务器的安全性,这可以通过配置vsftpd支持FTPS(FTP over TLS/SSL)来实现。另外,对于大型组织或高并发环境,可能需要考虑负载均衡和故障转移策略。 总之,...

    Firewall-Emulator:C ++中的模拟防火墙(int用户模式)

    概述 C ++中的模拟防火墙(int用户模式) 职能 使用tcpdump将数据包转储到pcap文件中 识别传出的DNS查询和传入的ARP请求 识别并监视TCP连接的建立和终止,当TCP连接数超过上限时,丢弃此类... GNU M4 ftp://ftp.gnu.org

    WindowsFirewall.diagcab

    当然,如果遇到有 WindowsFirewall.diagcab 无法解决的问题,可以点击查看详细信息来获取相关问题的报告,再到搜索引擎去查找或者咨询 IT Pro。 win10系统如何重置防火墙设置? 如果排查工具没有发现任何错误,可以将...

    CentOS 7 FTP-Server部署

    firewall-cmd --add-service=ftp --permanent ``` `--permanent`参数表示将该规则持久化保存,在重启系统或防火墙服务后依然有效。 - 重新加载防火墙规则: ```bash firewall-cmd --reload ``` 2. **关闭...

    Linux搭建FTP服务器

    为了提高安全性,你可以考虑启用TLS/SSL加密,通过`ssl_enable=YES`设置。此外,限制IP访问、使用Chroot Jail将用户锁定在自己的主目录内也是推荐的做法。 以上就是Linux系统下使用vsftpd搭建FTP服务器的基本步骤。...

    Firewall-Rules:防火墙规则解析器

    防火墙规则 关于 此脚本将允许您为基于 iptables 的防火墙编写“格式化英语”规则,而无需编写 iptables 脚本。 任何阅读规则文件的人都应该能够立即知道它的作用,而无需了解 iptables。 为什么?...

    EasySec Firewall SDK

    EasySec Firewall SDK is a professional software kit for developing network firewall, sniffer or analyser appliations for Microsoft Windows. Simple APIs of EasySec Firewall SDK include powerful ...

    IBM Firewall for AIX 用户指南(GA31-1829-02).pdf

    IBM Firewall for AIX 用户指南

Global site tag (gtag.js) - Google Analytics