Forum Discussion
Can F5 restrict the file types transferred via FTP?
Hello expert,
I have set up an FTP Virtual Server.
Can F5 restrict the file types transferred via FTP?
Thanks
7 Replies
- Shyy
Cirrus
If your server is web based you can use ASM to restrict file types
https://my.f5.com/manage/s/article/K78925560 Hi SanYang
You need waf module to restrict the files and if you only have LTM , it cannot restrict any files
- SanYang
Cirrostratus
sorry i dont understand your query. if its external facing service, use sftp
BR
Aswin
For FTP that doesn't seem normally possible. The FTP profile and the FTP commands in iRule don't give this option.
It is probably possible with looking at the data with an iRule and looking for the file name in the PUT command, but that requires some deep iRule knowledge an own development. If your not already an above average user of that it isn't possible.
This article gives nice info about how to set restrictions to FTP with an iRule:
iRule Security 101 - #07 - FTP Proxy | DevCentral
Below is an iRule that should get you going. You probably also want to check on PUT and MPUT besides STOR.
when RULE_INIT { set DEBUG 1 } when CLIENT_ACCEPTED { if { $::DEBUG } { log local0. "client accepted" } } when CLIENT_DATA { if { $::DEBUG } { log local0. "----------------------------------------------------------" } if { $::DEBUG } { log local0. "payload [TCP::payload]" } set client_data [string trim [TCP::payload]] #--------------------------------------------------- # Block or alert specific commands #--------------------------------------------------- switch -glob [string tolower $client_data] { "stor *.tar" - "stor *.gz" - "stor *.tgz" - "stor *.tar.gz" - "stor *.zip" { if { $::DEBUG } { log local0. "LOG: STOR request detected" } TCP::respond "550 STOR filetype not allowed\r\n" TCP::payload replace 0 [string length $client_data] "" return } } TCP::release TCP::collect } when SERVER_CONNECTED { if { $::DEBUG } { log "server connected" } TCP::release TCP::collect clientside { TCP::collect } } when SERVER_DATA { if { $::DEBUG } { log local0. "payload <[TCP::payload]>" } TCP::release TCP::collect } when CLIENT_CLOSED { if { $::DEBUG } { log local0. "client closed" } }When using WinSCP, it shows when the upload is being blocked.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
