Support » Plugin: Wordfence Security - Firewall & Malware Scan » Write Logs to the Standard File Path

  • rachelwhitton

    (@rachelwhitton)


    Request that logs be written to the standard file path, wp-content/uploads/wflogs instead of wp-content/wflogs. The issue with writing logs outside of the standard file path is that permissions are assumed on staging and production environments, which may not be granted (by design) resulting in permission denied failures. Writing plugin files to wp-content/uploads would resolve.

    Also, can the path for logs be set relative to the plugin’s parent directory to resolve compatibility issues on distributed infrastructures?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey folks at Wordfence,

    Are there any updates on this? We LOVE Wordfence and Pantheon and hope you can get them working together soon.

    Thanks!

    Subscribe

    Subscribe

    Subscribe

    8 Months and no reply? you should consider this more seriously… distributed infrastructures like Pantheon have a considerable user base I think that you folks should not discard.

    This code helps define the path absolutely based on the most current directory structure; I don’t believe asking that the path be definable as a relative path is necessary:

    
    <?php
    /**
     * Write to a wflog directory inside the uploads directory path.
     *
     * @link https://wordpress.org/support/topic/write-logs-to-the-standard-file-path/
     */
    if ( ! defined( 'WFWAF_LOG_PATH' ) ) {
    	// Get upload directory information.
    	$upload_dir_info = wp_upload_dir();
    	if ( array_key_exists( 'basedir', $upload_dir_info ) && ! empty( $upload_dir_info['basedir'] ) ) {
    		$use_upload_wflog = trailingslashit( $upload_dir_info['basedir'] ) . 'wflog';
    
    		// Make sure directory defined is trailing slashed.
    		define( 'WFWAF_LOG_PATH', trailingslashit( $use_upload_wflog ) );
    	}
    }

    In another support thread it looks like a Wordfence support person responded about security vulnerabilities using the uploads directory for wflogs but after re-reading it’s not clear to me if that’s a response to defining /uploads/ or a sub directory like /uploads/wflogs/ for the log path.
    Support thread: Hosting on Pantheon.io wflogs no write access

    The code solution above still doesn’t make the firewall functionality supportable on Pantheon, as far as I have been able to tell, because of the issues outlined in a separate support request: Set auto_prepend_file path relatively but in case someone finds this helpful I thought I would share.

    jerocha

    (@jerocha)

    @terriann Thank you so much, this will be helpful and a starting point for some customization. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Write Logs to the Standard File Path’ is closed to new replies.