documentation_complete: true


title: 'Enable Logging of All FTP Transactions'

description: |-
    Add or correct the following configuration options within the <tt>vsftpd</tt>
    configuration file, located at <tt>/etc/vsftpd/vsftpd.conf</tt>:
    <pre>xferlog_enable=YES
    xferlog_std_format=NO
    log_ftp_protocol=YES</pre>

rationale: |-
    To trace malicious activity facilitated by the FTP service, it must be configured to ensure that all commands sent to
    the FTP server are logged using the verbose vsftpd log
    format. The default vsftpd log file is <tt>/var/log/vsftpd.log</tt>.

severity: unknown

ocil_clause: 'xferlog_enable is missing, or is not set to yes'

ocil: |-
    Find if logging is applied to the FTP daemon.
    <br /><br />
    Procedures:
    <br /><br />
    If vsftpd is started by xinetd the following command will indicate the xinetd.d startup file:
    <pre>$ grep vsftpd /etc/xinetd.d/*</pre>
    <pre>$ grep server_args <i>vsftpd xinetd.d startup file</i></pre>
    This will indicate the vsftpd config file used when starting through xinetd.
    If the <i>server_args</i> line is missing or does not include the vsftpd configuration file, then the default config file (/etc/vsftpd/vsftpd.conf) is used.
    <pre>$ sudo grep xferlog_enable <i>vsftpd config file</i></pre>

warnings:
    - general: |-
        If verbose logging to <tt>vsftpd.log</tt> is done, sparse logging of
        downloads to <tt>/var/log/xferlog</tt> will not also occur. However,
        the information about what files were downloaded is included in the
        information logged to <tt>vsftpd.log</tt>.
