Wordfence (2018-2022)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

Wordfence is een WordPress-plugin op het gebied van site-beveiliging. Oa. detecteert het gehackte sites en kan het sites zelfs weer schoonmaken. Sind begin 2018 gebruik ik Wordfence op al m'n sites. Het bevalt goed, maar het heeft z'n beperkingen.

Beperkingen

WordFence detecteert fraudeleuse admin-accounts niet, als deze zijn aangemaakt vóór de installatie van WordFence → Zelf controleren of de aanwezige (admin)-account legitiem zijn

Installatie

wp plugin install wordfence --activate

Configuratie

Foutmelding: "The Wordfence Web Application Firewall cannot run. The configuration files are corrupt or inaccessible by the web server, which is preventing the WAF from functioning. Please verify the web server has permission to access the configuration files. You may also try to rebuild the configuration file by clicking here. It will automatically resume normal operation when it is fixed" en "We were unable to write to ~/wp-content/wflogs/ which the WAF uses for storage. Please update permissions on the parent directory so the web server can write to it."
  • Alert emails: Wordfence » All Options » General Wordfence options » Where to email alerts
  • Wordfence komt met een firewall: Wordfence Web Application Firewall (WAF). Om deze te kunnen configureren, moet Wordfence z'n configuratiebestanden in wp-content/wflogs kunnen beschrijven. Wat in ieder geval help:
chmod o+w wp-content/wflogs           # Misschien niet nodig?
sudo chmod o+rw wp-content/wflogs/*   # Nodig!

Unable to open config.php-foutmelding (okt. 2018)

Probleem

Diverse vergelijkbare foutmeldingen (via Bash):

Unable to open /var/www/example.com/wp-content/wflogs/config.php for reading and writing.
Unable to open /var/www/example.com/wp-content/wflogs/config-synced.php for reading and writing.
Unable to open /var/www/example.com/wp-content/wflogs/config-livewaf.php for reading and writing.
Unable to open /var/www/example.com/wp-content/wflogs/config-transient.php for reading and writing.

Aanvullende gegevens

Wat vreemd was: www-data is eigenaar van map + bestanden, de map had rechten 777, en www-data kon alle bestanden lezen en schrijven.

Oplossing

sudo chmod o+rw config.php
sudo chmod o+rw config-synced.php
sudo chmod o+rw config-livewaf.php
sudo chmod o+rw config-synced.php
sudo chmod o+rw config-transient.php

Een oplossing die nog iets radicaler is, en die ik evenmin helemaal vertrouw:

sudo chmod -R o+rw wp-content/wflogs

Wordfence Web Application Firewall cannot run-foutmelding (okt. 2018)

Probleem

"The Wordfence Web Application Firewall cannot run. The configuration files are corrupt or inaccessible by the web server, which is preventing the WAF from functioning. Please verify the web server has permission to access the configuration files. You may also try to rebuild the configuration file by clicking here. It will automatically resume normal operation when it is fixed." en "We were unable to write to ~/wp-content/wflogs/ which the WAF uses for storage. Please update permissions on the parent directory so the web server can write to it."

Oplossig (1)

Vanaf de root van de installatie:

sudo chmod -R o+rw wp-content/wflogs

Oplossig (2)

Is het probleem er nog steeds? In nov. 2018 klikte ik vervolgens op de link rebuild the configuration file, en dat werkte.

Bronnen