Wordfence (2018-2022): verschil tussen versies
Regel 73: | Regel 73: | ||
|[[file:20181218-1052.png|thumb|''"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."'']] | |[[file:20181218-1052.png|thumb|''"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."'']] | ||
|} | |} | ||
+ | |||
+ | === Oorzaak === | ||
+ | |||
+ | [https://www.wordfence.com/help/firewall/troubleshooting/?utm_source=plugin&utm_medium=pluginUI&utm_campaign=docsIcon#problems-reading-wordfence-firewall-config-data]: | ||
+ | |||
+ | :The Wordfence Firewall stores some of its information in the file system. The files are located in wp-content/wflogs/. If there are issues with file writing or disk space on the server, the configuration file config.php could become corrupt. If this happens, you will receive an administrative notice on all Wordfence pages, prompting you to rebuild the configuration file automatically. If restoration completes successfully, no further action is required on your part. Your Firewall is now in perfect shape again. | ||
+ | |||
+ | :If the message still appears after reloading the page, you may need to fix file permissions on the files in wp-content/wflogs/, including the wflogs folder itself. Some hosting companies may need to do this for you, while most others allow you to do it yourself. You can also try renaming the wflogs folder, which will reset the firewall settings, including Learning Mode and any automatic whitelist entries. | ||
=== Oplossing (1) === | === Oplossing (1) === |
Versie van 28 aug 2020 17:32
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 niets is perfect: Je moet dus (zoals altijd) je gezond verstand blijven gebruiken.
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
Zie de instellingen onder Wordfence » All Options in een bestaande website voor inspiratie.
Maak wp-content/wflogs beschrijfbaar voor Wordfence
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!
Foutmelding: Unable to open <file> for reading and writing (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. Unable to open /var/www/example.com/wp-content/wflogs/ips.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 og+rw wp-content/wflogs
Let op: Alleen sudo chmod -R o+rw wp-content/wflogs
(dus alleen others en geen group) werkt niet.
Daarnaast moet ik een enkele keer mbv. chown en chgrp mezelf eigenaar maken:
cd wp-content/wflogs sudo chown strompf * sudo chgrp strompf *
Foutmelding: Wordfence Web Application Firewall cannot run
Probleem
Oorzaak
[1]:
- The Wordfence Firewall stores some of its information in the file system. The files are located in wp-content/wflogs/. If there are issues with file writing or disk space on the server, the configuration file config.php could become corrupt. If this happens, you will receive an administrative notice on all Wordfence pages, prompting you to rebuild the configuration file automatically. If restoration completes successfully, no further action is required on your part. Your Firewall is now in perfect shape again.
- If the message still appears after reloading the page, you may need to fix file permissions on the files in wp-content/wflogs/, including the wflogs folder itself. Some hosting companies may need to do this for you, while most others allow you to do it yourself. You can also try renaming the wflogs folder, which will reset the firewall settings, including Learning Mode and any automatic whitelist entries.
Oplossing (1)
Vanaf de root van de installatie:
sudo chmod -R o+rw wp-content/wflogs
Oplossing (2)
Is het probleem er nog steeds? Klik op de link rebuild the configuration file, en dat werkte.
Oplossing (3)
Is het probleem er nog steeds? In maart 2019 was dit het winnende commando:
sudo chmod -Rv g+rwX "$path/wp-content/plugins/wordfence"
Dit commando heb ik opgenomen in script wp_set_rights
op m'n werkstation, maar nog niet op enige server.
Historie
Wanneer? Oplossingen ------------- ----------- * Okt. 2018 (1) (1)+(2) * Okt. 2018 (2) (1)+(2) * Nov. 2018: (1)+(2) * Dec. 2018: (1) * Mrt. 2019: (1)+(2)+(3) * Okt. 2019:
Foutmelding: Unable to open <file> for reading and writing (dec. 2018)
Deze foutmelding kreeg ik tijdens updates via WP-CLI. Zelfde probleem als een paar maanden eerder → Zie aldaar voor details + oplossing
Foutmelding: Error Saving Options
Tijdens configureren van WordFence:
Oplossing (vanuit de root van de installatie):
sudo chmod -R o+rwX wp-content/uploads
Foutmelding: Unable to create wordfence-waf.php (jan. 2019)
Deze foutmelding trad op bij een nieuwe site tijdens de installatieprocedure.
Oplossing:
cd .. # Dus 1 niveau boven de root sudo chmod o+rwX example.com