Replies: 0
Hi,
I’d need support in enabling the WAF “Extended protection” on a server environment, linux based AWS instance, with autoscaling and load balancer.
On this kind of setup, I usually prepare all my mods on local env (such as plugin and WordPress updates or custom code in the theme) and then I push them to be deployed on staging and live via CI/CD development practice.
Working on my local dev environment the “Extended protection” is clean and easy to enable, just a couple of clicks, after saving .htaccess file backup. During this process, as far as I understood, Wordfence basically creates one file (wordfence-waf.php) and edits the .htaccess file according to the detected server configuration. On my local dev env is Apache + mod_php, on live env is Apache + CGI/FastCGI. but, above all, the edits in the .htaccess write absolute paths to the newly created file.
For this reasons A) I cannot activate the “Extended protection” on my local env and then release the mods, because they would be completely different. At the same time B) I cannot activate it directly from live backend settings, because the modifications on files would be lost when AWS creates a new instance of the site code, cloning the repository.
Main question:
How can I solve this tedious problem? Can you advice some best practice?
Bonus question:
I also realized that our site is constantly in Learning mode, and when I force the status “Enabled and Protecting” (without waiting the date), it goes back to Learning mode by itself (in my last check it has been done after just one hour). Do you maybe know why, and if this could be related to the type of environment setup?
Thank you in advance for any help you could give 🙂