Commit ed593ac
committed
ftp: use parser data direction in ftpdata
The ftpdata_command keyword assumed a fixed relationship between the FTP
command and the data-flow direction: RETR was expected to be to-client
and STOR to-server. That matches passive FTP, but active FTP reverses
the TCP data flow because the server opens the connection from port 20.
In an active download, the RETR payload is therefore seen by Suricata in
the flow's to-server direction.
For firewall rules this caused an active RETR rule on
ftp-data:request_started to miss. The firewall then applied the default
app policy to the FTP-data transaction, dropped the flow, and prevented
fileinfo from being logged.
Use the direction that the FTP parser stored in FtpDataState from the
control-channel expectation instead of deriving direction from the
command. This preserves the command check while allowing active and
passive data connections to match in their actual parser-established
data direction.1 parent 1614df0 commit ed593ac
1 file changed
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 108 | + | |
| 109 | + | |
117 | 110 | | |
118 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
0 commit comments