diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 847d78e..01899ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,10 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + # the build provenance attestation (signed by GitHub's OIDC token, + # stored with the repository's attestations) + id-token: write + attestations: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 @@ -42,6 +46,14 @@ jobs: with: name: bfstop-${{ needs.ci.outputs.version }} path: build + # who built the zips, from which commit, with which workflow: checked + # with `gh attestation verify pkg_bfstop-X.Y.Z.zip --repo codeling/bfstop` + - name: Attest the build provenance of the zips + uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + with: + subject-path: | + build/*.zip + build/SHA256SUMS-* - name: Create the draft release env: GH_TOKEN: ${{ github.token }} diff --git a/CHANGELOG b/CHANGELOG index 9e7fb26..50dfc7b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,51 @@ 2.0.0 (unreleased) - Requires PHP 8.2 (was 8.1), the oldest version CI runs the tests on + - Hardening (issue #285): the page shown to a blocked address and the + unblock page may not be shown in another site's frame, and the unblock + page's type is not left to the browser to guess; with a proxy + configured, a request which didn't come through it is logged once an + hour for its address, not each time (anybody can send them, and push + the entries that matter out of the log); the proxy settings show where + the administrator's own request came from, its forwarding headers and + the address BFStop makes of them, and say that Client-Ip and + X-Cluster-Client-Ip are only safe if the proxy overwrites them; the + description of the blocking modes says which logins "Login Only" stops; + blocking through .htaccess is refused on nginx (which doesn't read the + file), LiteSpeed gets a warning of its own, and the warnings about the + .htaccess file only show where it is used; the release zips get a build + provenance attestation + - Issue #285: in "Full Site" mode, a blocked address's requests to the + backend and the API are refused before Joomla routes them (none of the + pages a blocked address may reach is there), with the queries of that + check not repeated after routing + - Issue #285: a blocked address may submit the forms of the password + recovery (reset request, code, new password, username reminder) at most + 10 times an hour; they send mails, and Joomla limits only the password + reset (per account), not the reminder. The description of the password + reminder setting recommends a captcha for these forms + - Issue #285: what administrators do with BFStop goes into Joomla's User + Actions Log - blocks added, changed and lifted, the allow list, the + .htaccess entries, the settings (the names of those changed), purging + failed logins or user name statistics, pruning and clearing BFStop's + log - as does lifting a block with the link of an unblock mail. BFStop's + own log can be cleared by the people it should hold to account. The + installation adds "Brute Force Stop" to the extensions the User Actions + Log records (its option "Events To Log"), where it can be unticked + - Issue #285: the settings page has a button which checks whether the web + server honours the block section of the .htaccess file: it makes a test + directory next to the file, with a .htaccess of the same form which + refuses one particular query, requests its file once with another query + and once with that one, and removes it again. It tells whether the + section works, is ignored (AllowOverride, or not Apache), breaks the site + (status 500), or why it couldn't be checked + - Issue #285: for sites behind nginx (which doesn't read .htaccess + files), the new setting "nginx Deny File" names a *.conf file in which + BFStop keeps the active blocks as "deny" lines, for the site's nginx + configuration to include, with "Full Site". It is written from the + block list on each block, unblock and change of a block, and by the + daily maintenance; entries overlapping the allow list or a trusted + proxy are left out, and only a file BFStop wrote is ever overwritten. + nginx reads it when it is reloaded, which the server has to arrange - Issue #294: the administrators' mail about a block lists the failed logins which led to it, not every failed login of the address still stored (for a permanent block: of ten years, including those of earlier diff --git a/component/admin/forms/settings.xml b/component/admin/forms/settings.xml index 02c58ea..048265e 100644 --- a/component/admin/forms/settings.xml +++ b/component/admin/forms/settings.xml @@ -217,6 +217,12 @@ validate="htaccesspath" label="PLG_SYSTEM_BFSTOP_HTACCESS_PATH_LABEL" description="PLG_SYSTEM_BFSTOP_HTACCESS_PATH_DESC" /> + +
configuració), però l'adreça del lloc no està definida ($live_site al configuration.php): no s'envia cap enllaç de desbloqueig." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recomanat)" @@ -216,3 +238,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="La xarxa %1$s és massa gran: la longitud del p COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Això és (o conté) un servidor intermediari de confiança de la configuració: si es bloqueja al fitxer .htaccess, es rebutjaria qualsevol petició que hi passi." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="Brute Force Stop no ha pogut treure els seus bloquejos de %s, que ja no bloqueja: el servidor web continua rebutjant aquestes adreces, també quan els seus bloquejos s'han acabat. Feu que el fitxer es pugui escriure i traieu-les a mà - són a les línies <If> entre '# BEGIN BFStop Blocks' i '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="El bloqueig s'ha desat, però no s'ha pogut afegir a %s: Joomla rebutja l'adreça, el servidor web no." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="L'usuari {username} ha bloquejat {ipaddress} al Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="L'usuari {username} ha modificat el bloqueig de {ipaddress} al Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="L'usuari {username} ha aixecat els bloquejos de {ipaddresses} al Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="El bloqueig de {ipaddress} al Brute Force Stop s'ha aixecat amb l'enllaç d'un correu de desbloqueig" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="L'usuari {username} ha afegit {ipaddress} a la llista de permesos del Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="L'usuari {username} ha modificat l'entrada {ipaddress} de la llista de permesos del Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="L'usuari {username} ha tret {ipaddresses} de la llista de permesos del Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="L'usuari {username} ha bloquejat {ipaddress} al fitxer .htaccess" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="L'usuari {username} ha tret {ipaddresses} del fitxer .htaccess" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="L'usuari {username} ha modificat la configuració del Brute Force Stop: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="L'usuari {username} ha suprimit {count} entrades de més de {days} dies del registre del Brute Force Stop" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="L'usuari {username} ha buidat el registre del Brute Force Stop" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="L'usuari {username} ha suprimit {count} inicis de sessió fallits de més de {days} dies del Brute Force Stop" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="L'usuari {username} ha suprimit les estadístiques de {count} noms d'usuari no vistos en {days} dies del Brute Force Stop" diff --git a/component/admin/language/de-DE/de-DE.com_bfstop.ini b/component/admin/language/de-DE/de-DE.com_bfstop.ini index 4b269b5..2b36279 100644 --- a/component/admin/language/de-DE/de-DE.com_bfstop.ini +++ b/component/admin/language/de-DE/de-DE.com_bfstop.ini @@ -28,6 +28,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: Fehlgeschlagene Logins" COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop: Einstellungen" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="Der Superuser hat den Standard-Benutzernamen 'admin'. Dies stellt ein Sicherheitsrisiko dar; Angreifern ist bewusst, dass dieser Benutzername in vielen Joomla!-Installationen existiert, darum wird er bei Angriffen besonders oft verwendet. Zur Erhöhung der Sicherheit wird empfohlen, den Benutzernamen zu ändern! Siehe auch: FAQ: Why should I immediately change the name of the default admin user after a new install?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="Ihr Server ist entweder kein Apache, oder die .htaccess existiert entweder nicht oder ist nicht les- oder beschreibbar; das Blocken mittels .htaccess-Eintrag wird nicht funktionieren!" +COM_BFSTOP_WARNING_HTACCESS_NGINX="Diese Website läuft auf nginx, das keine .htaccess-Dateien liest: Mit dem Sperrmodus „%1$s“ weist nicht der Webserver Adressen ab, sondern nur BFStop, wie bei „%2$s“. Wähle in den Einstellungen „%2$s“; nginx kann Adressen in seiner eigenen Konfiguration sperren." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="Diese Website läuft auf LiteSpeed, das .htaccess-Dateien liest, aber nicht jede Direktive von Apache: Ob es die <If>-Abschnitte beachtet, mit denen BFStop Adressen sperrt, hängt von seiner Edition und Version ab. Prüfe, ob der Webserver eine gesperrte Adresse abweist, oder wähle in den Einstellungen „%2$s“." +COM_BFSTOP_HTACCESS_CHECK="Prüfe .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="Der Webserver beachtet den Sperrabschnitt der .htaccess-Datei in %s: Eine Testanfrage, die er abweisen soll, wurde abgewiesen." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="Der Webserver ignoriert den Sperrabschnitt der .htaccess-Datei in %s: Eine Testanfrage, die er hätte abweisen sollen, kam durch. Apache muss dort Autorisierungsdirektiven lesen dürfen (AllowOverride AuthConfig oder All). nginx liest keine .htaccess-Dateien, OpenLiteSpeed liest nur ihre Rewrite-Regeln, und LiteSpeed Enterprise unterstützt womöglich nicht jede Direktive, die der Sperrabschnitt verwendet." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="Der Webserver ist an einer Testdatei mit den Direktiven des Sperrabschnitts gescheitert (Status 500): Er versteht sie nicht (sie brauchen Apache 2.4 oder neuer). Der Sperrabschnitt würde die Website in %s genauso lahmlegen; mehr steht im Fehlerlog des Webservers." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="Die .htaccess-Datei in %1$s konnte nicht geprüft werden: %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="Ihr Verzeichnis ist weder das Verzeichnis der Website noch eines darin, es hat also keine Adresse, die sich ausprobieren ließe" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="Dort konnte kein Testverzeichnis angelegt werden" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="Die Website konnte sich selbst nicht über HTTP erreichen" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="Eine Testdatei dort konnte nicht abgerufen werden (Status %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="Das BFStop Plugin ist nicht installiert! Bitte installieren Sie die neuste Version des BFStop Pakets von der BFStop Seite oder dem Joomla Extensions Directory!" COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="Kann den manifest cache der BFStop-Komponente nicht laden; es scheint etwas schiefzulaufen in Ihrer Joomla! Installation. Bitte installieren Sie die neuste Version des BFStop Pakets von der BFStop Seite oder dem Joomla Extensions Directory!" COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="Es sind unterschiedliche Versionen von BFStop Plugin und Komponente installiert! Bitte installieren Sie die neuste Version des BFStop Pakets von der BFStop Seite oder dem Joomla Extensions Directory!" @@ -48,6 +59,11 @@ COM_BFSTOP_TEST_NOTIFICATION="Benachrichtigung testen" COM_BFSTOP_TEST_NOTIFICATION_SUCCESS="Das Senden der Test-Benachrichtigung scheint erfolgreich gewesen zu sein! Bitte überprüfe auch, ob die Mail tatsächlich angekommen ist!" COM_BFSTOP_TEST_NOTIFICATION_FAILED="Das Senden der Test-Benachrichtigung ist fehlgeschlagen (%s)! Bitte prüfe Deine eMail-Konfiguration in den Joomla!-Einstellungen bzw. ob Du in den Benachrichtigungs-Einstellungen des bfstop-Plugins eine (korrekte) eMail-Adresse eingetragen und/oder einen Benutzer oder eine Gruppe ausgewählt hast!" COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="Über" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Prüfung mit deiner Anfrage" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="Die Anfrage deines Browsers kam beim Webserver von %s an." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="Sie enthielt den Header %1$s: %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="Sie enthielt keinen der Weiterleitungs-Header, die BFStop kennt." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="Mit den gespeicherten Einstellungen hält BFStop %s für deine Adresse. Ist das nicht die Adresse, die dein Computer im Internet hat (sondern z. B. die deines Proxys), passen die Einstellungen auf diesem Reiter noch nicht zu deiner Website." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Komponenten-Version: %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Plugin-Version: %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="unbekannt" @@ -130,7 +146,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="Wie viele Risikopunkte hinzugefügt w COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Zunehmende Sperrdauer" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="Wenn aktiviert, wird die Sperrdauer jedes Mal, wenn dieselbe IP-Adresse erneut gesperrt wird, gegenüber der vorherigen Sperre verdoppelt (bis zum 64-Fachen), statt immer dieselbe feste Dauer zu verwenden. Nach oben bleibt sie durch den unten eingestellten Übergang zur dauerhaften Sperre begrenzt." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Sperrmodus" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Was passiert, sobald eine IP-Adresse gesperrt wird. „Nur Berichten“ schränkt nie etwas ein - fehlgeschlagene Versuche werden weiterhin protokolliert, aber es wird keine IP gesperrt; nutze dies, um die Aktivität zu beobachten, bevor du etwas durchsetzt. „Nur Login“ lässt die IP die Website weiter normal nutzen (auch das Login-Formular ansehen) und weist nur den Login-Versuch selbst ab - das entspricht eher dem üblichen Verhalten einer Begrenzung von Login-Versuchen und stört legitime Benutzer weniger, die sich nur beim Passwort vertippt haben. „Ganze Website“ weist jede Anfrage von der gesperrten IP-Adresse ab und zeigt die unten eingestellte Meldung. „Ganze Website + .htaccess“ tut dasselbe und trägt die IP zusätzlich in die .htaccess ein, sodass der Webserver selbst sie abweist, bevor Joomla (und dieses Plugin) die Anfrage überhaupt sieht - dadurch kann eine so gesperrte IP aber auch nicht auf den Login beschränkt werden, weshalb dieser Modus nicht zusammen mit „Nur Login“ angeboten wird. Eine so gesperrte Adresse erreicht nur noch die Entsperr-Seite aus einer Entsperr-E-Mail: das Zurücksetzen des Passworts, die unten eingestellte Meldung und der Rest der Website bleiben ihr verschlossen. Gilt für jede Sperre, egal ob automatisch erstellt oder manuell in der Sperrliste hinzugefügt." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Was passiert, sobald eine IP-Adresse gesperrt wird. „Nur Berichten“ schränkt nie etwas ein - fehlgeschlagene Versuche werden weiterhin protokolliert, aber es wird keine IP gesperrt; nutze dies, um die Aktivität zu beobachten, bevor du etwas durchsetzt. „Nur Login“ lässt die IP die Website weiter normal nutzen (auch das Login-Formular ansehen) und weist nur den Login-Versuch selbst ab - das entspricht eher dem üblichen Verhalten einer Begrenzung von Login-Versuchen und stört legitime Benutzer weniger, die sich nur beim Passwort vertippt haben. „Ganze Website“ weist jede Anfrage von der gesperrten IP-Adresse ab und zeigt die unten eingestellte Meldung. „Ganze Website + .htaccess“ tut dasselbe und trägt die IP zusätzlich in die .htaccess ein, sodass der Webserver selbst sie abweist, bevor Joomla (und dieses Plugin) die Anfrage überhaupt sieht - dadurch kann eine so gesperrte IP aber auch nicht auf den Login beschränkt werden, weshalb dieser Modus nicht zusammen mit „Nur Login“ angeboten wird. Eine so gesperrte Adresse erreicht nur noch die Entsperr-Seite aus einer Entsperr-E-Mail: das Zurücksetzen des Passworts, die unten eingestellte Meldung und der Rest der Website bleiben ihr verschlossen. Gilt für jede Sperre, egal ob automatisch erstellt oder manuell in der Sperrliste hinzugefügt. „Nur Login“ erkennt die Login-Formulare von Joomlas eigenem Frontend und Backend (com_users, com_login) und Logins mit Zugangsdaten über die Web-Services-API. Über Erweiterungen, die Benutzer selbst anmelden (Social- oder Single-Sign-on-Logins, Login-Module, die an einen eigenen Controller senden, Passkeys), kann sich eine gesperrte Adresse weiterhin anmelden: Bietet deine Website solche Logins an, wähle „Ganze Website“." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Nur Berichten" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Nur Login" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Ganze Website" @@ -205,6 +221,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Leeren" COM_BFSTOP_LOG_CLEARED="Das Log wurde geleert." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Entsperr-Links können nur gesendet werden, wenn die Adresse der Website gesetzt ist ($live_site in der configuration.php der Website). Setze sie dort, oder schalte die Entsperr-Links aus." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="„%1$s“ (%2$d) darf nicht höher sein als „%3$s“ (%4$d): Jeder Client bekäme %2$d Versuche. Verringere „%1$s“ oder erhöhe „%3$s“." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="Diese Website läuft auf nginx, das keine .htaccess-Dateien liest: Der Sperrmodus „%1$s“ kann hier nicht funktionieren. Wähle „%2$s“; nginx kann Adressen in seiner eigenen Konfiguration sperren." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="nginx-Sperrdatei" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Nur für Websites, die nginx ausliefert, das keine .htaccess-Dateien liest: eine Datei (ein absoluter Pfad, endend auf .conf), in der BFStop die aktiven Sperren als „deny“-Zeilen führt, damit der server-Block der nginx-Konfiguration der Website sie einbindet. nginx liest sie nur beim Neuladen: Sorge dafür, dass es neu geladen wird, wenn sich die Datei ändert (z. B. mit einer systemd-Path-Unit oder einem Cronjob, der „nginx -t && nginx -s reload“ ausführt). Adressen der Erlaubnisliste und vertrauenswürdige Proxys werden ausgelassen. Leer: keine solche Datei." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="Keine Datei, die BFStop als nginx-Sperrdatei schreiben kann: %1$s. Es muss ein absoluter Pfad einer Datei sein, deren Name auf %2$s endet." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="Das Verzeichnis der nginx-Sperrdatei %1$s existiert nicht oder ist nicht beschreibbar." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s existiert und wurde nicht von BFStop geschrieben: Sie würde überschrieben. Wähle eine neue Datei." COM_BFSTOP_WARNING_NO_LIVE_SITE="Die Adresse der Website ist nicht gesetzt ($live_site in der configuration.php). Joomla! baut die Links in den Emails von Brute Force Stop dann mit dem Host, den die jeweilige Anfrage nennt und den ein Besucher frei wählen kann - deshalb werden keine Entsperr-Links gesendet, und die Benachrichtigungen an die Administratoren nennen keine Adresse. Um die Adresse zu setzen, füge diese Zeile in die Klasse in der configuration.php der Website ein, mit der Adresse, unter der die Website erreichbar ist (aus dieser Anfrage vorgeschlagen, bitte prüfen): %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Entsperr-Links sollen gesendet werden (Einstellungen), aber die Adresse der Website ist nicht gesetzt ($live_site in der configuration.php): es werden keine Entsperr-Links gesendet." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (empfohlen)" @@ -214,3 +236,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="Das Netz %1$s ist zu groß: seine Präfixlänge COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Das ist (oder enthält) ein vertrauenswürdiger Proxy der Einstellungen: in der .htaccess-Datei gesperrt, würde jede Anfrage abgewiesen, die über ihn kommt." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="Brute Force Stop konnte seine Sperren nicht aus %s entfernen, das nicht mehr sperrt: der Webserver weist diese Adressen weiter ab, auch wenn ihre Sperren abgelaufen sind. Machen Sie die Datei beschreibbar und entfernen Sie sie von Hand - sie stehen in den <If>-Zeilen zwischen '# BEGIN BFStop Blocks' und '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="Die Sperre ist gespeichert, konnte aber nicht in %s eingetragen werden: Joomla weist die Adresse ab, der Webserver nicht." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="Benutzer {username} hat {ipaddress} in Brute Force Stop gesperrt" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="Benutzer {username} hat die Sperre von {ipaddress} in Brute Force Stop geändert" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="Benutzer {username} hat die Sperren von {ipaddresses} in Brute Force Stop aufgehoben" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="Die Sperre von {ipaddress} in Brute Force Stop wurde mit dem Link einer Entsperr-E-Mail aufgehoben" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="Benutzer {username} hat {ipaddress} zur Erlaubnisliste von Brute Force Stop hinzugefügt" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="Benutzer {username} hat den Eintrag {ipaddress} der Erlaubnisliste von Brute Force Stop geändert" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="Benutzer {username} hat {ipaddresses} aus der Erlaubnisliste von Brute Force Stop entfernt" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="Benutzer {username} hat {ipaddress} in der .htaccess-Datei gesperrt" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="Benutzer {username} hat {ipaddresses} aus der .htaccess-Datei entfernt" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="Benutzer {username} hat die Einstellungen von Brute Force Stop geändert: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="Benutzer {username} hat {count} Einträge, die älter als {days} Tage sind, aus dem Log von Brute Force Stop gelöscht" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="Benutzer {username} hat das Log von Brute Force Stop geleert" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="Benutzer {username} hat {count} fehlgeschlagene Logins, die älter als {days} Tage sind, aus Brute Force Stop gelöscht" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="Benutzer {username} hat die Statistiken von {count} Benutzernamen, die seit {days} Tagen nicht mehr vorkamen, aus Brute Force Stop gelöscht" diff --git a/component/admin/language/en-GB/en-GB.com_bfstop.ini b/component/admin/language/en-GB/en-GB.com_bfstop.ini index 158f30d..477acef 100644 --- a/component/admin/language/en-GB/en-GB.com_bfstop.ini +++ b/component/admin/language/en-GB/en-GB.com_bfstop.ini @@ -28,6 +28,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: Failed Logins" COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop: Settings" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="Superuser is using the default username 'admin'. This is a security risk; attackers know that this username exists in many Joomla!-Installations, therefore it is used very commonly in many attacks. To increase security it is recommended to change the username for the Superuser! See also: Joomla! Security and Performance FAQ: Why should I immediately change the name of the default admin user after a new install?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="You're either not using apache server, or the .htaccess file either does not exist, or it is not read- or writeable. Blocking via .htaccess will not work." +COM_BFSTOP_WARNING_HTACCESS_NGINX="This site runs on nginx, which doesn't read .htaccess files: with the blocking mode '%1$s', no address is turned away by the web server, only by BFStop, as with '%2$s'. Choose '%2$s' in the settings; nginx can deny addresses in its own configuration." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="This site runs on LiteSpeed, which reads .htaccess files, but not every directive of Apache: whether it honours the <If> sections BFStop blocks addresses with depends on its edition and version. Check that the web server turns a blocked address away, or choose '%2$s' in the settings." +COM_BFSTOP_HTACCESS_CHECK="Check .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="The web server honours the block section of the .htaccess file in %s: a test request which it should turn away was turned away." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="The web server ignores the block section of the .htaccess file in %s: a test request which it should have turned away got through. Apache has to be allowed to read authorization directives there (AllowOverride AuthConfig, or All). nginx doesn't read .htaccess files, OpenLiteSpeed reads only their rewrite rules, and LiteSpeed Enterprise may not support every directive the block section uses." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="The web server failed on a test file with the directives of the block section (status 500): it doesn't understand them (they need Apache 2.4 or later). The block section would break the site in %s the same way; the web server's error log says more." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="The .htaccess file in %1$s could not be checked: %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="its directory is neither the site's directory nor one in it, so it has no address to try" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="a test directory could not be created there" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="the site could not reach itself over HTTP" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="a test file there could not be fetched (status %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="The bfstop plugin is not installed! Please install the latest bfstop package from the bfstop page or the Joomla Extensions Directory!" COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="Cannot retrieve manifest cache of BFStop component. There seems to be something wrong with your Joomla! installation. Please install the latest bfstop package from the bfstop page or the Joomla Extensions Directory!" COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="BFStop plugin and component seem to be installed in different versions. Please install the latest bfstop package from the bfstop page or the Joomla Extensions Directory!" @@ -48,6 +59,11 @@ COM_BFSTOP_TEST_NOTIFICATION="Test Notification" COM_BFSTOP_TEST_NOTIFICATION_SUCCESS="Sending the test notification seems to have been successful. Please check that you also received an eMail to the abovementioned address!" COM_BFSTOP_TEST_NOTIFICATION_FAILED="Sending the test notification failed (%s)! Please check your eMail configuration in the Joomla! configuration; also check that you have entered a (correct) email address and/or have chosen a user or group in the plugin configuration." COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="About" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Check with your request" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="Your browser's request reached the web server from %s." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="It carried the header %1$s: %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="It carried none of the forwarding headers BFStop knows." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="With the saved settings, BFStop takes your address to be %s. If that isn't the address your computer has on the internet (it is your proxy's, say), the settings on this tab don't fit your site yet." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Component version: %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Plugin version: %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="unknown" @@ -130,7 +146,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="How many risk points to add when the COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Progressive Block Duration" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="If enabled, each time the same IP address gets blocked again, the block duration is doubled compared to the previous block (up to a 64x cap), instead of always using the same fixed duration. Still bounded above by the permanent-block escalation configured below." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Block Mode" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="What happens once an IP address is blocked. 'Reporting Only' never actually restricts anything - failed attempts are still logged, but no IP is ever blocked, so use this to observe activity before enforcing anything. 'Login Only' lets the IP keep browsing the site normally (including viewing the login form) and only rejects the login attempt itself - closer to how a login-attempt limiter typically behaves, and less disruptive for a legitimate user who just mistyped their password. 'Full Site' denies every request from the blocked IP address and shows the message configured below. 'Full Site + .htaccess' does the same, and additionally adds the IP to .htaccess so the web server itself denies it before Joomla (and this plugin) ever sees the request - this also means an IP blocked this way can't be restricted to logins only, so it's not offered together with 'Login Only'. Such an address only reaches the unblock page of an unblock email: the password reset, the blocked message configured below and the rest of the site are out of its reach. Applies to every block, whether created automatically or added manually in the Blocklist." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="What happens once an IP address is blocked. 'Reporting Only' never actually restricts anything - failed attempts are still logged, but no IP is ever blocked, so use this to observe activity before enforcing anything. 'Login Only' lets the IP keep browsing the site normally (including viewing the login form) and only rejects the login attempt itself - closer to how a login-attempt limiter typically behaves, and less disruptive for a legitimate user who just mistyped their password. 'Full Site' denies every request from the blocked IP address and shows the message configured below. 'Full Site + .htaccess' does the same, and additionally adds the IP to .htaccess so the web server itself denies it before Joomla (and this plugin) ever sees the request - this also means an IP blocked this way can't be restricted to logins only, so it's not offered together with 'Login Only'. Such an address only reaches the unblock page of an unblock email: the password reset, the blocked message configured below and the rest of the site are out of its reach. Applies to every block, whether created automatically or added manually in the Blocklist. 'Login Only' recognises the login forms of Joomla's own frontend and backend (com_users, com_login) and logins with credentials through the Web Services API. A blocked address can still log in through extensions which log users in themselves (social or single sign-on logins, login modules posting to a controller of their own, passkeys): if your site offers such logins, choose 'Full Site'." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Reporting Only" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Login Only" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Full Site" @@ -205,6 +221,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Clear" COM_BFSTOP_LOG_CLEARED="The log was cleared." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Unblock links can only be sent if the site's address is set ($live_site in the site's configuration.php). Set it there, or turn the unblock links off." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) must not be higher than \"%3$s\" (%4$d): every client would get %2$d attempts. Lower \"%1$s\", or raise \"%3$s\"." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="This site runs on nginx, which doesn't read .htaccess files: the blocking mode '%1$s' can't work here. Choose '%2$s'; nginx can deny addresses in its own configuration." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="nginx Deny File" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Only for sites served by nginx, which doesn't read .htaccess files: a file (an absolute path, ending in .conf) which BFStop keeps the active blocks in, as 'deny' lines, for the server block of the site's nginx configuration to include. nginx reads it only when it is reloaded: have it reloaded when the file changes (e.g. with a systemd path unit, or a cron job running 'nginx -t && nginx -s reload'). Addresses of the allow list and trusted proxies are left out. Empty: no such file." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="Not a file BFStop can write as the nginx deny file: %1$s. It has to be an absolute path of a file whose name ends in %2$s." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="The directory of the nginx deny file %1$s doesn't exist, or can't be written to." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s exists, and was not written by BFStop: it would be overwritten. Choose a new file." COM_BFSTOP_WARNING_NO_LIVE_SITE="The site's address is not set ($live_site in configuration.php). Joomla! then builds the links in the emails of Brute Force Stop from the host named by each request, which a visitor can choose freely - so no unblock links are sent, and the notifications to the administrators name no address. To set the address, add this line to the class in the site's configuration.php, with the address under which the site is reached (proposed from this request, please check it): %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Unblock links are to be sent (settings), but the site's address is not set ($live_site in configuration.php): no unblock links are sent." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recommended)" @@ -214,3 +236,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="The network %1$s is too large: its prefix lengt COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="This is (or contains) a trusted proxy of the settings: blocked in the .htaccess file, every request coming through it would be turned away." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="Brute Force Stop could not take its blocks out of %s, which no longer blocks: the web server goes on refusing these addresses, also once their blocks are over. Make the file writable and remove them by hand - they are in the <If> lines between '# BEGIN BFStop Blocks' and '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="The block is saved, but could not be added to %s: Joomla turns the address away, the web server doesn't." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="User {username} blocked {ipaddress} in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="User {username} changed the block of {ipaddress} in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="User {username} lifted the blocks of {ipaddresses} in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="The block of {ipaddress} in Brute Force Stop was lifted with the link of an unblock mail" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="User {username} added {ipaddress} to the allow list of Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="User {username} changed the entry {ipaddress} of the allow list of Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="User {username} removed {ipaddresses} from the allow list of Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="User {username} blocked {ipaddress} in the .htaccess file" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="User {username} removed {ipaddresses} from the .htaccess file" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="User {username} changed the settings of Brute Force Stop: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="User {username} deleted {count} entries older than {days} days from the log of Brute Force Stop" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="User {username} cleared the log of Brute Force Stop" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="User {username} deleted {count} failed logins older than {days} days from Brute Force Stop" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="User {username} deleted the statistics of {count} user names not seen for {days} days from Brute Force Stop" diff --git a/component/admin/language/es-ES/es-ES.com_bfstop.ini b/component/admin/language/es-ES/es-ES.com_bfstop.ini index 7c380dd..46632e7 100644 --- a/component/admin/language/es-ES/es-ES.com_bfstop.ini +++ b/component/admin/language/es-ES/es-ES.com_bfstop.ini @@ -28,6 +28,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: Entradas al sistema Fracas COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop: Ajustes" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="Super-usuario está utilizando el valor predeterminado para el nombre de usuario 'admin'. Este es un riesgo de seguridad, los atacantes saben que este nombre de usuario ya existe en Joomla!-instalación, por lo tanto, se utiliza muy frecuentemente en muchos de los ataques. Para aumentar la seguridad, se recomienda cambiar el nombre de usuario para el superusuario. Ver también: Joomla! Security and Performance FAQ: Why should I immediately change the name of the default admin user after a new install?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="O bien no está utilizando un servidor Apache, o bien el archivo .htaccess no existe o no se puede leer o escribir. El bloqueo mediante .htaccess no funcionará." +COM_BFSTOP_WARNING_HTACCESS_NGINX="Este sitio funciona con nginx, que no lee los archivos .htaccess: con el modo de bloqueo «%1$s», el servidor web no rechaza ninguna dirección, solo lo hace BFStop, como con «%2$s». Elija «%2$s» en los ajustes; nginx puede denegar direcciones en su propia configuración." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="Este sitio funciona con LiteSpeed, que lee los archivos .htaccess, pero no todas las directivas de Apache: que respete las secciones <If> con las que BFStop bloquea direcciones depende de su edición y versión. Compruebe que el servidor web rechaza una dirección bloqueada, o elija «%2$s» en los ajustes." +COM_BFSTOP_HTACCESS_CHECK="Comprobar .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="El servidor web respeta la sección de bloqueos del archivo .htaccess en %s: una solicitud de prueba que debe rechazar fue rechazada." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="El servidor web ignora la sección de bloqueos del archivo .htaccess en %s: una solicitud de prueba que debería haber rechazado pasó. Apache debe poder leer allí las directivas de autorización (AllowOverride AuthConfig, o All). nginx no lee los archivos .htaccess, OpenLiteSpeed solo lee sus reglas de reescritura y puede que LiteSpeed Enterprise no admita todas las directivas que usa la sección de bloqueos." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="El servidor web falló con un archivo de prueba con las directivas de la sección de bloqueos (estado 500): no las entiende (necesitan Apache 2.4 o posterior). La sección de bloqueos rompería el sitio en %s de la misma manera; el registro de errores del servidor web da más detalles." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="No se pudo comprobar el archivo .htaccess en %1$s: %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="su directorio no es el directorio del sitio ni uno dentro de él, así que no tiene una dirección que probar" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="no se pudo crear allí un directorio de prueba" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="el sitio no pudo acceder a sí mismo por HTTP" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="no se pudo obtener allí un archivo de prueba (estado %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="¡El plugin bfstop no está instalado! Instale el último paquete de bfstop desde la página de bfstop o desde el Directorio de extensiones de Joomla." COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="No se puede obtener la caché del manifiesto del componente BFStop. Parece que hay algún problema con su instalación de Joomla!. Instale el último paquete de bfstop desde la página de bfstop o desde el Directorio de extensiones de Joomla." COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="Parece que el plugin y el componente de BFStop están instalados en versiones diferentes. Instale el último paquete de bfstop desde la página de bfstop o desde el Directorio de extensiones de Joomla." @@ -48,6 +59,11 @@ COM_BFSTOP_TEST_NOTIFICATION="Notificación de Prueba" COM_BFSTOP_TEST_NOTIFICATION_SUCCESS="El envío de la notificación de prueba ha tenido éxito. Compruebe que ha recibido un mensaje de correo electrónico a la dirección antes mencionada!" COM_BFSTOP_TEST_NOTIFICATION_FAILED="El envío de notificación de prueba ha fallado (%s)! Por favor, compruebe la configuración de correo electrónico en el Joomla! configuration!" COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="Acerca de" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Comprobación con su solicitud" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="La solicitud de su navegador llegó al servidor web desde %s." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="Llevaba la cabecera %1$s: %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="No llevaba ninguna de las cabeceras de reenvío que BFStop conoce." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="Con los ajustes guardados, BFStop considera que su dirección es %s. Si esa no es la dirección que su equipo tiene en Internet (por ejemplo, es la de su proxy), los ajustes de esta pestaña aún no se ajustan a su sitio." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Versión del componente: %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Versión del plugin: %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="desconocida" @@ -130,7 +146,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="Cuántos puntos de riesgo se suman cu COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Duración progresiva del bloqueo" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="Si está activada, cada vez que la misma dirección IP vuelve a ser bloqueada, la duración del bloqueo se duplica respecto al bloqueo anterior (hasta un máximo de 64 veces), en lugar de usar siempre la misma duración fija. Sigue estando limitada por el paso a bloqueo permanente configurado más abajo." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Modo de bloqueo" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Qué ocurre cuando se bloquea una dirección IP. «Solo informes» nunca restringe nada: los intentos fallidos se siguen registrando, pero no se bloquea ninguna IP, así que úselo para observar la actividad antes de aplicar nada. «Solo inicio de sesión» deja que la IP siga navegando con normalidad por el sitio (incluido ver el formulario de acceso) y solo rechaza el propio intento de inicio de sesión; se parece más al comportamiento habitual de un limitador de intentos de acceso y molesta menos a un usuario legítimo que simplemente ha escrito mal su contraseña. «Todo el sitio» deniega todas las solicitudes de la dirección IP bloqueada y muestra el mensaje configurado más abajo. «Todo el sitio + .htaccess» hace lo mismo y además añade la IP a .htaccess para que el propio servidor web la deniegue antes de que Joomla (y este plugin) llegue a ver la solicitud; esto también significa que una IP bloqueada así no se puede limitar solo al inicio de sesión, por lo que no se ofrece junto con «Solo inicio de sesión». Una dirección bloqueada así solo llega a la página de desbloqueo de un correo de desbloqueo: el restablecimiento de la contraseña, el mensaje configurado más abajo y el resto del sitio quedan fuera de su alcance. Se aplica a todos los bloqueos, tanto los creados automáticamente como los añadidos manualmente en la lista de bloqueos." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Qué ocurre cuando se bloquea una dirección IP. «Solo informes» nunca restringe nada: los intentos fallidos se siguen registrando, pero no se bloquea ninguna IP, así que úselo para observar la actividad antes de aplicar nada. «Solo inicio de sesión» deja que la IP siga navegando con normalidad por el sitio (incluido ver el formulario de acceso) y solo rechaza el propio intento de inicio de sesión; se parece más al comportamiento habitual de un limitador de intentos de acceso y molesta menos a un usuario legítimo que simplemente ha escrito mal su contraseña. «Todo el sitio» deniega todas las solicitudes de la dirección IP bloqueada y muestra el mensaje configurado más abajo. «Todo el sitio + .htaccess» hace lo mismo y además añade la IP a .htaccess para que el propio servidor web la deniegue antes de que Joomla (y este plugin) llegue a ver la solicitud; esto también significa que una IP bloqueada así no se puede limitar solo al inicio de sesión, por lo que no se ofrece junto con «Solo inicio de sesión». Una dirección bloqueada así solo llega a la página de desbloqueo de un correo de desbloqueo: el restablecimiento de la contraseña, el mensaje configurado más abajo y el resto del sitio quedan fuera de su alcance. Se aplica a todos los bloqueos, tanto los creados automáticamente como los añadidos manualmente en la lista de bloqueos. «Solo inicio de sesión» reconoce los formularios de inicio de sesión del frontend y el backend propios de Joomla (com_users, com_login) y los inicios de sesión con credenciales a través de la API de servicios web. Una dirección bloqueada aún puede iniciar sesión mediante extensiones que inician la sesión de los usuarios por sí mismas (inicios de sesión sociales o de inicio de sesión único, módulos de inicio de sesión que envían a un controlador propio, llaves de acceso): si su sitio ofrece este tipo de inicios de sesión, elija «Todo el sitio»." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Solo informes" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Solo inicio de sesión" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Todo el sitio" @@ -205,6 +221,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Vaciar" COM_BFSTOP_LOG_CLEARED="Se ha vaciado el registro." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Los enlaces de desbloqueo solo se pueden enviar si la dirección del sitio está definida ($live_site en el configuration.php del sitio). Defínala allí, o desactive los enlaces de desbloqueo." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) no puede ser mayor que \"%3$s\" (%4$d): cada cliente tendría %2$d intentos. Reduzca \"%1$s\", o aumente \"%3$s\"." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="Este sitio funciona con nginx, que no lee los archivos .htaccess: el modo de bloqueo «%1$s» no puede funcionar aquí. Elija «%2$s»; nginx puede denegar direcciones en su propia configuración." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="Archivo de denegación de nginx" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Solo para sitios servidos por nginx, que no lee los archivos .htaccess: un archivo (una ruta absoluta, terminada en .conf) en el que BFStop mantiene los bloqueos activos, como líneas «deny», para que el bloque server de la configuración de nginx del sitio lo incluya. nginx solo lo lee al recargarse: haga que se recargue cuando el archivo cambie (p. ej., con una unidad path de systemd o una tarea cron que ejecute «nginx -t && nginx -s reload»). Se omiten las direcciones de la lista de permitidos y los proxies de confianza. Vacío: ningún archivo." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="No es un archivo que BFStop pueda escribir como archivo de denegación de nginx: %1$s. Debe ser la ruta absoluta de un archivo cuyo nombre termine en %2$s." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="El directorio del archivo de denegación de nginx %1$s no existe o no se puede escribir en él." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s existe y no lo escribió BFStop: se sobrescribiría. Elija un archivo nuevo." COM_BFSTOP_WARNING_NO_LIVE_SITE="La dirección del sitio no está definida ($live_site en configuration.php). Entonces Joomla! construye los enlaces de los correos de Brute Force Stop con el host indicado en cada petición, que un visitante puede elegir libremente - por eso no se envían enlaces de desbloqueo y las notificaciones a los administradores no indican ninguna dirección. Para definir la dirección, añada esta línea a la clase del configuration.php del sitio, con la dirección en la que se accede al sitio (propuesta a partir de esta petición, compruébela): %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Se deben enviar enlaces de desbloqueo (configuración), pero la dirección del sitio no está definida ($live_site en configuration.php): no se envían enlaces de desbloqueo." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recomendado)" @@ -214,3 +236,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="La red %1$s es demasiado grande: la longitud de COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Esto es (o contiene) un proxy de confianza de la configuración: bloqueado en el archivo .htaccess, se rechazaría cualquier petición que pase por él." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="Brute Force Stop no pudo quitar sus bloqueos de %s, que ya no bloquea: el servidor web sigue rechazando estas direcciones, también cuando sus bloqueos han terminado. Haga el archivo escribible y quítelas a mano - están en las líneas <If> entre '# BEGIN BFStop Blocks' y '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="El bloqueo se ha guardado, pero no se pudo añadir a %s: Joomla rechaza la dirección, el servidor web no." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="El usuario {username} bloqueó {ipaddress} en Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="El usuario {username} modificó el bloqueo de {ipaddress} en Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="El usuario {username} levantó los bloqueos de {ipaddresses} en Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="El bloqueo de {ipaddress} en Brute Force Stop se levantó con el enlace de un correo de desbloqueo" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="El usuario {username} añadió {ipaddress} a la lista de permitidos de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="El usuario {username} modificó la entrada {ipaddress} de la lista de permitidos de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="El usuario {username} quitó {ipaddresses} de la lista de permitidos de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="El usuario {username} bloqueó {ipaddress} en el archivo .htaccess" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="El usuario {username} quitó {ipaddresses} del archivo .htaccess" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="El usuario {username} modificó los ajustes de Brute Force Stop: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="El usuario {username} eliminó {count} entradas de más de {days} días del registro de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="El usuario {username} vació el registro de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="El usuario {username} eliminó {count} inicios de sesión fallidos de más de {days} días de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="El usuario {username} eliminó las estadísticas de {count} nombres de usuario no vistos en {days} días de Brute Force Stop" diff --git a/component/admin/language/fr-FR/fr-FR.com_bfstop.ini b/component/admin/language/fr-FR/fr-FR.com_bfstop.ini index ff7ce66..bdba277 100644 --- a/component/admin/language/fr-FR/fr-FR.com_bfstop.ini +++ b/component/admin/language/fr-FR/fr-FR.com_bfstop.ini @@ -29,6 +29,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: connexions échouées" COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop : configuration" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="Le profil 'SuperUtilisateur' est attribué à l'utilisateur 'admin'. Cette attribution constitue un risque important en terme de sécurité; les pirates savent que ce nom d'utilisateur est commun et notamment utilisé dans Joomla. Pour améliorer la sécurité, il est vivement recommandé de changer le nom d'utilisateur auquel il est attribué un profil d'administrateur 'SuperUtilisateur'! Consultez également: Joomla! Sécurity et Performance FAQ: Pourquoi changer le nom de l'utilisateur administrateur après une nouvelle installation?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="Soit vous n'utilisez pas un serveur Apache, soit le fichier .htaccess n'existe pas ou n'est pas lisible ou modifiable. Le blocage via .htaccess ne fonctionnera pas." +COM_BFSTOP_WARNING_HTACCESS_NGINX="Ce site fonctionne avec nginx, qui ne lit pas les fichiers .htaccess : avec le mode de blocage « %1$s », aucune adresse n'est refusée par le serveur web, seulement par BFStop, comme avec « %2$s ». Choisissez « %2$s » dans les paramètres ; nginx peut refuser des adresses dans sa propre configuration." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="Ce site fonctionne avec LiteSpeed, qui lit les fichiers .htaccess, mais pas toutes les directives d'Apache : qu'il respecte les sections <If> avec lesquelles BFStop bloque les adresses dépend de son édition et de sa version. Vérifiez que le serveur web refuse une adresse bloquée, ou choisissez « %2$s » dans les paramètres." +COM_BFSTOP_HTACCESS_CHECK="Vérifier .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="Le serveur web respecte la section de blocage du fichier .htaccess dans %s : une requête de test qu'il doit refuser a été refusée." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="Le serveur web ignore la section de blocage du fichier .htaccess dans %s : une requête de test qu'il aurait dû refuser est passée. Apache doit pouvoir y lire les directives d'autorisation (AllowOverride AuthConfig, ou All). nginx ne lit pas les fichiers .htaccess, OpenLiteSpeed n'en lit que les règles de réécriture, et LiteSpeed Enterprise ne prend peut-être pas en charge toutes les directives qu'utilise la section de blocage." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="Le serveur web a échoué sur un fichier de test contenant les directives de la section de blocage (statut 500) : il ne les comprend pas (elles nécessitent Apache 2.4 ou ultérieur). La section de blocage casserait le site dans %s de la même manière ; le journal d'erreurs du serveur web en dit plus." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="Le fichier .htaccess dans %1$s n'a pas pu être vérifié : %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="son dossier n'est ni le dossier du site ni un dossier qu'il contient, il n'a donc pas d'adresse à essayer" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="aucun dossier de test n'a pu y être créé" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="le site n'a pas pu s'atteindre lui-même en HTTP" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="un fichier de test n'a pas pu y être récupéré (statut %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="Le plugin bfstop n'est pas installé ! Veuillez installer le dernier paquet bfstop depuis la page de bfstop ou depuis le répertoire des extensions Joomla !" COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="Impossible de récupérer le cache du manifeste du composant BFStop. Il semble y avoir un problème avec votre installation de Joomla!. Veuillez installer le dernier paquet bfstop depuis la page de bfstop ou depuis le répertoire des extensions Joomla !" COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="Le plugin et le composant BFStop semblent installés dans des versions différentes. Veuillez installer le dernier paquet bfstop depuis la page de bfstop ou depuis le répertoire des extensions Joomla !" @@ -48,6 +59,11 @@ COM_BFSTOP_BLOCKED_UNTIL="Bloquée jusqu'à %s" COM_BFSTOP_BLOCK_EXPIRED_AT="Expiration du blocage le %s" COM_BFSTOP_UNBLOCKED_STATE="Débloquée le %s" COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="À propos" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Vérification avec votre requête" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="La requête de votre navigateur est arrivée au serveur web depuis %s." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="Elle contenait l'en-tête %1$s : %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="Elle ne contenait aucun des en-têtes de transfert que BFStop connaît." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="Avec les paramètres enregistrés, BFStop considère que votre adresse est %s. Si ce n'est pas l'adresse de votre ordinateur sur Internet (c'est celle de votre proxy, par exemple), les paramètres de cet onglet ne conviennent pas encore à votre site." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Version du composant : %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Version du plugin : %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="inconnue" @@ -138,7 +154,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="Nombre de points de risque à ajouter COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Durée de blocage progressive" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="Si activé, chaque fois que la même adresse IP est de nouveau bloquée, la durée du blocage est doublée par rapport au blocage précédent (dans la limite de 64 fois), au lieu d'utiliser toujours la même durée fixe. Elle reste bornée par le passage au blocage permanent configuré ci-dessous." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Mode de blocage" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Ce qui se passe lorsqu'une adresse IP est bloquée. « Rapport seulement » ne restreint jamais rien : les tentatives échouées sont toujours journalisées, mais aucune adresse IP n'est bloquée ; utilisez ce mode pour observer l'activité avant d'appliquer quoi que ce soit. « Connexion seulement » laisse l'adresse IP naviguer normalement sur le site (y compris afficher le formulaire de connexion) et ne rejette que la tentative de connexion elle-même ; c'est plus proche du comportement habituel d'un limiteur de tentatives de connexion et moins gênant pour un utilisateur légitime qui s'est simplement trompé de mot de passe. « Site entier » refuse toutes les requêtes de l'adresse IP bloquée et affiche le message configuré ci-dessous. « Site entier + .htaccess » fait de même et ajoute en plus l'adresse IP à .htaccess afin que le serveur web lui-même la refuse avant que Joomla (et ce plugin) ne voie la requête ; une adresse IP bloquée ainsi ne peut donc pas être limitée à la connexion, et ce mode n'est pas proposé avec « Connexion seulement ». Une adresse bloquée ainsi n'atteint plus que la page de déblocage d'un e-mail de déblocage : la réinitialisation du mot de passe, le message configuré ci-dessous et le reste du site lui restent inaccessibles. S'applique à tous les blocages, qu'ils soient créés automatiquement ou ajoutés manuellement dans la liste de blocage." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Ce qui se passe lorsqu'une adresse IP est bloquée. « Rapport seulement » ne restreint jamais rien : les tentatives échouées sont toujours journalisées, mais aucune adresse IP n'est bloquée ; utilisez ce mode pour observer l'activité avant d'appliquer quoi que ce soit. « Connexion seulement » laisse l'adresse IP naviguer normalement sur le site (y compris afficher le formulaire de connexion) et ne rejette que la tentative de connexion elle-même ; c'est plus proche du comportement habituel d'un limiteur de tentatives de connexion et moins gênant pour un utilisateur légitime qui s'est simplement trompé de mot de passe. « Site entier » refuse toutes les requêtes de l'adresse IP bloquée et affiche le message configuré ci-dessous. « Site entier + .htaccess » fait de même et ajoute en plus l'adresse IP à .htaccess afin que le serveur web lui-même la refuse avant que Joomla (et ce plugin) ne voie la requête ; une adresse IP bloquée ainsi ne peut donc pas être limitée à la connexion, et ce mode n'est pas proposé avec « Connexion seulement ». Une adresse bloquée ainsi n'atteint plus que la page de déblocage d'un e-mail de déblocage : la réinitialisation du mot de passe, le message configuré ci-dessous et le reste du site lui restent inaccessibles. S'applique à tous les blocages, qu'ils soient créés automatiquement ou ajoutés manuellement dans la liste de blocage. « Connexion seulement » reconnaît les formulaires de connexion du frontend et du backend de Joomla lui-même (com_users, com_login) et les connexions avec identifiants via l'API des services web. Une adresse bloquée peut toujours se connecter par des extensions qui connectent elles-mêmes les utilisateurs (connexions via réseaux sociaux ou authentification unique, modules de connexion qui envoient à leur propre contrôleur, clés d'accès) : si votre site propose de telles connexions, choisissez « Site entier »." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Rapport seulement" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Connexion seulement" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Site entier" @@ -213,6 +229,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Vider" COM_BFSTOP_LOG_CLEARED="Le journal a été vidé." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Les liens de déblocage ne peuvent être envoyés que si l'adresse du site est définie ($live_site dans le fichier configuration.php du site). Définissez-la, ou désactivez les liens de déblocage." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="« %1$s » (%2$d) ne doit pas être supérieur à « %3$s » (%4$d) : chaque client aurait %2$d tentatives. Diminuez « %1$s », ou augmentez « %3$s »." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="Ce site fonctionne avec nginx, qui ne lit pas les fichiers .htaccess : le mode de blocage « %1$s » ne peut pas fonctionner ici. Choisissez « %2$s » ; nginx peut refuser des adresses dans sa propre configuration." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="Fichier de refus nginx" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Uniquement pour les sites servis par nginx, qui ne lit pas les fichiers .htaccess : un fichier (un chemin absolu, se terminant par .conf) dans lequel BFStop tient les blocages actifs, sous forme de lignes « deny », que le bloc server de la configuration nginx du site doit inclure. nginx ne le lit qu'au rechargement : faites-le recharger quand le fichier change (par exemple avec une unité path systemd ou une tâche cron exécutant « nginx -t && nginx -s reload »). Les adresses de la liste d'autorisation et les proxys de confiance sont omis. Vide : aucun fichier." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="Ce n'est pas un fichier que BFStop peut écrire comme fichier de refus nginx : %1$s. Ce doit être le chemin absolu d'un fichier dont le nom se termine par %2$s." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="Le dossier du fichier de refus nginx %1$s n'existe pas ou n'est pas accessible en écriture." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s existe et n'a pas été écrit par BFStop : il serait écrasé. Choisissez un nouveau fichier." COM_BFSTOP_WARNING_NO_LIVE_SITE="L'adresse du site n'est pas définie ($live_site dans configuration.php). Joomla! construit alors les liens des e-mails de Brute Force Stop à partir de l'hôte indiqué par chaque requête, qu'un visiteur peut choisir librement - c'est pourquoi aucun lien de déblocage n'est envoyé et les notifications aux administrateurs n'indiquent pas d'adresse. Pour définir l'adresse, ajoutez cette ligne à la classe du fichier configuration.php du site, avec l'adresse à laquelle le site est accessible (proposée d'après cette requête, veuillez la vérifier) : %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Des liens de déblocage doivent être envoyés (paramètres), mais l'adresse du site n'est pas définie ($live_site dans configuration.php) : aucun lien de déblocage n'est envoyé." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recommandé)" @@ -222,3 +244,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="Le réseau %1$s est trop grand : la longueur de COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Il s'agit (ou cela contient) d'un proxy de confiance des paramètres : bloqué dans le fichier .htaccess, toute requête passant par lui serait refusée." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="Brute Force Stop n'a pas pu retirer ses blocages de %s, qui ne bloque plus : le serveur web continue de refuser ces adresses, même une fois leurs blocages terminés. Rendez le fichier accessible en écriture et retirez-les à la main - elles se trouvent dans les lignes <If> entre '# BEGIN BFStop Blocks' et '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="Le blocage est enregistré, mais n'a pas pu être ajouté à %s : Joomla refuse l'adresse, le serveur web non." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="L'utilisateur {username} a bloqué {ipaddress} dans Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="L'utilisateur {username} a modifié le blocage de {ipaddress} dans Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="L'utilisateur {username} a levé les blocages de {ipaddresses} dans Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="Le blocage de {ipaddress} dans Brute Force Stop a été levé avec le lien d'un e-mail de déblocage" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="L'utilisateur {username} a ajouté {ipaddress} à la liste d'autorisation de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="L'utilisateur {username} a modifié l'entrée {ipaddress} de la liste d'autorisation de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="L'utilisateur {username} a retiré {ipaddresses} de la liste d'autorisation de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="L'utilisateur {username} a bloqué {ipaddress} dans le fichier .htaccess" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="L'utilisateur {username} a retiré {ipaddresses} du fichier .htaccess" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="L'utilisateur {username} a modifié les paramètres de Brute Force Stop : {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="L'utilisateur {username} a supprimé {count} entrées de plus de {days} jours du journal de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="L'utilisateur {username} a vidé le journal de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="L'utilisateur {username} a supprimé {count} échecs de connexion de plus de {days} jours de Brute Force Stop" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="L'utilisateur {username} a supprimé les statistiques de {count} identifiants non vus depuis {days} jours de Brute Force Stop" diff --git a/component/admin/language/it-IT/it-IT.com_bfstop.ini b/component/admin/language/it-IT/it-IT.com_bfstop.ini index 87de659..f04f9d6 100644 --- a/component/admin/language/it-IT/it-IT.com_bfstop.ini +++ b/component/admin/language/it-IT/it-IT.com_bfstop.ini @@ -28,6 +28,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: Accessi Falliti" COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop: Configurazione" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="Il Superuser sta usando il nome utente 'admin' predefinito. Questo è un rischio per la sicurezza; gli attaccanti sanno che questo nome utente esiste in molte installazioni Joomla!, e viene utilizzato spesso in molti attacchi. Per aumentare la sicurezza si consiglia di modificare il nome utente per il Superuser! Vedi anche:Joomla! Security and Performance FAQ: Why should I immediately change the name of the default admin user after a new install?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="O non stai usando un server Apache, oppure il file .htaccess non esiste o non è leggibile o scrivibile. Il blocco tramite .htaccess non funzionerà." +COM_BFSTOP_WARNING_HTACCESS_NGINX="Questo sito gira su nginx, che non legge i file .htaccess: con la modalità di blocco «%1$s» nessun indirizzo viene respinto dal server web, ma solo da BFStop, come con «%2$s». Scegli «%2$s» nelle impostazioni; nginx può negare indirizzi nella propria configurazione." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="Questo sito gira su LiteSpeed, che legge i file .htaccess, ma non tutte le direttive di Apache: se rispetta le sezioni <If> con cui BFStop blocca gli indirizzi dipende dalla sua edizione e versione. Verifica che il server web respinga un indirizzo bloccato, oppure scegli «%2$s» nelle impostazioni." +COM_BFSTOP_HTACCESS_CHECK="Verifica .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="Il server web rispetta la sezione dei blocchi del file .htaccess in %s: una richiesta di prova che deve respingere è stata respinta." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="Il server web ignora la sezione dei blocchi del file .htaccess in %s: una richiesta di prova che avrebbe dovuto respingere è passata. Apache deve poter leggere lì le direttive di autorizzazione (AllowOverride AuthConfig, oppure All). nginx non legge i file .htaccess, OpenLiteSpeed ne legge solo le regole di riscrittura e LiteSpeed Enterprise potrebbe non supportare tutte le direttive usate dalla sezione dei blocchi." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="Il server web è andato in errore su un file di prova con le direttive della sezione dei blocchi (stato 500): non le comprende (richiedono Apache 2.4 o successivo). La sezione dei blocchi bloccherebbe il sito in %s allo stesso modo; il log degli errori del server web dice di più." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="Non è stato possibile verificare il file .htaccess in %1$s: %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="la sua cartella non è la cartella del sito né una al suo interno, quindi non c'è un indirizzo da provare" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="non è stato possibile creare lì una cartella di prova" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="il sito non è riuscito a raggiungere sé stesso via HTTP" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="non è stato possibile ottenere lì un file di prova (stato %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="Il plugin bfstop non è installato! Installa l'ultimo pacchetto di bfstop dalla pagina di bfstop o dalla Joomla Extensions Directory!" COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="Impossibile leggere la cache del manifest del componente BFStop. Sembra che ci sia qualcosa che non va nella tua installazione di Joomla!. Installa l'ultimo pacchetto di bfstop dalla pagina di bfstop o dalla Joomla Extensions Directory!" COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="Il plugin e il componente BFStop sembrano installati in versioni diverse. Installa l'ultimo pacchetto di bfstop dalla pagina di bfstop o dalla Joomla Extensions Directory!" @@ -48,6 +59,11 @@ COM_BFSTOP_TEST_NOTIFICATION="Notifica di Prova" COM_BFSTOP_TEST_NOTIFICATION_SUCCESS="L'invio della notifica di prova sembra aver avuto successo. Si prega di verificare che è anche arrivata una e-mail all'indirizzo indicato sopra!" COM_BFSTOP_TEST_NOTIFICATION_FAILED="L'invio della notifica di prova è fallito (%s)! Si prega di controllare le Impostazioni Mail nella configurazione di Joomla!; la configurazione di notifica di questo plugin; e l'indirizzo e-mail per l'utente scelto nella configurazione del plugin." COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="Informazioni" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Verifica con la tua richiesta" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="La richiesta del tuo browser è arrivata al server web da %s." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="Conteneva l'header %1$s: %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="Non conteneva nessuno degli header di inoltro che BFStop conosce." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="Con le impostazioni salvate, BFStop considera %s il tuo indirizzo. Se non è l'indirizzo che il tuo computer ha su Internet (per esempio è quello del tuo proxy), le impostazioni di questa scheda non sono ancora adatte al tuo sito." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Versione del componente: %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Versione del plugin: %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="sconosciuta" @@ -130,7 +146,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="Quanti punti di rischio aggiungere qu COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Durata progressiva del blocco" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="Se attivo, ogni volta che lo stesso indirizzo IP viene bloccato di nuovo, la durata del blocco raddoppia rispetto al blocco precedente (fino a un massimo di 64 volte), invece di usare sempre la stessa durata fissa. Rimane comunque limitata dal passaggio al blocco permanente configurato sotto." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Modalità di blocco" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Cosa succede quando un indirizzo IP viene bloccato. «Solo segnalazione» non limita mai nulla: i tentativi falliti vengono comunque registrati, ma nessun IP viene bloccato, quindi usala per osservare l'attività prima di applicare qualsiasi restrizione. «Solo accesso» lascia che l'IP continui a navigare normalmente sul sito (compreso il modulo di accesso) e rifiuta solo il tentativo di accesso in sé: è più vicino al comportamento tipico di un limitatore di tentativi di accesso e disturba meno un utente legittimo che ha semplicemente sbagliato la password. «Intero sito» rifiuta ogni richiesta dall'indirizzo IP bloccato e mostra il messaggio configurato sotto. «Intero sito + .htaccess» fa lo stesso e in più aggiunge l'IP a .htaccess, così il server web stesso lo rifiuta prima che Joomla (e questo plugin) veda la richiesta; questo significa anche che un IP bloccato in questo modo non può essere limitato al solo accesso, perciò non viene offerto insieme a «Solo accesso». Un indirizzo bloccato così raggiunge solo la pagina di sblocco di un'email di sblocco: il ripristino della password, il messaggio configurato sotto e il resto del sito restano fuori dalla sua portata. Vale per ogni blocco, sia creato automaticamente sia aggiunto a mano nella lista dei blocchi." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Cosa succede quando un indirizzo IP viene bloccato. «Solo segnalazione» non limita mai nulla: i tentativi falliti vengono comunque registrati, ma nessun IP viene bloccato, quindi usala per osservare l'attività prima di applicare qualsiasi restrizione. «Solo accesso» lascia che l'IP continui a navigare normalmente sul sito (compreso il modulo di accesso) e rifiuta solo il tentativo di accesso in sé: è più vicino al comportamento tipico di un limitatore di tentativi di accesso e disturba meno un utente legittimo che ha semplicemente sbagliato la password. «Intero sito» rifiuta ogni richiesta dall'indirizzo IP bloccato e mostra il messaggio configurato sotto. «Intero sito + .htaccess» fa lo stesso e in più aggiunge l'IP a .htaccess, così il server web stesso lo rifiuta prima che Joomla (e questo plugin) veda la richiesta; questo significa anche che un IP bloccato in questo modo non può essere limitato al solo accesso, perciò non viene offerto insieme a «Solo accesso». Un indirizzo bloccato così raggiunge solo la pagina di sblocco di un'email di sblocco: il ripristino della password, il messaggio configurato sotto e il resto del sito restano fuori dalla sua portata. Vale per ogni blocco, sia creato automaticamente sia aggiunto a mano nella lista dei blocchi. «Solo accesso» riconosce i moduli di accesso del frontend e del backend di Joomla stesso (com_users, com_login) e gli accessi con credenziali tramite l'API dei servizi web. Un indirizzo bloccato può comunque accedere tramite estensioni che effettuano l'accesso degli utenti da sé (accessi social o single sign-on, moduli di accesso che inviano a un proprio controller, passkey): se il tuo sito offre questo tipo di accesso, scegli «Intero sito»." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Solo segnalazione" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Solo accesso" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Intero sito" @@ -205,6 +221,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Svuota" COM_BFSTOP_LOG_CLEARED="Il log è stato svuotato." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="I link di sblocco possono essere inviati solo se l'indirizzo del sito è impostato ($live_site nel configuration.php del sito). Impostalo lì, oppure disattiva i link di sblocco." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) non può essere superiore a \"%3$s\" (%4$d): ogni client avrebbe %2$d tentativi. Riduci \"%1$s\", oppure aumenta \"%3$s\"." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="Questo sito gira su nginx, che non legge i file .htaccess: la modalità di blocco «%1$s» qui non può funzionare. Scegli «%2$s»; nginx può negare indirizzi nella propria configurazione." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="File di negazione di nginx" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Solo per siti serviti da nginx, che non legge i file .htaccess: un file (un percorso assoluto, che termina in .conf) in cui BFStop tiene i blocchi attivi, come righe «deny», perché il blocco server della configurazione nginx del sito lo includa. nginx lo legge solo quando viene ricaricato: fai in modo che venga ricaricato quando il file cambia (per esempio con una unit path di systemd o un cron job che esegua «nginx -t && nginx -s reload»). Gli indirizzi della lista dei consentiti e i proxy fidati sono esclusi. Vuoto: nessun file." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="Non è un file che BFStop possa scrivere come file di negazione di nginx: %1$s. Deve essere il percorso assoluto di un file il cui nome termina in %2$s." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="La cartella del file di negazione di nginx %1$s non esiste o non è scrivibile." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s esiste e non è stato scritto da BFStop: verrebbe sovrascritto. Scegli un file nuovo." COM_BFSTOP_WARNING_NO_LIVE_SITE="L'indirizzo del sito non è impostato ($live_site in configuration.php). Joomla! costruisce allora i link nelle email di Brute Force Stop dall'host indicato in ogni richiesta, che un visitatore può scegliere liberamente - per questo non vengono inviati link di sblocco e le notifiche agli amministratori non indicano alcun indirizzo. Per impostare l'indirizzo, aggiungi questa riga alla classe nel configuration.php del sito, con l'indirizzo con cui si raggiunge il sito (proposto in base a questa richiesta, verificalo): %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="I link di sblocco devono essere inviati (impostazioni), ma l'indirizzo del sito non è impostato ($live_site in configuration.php): non viene inviato alcun link di sblocco." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (consigliato)" @@ -214,3 +236,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="La rete %1$s è troppo grande: la lunghezza del COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Questo è (o contiene) un proxy attendibile delle impostazioni: bloccato nel file .htaccess, ogni richiesta che passa da esso verrebbe respinta." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="Brute Force Stop non è riuscito a togliere i suoi blocchi da %s, che non blocca più: il server web continua a rifiutare questi indirizzi, anche quando i loro blocchi sono terminati. Rendi il file scrivibile e toglili a mano - si trovano nelle righe <If> tra '# BEGIN BFStop Blocks' e '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="Il blocco è salvato, ma non è stato possibile aggiungerlo a %s: Joomla rifiuta l'indirizzo, il server web no." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="L'utente {username} ha bloccato {ipaddress} in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="L'utente {username} ha modificato il blocco di {ipaddress} in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="L'utente {username} ha revocato i blocchi di {ipaddresses} in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="Il blocco di {ipaddress} in Brute Force Stop è stato revocato con il link di un'email di sblocco" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="L'utente {username} ha aggiunto {ipaddress} alla lista dei consentiti di Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="L'utente {username} ha modificato la voce {ipaddress} della lista dei consentiti di Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="L'utente {username} ha rimosso {ipaddresses} dalla lista dei consentiti di Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="L'utente {username} ha bloccato {ipaddress} nel file .htaccess" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="L'utente {username} ha rimosso {ipaddresses} dal file .htaccess" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="L'utente {username} ha modificato le impostazioni di Brute Force Stop: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="L'utente {username} ha eliminato {count} voci più vecchie di {days} giorni dal log di Brute Force Stop" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="L'utente {username} ha svuotato il log di Brute Force Stop" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="L'utente {username} ha eliminato {count} accessi falliti più vecchi di {days} giorni da Brute Force Stop" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="L'utente {username} ha eliminato le statistiche di {count} nomi utente non visti da {days} giorni da Brute Force Stop" diff --git a/component/admin/language/nl-NL/nl-NL.com_bfstop.ini b/component/admin/language/nl-NL/nl-NL.com_bfstop.ini index 7a74103..ea1b76f 100644 --- a/component/admin/language/nl-NL/nl-NL.com_bfstop.ini +++ b/component/admin/language/nl-NL/nl-NL.com_bfstop.ini @@ -28,6 +28,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: Mislukte logins" COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop: Instellingen" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="Superuser gebruikt de default gebruikersnaam 'admin'. Dit is een gevaar voor de veiligheid. Aanvallers weten dat deze gebruikersnaam in vele Joomla-installaties bestaat wordt daarom vaak gebruikt in aanvallen. Om een betere veiligheid te krijgen is het beter de gebruikersnaam van de admin te veranderen of deze te verwijderen (als een andere gebruiker de SuperAdmin rechten heeft). Zie ook: Joomla! Security and Performance FAQ: Why should I immediately change the name of the default admin user after a new install?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="Je gebruikt geen Apache-server, of het .htaccess-bestand bestaat niet of is niet leesbaar of beschrijfbaar. Blokkeren via .htaccess zal niet werken." +COM_BFSTOP_WARNING_HTACCESS_NGINX="Deze site draait op nginx, dat geen .htaccess-bestanden leest: met de blokkeermodus '%1$s' weigert niet de webserver adressen, maar alleen BFStop, zoals bij '%2$s'. Kies '%2$s' in de instellingen; nginx kan adressen in zijn eigen configuratie weigeren." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="Deze site draait op LiteSpeed, dat .htaccess-bestanden leest, maar niet elke directive van Apache: of het de <If>-secties volgt waarmee BFStop adressen blokkeert, hangt af van de editie en versie. Controleer of de webserver een geblokkeerd adres weigert, of kies '%2$s' in de instellingen." +COM_BFSTOP_HTACCESS_CHECK="Controleer .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="De webserver volgt de blokkeersectie van het .htaccess-bestand in %s: een testverzoek dat hij moet weigeren, is geweigerd." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="De webserver negeert de blokkeersectie van het .htaccess-bestand in %s: een testverzoek dat hij had moeten weigeren, kwam erdoor. Apache moet daar autorisatiedirectives mogen lezen (AllowOverride AuthConfig of All). nginx leest geen .htaccess-bestanden, OpenLiteSpeed leest er alleen de rewrite-regels uit, en LiteSpeed Enterprise ondersteunt mogelijk niet elke directive die de blokkeersectie gebruikt." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="De webserver liep vast op een testbestand met de directives van de blokkeersectie (status 500): hij begrijpt ze niet (ze vereisen Apache 2.4 of nieuwer). De blokkeersectie zou de site in %s op dezelfde manier breken; het foutenlogboek van de webserver zegt meer." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="Het .htaccess-bestand in %1$s kon niet worden gecontroleerd: %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="de map ervan is niet de map van de site en ook geen map daarin, dus er is geen adres om te proberen" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="daar kon geen testmap worden aangemaakt" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="de site kon zichzelf niet via HTTP bereiken" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="een testbestand daar kon niet worden opgehaald (status %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="De bfstop-plugin is niet geïnstalleerd! Installeer het nieuwste bfstop-pakket van de bfstop-pagina of de Joomla Extensions Directory!" COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="De manifestcache van de BFStop-component kan niet worden opgehaald. Er lijkt iets mis te zijn met je Joomla!-installatie. Installeer het nieuwste bfstop-pakket van de bfstop-pagina of de Joomla Extensions Directory!" COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="De BFStop-plugin en -component lijken in verschillende versies geïnstalleerd te zijn. Installeer het nieuwste bfstop-pakket van de bfstop-pagina of de Joomla Extensions Directory!" @@ -49,6 +60,11 @@ COM_BFSTOP_TEST_NOTIFICATION="Verstuur testbericht" COM_BFSTOP_TEST_NOTIFICATION_SUCCESS="Het versturen van het testbericht lijkt te zijn geslaagd. Controleer dat u ook een E-mail op bovengenoemde adres(sen) ontvangt!" COM_BFSTOP_TEST_NOTIFICATION_FAILED="Het versturen van het testbericht is mislukt (%s)! Controleer de configuratie-parameters van de kennisgeving van deze plugin en met name de opgegeven e-mailadres(sen) of gebruikersgroep. Controleer zonodig ook uw e-mailadres in de Joomla configuratie." COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="Over" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Controle met je verzoek" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="Het verzoek van je browser kwam bij de webserver aan vanaf %s." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="Het bevatte de header %1$s: %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="Het bevatte geen van de doorstuur-headers die BFStop kent." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="Met de opgeslagen instellingen houdt BFStop %s voor je adres. Is dat niet het adres dat je computer op internet heeft (maar bijvoorbeeld dat van je proxy), dan passen de instellingen op dit tabblad nog niet bij je site." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Componentversie: %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Pluginversie: %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="onbekend" @@ -131,7 +147,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="Hoeveel risicopunten er worden toegev COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Oplopende blokkadeduur" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="Indien ingeschakeld wordt de blokkadeduur telkens als hetzelfde IP-adres opnieuw wordt geblokkeerd verdubbeld ten opzichte van de vorige blokkade (tot maximaal 64 keer), in plaats van steeds dezelfde vaste duur te gebruiken. Blijft nog steeds begrensd door de hieronder ingestelde overgang naar een permanente blokkade." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Blokkeermodus" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Wat er gebeurt zodra een IP-adres is geblokkeerd. 'Alleen rapporteren' beperkt nooit iets - mislukte pogingen worden nog steeds gelogd, maar er wordt nooit een IP geblokkeerd; gebruik dit om de activiteit te bekijken voordat je iets afdwingt. 'Alleen aanmelden' laat het IP gewoon op de site rondkijken (inclusief het aanmeldformulier) en weigert alleen de aanmeldpoging zelf - dichter bij hoe een begrenzer van aanmeldpogingen gewoonlijk werkt, en minder storend voor een legitieme gebruiker die zich gewoon in zijn wachtwoord heeft vergist. 'Hele site' weigert elk verzoek van het geblokkeerde IP-adres en toont het hieronder ingestelde bericht. 'Hele site + .htaccess' doet hetzelfde en voegt het IP bovendien toe aan .htaccess, zodat de webserver zelf het weigert voordat Joomla (en deze plugin) het verzoek ziet - dit betekent ook dat een zo geblokkeerd IP niet tot alleen aanmelden beperkt kan worden, dus wordt het niet samen met 'Alleen aanmelden' aangeboden. Een zo geblokkeerd adres bereikt alleen nog de deblokkeerpagina uit een deblokkeer-e-mail: het herstellen van het wachtwoord, het hieronder ingestelde bericht en de rest van de site blijven buiten bereik. Geldt voor elke blokkade, of die nu automatisch is aangemaakt of handmatig aan de blokkadelijst is toegevoegd." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Wat er gebeurt zodra een IP-adres is geblokkeerd. 'Alleen rapporteren' beperkt nooit iets - mislukte pogingen worden nog steeds gelogd, maar er wordt nooit een IP geblokkeerd; gebruik dit om de activiteit te bekijken voordat je iets afdwingt. 'Alleen aanmelden' laat het IP gewoon op de site rondkijken (inclusief het aanmeldformulier) en weigert alleen de aanmeldpoging zelf - dichter bij hoe een begrenzer van aanmeldpogingen gewoonlijk werkt, en minder storend voor een legitieme gebruiker die zich gewoon in zijn wachtwoord heeft vergist. 'Hele site' weigert elk verzoek van het geblokkeerde IP-adres en toont het hieronder ingestelde bericht. 'Hele site + .htaccess' doet hetzelfde en voegt het IP bovendien toe aan .htaccess, zodat de webserver zelf het weigert voordat Joomla (en deze plugin) het verzoek ziet - dit betekent ook dat een zo geblokkeerd IP niet tot alleen aanmelden beperkt kan worden, dus wordt het niet samen met 'Alleen aanmelden' aangeboden. Een zo geblokkeerd adres bereikt alleen nog de deblokkeerpagina uit een deblokkeer-e-mail: het herstellen van het wachtwoord, het hieronder ingestelde bericht en de rest van de site blijven buiten bereik. Geldt voor elke blokkade, of die nu automatisch is aangemaakt of handmatig aan de blokkadelijst is toegevoegd. 'Alleen aanmelden' herkent de aanmeldformulieren van Joomla's eigen frontend en backend (com_users, com_login) en aanmeldingen met inloggegevens via de Web Services API. Via extensies die gebruikers zelf aanmelden (aanmelden via sociale netwerken of single sign-on, aanmeldmodules die naar een eigen controller posten, passkeys) kan een geblokkeerd adres zich nog steeds aanmelden: biedt je site zulke aanmeldingen aan, kies dan 'Hele site'." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Alleen rapporteren" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Alleen aanmelden" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Hele site" @@ -206,6 +222,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Wissen" COM_BFSTOP_LOG_CLEARED="Het log is gewist." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Deblokkeerlinks kunnen alleen worden verstuurd als het adres van de site is ingesteld ($live_site in de configuration.php van de site). Stel het daar in, of schakel de deblokkeerlinks uit." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) mag niet hoger zijn dan \"%3$s\" (%4$d): elke client zou %2$d pogingen krijgen. Verlaag \"%1$s\", of verhoog \"%3$s\"." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="Deze site draait op nginx, dat geen .htaccess-bestanden leest: de blokkeermodus '%1$s' kan hier niet werken. Kies '%2$s'; nginx kan adressen in zijn eigen configuratie weigeren." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="nginx-weigerbestand" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Alleen voor sites die nginx serveert, dat geen .htaccess-bestanden leest: een bestand (een absoluut pad, eindigend op .conf) waarin BFStop de actieve blokkades bijhoudt als 'deny'-regels, zodat het server-blok van de nginx-configuratie van de site het kan invoegen. nginx leest het alleen bij herladen: zorg dat het herladen wordt wanneer het bestand verandert (bijv. met een systemd-path-unit of een cronjob die 'nginx -t && nginx -s reload' uitvoert). Adressen van de toegestane lijst en vertrouwde proxy's worden weggelaten. Leeg: geen bestand." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="Geen bestand dat BFStop als nginx-weigerbestand kan schrijven: %1$s. Het moet een absoluut pad zijn van een bestand waarvan de naam eindigt op %2$s." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="De map van het nginx-weigerbestand %1$s bestaat niet of is niet beschrijfbaar." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s bestaat en is niet door BFStop geschreven: het zou worden overschreven. Kies een nieuw bestand." COM_BFSTOP_WARNING_NO_LIVE_SITE="Het adres van de site is niet ingesteld ($live_site in configuration.php). Joomla! bouwt de links in de e-mails van Brute Force Stop dan op uit de host die elk verzoek noemt, en die kan een bezoeker vrij kiezen - daarom worden geen deblokkeerlinks verstuurd en noemen de meldingen aan de beheerders geen adres. Om het adres in te stellen, voeg deze regel toe aan de klasse in de configuration.php van de site, met het adres waarop de site bereikbaar is (voorgesteld op basis van dit verzoek, controleer het): %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Er moeten deblokkeerlinks worden verstuurd (instellingen), maar het adres van de site is niet ingesteld ($live_site in configuration.php): er worden geen deblokkeerlinks verstuurd." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (aanbevolen)" @@ -215,3 +237,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="Het netwerk %1$s is te groot: de prefixlengte m COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Dit is (of bevat) een vertrouwde proxy uit de instellingen: geblokkeerd in het .htaccess-bestand zou elk verzoek dat erdoorheen komt worden geweigerd." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="Brute Force Stop kon zijn blokkades niet uit %s verwijderen, dat niet meer blokkeert: de webserver blijft deze adressen weigeren, ook als hun blokkades voorbij zijn. Maak het bestand schrijfbaar en verwijder ze met de hand - ze staan in de <If>-regels tussen '# BEGIN BFStop Blocks' en '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="De blokkade is opgeslagen, maar kon niet aan %s worden toegevoegd: Joomla weigert het adres, de webserver niet." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="Gebruiker {username} heeft {ipaddress} geblokkeerd in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="Gebruiker {username} heeft de blokkade van {ipaddress} gewijzigd in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="Gebruiker {username} heeft de blokkades van {ipaddresses} opgeheven in Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="De blokkade van {ipaddress} in Brute Force Stop is opgeheven met de link uit een deblokkeer-e-mail" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="Gebruiker {username} heeft {ipaddress} toegevoegd aan de toegestane lijst van Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="Gebruiker {username} heeft de vermelding {ipaddress} van de toegestane lijst van Brute Force Stop gewijzigd" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="Gebruiker {username} heeft {ipaddresses} verwijderd uit de toegestane lijst van Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="Gebruiker {username} heeft {ipaddress} geblokkeerd in het .htaccess-bestand" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="Gebruiker {username} heeft {ipaddresses} verwijderd uit het .htaccess-bestand" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="Gebruiker {username} heeft de instellingen van Brute Force Stop gewijzigd: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="Gebruiker {username} heeft {count} vermeldingen ouder dan {days} dagen verwijderd uit het logboek van Brute Force Stop" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="Gebruiker {username} heeft het logboek van Brute Force Stop geleegd" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="Gebruiker {username} heeft {count} mislukte aanmeldingen ouder dan {days} dagen verwijderd uit Brute Force Stop" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="Gebruiker {username} heeft de statistieken van {count} gebruikersnamen die {days} dagen niet zijn gezien verwijderd uit Brute Force Stop" diff --git a/component/admin/language/pt-BR/pt-BR.com_bfstop.ini b/component/admin/language/pt-BR/pt-BR.com_bfstop.ini index c3a52e4..5830b35 100644 --- a/component/admin/language/pt-BR/pt-BR.com_bfstop.ini +++ b/component/admin/language/pt-BR/pt-BR.com_bfstop.ini @@ -28,6 +28,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: Logins com falha" COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop: Configurações" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="O Super Usuário está usando o nome de usuário padrão 'admin'. Isso é um risco de segurança; os atacantes sabem que esse nome de usuário existe em muitas instalações do Joomla!, por isso ele é muito usado em vários ataques. Para aumentar a segurança, recomenda-se alterar o nome de usuário do Super Usuário! Veja também: Joomla! Security and Performance FAQ: Why should I immediately change the name of the default admin user after a new install?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="Ou você não está usando um servidor Apache, ou o arquivo .htaccess não existe ou não pode ser lido nem gravado. O bloqueio via .htaccess não vai funcionar." +COM_BFSTOP_WARNING_HTACCESS_NGINX="Este site roda no nginx, que não lê arquivos .htaccess: com o modo de bloqueio '%1$s', nenhum endereço é recusado pelo servidor web, apenas pelo BFStop, como com '%2$s'. Escolha '%2$s' nas configurações; o nginx pode negar endereços na sua própria configuração." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="Este site roda no LiteSpeed, que lê arquivos .htaccess, mas não todas as diretivas do Apache: se ele respeita as seções <If> com que o BFStop bloqueia endereços depende da sua edição e versão. Verifique se o servidor web recusa um endereço bloqueado, ou escolha '%2$s' nas configurações." +COM_BFSTOP_HTACCESS_CHECK="Verificar .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="O servidor web respeita a seção de bloqueios do arquivo .htaccess em %s: uma requisição de teste que ele deve recusar foi recusada." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="O servidor web ignora a seção de bloqueios do arquivo .htaccess em %s: uma requisição de teste que ele deveria ter recusado passou. O Apache precisa poder ler ali diretivas de autorização (AllowOverride AuthConfig, ou All). O nginx não lê arquivos .htaccess, o OpenLiteSpeed lê apenas as regras de reescrita deles, e o LiteSpeed Enterprise pode não suportar todas as diretivas que a seção de bloqueios usa." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="O servidor web falhou em um arquivo de teste com as diretivas da seção de bloqueios (status 500): ele não as entende (elas precisam do Apache 2.4 ou posterior). A seção de bloqueios quebraria o site em %s da mesma forma; o log de erros do servidor web diz mais." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="Não foi possível verificar o arquivo .htaccess em %1$s: %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="o diretório dele não é o diretório do site nem um dentro dele, então não há endereço para testar" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="não foi possível criar ali um diretório de teste" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="o site não conseguiu acessar a si mesmo por HTTP" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="não foi possível obter ali um arquivo de teste (status %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="O plugin bfstop não está instalado! Instale o pacote bfstop mais recente a partir da página do bfstop ou do Joomla Extensions Directory!" COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="Não foi possível obter o cache do manifesto do componente BFStop. Parece haver algo errado com a sua instalação do Joomla!. Instale o pacote bfstop mais recente a partir da página do bfstop ou do Joomla Extensions Directory!" COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="O plugin e o componente BFStop parecem estar instalados em versões diferentes. Instale o pacote bfstop mais recente a partir da página do bfstop ou do Joomla Extensions Directory!" @@ -48,6 +59,11 @@ COM_BFSTOP_TEST_NOTIFICATION="Notificação de teste" COM_BFSTOP_TEST_NOTIFICATION_SUCCESS="O envio da notificação de teste parece ter sido bem-sucedido. Verifique se você também recebeu um e-mail no endereço indicado acima!" COM_BFSTOP_TEST_NOTIFICATION_FAILED="Falha ao enviar a notificação de teste (%s)! Verifique a configuração de e-mail nas configurações do Joomla!; verifique também se você informou um endereço de e-mail (correto) e/ou escolheu um usuário ou grupo na configuração do plugin." COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="Sobre" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Verificação com a sua requisição" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="A requisição do seu navegador chegou ao servidor web a partir de %s." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="Ela continha o cabeçalho %1$s: %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="Ela não continha nenhum dos cabeçalhos de encaminhamento que o BFStop conhece." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="Com as configurações salvas, o BFStop considera que o seu endereço é %s. Se esse não for o endereço que o seu computador tem na internet (por exemplo, for o do seu proxy), as configurações desta aba ainda não correspondem ao seu site." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Versão do componente: %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Versão do plugin: %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="desconhecida" @@ -130,7 +146,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="Quantos pontos de risco somar quando COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Duração progressiva do bloqueio" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="Se ativado, a cada vez que o mesmo endereço IP é bloqueado novamente, a duração do bloqueio é dobrada em relação ao bloqueio anterior (até o limite de 64 vezes), em vez de sempre usar a mesma duração fixa. Continua limitada pela passagem para o bloqueio permanente configurada abaixo." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Modo de bloqueio" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="O que acontece depois que um endereço IP é bloqueado. 'Somente relatório' nunca restringe nada - as tentativas com falha continuam sendo registradas, mas nenhum IP é bloqueado, então use-o para observar a atividade antes de aplicar qualquer coisa. 'Somente login' deixa o IP continuar navegando normalmente pelo site (inclusive vendo o formulário de login) e recusa apenas a tentativa de login em si - mais próximo do comportamento típico de um limitador de tentativas de login e menos incômodo para um usuário legítimo que apenas errou a senha. 'Site inteiro' recusa todas as requisições do endereço IP bloqueado e mostra a mensagem configurada abaixo. 'Site inteiro + .htaccess' faz o mesmo e, além disso, acrescenta o IP ao .htaccess para que o próprio servidor web o recuse antes que o Joomla (e este plugin) chegue a ver a requisição - isso também significa que um IP bloqueado assim não pode ser restrito apenas ao login, por isso não é oferecido junto com 'Somente login'. Um endereço bloqueado assim só alcança a página de desbloqueio de um e-mail de desbloqueio: a redefinição de senha, a mensagem configurada abaixo e o restante do site ficam fora do seu alcance. Vale para todos os bloqueios, sejam criados automaticamente ou adicionados manualmente na lista de bloqueios." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="O que acontece depois que um endereço IP é bloqueado. 'Somente relatório' nunca restringe nada - as tentativas com falha continuam sendo registradas, mas nenhum IP é bloqueado, então use-o para observar a atividade antes de aplicar qualquer coisa. 'Somente login' deixa o IP continuar navegando normalmente pelo site (inclusive vendo o formulário de login) e recusa apenas a tentativa de login em si - mais próximo do comportamento típico de um limitador de tentativas de login e menos incômodo para um usuário legítimo que apenas errou a senha. 'Site inteiro' recusa todas as requisições do endereço IP bloqueado e mostra a mensagem configurada abaixo. 'Site inteiro + .htaccess' faz o mesmo e, além disso, acrescenta o IP ao .htaccess para que o próprio servidor web o recuse antes que o Joomla (e este plugin) chegue a ver a requisição - isso também significa que um IP bloqueado assim não pode ser restrito apenas ao login, por isso não é oferecido junto com 'Somente login'. Um endereço bloqueado assim só alcança a página de desbloqueio de um e-mail de desbloqueio: a redefinição de senha, a mensagem configurada abaixo e o restante do site ficam fora do seu alcance. Vale para todos os bloqueios, sejam criados automaticamente ou adicionados manualmente na lista de bloqueios. 'Somente login' reconhece os formulários de login do frontend e do backend do próprio Joomla (com_users, com_login) e os logins com credenciais pela API de Web Services. Um endereço bloqueado ainda pode fazer login por extensões que fazem o login dos usuários por conta própria (logins sociais ou de login único, módulos de login que enviam para um controlador próprio, chaves de acesso): se o seu site oferece esse tipo de login, escolha 'Site inteiro'." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Somente relatório" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Somente login" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Site inteiro" @@ -205,6 +221,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Esvaziar" COM_BFSTOP_LOG_CLEARED="O log foi esvaziado." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Links de desbloqueio só podem ser enviados se o endereço do site estiver definido ($live_site no configuration.php do site). Defina-o lá, ou desative os links de desbloqueio." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) não pode ser maior que \"%3$s\" (%4$d): todo cliente teria %2$d tentativas. Diminua \"%1$s\", ou aumente \"%3$s\"." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="Este site roda no nginx, que não lê arquivos .htaccess: o modo de bloqueio '%1$s' não pode funcionar aqui. Escolha '%2$s'; o nginx pode negar endereços na sua própria configuração." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="Arquivo de negação do nginx" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Apenas para sites servidos pelo nginx, que não lê arquivos .htaccess: um arquivo (um caminho absoluto, terminado em .conf) em que o BFStop mantém os bloqueios ativos, como linhas 'deny', para o bloco server da configuração do nginx do site incluir. O nginx só o lê ao ser recarregado: providencie que ele seja recarregado quando o arquivo mudar (por exemplo, com uma unidade path do systemd ou uma tarefa cron que execute 'nginx -t && nginx -s reload'). Endereços da lista de permissões e proxies confiáveis são omitidos. Vazio: nenhum arquivo." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="Não é um arquivo que o BFStop possa escrever como arquivo de negação do nginx: %1$s. Precisa ser o caminho absoluto de um arquivo cujo nome termine em %2$s." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="O diretório do arquivo de negação do nginx %1$s não existe ou não pode ser gravado." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s existe e não foi escrito pelo BFStop: seria sobrescrito. Escolha um arquivo novo." COM_BFSTOP_WARNING_NO_LIVE_SITE="O endereço do site não está definido ($live_site no configuration.php). O Joomla! então monta os links dos e-mails do Brute Force Stop com o host indicado em cada requisição, que um visitante pode escolher livremente - por isso nenhum link de desbloqueio é enviado e as notificações aos administradores não indicam nenhum endereço. Para definir o endereço, adicione esta linha à classe no configuration.php do site, com o endereço pelo qual o site é acessado (proposto a partir desta requisição, verifique-o): %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Links de desbloqueio devem ser enviados (configurações), mas o endereço do site não está definido ($live_site no configuration.php): nenhum link de desbloqueio é enviado." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recomendado)" @@ -214,3 +236,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="A rede %1$s é grande demais: o comprimento do COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Isto é (ou contém) um proxy confiável das configurações: bloqueado no arquivo .htaccess, toda requisição que passa por ele seria recusada." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="O Brute Force Stop não conseguiu retirar seus bloqueios de %s, que não bloqueia mais: o servidor web continua recusando esses endereços, mesmo depois que seus bloqueios terminam. Torne o arquivo gravável e retire-os manualmente - eles estão nas linhas <If> entre '# BEGIN BFStop Blocks' e '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="O bloqueio foi salvo, mas não pôde ser adicionado a %s: o Joomla recusa o endereço, o servidor web não." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="O usuário {username} bloqueou {ipaddress} no Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="O usuário {username} alterou o bloqueio de {ipaddress} no Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="O usuário {username} suspendeu os bloqueios de {ipaddresses} no Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="O bloqueio de {ipaddress} no Brute Force Stop foi suspenso com o link de um e-mail de desbloqueio" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="O usuário {username} adicionou {ipaddress} à lista de permissões do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="O usuário {username} alterou a entrada {ipaddress} da lista de permissões do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="O usuário {username} removeu {ipaddresses} da lista de permissões do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="O usuário {username} bloqueou {ipaddress} no arquivo .htaccess" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="O usuário {username} removeu {ipaddresses} do arquivo .htaccess" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="O usuário {username} alterou as configurações do Brute Force Stop: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="O usuário {username} excluiu {count} entradas com mais de {days} dias do log do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="O usuário {username} limpou o log do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="O usuário {username} excluiu {count} logins com falha com mais de {days} dias do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="O usuário {username} excluiu as estatísticas de {count} nomes de usuário não vistos há {days} dias do Brute Force Stop" diff --git a/component/admin/language/pt-PT/pt-PT.com_bfstop.ini b/component/admin/language/pt-PT/pt-PT.com_bfstop.ini index c4a8567..23773c2 100644 --- a/component/admin/language/pt-PT/pt-PT.com_bfstop.ini +++ b/component/admin/language/pt-PT/pt-PT.com_bfstop.ini @@ -28,6 +28,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: Inícios de sessão falhad COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop: Definições" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="O Super Utilizador está usando o nome de utilizador padrão 'admin'. Isso é um risco de segurança; os atacantes sabem que esse nome de utilizador existe em muitas instalações do Joomla!, por isso ele é muito usado em vários ataques. Para aumentar a segurança, recomenda-se alterar o nome de utilizador do Super Utilizador! Veja também: Joomla! Security and Performance FAQ: Why should I immediately change the name of the default admin user after a new install?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="Ou o utilizador não está usando um servidor Apache, ou o ficheiro .htaccess não existe ou não pode ser lido nem gravado. O bloqueio via .htaccess não vai funcionar." +COM_BFSTOP_WARNING_HTACCESS_NGINX="Este site funciona com nginx, que não lê ficheiros .htaccess: com o modo de bloqueio '%1$s', nenhum endereço é recusado pelo servidor web, apenas pelo BFStop, como com '%2$s'. Escolha '%2$s' nas definições; o nginx pode negar endereços na sua própria configuração." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="Este site funciona com LiteSpeed, que lê ficheiros .htaccess, mas não todas as diretivas do Apache: se respeita as secções <If> com que o BFStop bloqueia endereços depende da sua edição e versão. Verifique se o servidor web recusa um endereço bloqueado, ou escolha '%2$s' nas definições." +COM_BFSTOP_HTACCESS_CHECK="Verificar .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="O servidor web respeita a secção de bloqueios do ficheiro .htaccess em %s: um pedido de teste que deve recusar foi recusado." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="O servidor web ignora a secção de bloqueios do ficheiro .htaccess em %s: um pedido de teste que deveria ter recusado passou. O Apache tem de poder ler aí diretivas de autorização (AllowOverride AuthConfig, ou All). O nginx não lê ficheiros .htaccess, o OpenLiteSpeed lê apenas as respetivas regras de reescrita, e o LiteSpeed Enterprise pode não suportar todas as diretivas que a secção de bloqueios utiliza." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="O servidor web falhou num ficheiro de teste com as diretivas da secção de bloqueios (estado 500): não as entende (precisam do Apache 2.4 ou posterior). A secção de bloqueios avariaria o site em %s da mesma forma; o registo de erros do servidor web diz mais." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="Não foi possível verificar o ficheiro .htaccess em %1$s: %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="o seu diretório não é o diretório do site nem um dentro dele, por isso não há endereço para testar" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="não foi possível criar aí um diretório de teste" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="o site não conseguiu aceder a si próprio por HTTP" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="não foi possível obter aí um ficheiro de teste (estado %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="O plugin bfstop não está instalado! Instale o pacote bfstop mais recente a partir da página do bfstop ou do Joomla Extensions Directory!" COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="Não foi possível obter o cache do manifesto do componente BFStop. Parece haver algo errado com a sua instalação do Joomla!. Instale o pacote bfstop mais recente a partir da página do bfstop ou do Joomla Extensions Directory!" COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="O plugin e o componente BFStop parecem estar instalados em versões diferentes. Instale o pacote bfstop mais recente a partir da página do bfstop ou do Joomla Extensions Directory!" @@ -48,6 +59,11 @@ COM_BFSTOP_TEST_NOTIFICATION="Notificação de teste" COM_BFSTOP_TEST_NOTIFICATION_SUCCESS="O envio da notificação de teste parece ter sido bem-sucedido. Verifique se também recebeu um e-mail no endereço indicado acima!" COM_BFSTOP_TEST_NOTIFICATION_FAILED="Falha ao enviar a notificação de teste (%s)! Verifique a configuração de e-mail nas definições do Joomla!; verifique também se informou um endereço de e-mail (correto) e/ou escolheu um utilizador ou grupo na configuração do plugin." COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="Sobre" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Verificação com o seu pedido" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="O pedido do seu navegador chegou ao servidor web a partir de %s." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="Continha o cabeçalho %1$s: %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="Não continha nenhum dos cabeçalhos de reencaminhamento que o BFStop conhece." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="Com as definições guardadas, o BFStop considera que o seu endereço é %s. Se esse não for o endereço que o seu computador tem na Internet (por exemplo, for o do seu proxy), as definições deste separador ainda não correspondem ao seu site." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Versão do componente: %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Versão do plugin: %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="desconhecida" @@ -130,7 +146,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="Quantos pontos de risco somar quando COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Duração progressiva do bloqueio" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="Se ativado, a cada vez que o mesmo endereço IP é bloqueado novamente, a duração do bloqueio é dobrada em relação ao bloqueio anterior (até o limite de 64 vezes), em vez de sempre usar a mesma duração fixa. Continua limitada pela passagem para o bloqueio permanente configurada abaixo." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Modo de bloqueio" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="O que acontece depois que um endereço IP é bloqueado. 'Somente relatório' nunca restringe nada - as tentativas com falha continuam a ser registadas, mas nenhum IP é bloqueado, então use-o para observar a atividade antes de aplicar qualquer coisa. 'Somente início de sessão' deixa o IP continuar navegando normalmente pelo site (inclusive vendo o formulário de início de sessão) e recusa apenas a tentativa de início de sessão em si - mais próximo do comportamento típico de um limitador de tentativas de início de sessão e menos incômodo para um utilizador legítimo que apenas errou a palavra-passe. 'Site inteiro' recusa todas as pedidos do endereço IP bloqueado e mostra a mensagem configurada abaixo. 'Site inteiro + .htaccess' faz o mesmo e, além disso, acrescenta o IP ao .htaccess para que o próprio servidor web o recuse antes que o Joomla (e este plugin) chegue a ver a pedido - isso também significa que um IP bloqueado assim não pode ser restrito apenas ao início de sessão, por isso não é oferecido junto com 'Somente início de sessão'. Um endereço bloqueado assim só alcança a página de desbloqueio de um e-mail de desbloqueio: a reposição da palavra-passe, a mensagem configurada abaixo e o resto do site ficam fora do seu alcance. Vale para todos os bloqueios, sejam criados automaticamente ou adicionados manualmente na lista de bloqueios." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="O que acontece depois que um endereço IP é bloqueado. 'Somente relatório' nunca restringe nada - as tentativas com falha continuam a ser registadas, mas nenhum IP é bloqueado, então use-o para observar a atividade antes de aplicar qualquer coisa. 'Somente início de sessão' deixa o IP continuar navegando normalmente pelo site (inclusive vendo o formulário de início de sessão) e recusa apenas a tentativa de início de sessão em si - mais próximo do comportamento típico de um limitador de tentativas de início de sessão e menos incômodo para um utilizador legítimo que apenas errou a palavra-passe. 'Site inteiro' recusa todas as pedidos do endereço IP bloqueado e mostra a mensagem configurada abaixo. 'Site inteiro + .htaccess' faz o mesmo e, além disso, acrescenta o IP ao .htaccess para que o próprio servidor web o recuse antes que o Joomla (e este plugin) chegue a ver a pedido - isso também significa que um IP bloqueado assim não pode ser restrito apenas ao início de sessão, por isso não é oferecido junto com 'Somente início de sessão'. Um endereço bloqueado assim só alcança a página de desbloqueio de um e-mail de desbloqueio: a reposição da palavra-passe, a mensagem configurada abaixo e o resto do site ficam fora do seu alcance. Vale para todos os bloqueios, sejam criados automaticamente ou adicionados manualmente na lista de bloqueios. 'Somente início de sessão' reconhece os formulários de início de sessão do frontend e do backend do próprio Joomla (com_users, com_login) e os inícios de sessão com credenciais através da API de Web Services. Um endereço bloqueado ainda pode iniciar sessão através de extensões que iniciam a sessão dos utilizadores por si próprias (inícios de sessão sociais ou de autenticação única, módulos de início de sessão que enviam para um controlador próprio, chaves de acesso): se o seu site oferece este tipo de início de sessão, escolha 'Site inteiro'." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Somente relatório" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Somente início de sessão" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Site inteiro" @@ -205,6 +221,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Esvaziar" COM_BFSTOP_LOG_CLEARED="O registo foi esvaziado." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="As ligações de desbloqueio só podem ser enviadas se o endereço do site estiver definido ($live_site no configuration.php do site). Defina-o aí, ou desative as ligações de desbloqueio." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) não pode ser superior a \"%3$s\" (%4$d): cada cliente teria %2$d tentativas. Diminua \"%1$s\", ou aumente \"%3$s\"." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="Este site funciona com nginx, que não lê ficheiros .htaccess: o modo de bloqueio '%1$s' não pode funcionar aqui. Escolha '%2$s'; o nginx pode negar endereços na sua própria configuração." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="Ficheiro de negação do nginx" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Apenas para sites servidos pelo nginx, que não lê ficheiros .htaccess: um ficheiro (um caminho absoluto, terminado em .conf) em que o BFStop mantém os bloqueios ativos, como linhas 'deny', para o bloco server da configuração do nginx do site incluir. O nginx só o lê ao ser recarregado: garanta que é recarregado quando o ficheiro muda (por exemplo, com uma unidade path do systemd ou uma tarefa cron que execute 'nginx -t && nginx -s reload'). Endereços da lista de permissões e proxies de confiança são omitidos. Vazio: nenhum ficheiro." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="Não é um ficheiro que o BFStop possa escrever como ficheiro de negação do nginx: %1$s. Tem de ser o caminho absoluto de um ficheiro cujo nome termine em %2$s." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="O diretório do ficheiro de negação do nginx %1$s não existe ou não pode ser escrito." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s existe e não foi escrito pelo BFStop: seria substituído. Escolha um ficheiro novo." COM_BFSTOP_WARNING_NO_LIVE_SITE="O endereço do site não está definido ($live_site no configuration.php). O Joomla! constrói então as ligações dos e-mails do Brute Force Stop com o anfitrião indicado em cada pedido, que um visitante pode escolher livremente - por isso não é enviada nenhuma ligação de desbloqueio e as notificações aos administradores não indicam nenhum endereço. Para definir o endereço, adicione esta linha à classe no configuration.php do site, com o endereço pelo qual o site é acedido (proposto a partir deste pedido, verifique-o): %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Devem ser enviadas ligações de desbloqueio (definições), mas o endereço do site não está definido ($live_site no configuration.php): não é enviada nenhuma ligação de desbloqueio." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recomendado)" @@ -214,3 +236,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="A rede %1$s é demasiado grande: o comprimento COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Isto é (ou contém) um proxy de confiança das definições: bloqueado no ficheiro .htaccess, todos os pedidos que passam por ele seriam recusados." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="O Brute Force Stop não conseguiu retirar os seus bloqueios de %s, que já não bloqueia: o servidor web continua a recusar estes endereços, mesmo depois de os bloqueios terminarem. Torne o ficheiro gravável e retire-os manualmente - estão nas linhas <If> entre '# BEGIN BFStop Blocks' e '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="O bloqueio foi guardado, mas não pôde ser adicionado a %s: o Joomla recusa o endereço, o servidor web não." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="O utilizador {username} bloqueou {ipaddress} no Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="O utilizador {username} alterou o bloqueio de {ipaddress} no Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="O utilizador {username} levantou os bloqueios de {ipaddresses} no Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="O bloqueio de {ipaddress} no Brute Force Stop foi levantado com a ligação de um e-mail de desbloqueio" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="O utilizador {username} adicionou {ipaddress} à lista de permissões do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="O utilizador {username} alterou a entrada {ipaddress} da lista de permissões do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="O utilizador {username} removeu {ipaddresses} da lista de permissões do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="O utilizador {username} bloqueou {ipaddress} no ficheiro .htaccess" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="O utilizador {username} removeu {ipaddresses} do ficheiro .htaccess" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="O utilizador {username} alterou as definições do Brute Force Stop: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="O utilizador {username} eliminou {count} entradas com mais de {days} dias do registo do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="O utilizador {username} limpou o registo do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="O utilizador {username} eliminou {count} inícios de sessão falhados com mais de {days} dias do Brute Force Stop" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="O utilizador {username} eliminou as estatísticas de {count} nomes de utilizador não vistos há {days} dias do Brute Force Stop" diff --git a/component/admin/language/ru-RU/ru-RU.com_bfstop.ini b/component/admin/language/ru-RU/ru-RU.com_bfstop.ini index eb811e7..2670c20 100644 --- a/component/admin/language/ru-RU/ru-RU.com_bfstop.ini +++ b/component/admin/language/ru-RU/ru-RU.com_bfstop.ini @@ -28,6 +28,17 @@ COM_BFSTOP_HEADING_FAILEDLOGINLIST="Brute Force Stop: Неудачные поп COM_BFSTOP_HEADING_SETTINGS="Brute Force Stop: Настройки" COM_BFSTOP_WARNING_ADMIN_USER_EXISTS="Супер администратор использует по умолчанию имя пользователя 'admin'. Это риск для безопасности; хакеры используют это имя пользователя очень часто для взлома. Для повышения безопасности рекомендуется изменить имя пользователя для супер администратора! Смотри также: Joomla! FAQ Безопасность и производительность: Почему я должен немедленно изменить имя пользователя администратора по умолчанию после установки Joomla?" COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING="Либо вы используете не сервер Apache, либо файл .htaccess не существует или недоступен для чтения или записи. Блокировка через .htaccess работать не будет." +COM_BFSTOP_WARNING_HTACCESS_NGINX="Этот сайт работает на nginx, который не читает файлы .htaccess: в режиме блокировки «%1$s» адреса отклоняет не веб-сервер, а только BFStop, как в режиме «%2$s». Выберите в настройках «%2$s»; nginx может запрещать адреса в собственной конфигурации." +COM_BFSTOP_WARNING_HTACCESS_LITESPEED="Этот сайт работает на LiteSpeed, который читает файлы .htaccess, но не все директивы Apache: соблюдает ли он разделы <If>, которыми BFStop блокирует адреса, зависит от его редакции и версии. Проверьте, что веб-сервер отклоняет заблокированный адрес, или выберите в настройках «%2$s»." +COM_BFSTOP_HTACCESS_CHECK="Проверить .htaccess" +COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE="Веб-сервер соблюдает раздел блокировок файла .htaccess в %s: тестовый запрос, который он должен отклонить, был отклонён." +COM_BFSTOP_HTACCESS_CHECK_IGNORED="Веб-сервер игнорирует раздел блокировок файла .htaccess в %s: тестовый запрос, который он должен был отклонить, прошёл. Apache должен иметь право читать там директивы авторизации (AllowOverride AuthConfig или All). nginx не читает файлы .htaccess, OpenLiteSpeed читает из них только правила перезаписи, а LiteSpeed Enterprise может поддерживать не все директивы, которые использует раздел блокировок." +COM_BFSTOP_HTACCESS_CHECK_BROKEN="Веб-сервер выдал ошибку на тестовом файле с директивами раздела блокировок (статус 500): он их не понимает (нужен Apache 2.4 или новее). Раздел блокировок так же нарушил бы работу сайта в %s; подробности в журнале ошибок веб-сервера." +COM_BFSTOP_HTACCESS_CHECK_UNKNOWN="Не удалось проверить файл .htaccess в %1$s: %2$s." +COM_BFSTOP_HTACCESS_CHECK_REASON_OUTSIDE="его каталог не является каталогом сайта или каталогом внутри него, поэтому нет адреса для проверки" +COM_BFSTOP_HTACCESS_CHECK_REASON_WRITE="там не удалось создать тестовый каталог" +COM_BFSTOP_HTACCESS_CHECK_REASON_REQUEST="сайт не смог обратиться к самому себе по HTTP" +COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS="не удалось получить тестовый файл оттуда (статус %s)" COM_BFSTOP_WARNING_PLUGIN_NOT_INSTALLED="Плагин bfstop не установлен! Установите последнюю версию пакета bfstop со страницы bfstop или из каталога расширений Joomla!" COM_BFSTOP_WARNING_CANNOT_RETRIEVE_COMPONENT_CACHE="Не удаётся получить кеш манифеста компонента BFStop. Похоже, с вашей установкой Joomla! что-то не так. Установите последнюю версию пакета bfstop со страницы bfstop или из каталога расширений Joomla!" COM_BFSTOP_WARNING_COMPONENT_PLUGIN_DIFFERENT_VERSION="Плагин и компонент BFStop, судя по всему, установлены в разных версиях. Установите последнюю версию пакета bfstop со страницы bfstop или из каталога расширений Joomla!" @@ -48,6 +59,11 @@ COM_BFSTOP_TEST_NOTIFICATION="Тестовое сообщение" COM_BFSTOP_TEST_NOTIFICATION_SUCCESS="Отправка тестового сообщения произведена успешно. Пожалуйста, проверьте, получили ли вы письмо по вышеуказанному адресу!" COM_BFSTOP_TEST_NOTIFICATION_FAILED="Ошибка при отправке тестового сообщения (%s)! Пожалуйста, проверьте настройки электронной почты в конфигурации Joomla!, а также настройки отправки емаил сообщений и адрес получателя bfstop плагина." COM_BFSTOP_SETTINGS_VERSION_FIELDSET_LABEL="О программе" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADING="Проверка по вашему запросу" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE="Запрос вашего браузера пришёл на веб-сервер с адреса %s." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER="Он содержал заголовок %1$s: %2$s" +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER="Он не содержал ни одного из известных BFStop заголовков пересылки." +COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED="С сохранёнными настройками BFStop считает вашим адресом %s. Если это не тот адрес, который ваш компьютер имеет в интернете (например, это адрес вашего прокси), настройки на этой вкладке ещё не подходят для вашего сайта." COM_BFSTOP_SETTINGS_VERSION_COMPONENT="Версия компонента: %s" COM_BFSTOP_SETTINGS_VERSION_PLUGIN="Версия плагина: %s" COM_BFSTOP_SETTINGS_VERSION_UNKNOWN="неизвестно" @@ -130,7 +146,7 @@ COM_BFSTOP_SETTINGS_RISK_RDNS_POINTS_DESC="Сколько баллов риск COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_LABEL="Прогрессивная длительность блокировки" COM_BFSTOP_SETTINGS_PROGRESSIVE_BLOCK_DURATION_DESC="Если включено, при каждой повторной блокировке одного и того же IP-адреса длительность блокировки удваивается по сравнению с предыдущей (максимум в 64 раза), вместо того чтобы всегда использовать одну и ту же фиксированную длительность. По-прежнему ограничена переходом к постоянной блокировке, настроенным ниже." COM_BFSTOP_SETTINGS_BLOCK_MODE_LABEL="Режим блокировки" -COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Что происходит после блокировки IP-адреса. «Только отчёты» ничего не ограничивает: неудачные попытки по-прежнему записываются, но ни один IP не блокируется, поэтому используйте этот режим, чтобы понаблюдать за активностью, прежде чем что-либо применять. «Только вход» позволяет IP как обычно просматривать сайт (включая форму входа) и отклоняет только саму попытку входа - это ближе к поведению типичного ограничителя попыток входа и меньше мешает добросовестному пользователю, который просто ошибся при вводе пароля. «Весь сайт» отклоняет все запросы с заблокированного IP-адреса и показывает сообщение, настроенное ниже. «Весь сайт + .htaccess» делает то же самое и дополнительно добавляет IP в .htaccess, чтобы сам веб-сервер отклонял его ещё до того, как запрос увидит Joomla (и этот плагин); это также означает, что IP, заблокированный таким образом, нельзя ограничить только входом, поэтому этот режим не предлагается вместе с «Только вход». Заблокированный так адрес может открыть только страницу разблокировки из письма для разблокировки: сброс пароля, настроенное ниже сообщение и остальной сайт ему недоступны. Применяется к любой блокировке, созданной автоматически или добавленной вручную в список блокировок." +COM_BFSTOP_SETTINGS_BLOCK_MODE_DESC="Что происходит после блокировки IP-адреса. «Только отчёты» ничего не ограничивает: неудачные попытки по-прежнему записываются, но ни один IP не блокируется, поэтому используйте этот режим, чтобы понаблюдать за активностью, прежде чем что-либо применять. «Только вход» позволяет IP как обычно просматривать сайт (включая форму входа) и отклоняет только саму попытку входа - это ближе к поведению типичного ограничителя попыток входа и меньше мешает добросовестному пользователю, который просто ошибся при вводе пароля. «Весь сайт» отклоняет все запросы с заблокированного IP-адреса и показывает сообщение, настроенное ниже. «Весь сайт + .htaccess» делает то же самое и дополнительно добавляет IP в .htaccess, чтобы сам веб-сервер отклонял его ещё до того, как запрос увидит Joomla (и этот плагин); это также означает, что IP, заблокированный таким образом, нельзя ограничить только входом, поэтому этот режим не предлагается вместе с «Только вход». Заблокированный так адрес может открыть только страницу разблокировки из письма для разблокировки: сброс пароля, настроенное ниже сообщение и остальной сайт ему недоступны. Применяется к любой блокировке, созданной автоматически или добавленной вручную в список блокировок. «Только вход» распознаёт формы входа собственных фронтенда и бэкенда Joomla (com_users, com_login) и входы с учётными данными через API веб-сервисов. Через расширения, которые сами выполняют вход пользователей (вход через соцсети или единый вход, модули входа, отправляющие данные в собственный контроллер, ключи доступа), заблокированный адрес по-прежнему может войти: если на вашем сайте есть такие способы входа, выберите «Весь сайт»." COM_BFSTOP_SETTINGS_BLOCK_MODE_OFF="Только отчёты" COM_BFSTOP_SETTINGS_BLOCK_MODE_LOGINONLY="Только вход" COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL="Весь сайт" @@ -205,6 +221,12 @@ COM_BFSTOP_LOG_CLEAR_CONFIRM="Очистить" COM_BFSTOP_LOG_CLEARED="Журнал очищен." COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Ссылки разблокировки можно отправлять, только если задан адрес сайта ($live_site в configuration.php сайта). Задайте его там или отключите ссылки разблокировки." COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="«%1$s» (%2$d) не может быть больше, чем «%3$s» (%4$d): каждый клиент получил бы %2$d попыток. Уменьшите «%1$s» или увеличьте «%3$s»." +COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE="Этот сайт работает на nginx, который не читает файлы .htaccess: режим блокировки «%1$s» здесь работать не может. Выберите «%2$s»; nginx может запрещать адреса в собственной конфигурации." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_LABEL="Файл запретов nginx" +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DESC="Только для сайтов, которые обслуживает nginx, не читающий файлы .htaccess: файл (абсолютный путь, оканчивающийся на .conf), в котором BFStop хранит активные блокировки в виде строк «deny», чтобы блок server конфигурации nginx сайта включал его. nginx читает его только при перезагрузке: обеспечьте перезагрузку при изменении файла (например, с помощью path-юнита systemd или задания cron, выполняющего «nginx -t && nginx -s reload»). Адреса из списка разрешённых и доверенные прокси пропускаются. Пусто: файла нет." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_PATH="BFStop не может записать этот файл как файл запретов nginx: %1$s. Это должен быть абсолютный путь к файлу, имя которого оканчивается на %2$s." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_DIRECTORY="Каталог файла запретов nginx %1$s не существует или недоступен для записи." +COM_BFSTOP_SETTINGS_NGINX_DENY_FILE_FOREIGN="%1$s существует и записан не BFStop: он был бы перезаписан. Выберите новый файл." COM_BFSTOP_WARNING_NO_LIVE_SITE="Адрес сайта не задан ($live_site в configuration.php). Тогда Joomla! строит ссылки в письмах Brute Force Stop с хостом, указанным в каждом запросе, который посетитель может выбрать произвольно, — поэтому ссылки разблокировки не отправляются, а уведомления администраторам не содержат адреса. Чтобы задать адрес, добавьте эту строку в класс в configuration.php сайта, указав адрес, по которому доступен сайт (предложен на основе этого запроса, проверьте его): %s" COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Ссылки разблокировки должны отправляться (настройки), но адрес сайта не задан ($live_site в configuration.php): ссылки разблокировки не отправляются." COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (рекомендуется)" @@ -214,3 +236,19 @@ COM_BFSTOP_IP_NETWORK_TOO_LARGE="Сеть %1$s слишком велика: дл COM_BFSTOP_IPADDRESS_TRUSTED_PROXY="Это (или содержит) доверенный прокси из настроек: при блокировке в файле .htaccess отклонялся бы любой запрос, проходящий через него." COM_BFSTOP_SETTINGS_HTACCESS_NOT_TIDIED="Brute Force Stop не удалось убрать свои блокировки из %s, который больше не блокирует: веб-сервер продолжает отклонять эти адреса, даже после окончания их блокировок. Сделайте файл доступным для записи и удалите их вручную - они в строках <If> между '# BEGIN BFStop Blocks' и '# END BFStop Blocks'." COM_BFSTOP_BLOCK_HTACCESS_NOT_WRITTEN="Блокировка сохранена, но её не удалось добавить в %s: Joomla отклоняет адрес, веб-сервер — нет." + +; the messages of the User Actions Log (see ActionLogHelper) +COM_BFSTOP_ACTIONLOG_BLOCK_ADDED="Пользователь {username} заблокировал {ipaddress} в Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_CHANGED="Пользователь {username} изменил блокировку {ipaddress} в Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED="Пользователь {username} снял блокировки {ipaddresses} в Brute Force Stop" +COM_BFSTOP_ACTIONLOG_BLOCK_LIFTED_BY_TOKEN="Блокировка {ipaddress} в Brute Force Stop снята по ссылке из письма для разблокировки" +COM_BFSTOP_ACTIONLOG_ALLOW_ADDED="Пользователь {username} добавил {ipaddress} в список разрешённых Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_CHANGED="Пользователь {username} изменил запись {ipaddress} в списке разрешённых Brute Force Stop" +COM_BFSTOP_ACTIONLOG_ALLOW_REMOVED="Пользователь {username} удалил {ipaddresses} из списка разрешённых Brute Force Stop" +COM_BFSTOP_ACTIONLOG_HTACCESS_ADDED="Пользователь {username} заблокировал {ipaddress} в файле .htaccess" +COM_BFSTOP_ACTIONLOG_HTACCESS_REMOVED="Пользователь {username} удалил {ipaddresses} из файла .htaccess" +COM_BFSTOP_ACTIONLOG_SETTINGS_CHANGED="Пользователь {username} изменил настройки Brute Force Stop: {settings}" +COM_BFSTOP_ACTIONLOG_LOG_PRUNED="Пользователь {username} удалил из журнала Brute Force Stop {count} записей старше {days} дней" +COM_BFSTOP_ACTIONLOG_LOG_CLEARED="Пользователь {username} очистил журнал Brute Force Stop" +COM_BFSTOP_ACTIONLOG_FAILEDLOGINS_PURGED="Пользователь {username} удалил из Brute Force Stop {count} неудачных входов старше {days} дней" +COM_BFSTOP_ACTIONLOG_USERNAMESTATS_PURGED="Пользователь {username} удалил из Brute Force Stop статистику {count} имён пользователей, не встречавшихся {days} дней" diff --git a/component/admin/src/Controller/AllowController.php b/component/admin/src/Controller/AllowController.php index a95147e..59a93d5 100644 --- a/component/admin/src/Controller/AllowController.php +++ b/component/admin/src/Controller/AllowController.php @@ -10,7 +10,9 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; class AllowController extends FormController { @@ -35,6 +37,20 @@ protected function allowEdit($data = array(), $key = 'id') return parent::allowEdit($data, $key) && $this->mayChangeAllowList(); } + /** + * An entry of the allow list added or changed goes into the User + * Actions Log: it exempts addresses from blocking. + */ + protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) + { + $id = (int) $model->getState($model->getName().'.id'); + $addresses = ActionLogHelper::addresses('#__bfstop_allowlist', array($id)); + ActionLogHelper::log($model->getState($model->getName().'.new') ? 'allow_added' : 'allow_changed', array( + 'id' => $id, + 'ipaddress' => $addresses[$id] ?? (string) ($validData['ipaddress'] ?? ''), + )); + } + public function save($key = null, $urlVar = null) { $return = parent::save($key, $urlVar); diff --git a/component/admin/src/Controller/BlockController.php b/component/admin/src/Controller/BlockController.php index 24e1cdb..8aa8e5e 100644 --- a/component/admin/src/Controller/BlockController.php +++ b/component/admin/src/Controller/BlockController.php @@ -10,7 +10,13 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; +use Codeling\Component\Bfstop\Administrator\Helper\LogHelper; use Codeling\Library\Bfstop\Helper\IpHelper; +use Codeling\Library\Bfstop\Helper\NginxDenyFile; +use Codeling\Library\Bfstop\Repository\Repositories; +use Codeling\Library\Bfstop\Settings; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\CMS\MVC\Controller\FormController; class BlockController extends FormController @@ -52,6 +58,22 @@ protected function allowSave($data, $key = 'id') return $user && $user->authorise('core.admin', $this->option); } + /** + * A block added or changed by hand goes into the User Actions Log. + */ + protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) + { + $id = (int) $model->getState($model->getName().'.id'); + $addresses = ActionLogHelper::addresses('#__bfstop_bannedip', array($id)); + // a block made or changed by hand goes into the nginx deny file as well + NginxDenyFile::syncForSettings(Settings::stored(), new Repositories(LogHelper::getLogger())); + ActionLogHelper::log($model->getState($model->getName().'.new') ? 'block_added' : 'block_changed', array( + 'id' => $id, + 'ipaddress' => $addresses[$id] ?? (string) ($validData['ipaddress'] ?? ''), + 'duration' => (string) ($validData['duration'] ?? ''), + )); + } + public function save($key = null, $urlVar = null) { $return = parent::save($key, $urlVar); diff --git a/component/admin/src/Controller/DisplayController.php b/component/admin/src/Controller/DisplayController.php index 6929761..32640cb 100644 --- a/component/admin/src/Controller/DisplayController.php +++ b/component/admin/src/Controller/DisplayController.php @@ -35,7 +35,7 @@ public function display($cachable = false, $urlparams = []) return $this; } $this->warnIfAdminUserExists(); - $this->warnIfHtAccessNotWorking(); + $this->warnIfHtAccessNotWorking($view); $this->checkWhetherProxyConfigured(); if ($view !== 'settings') { @@ -68,21 +68,41 @@ public function warnIfAdminUserExists() } } - public function warnIfHtAccessNotWorking() + /** + * Says why blocking through the .htaccess file won't work, if it doesn't + * look as if it would: where it is the blocking mode, and on the pages + * of the file's entries. + * + * @param string $view the page shown + */ + public function warnIfHtAccessNotWorking($view = '') { + if (ParamHelper::get('blockMode') !== 'htaccess' && $view !== 'htblocklist' && $view !== 'htblock') + { + return; + } $htaccessPath = UnblockHelper::getHtaccessPath(); $htaccess = new HtaccessHelper($htaccessPath, null); $req = $htaccess->checkRequirements(); - if (!$req['apacheserver'] || + $modes = array(Text::_('COM_BFSTOP_SETTINGS_BLOCK_MODE_HTACCESS'), Text::_('COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL')); + if ($req['server'] === HtaccessHelper::ServerNginx) + { + // the file itself doesn't matter: nginx never reads it + $this->app->enqueueMessage(Text::sprintf('COM_BFSTOP_WARNING_HTACCESS_NGINX', ...$modes), 'warning'); + return; + } + if ($req['server'] === HtaccessHelper::ServerLiteSpeed) + { + $this->app->enqueueMessage(Text::sprintf('COM_BFSTOP_WARNING_HTACCESS_LITESPEED', ...$modes), 'warning'); + } + // whether the web server honours the section takes requests to find + // out: the settings page has a button for it (settings.checkHtaccess) + if (!in_array($req['server'], array(HtaccessHelper::ServerApache, HtaccessHelper::ServerLiteSpeed), true) || !$req['found'] || !$req['readable'] || !$req['writeable']) - // TODO: add check whether .htaccess actually is effective! { - $application = $this->app; - $application->enqueueMessage(Text::_('COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING') - // .'found='.$req['found'].', readable='.$req['readable'].', writeable='.$req['writeable'].', apache='.$req['apacheserver'] - , 'warning'); + $this->app->enqueueMessage(Text::_('COM_BFSTOP_WARNING_HTACCESS_NOT_WORKING'), 'warning'); } } diff --git a/component/admin/src/Controller/FailedloginlistController.php b/component/admin/src/Controller/FailedloginlistController.php index b267bba..ba7f588 100644 --- a/component/admin/src/Controller/FailedloginlistController.php +++ b/component/admin/src/Controller/FailedloginlistController.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\LogHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; @@ -49,6 +50,7 @@ public function purge() { $deleted = $this->getModel('failedloginlist')->purgeOlderThan($age); $logger->log("Manually purged $deleted failed login entries older than $age days", Log::INFO); + ActionLogHelper::log('failedlogins_purged', array('count' => $deleted, 'days' => $age)); $this->setRedirect($listUrl, Text::plural('COM_BFSTOP_FAILEDLOGIN_PURGE_N_DELETED', $deleted, $age), 'message'); } diff --git a/component/admin/src/Controller/HtblockController.php b/component/admin/src/Controller/HtblockController.php index da73d88..74a5313 100644 --- a/component/admin/src/Controller/HtblockController.php +++ b/component/admin/src/Controller/HtblockController.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\LogHelper; use Codeling\Component\Bfstop\Administrator\Helper\UnblockHelper; use Codeling\Library\Bfstop\Repository\Repositories; @@ -110,6 +111,7 @@ public function save($key = null, $urlVar = null) if ($result) { $logger->log("Added ipaddress '$ipaddress' to .htaccess from backend", Log::INFO); + ActionLogHelper::log('htaccess_added', array('ipaddress' => $ipaddress)); $this->setRedirect( Route::_('index.php?option=com_bfstop&view=htblocklist', false) ); diff --git a/component/admin/src/Controller/LogController.php b/component/admin/src/Controller/LogController.php index 23e1fd1..1563351 100644 --- a/component/admin/src/Controller/LogController.php +++ b/component/admin/src/Controller/LogController.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\LogHelper; use Codeling\Component\Bfstop\Administrator\Helper\ParamHelper; use Codeling\Library\Bfstop\Helper\LoggerHelper; @@ -62,6 +63,7 @@ public function prune() LoggerHelper::rotateIfTooBig(LoggerHelper::maxBytesFromMegabytes($maxMB)); $deleted = LoggerHelper::pruneByAge($keepDays); LogHelper::getLogger()->log("Manually pruned $deleted log entries older than $keepDays days", Log::INFO); + ActionLogHelper::log('log_pruned', array('count' => $deleted, 'days' => $keepDays)); $this->setRedirect($listUrl, Text::plural('COM_BFSTOP_LOG_PRUNE_N_DELETED', $deleted, $keepDays), 'message'); } @@ -77,6 +79,7 @@ public function clear() LoggerHelper::deleteLogFiles(); // the new log file starts with a note on what happened to the old one $logger->log('The log was cleared manually', Log::INFO); + ActionLogHelper::log('log_cleared'); $this->setRedirect($listUrl, Text::_('COM_BFSTOP_LOG_CLEARED'), 'message'); } } diff --git a/component/admin/src/Controller/SettingsController.php b/component/admin/src/Controller/SettingsController.php index 1359570..a6e5392 100644 --- a/component/admin/src/Controller/SettingsController.php +++ b/component/admin/src/Controller/SettingsController.php @@ -10,8 +10,10 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\HtaccessCheckHelper; use Codeling\Component\Bfstop\Administrator\Helper\LogHelper; use Codeling\Component\Bfstop\Administrator\Helper\ParamHelper; +use Codeling\Component\Bfstop\Administrator\Helper\UnblockHelper; use Codeling\Library\Bfstop\Helper\NotifierHelper; use Codeling\Library\Bfstop\Repository\Repositories; use Joomla\CMS\Language\Text; @@ -100,6 +102,50 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') return ''; } + /** + * Checks whether the web server honours the block section of the + * .htaccess file (see HtaccessCheckHelper), for the directory of the + * saved settings. + */ + public function checkHtaccess() + { + $this->checkToken(); + $settingsUrl = Route::_('index.php?option=com_bfstop&view=settings', false); + if (!$this->allowSave()) + { + $this->setRedirect($settingsUrl, Text::_('COM_BFSTOP_NOT_AUTHORISED'), 'error'); + return; + } + $dir = UnblockHelper::getHtaccessPath(); + list($message, $type) = self::htaccessCheckMessage(HtaccessCheckHelper::run($dir), $dir); + $this->setRedirect($settingsUrl, $message, $type); + } + + /** + * The message and its type for the result of HtaccessCheckHelper::run() + * for the directory $dir. + * + * @return string[] array(message, type) + */ + public static function htaccessCheckMessage(array $result, string $dir): array + { + list($outcome, $detail) = $result; + $where = htmlspecialchars($dir, ENT_QUOTES, 'UTF-8'); + switch ($outcome) + { + case HtaccessCheckHelper::Effective: + return array(Text::sprintf('COM_BFSTOP_HTACCESS_CHECK_EFFECTIVE', $where), 'message'); + case HtaccessCheckHelper::Ignored: + return array(Text::sprintf('COM_BFSTOP_HTACCESS_CHECK_IGNORED', $where), 'warning'); + case HtaccessCheckHelper::Broken: + return array(Text::sprintf('COM_BFSTOP_HTACCESS_CHECK_BROKEN', $where), 'error'); + } + $reason = in_array($detail, array('outside', 'write', 'request'), true) + ? Text::_('COM_BFSTOP_HTACCESS_CHECK_REASON_'.strtoupper($detail)) + : Text::sprintf('COM_BFSTOP_HTACCESS_CHECK_REASON_STATUS', htmlspecialchars($detail, ENT_QUOTES, 'UTF-8')); + return array(Text::sprintf('COM_BFSTOP_HTACCESS_CHECK_UNKNOWN', $where, $reason), 'warning'); + } + public function testNotify() { $this->checkToken(); diff --git a/component/admin/src/Controller/UsernamestatsController.php b/component/admin/src/Controller/UsernamestatsController.php index 6e39f66..b4a5842 100644 --- a/component/admin/src/Controller/UsernamestatsController.php +++ b/component/admin/src/Controller/UsernamestatsController.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\LogHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; @@ -49,6 +50,7 @@ public function purge() { $deleted = $this->getModel('usernamestats')->purgeNotSeenFor($age); $logger->log("Manually deleted statistics of $deleted usernames not seen for $age days", Log::INFO); + ActionLogHelper::log('usernamestats_purged', array('count' => $deleted, 'days' => $age)); $this->setRedirect($listUrl, Text::plural('COM_BFSTOP_USERNAMESTATS_PURGE_N_DELETED', $deleted, $age), 'message'); } diff --git a/component/admin/src/Helper/ActionLogHelper.php b/component/admin/src/Helper/ActionLogHelper.php new file mode 100644 index 0000000..bea784d --- /dev/null +++ b/component/admin/src/Helper/ActionLogHelper.php @@ -0,0 +1,131 @@ + value; values are escaped where shown + */ + public static function log(string $action, array $data = array()): void + { + try + { + if (!self::isEnabled()) + { + return; + } + $app = Factory::getApplication(); + $user = $app->getIdentity(); + $userId = $user ? (int) $user->id : 0; + $message = array_map(fn ($value) => is_array($value) ? implode(', ', $value) : (string) $value, $data) + array( + 'action' => $action, + 'userid' => (string) $userId, + 'username' => $user ? (string) $user->username : '', + 'accountlink' => 'index.php?option=com_users&task=user.edit&id='.$userId, + ); + // com_actionlogs' ActionlogModel, as Joomla's own action log plugins use it + $component = $app->bootComponent('com_actionlogs'); + if (!$component instanceof MVCFactoryServiceInterface) + { + return; + } + $model = $component->getMVCFactory()->createModel('Actionlog', 'Administrator', array('ignore_request' => true)); + if (!is_object($model) || !method_exists($model, 'addLog')) + { + return; + } + $model->addLog(array($message), self::KeyPrefix.strtoupper($action), self::Extension, $userId); + } + catch (\Throwable $e) + { + LogHelper::getLogger()->log('Could not write "'.$action.'" to the User Actions Log: '.$e->getMessage(), Log::WARNING); + } + } + + /** + * Whether the User Actions Log records BFStop: it is among the extensions + * of its option "Events To Log". + */ + public static function isEnabled(): bool + { + if (!ComponentHelper::isEnabled('com_actionlogs')) + { + return false; + } + $extensions = ComponentHelper::getParams('com_actionlogs')->get('loggable_extensions', array()); + return in_array(self::Extension, (array) $extensions, true); + } + + /** + * The addresses of the rows $ids of the list $table (#__bfstop_bannedip, + * #__bfstop_allowlist), for the message about what happened to them: read + * before it happens, the rows may be gone afterwards. + * + * @param int[] $ids + * @return string[] id => address + */ + public static function addresses(string $table, array $ids): array + { + $ids = array_values(array_filter(array_map('intval', $ids))); + if (count($ids) === 0 || !in_array($table, array('#__bfstop_bannedip', '#__bfstop_allowlist'), true)) + { + return array(); + } + try + { + $db = Factory::getContainer()->get(DatabaseInterface::class); + $query = $db->createQuery() + ->select($db->quoteName(array('id', 'ipaddress'))) + ->from($db->quoteName($table)) + ->whereIn($db->quoteName('id'), $ids, ParameterType::INTEGER) + ->order($db->quoteName('id')); + $db->setQuery($query); + return $db->loadAssocList('id', 'ipaddress') ?: array(); + } + catch (\Throwable $e) + { + return array(); + } + } +} diff --git a/component/admin/src/Helper/HtaccessCheckHelper.php b/component/admin/src/Helper/HtaccessCheckHelper.php new file mode 100644 index 0000000..50b7bc3 --- /dev/null +++ b/component/admin/src/Helper/HtaccessCheckHelper.php @@ -0,0 +1,147 @@ + and "Require", Apache 2.4). + * + * The block section itself can't be tried: it turns away blocked + * addresses, and the site has none to send a request from. So the check + * makes a probe directory in the directory of the .htaccess file, whose own + * .htaccess has a condition of the same form, and refuses the requests with + * a query of its choosing (HtaccessHelper::writeProbe()). It requests the + * probe's file over HTTP - from the site's own address, as a visitor would - + * once with another query, which has to get the file, and once with that + * one, which has to be refused. The directory is removed again right away. + */ +final class HtaccessCheckHelper +{ + public const Effective = 'effective'; + // the probe was served all the same + public const Ignored = 'ignored'; + // the server failed on the probe's .htaccess (500): it doesn't know a directive + public const Broken = 'broken'; + // the check could not be made; the detail says why + public const Unknown = 'unknown'; + + /** + * The URL the directory $dir is served at, if it is the site's + * directory or one in it; null otherwise. + */ + public static function urlOf(string $dir, string $siteRoot, string $siteUrl): ?string + { + $dir = realpath($dir); + $root = realpath($siteRoot); + if ($dir === false || $root === false) + { + return null; + } + if ($dir === $root) + { + return rtrim($siteUrl, '/'); + } + if (strpos($dir, $root.DIRECTORY_SEPARATOR) !== 0) + { + return null; + } + $relative = str_replace(DIRECTORY_SEPARATOR, '/', substr($dir, strlen($root) + 1)); + return rtrim($siteUrl, '/').'/'.implode('/', array_map('rawurlencode', explode('/', $relative))); + } + + /** + * Runs the check for the .htaccess file in $dir. + * + * @param callable|null $fetch url => array(status, body), or null if the + * request failed; null for a real HTTP request + * @return array array(result, detail): one of the constants, and what was + * seen (a status, a reason) for the message + */ + public static function run(string $dir, ?callable $fetch = null, ?string $siteRoot = null, ?string $siteUrl = null): array + { + $url = self::urlOf($dir, $siteRoot ?? JPATH_ROOT, $siteUrl ?? Uri::root()); + if ($url === null) + { + return array(self::Unknown, 'outside'); + } + $token = bin2hex(random_bytes(16)); + $probe = rtrim($dir, '/\\').'/bfstop-check-'.$token; + if (!HtaccessHelper::writeProbe($probe, $token)) + { + HtaccessHelper::removeProbe($probe); + return array(self::Unknown, 'write'); + } + try + { + $fetch ??= array(self::class, 'fetch'); + $file = $url.'/'.basename($probe).'/'.HtaccessHelper::ProbeFile; + $allowed = $fetch($file.'?allow='.$token); + if ($allowed === null) + { + return array(self::Unknown, 'request'); + } + if ((int) $allowed[0] === 500) + { + return array(self::Broken, '500'); + } + if ((int) $allowed[0] !== 200 || trim((string) $allowed[1]) !== $token) + { + // something else stands between the site and its own files + // (authentication, a firewall, a CDN): the check can't say + return array(self::Unknown, (string) (int) $allowed[0]); + } + $denied = $fetch($file.'?deny='.$token); + if ($denied === null) + { + return array(self::Unknown, 'request'); + } + switch ((int) $denied[0]) + { + case 403: + return array(self::Effective, '403'); + case 500: + return array(self::Broken, '500'); + case 200: + return array(self::Ignored, '200'); + default: + return array(self::Unknown, (string) (int) $denied[0]); + } + } + finally + { + HtaccessHelper::removeProbe($probe); + } + } + + /** + * A GET request of $url, not to be answered from a cache on the way: + * array(status, body), or null if it failed. + */ + public static function fetch(string $url): ?array + { + try + { + $http = HttpFactory::getHttp(array(), array('curl', 'stream')); + $response = $http->get($url, array('Cache-Control' => 'no-cache', 'Pragma' => 'no-cache'), 10); + return array((int) $response->getStatusCode(), (string) $response->getBody()); + } + catch (\Throwable $e) + { + return null; + } + } +} diff --git a/component/admin/src/Helper/UnblockHelper.php b/component/admin/src/Helper/UnblockHelper.php index ab785bc..6344f05 100644 --- a/component/admin/src/Helper/UnblockHelper.php +++ b/component/admin/src/Helper/UnblockHelper.php @@ -11,7 +11,9 @@ defined('_JEXEC') or die; use Codeling\Library\Bfstop\Helper\HtaccessHelper; +use Codeling\Library\Bfstop\Helper\NginxDenyFile; use Codeling\Library\Bfstop\Repository\Repositories; +use Codeling\Library\Bfstop\Settings; use Joomla\CMS\Log\Log; class UnblockHelper @@ -33,8 +35,11 @@ public static function getHtaccessPath() public static function removeLiftedHtaccessBlocks($logger) { $htaccess = new HtaccessHelper(self::getHtaccessPath(), $logger); - $htaccess->removeStaleBlocks((new Repositories($logger))->blocks(), + $repositories = new Repositories($logger); + $htaccess->removeStaleBlocks($repositories->blocks(), ParamHelper::get('blockMode') === 'htaccess'); + // the same for nginx's file, which is written from the block list + NginxDenyFile::syncForSettings(Settings::stored(), $repositories); } public static function unblockHtaccess($ips, $logger) diff --git a/component/admin/src/Model/AllowlistModel.php b/component/admin/src/Model/AllowlistModel.php index 3cf7912..e061445 100644 --- a/component/admin/src/Model/AllowlistModel.php +++ b/component/admin/src/Model/AllowlistModel.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\OrderingHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; @@ -50,6 +51,7 @@ public function remove($ids, $logger) { return Text::_('COM_BFSTOP_ALLOWLIST_NOTHING_REMOVED'); } + $addresses = ActionLogHelper::addresses('#__bfstop_allowlist', $ids); try { $db = $this->getDatabase(); @@ -61,6 +63,7 @@ public function remove($ids, $logger) $query->where($conditions); $db->setQuery($query); $db->execute(); + ActionLogHelper::log('allow_removed', array('ipaddresses' => array_values($addresses))); return Text::_('COM_BFSTOP_ALLOWLIST_REMOVED'); } catch (\RuntimeException $e) diff --git a/component/admin/src/Model/BlocklistModel.php b/component/admin/src/Model/BlocklistModel.php index dff08fc..606d240 100644 --- a/component/admin/src/Model/BlocklistModel.php +++ b/component/admin/src/Model/BlocklistModel.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\OrderingHelper; use Codeling\Component\Bfstop\Administrator\Helper\UnblockHelper; use Codeling\Library\Bfstop\Repository\BlockRepository; @@ -51,6 +52,7 @@ protected function populateState($ordering = null, $direction = null) public function unblock($ids, $logger) { + $addresses = ActionLogHelper::addresses('#__bfstop_bannedip', is_array($ids) ? $ids : array()); $unblocked = (new Repositories($logger, $this->getDatabase()))->blocks() ->lift(is_array($ids) ? $ids : array(), BlockRepository::LiftedByAdministrator); // with blocking through .htaccess, the web server would otherwise go on @@ -58,6 +60,7 @@ public function unblock($ids, $logger) UnblockHelper::removeLiftedHtaccessBlocks($logger); if ($unblocked) { + ActionLogHelper::log('blocks_lifted', array('ipaddresses' => array_values($addresses))); return Text::_("COM_BFSTOP_UNBLOCK_SUCCESS"); } else diff --git a/component/admin/src/Model/HtblocklistModel.php b/component/admin/src/Model/HtblocklistModel.php index 908f970..0d772f9 100644 --- a/component/admin/src/Model/HtblocklistModel.php +++ b/component/admin/src/Model/HtblocklistModel.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\UnblockHelper; use Codeling\Library\Bfstop\Helper\HtaccessHelper; use Joomla\CMS\Language\Text; @@ -76,6 +77,7 @@ public function unblock($ids, $logger) { if (UnblockHelper::unblockHtaccess($ids, $logger)) { + ActionLogHelper::log('htaccess_removed', array('ipaddresses' => array_values(array_map('strval', (array) $ids)))); return Text::_("COM_BFSTOP_UNBLOCK_SUCCESS"); } else diff --git a/component/admin/src/Model/SettingsModel.php b/component/admin/src/Model/SettingsModel.php index ad5bf98..85b439a 100644 --- a/component/admin/src/Model/SettingsModel.php +++ b/component/admin/src/Model/SettingsModel.php @@ -10,8 +10,10 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\LogHelper; use Codeling\Library\Bfstop\Helper\HtaccessHelper; +use Codeling\Library\Bfstop\Helper\NginxDenyFile; use Codeling\Library\Bfstop\Origin; use Codeling\Library\Bfstop\Repository\Repositories; use Codeling\Library\Bfstop\Service\BlockPolicy; @@ -120,6 +122,15 @@ public function validate($form, $data, $group = null) $this->setError(Text::_('COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE')); return false; } + if (is_array($valid) && ($valid['params']['blockMode'] ?? '') === 'htaccess' && + HtaccessHelper::webServer($_SERVER['SERVER_SOFTWARE'] ?? '') === HtaccessHelper::ServerNginx) + { + // nginx never reads the file: the mode would only pretend to block + // in the web server + $this->setError(Text::sprintf('COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE', + Text::_('COM_BFSTOP_SETTINGS_BLOCK_MODE_HTACCESS'), Text::_('COM_BFSTOP_SETTINGS_BLOCK_MODE_FULL'))); + return false; + } if (is_array($valid)) { // the floor of the risk scoring is a floor of the threshold for @@ -164,9 +175,54 @@ public function save($data) return false; } $this->tidyFormerHtaccessFile($stored, $data['params']); + self::syncNginxDenyFiles($stored, is_array($data['params']) ? $data['params'] : array()); + $changed = self::changedSettings($stored, is_array($data['params']) ? $data['params'] : array()); + if (count($changed) > 0) + { + ActionLogHelper::log('settings_changed', array('settings' => $changed)); + } return true; } + /** + * Writes the nginx deny file of the settings $params from the block list + * (see NginxDenyFile); the one of the settings $stored, if it is another + * one, gets no entries: nginx would go on blocking with it. + */ + public static function syncNginxDenyFiles(array $stored, array $params): void + { + $logger = LogHelper::getLogger(); + $former = trim((string) ($stored['nginxDenyFile'] ?? '')); + if ($former !== '' && $former !== trim((string) ($params['nginxDenyFile'] ?? '')) && is_file($former)) + { + (new NginxDenyFile($former, $logger))->write(array()); + } + NginxDenyFile::syncForSettings(new Registry($params), new Repositories($logger)); + } + + /** + * The names of the settings which differ between $before and $after (as + * stored), for the User Actions Log: the names only, not the values. + * + * @return string[] + */ + public static function changedSettings(array $before, array $after): array + { + $changed = array(); + foreach (array_unique(array_merge(array_keys($before), array_keys($after))) as $name) + { + $old = $before[$name] ?? null; + $new = $after[$name] ?? null; + // stored as JSON: 5 and "5" are the same setting + if (json_encode(is_scalar($old) ? (string) $old : $old) !== json_encode(is_scalar($new) ? (string) $new : $new)) + { + $changed[] = (string) $name; + } + } + sort($changed); + return $changed; + } + /** * The directory of the .htaccess file of the settings $params (the * default is HtaccessHelper::resolvePath()'s), without a trailing slash, diff --git a/component/admin/src/Rule/NginxdenyfileRule.php b/component/admin/src/Rule/NginxdenyfileRule.php new file mode 100644 index 0000000..6ea70ce --- /dev/null +++ b/component/admin/src/Rule/NginxdenyfileRule.php @@ -0,0 +1,42 @@ +pluginVersion = (string) $versions['plugin']; $this->componentVersion = (string) $versions['component']; + $this->addressCheck = self::addressCheck($_SERVER, IpHelper::getAddress(LogHelper::getLogger())); + if (!BlockPolicy::hasLiveSite()) { Factory::getApplication()->enqueueMessage(self::liveSiteNote(), 'warning'); @@ -77,6 +82,52 @@ public static function liveSiteNote() ''.htmlspecialchars($line, ENT_QUOTES, 'UTF-8').''); } + // how much of a forwarding header the check shows at most + private const HeaderDisplayLength = 200; + + /** + * The check of the proxy settings on their tab: where the request of the + * administrator's browser came from, the forwarding headers it carried + * and which client address the plugin makes of that with the saved + * settings. An address which is not the one of the administrator's + * computer (the proxy's, one the browser can't have) shows that the + * settings don't fit, before visitors get blocked for it. + * + * @param array $server $_SERVER + * @param string $used IpHelper::getAddress() for the request + * @return string HTML + */ + public static function addressCheck(array $server, $used) + { + $escape = fn ($value) => htmlspecialchars((string) $value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + $lines = array(Text::sprintf('COM_BFSTOP_SETTINGS_ADDRESS_CHECK_REMOTE', + ''.$escape($server['REMOTE_ADDR'] ?? '').'')); + $headers = 0; + foreach (IpHelper::KnownProxyHeaders as $header) + { + if (!isset($server[$header]) || (string) $server[$header] === '') + { + continue; + } + // HTTP_X_FORWARDED_FOR: X-Forwarded-For + $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($header, 5))))); + $value = (string) $server[$header]; + if (mb_strlen($value, 'UTF-8') > self::HeaderDisplayLength) + { + $value = mb_substr($value, 0, self::HeaderDisplayLength, 'UTF-8').'…'; + } + $lines[] = Text::sprintf('COM_BFSTOP_SETTINGS_ADDRESS_CHECK_HEADER', + ''.$escape($name).'', ''.$escape($value).''); + ++$headers; + } + if ($headers === 0) + { + $lines[] = Text::_('COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER'); + } + $lines[] = Text::sprintf('COM_BFSTOP_SETTINGS_ADDRESS_CHECK_USED', ''.$escape($used).''); + return '
  • '.implode('
  • ', $lines).'
'; + } + protected function addToolbar() { ToolbarHelper::title(Text::_('COM_BFSTOP_HEADING_SETTINGS')); @@ -88,5 +139,11 @@ protected function addToolbar() ToolbarHelper::cancel('settings.cancel'); ToolbarHelper::custom('settings.testNotify', 'preview', '', 'COM_BFSTOP_TEST_NOTIFICATION', false); + if ($this->canSave) + { + // whether the web server honours the block section of .htaccess + ToolbarHelper::custom('settings.checkHtaccess', 'checkmark', '', + 'COM_BFSTOP_HTACCESS_CHECK', false); + } } } diff --git a/component/admin/tmpl/settings/default.php b/component/admin/tmpl/settings/default.php index 34b535c..026a846 100644 --- a/component/admin/tmpl/settings/default.php +++ b/component/admin/tmpl/settings/default.php @@ -25,6 +25,12 @@ description); ?> + +name === 'proxy' && $this->addressCheck !== ''): ?> +
+

+ addressCheck; ?> +
form->renderFieldset($fieldset->name); ?> diff --git a/component/installscript.php b/component/installscript.php index f82e422..f09eff1 100644 --- a/component/installscript.php +++ b/component/installscript.php @@ -13,7 +13,9 @@ use Joomla\CMS\Installer\InstallerScriptInterface; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; +use Joomla\Database\DatabaseInterface; use Joomla\Filesystem\Folder; +use Joomla\Registry\Registry; /** * Joomla takes the instance this file returns (see the end); the class keeps @@ -41,9 +43,104 @@ public function install(InstallerAdapter $adapter): bool public function uninstall(InstallerAdapter $adapter): bool { + self::unregisterFromActionLogs(Factory::getContainer()->get(DatabaseInterface::class)); return true; } + // what the User Actions Log knows the component by (see ActionLogHelper) + public const ActionLogExtension = 'com_bfstop'; + + /** + * Makes the component one of the extensions the User Actions Log offers + * to record ("Events To Log" in its options), and - when it is new + * there - one it records: an extension added to the list later is not + * ticked otherwise. If an administrator unticks it, an update leaves that + * as it is. + * + * @return bool whether it was new to the list + */ + public static function registerWithActionLogs(DatabaseInterface $db): bool + { + $extension = self::ActionLogExtension; + $query = $db->createQuery() + ->select('COUNT(*)') + ->from($db->quoteName('#__action_logs_extensions')) + ->where($db->quoteName('extension').' = :extension') + ->bind(':extension', $extension); + if ((int) $db->setQuery($query)->loadResult() > 0) + { + return false; + } + $row = (object) array('extension' => $extension); + $db->insertObject('#__action_logs_extensions', $row); + self::changeLoggedExtensions($db, function (array $extensions) use ($extension) + { + return in_array($extension, $extensions, true) ? $extensions : array_merge($extensions, array($extension)); + }); + return true; + } + + /** + * Takes the component out of the lists of the User Actions Log again. + * What it logged stays, as the entries of uninstalled extensions do. + */ + public static function unregisterFromActionLogs(DatabaseInterface $db): void + { + $extension = self::ActionLogExtension; + try + { + $query = $db->createQuery() + ->delete($db->quoteName('#__action_logs_extensions')) + ->where($db->quoteName('extension').' = :extension') + ->bind(':extension', $extension); + $db->setQuery($query)->execute(); + self::changeLoggedExtensions($db, function (array $extensions) use ($extension) + { + return array_values(array_diff($extensions, array($extension))); + }); + } + catch (\Throwable $e) + { + // nothing which should keep the component from being uninstalled + } + } + + /** + * Applies $change to the "loggable_extensions" option of com_actionlogs. + */ + private static function changeLoggedExtensions(DatabaseInterface $db, callable $change): void + { + $element = 'com_actionlogs'; + $query = $db->createQuery() + ->select($db->quoteName(array('extension_id', 'params'))) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('type').' = '.$db->quote('component')) + ->where($db->quoteName('element').' = :element') + ->bind(':element', $element); + $component = $db->setQuery($query)->loadObject(); + if ($component === null) + { + return; + } + $params = new Registry((string) $component->params); + $before = array_values(array_map('strval', (array) $params->get('loggable_extensions', array()))); + $after = $change($before); + if ($after === $before) + { + return; + } + $params->set('loggable_extensions', $after); + $json = $params->toString(); + $id = (int) $component->extension_id; + $update = $db->createQuery() + ->update($db->quoteName('#__extensions')) + ->set($db->quoteName('params').' = :params') + ->where($db->quoteName('extension_id').' = :id') + ->bind(':params', $json) + ->bind(':id', $id, \Joomla\Database\ParameterType::INTEGER); + $db->setQuery($update)->execute(); + } + public function update(InstallerAdapter $adapter): bool { $bfstopPath = JPATH_ADMINISTRATOR."/components/com_bfstop/"; @@ -71,6 +168,19 @@ public function update(InstallerAdapter $adapter): bool public function postflight(string $type, InstallerAdapter $adapter): bool { + if ($type === 'install' || $type === 'update' || $type === 'discover_install') + { + try + { + self::registerWithActionLogs(Factory::getContainer()->get(DatabaseInterface::class)); + } + catch (\Throwable $e) + { + // the component works without; the User Actions Log just lacks it + Factory::getApplication()->enqueueMessage('Could not register with the User Actions Log: '. + htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8'), 'warning'); + } + } // on an update, the plugin says what there is to review (if anything) if ($type !== 'install') { diff --git a/component/site/src/Model/TokenunblockModel.php b/component/site/src/Model/TokenunblockModel.php index 746b2cb..2b9daf3 100644 --- a/component/site/src/Model/TokenunblockModel.php +++ b/component/site/src/Model/TokenunblockModel.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\UnblockHelper; use Codeling\Library\Bfstop\Helper\IpHelper; use Codeling\Library\Bfstop\Repository\BlockRepository; @@ -111,7 +112,12 @@ public function process($token, $isPost, $requestIp, $logger) "other than the blocked one.", Log::WARNING); return self::ResultWrongIp; } - return $this->lift($repositories, $token, $issued['blockId'], $logger); + $result = $this->lift($repositories, $token, $issued['blockId'], $logger); + if ($result === self::ResultUnblocked) + { + ActionLogHelper::log('block_lifted_by_token', array('id' => $issued['blockId'], 'ipaddress' => $issued['address'])); + } + return $result; } /** diff --git a/component/site/src/View/Tokenunblock/HtmlView.php b/component/site/src/View/Tokenunblock/HtmlView.php index 026c0cc..2805272 100644 --- a/component/site/src/View/Tokenunblock/HtmlView.php +++ b/component/site/src/View/Tokenunblock/HtmlView.php @@ -89,8 +89,21 @@ public function display($tpl = null) // kept by caches, passed on to other sites in the Referer header of // requests for resources the template loads from them, or indexed. $app->allowCache(false); - $app->setHeader('Referrer-Policy', 'no-referrer', true); - $app->setHeader('X-Robots-Tag', 'noindex, nofollow', true); + // Its form unblocks with one click: no other site may show it in a + // frame (clickjacking), and its type is not for the browser to guess. + // X-Frame-Options, not a Content-Security-Policy: that would replace + // the policy the site may send already (Joomla's HTTP headers plugin); + // a frame-ancestors of that policy takes precedence in browsers which + // know it. + foreach (array( + 'Referrer-Policy' => 'no-referrer', + 'X-Robots-Tag' => 'noindex, nofollow', + 'X-Frame-Options' => 'DENY', + 'X-Content-Type-Options' => 'nosniff', + ) as $name => $value) + { + $app->setHeader($name, $value, true); + } parent::display($tpl); } } diff --git a/library/src/Helper/HtaccessHelper.php b/library/src/Helper/HtaccessHelper.php index dbf0e04..d5920f5 100644 --- a/library/src/Helper/HtaccessHelper.php +++ b/library/src/Helper/HtaccessHelper.php @@ -78,6 +78,60 @@ class HtaccessHelper */ public const MaxBlockLines = 2000; + // the file a probe directory holds besides its .htaccess (see writeProbe()) + public const ProbeFile = 'probe.html'; + // the address of the probe's condition: TEST-NET-1, never a real client + private const ProbeAddress = '192.0.2.1'; + + /** + * The .htaccess of a probe: an with "Require all denied" as the + * block section has, for an address no client has - or the query + * "deny=$token". Whether the web server honours the block section is + * then a matter of whether a request of the probe with that query is + * refused, and one with another query is not (see writeProbe()). + * + * @param string $token hex digits + * @return string[] + */ + public static function probeLines(string $token): array + { + if (!preg_match('/^[0-9a-f]{16,64}$/', $token)) + { + throw new \InvalidArgumentException('The token of a probe is 16 to 64 hex digits'); + } + return array( + '', + self::DenyLine, + self::EndIfLine, + ); + } + + /** + * Makes the probe directory $dir (which must not exist): a .htaccess (see + * probeLines()) and a file with $token as its content. + */ + public static function writeProbe(string $dir, string $token): bool + { + $lines = self::probeLines($token); + if (file_exists($dir) || !@mkdir($dir, 0755)) + { + return false; + } + return @file_put_contents($dir.'/.htaccess', implode("\n", $lines)."\n") !== false && + @file_put_contents($dir.'/'.self::ProbeFile, $token) !== false; + } + + /** + * Removes a probe directory made by writeProbe(), and only that: its two + * files, then the directory. + */ + public static function removeProbe(string $dir): void + { + @unlink($dir.'/.htaccess'); + @unlink($dir.'/'.self::ProbeFile); + @rmdir($dir); + } + /** * Construct class with given $path. * @@ -94,16 +148,44 @@ public function getFileName() return $this->path; } + public const ServerApache = 'apache'; + public const ServerLiteSpeed = 'litespeed'; + public const ServerNginx = 'nginx'; + public const ServerOther = 'other'; + + /** + * Which web server the SERVER_SOFTWARE $serverSoftware names, as far as + * the .htaccess file goes: Apache reads it; nginx never does (the blocks + * in it do nothing); LiteSpeed reads it, but not every directive of + * Apache - whether it honours the sections the blocks are written + * in depends on its edition and version. Anything else (or a server + * which doesn't say) is "other". + */ + public static function webServer($serverSoftware): string + { + $software = strtolower((string) $serverSoftware); + foreach (array(self::ServerLiteSpeed, self::ServerNginx, self::ServerApache) as $server) + { + if (str_contains($software, $server)) + { + return $server; + } + } + return self::ServerOther; + } + /** - * Check if .htaccess file is found, readable and writeable. + * Check if .htaccess file is found, readable and writeable, and which web + * server the site runs on (see webServer()). * * @return array */ public function checkRequirements() { + $server = self::webServer($_SERVER['SERVER_SOFTWARE'] ?? ''); $result = array( - 'apacheserver' => - strstr(preg_replace("/[^a-z]+/", "", strtolower($_SERVER['SERVER_SOFTWARE'] ?? '')), 'apache'), + 'server' => $server, + 'apacheserver' => $server === self::ServerApache, 'found' => file_exists($this->path), 'readable' => is_readable($this->path), 'writeable' => is_writeable($this->path) diff --git a/library/src/Helper/IpHelper.php b/library/src/Helper/IpHelper.php index 2c454e8..a403fb2 100644 --- a/library/src/Helper/IpHelper.php +++ b/library/src/Helper/IpHelper.php @@ -544,6 +544,34 @@ public static function getAddress(LoggerHelper $logger) // proxySettings() holds: its REMOTE_ADDR, header and the client address private static $address = null; + // a request which bypassed the proxy is warned about once in this many + // seconds for its address (or the others of its slot) + public const DirectRequestWarningInterval = 3600; + private const DirectRequestWarningSlots = 64; + + /** + * The stamp file of the warning about a request from $remoteAddr which + * did not come through the proxy (see mayWarnAboutDirectRequest()). + */ + public static function directRequestWarningFile($remoteAddr): string + { + return LockHelper::file('proxywarning', + LockHelper::slot($remoteAddr, self::DirectRequestWarningSlots), 'stamp'); + } + + /** + * Whether a request from $remoteAddr which did not come through the + * proxy is to be logged. Every such request would otherwise write a + * warning - anybody can send them, as many as they like, and push the + * entries that matter out of the rotated log - so it is once an hour for + * each address; addresses are spread over a fixed number of stamp files, + * so that many addresses can't fill the temporary directory either. + */ + private static function mayWarnAboutDirectRequest($remoteAddr): bool + { + return LockHelper::due(self::directRequestWarningFile($remoteAddr), self::DirectRequestWarningInterval); + } + /** * The client address of a request which came through a proxy, if * REMOTE_ADDR is one of the trusted ones, see getAddress(). @@ -554,6 +582,10 @@ private static function addressBehindProxy($remoteAddr, array $settings, LoggerH $trustedProxies = $settings['trustedProxies']; if (count($trustedProxies) === 0 || !self::isTrustedProxy($remoteAddr, $trustedProxies)) { + if (!self::mayWarnAboutDirectRequest($remoteAddr)) + { + return $remoteAddr; + } $logger->log('Proxy/load balancer usage is enabled, but the request did not originate from the '. 'configured proxy IP address (configured: "'.$proxyIpAddress.'", actual: "'.$remoteAddr. '") - ignoring the proxy header and using REMOTE_ADDR!', Log::WARNING); diff --git a/library/src/Helper/LockHelper.php b/library/src/Helper/LockHelper.php index c568074..8e029f1 100644 --- a/library/src/Helper/LockHelper.php +++ b/library/src/Helper/LockHelper.php @@ -88,6 +88,26 @@ public static function slot($key, int $count): int return hexdec(substr(hash_hmac('sha256', (string) $key, $secret), 0, 7)) % max(1, $count); } + /** + * Whether what the stamp $file stands for is due again: true if it wasn't + * done in the last $interval seconds (the file's modification time), and + * then the file is touched, so that the next $interval seconds say false. + * Two requests at the same moment may both be told true; it is meant for + * things like log messages, which must not repeat with every request. + * Where the file can't be written, everything is always due. + */ + public static function due(string $file, int $interval): bool + { + clearstatcache(true, $file); + $last = @filemtime($file); + if ($last !== false && time() - $last < $interval && $last <= time()) + { + return false; + } + @touch($file); + return true; + } + /** * Takes the exclusive lock on $file, creating the file if need be. * diff --git a/library/src/Helper/NginxDenyFile.php b/library/src/Helper/NginxDenyFile.php new file mode 100644 index 0000000..59c4e84 --- /dev/null +++ b/library/src/Helper/NginxDenyFile.php @@ -0,0 +1,214 @@ +file = $file; + $this->logger = $logger; + } + + public function getFileName(): string + { + return $this->file; + } + + /** + * The file of the settings $params, or null if there is none (the + * setting is empty). + */ + public static function forSettings(Registry $params, ?LoggerHelper $logger = null): ?self + { + $file = trim(Settings::string($params, 'nginxDenyFile')); + return $file === '' ? null : new self($file, $logger); + } + + /** + * Why the file $file can't be written by this class: 'path' (not an + * absolute plain path ending in .conf), 'directory' (its directory doesn't + * exist or isn't writable), 'foreign' (it exists, but wasn't written by + * this class) - or null if it can. + */ + public static function problem(string $file): ?string + { + if (preg_match('/[\x00-\x1f]/', $file) || preg_match('#^[a-z][a-z0-9+.-]*://#i', $file) || + !(str_starts_with($file, '/') || preg_match('#^[A-Za-z]:[\\\\/]#', $file)) || + !str_ends_with(strtolower($file), self::Suffix) || basename($file) === self::Suffix) + { + return 'path'; + } + $dir = dirname($file); + if (!is_dir($dir) || !is_writable($dir)) + { + return 'directory'; + } + if (file_exists($file) && !self::isOwn($file)) + { + return 'foreign'; + } + return null; + } + + private static function isOwn(string $file): bool + { + $handle = @fopen($file, 'r'); + if ($handle === false) + { + return false; + } + $first = fgets($handle); + fclose($handle); + return $first !== false && rtrim($first, "\r\n") === self::Header; + } + + /** + * The content of the file for the entries $entries; only addresses and + * networks get in (what is written there is part of the server's + * configuration), each once, and at most HtaccessHelper::MaxBlockLines. + * + * @param string[] $entries + */ + public static function content(array $entries): string + { + $entries = array_slice(array_values(array_unique(array_filter(array_map('strval', $entries), + array(IpHelper::class, 'isValidIpOrSubnet')))), 0, HtaccessHelper::MaxBlockLines); + $lines = array(self::Header); + foreach ($entries as $entry) + { + $lines[] = 'deny '.$entry.';'; + } + return implode("\n", $lines)."\n"; + } + + /** + * Writes the file with the entries $entries, in one step (a file next to + * it, renamed), unless it holds them already. + * + * @param string[] $entries + */ + public function write(array $entries): bool + { + $problem = self::problem($this->file); + if ($problem !== null) + { + $this->log('Not writing the nginx deny file '.$this->file.': '.array( + 'path' => 'it must be an absolute path of a file named *.conf', + 'directory' => 'its directory does not exist or is not writable', + 'foreign' => 'the file exists, but was not written by BFStop', + )[$problem], Log::ERROR); + return false; + } + $content = self::content($entries); + if (is_file($this->file) && @file_get_contents($this->file) === $content) + { + return true; + } + $temporary = $this->file.'.'.bin2hex(random_bytes(4)).'.tmp'; + if (@file_put_contents($temporary, $content) === false || !@rename($temporary, $this->file)) + { + @unlink($temporary); + $this->log('Could not write the nginx deny file '.$this->file, Log::ERROR); + return false; + } + @chmod($this->file, 0644); + return true; + } + + /** + * Writes the file from the block list: the entries of the active blocks + * if $blocking (the blocking mode is "Full Site"), else none. Not if the + * block list can't be read: the file stays as it is then. + */ + public function sync(Repositories $repositories, bool $blocking): bool + { + if (!$blocking) + { + // nothing is to be blocked by nginx; a file which isn't there yet + // needn't be made for that + return !file_exists($this->file) || $this->write(array()); + } + $addresses = $repositories->blocks()->activeAddresses(); + if ($addresses === null) + { + return false; + } + $proxies = IpHelper::trustedProxies(); + $entries = array(); + foreach ($addresses as $address) + { + $allowed = $repositories->allowList()->entriesOverlapping($address); + if ($allowed === null) + { + // can't tell which addresses would be turned away with it + return false; + } + if (count($allowed) === 0 && !IpHelper::overlapsTrustedProxy($address, $proxies)) + { + $entries[] = $address; + } + } + return $this->write($entries); + } + + /** + * Writes the file of the settings $params from the block list (see + * sync()), if they name one. + */ + public static function syncForSettings(Registry $params, Repositories $repositories): ?bool + { + $file = self::forSettings($params, $repositories->logger()); + return $file?->sync($repositories, Settings::string($params, 'blockMode') === 'full'); + } + + private function log(string $message, int $priority): void + { + $this->logger?->log($message, $priority); + } +} diff --git a/library/src/Repository/BlockRepository.php b/library/src/Repository/BlockRepository.php index 52b9a8a..bdaba0f 100644 --- a/library/src/Repository/BlockRepository.php +++ b/library/src/Repository/BlockRepository.php @@ -117,6 +117,28 @@ public function addressesWithoutActiveBlock() }, array()); } + /** + * The addresses and networks of the active blocks, those of the newest + * blocks first: for blocking through the web server's configuration. + * + * @return string[]|null null (unknown) if the block list could not be read + */ + public function activeAddresses() + { + return $this->unknown('activeAddresses', function () + { + $query = $this->db->createQuery() + ->select($this->db->quoteName('t.ipaddress')) + ->select('MAX('.$this->db->quoteName('t.id').') AS newest') + ->from($this->db->quoteName(self::Table, 't')) + ->where($this->activeCondition('t', 'u')) + ->group($this->db->quoteName('t.ipaddress')) + ->order('newest DESC'); + $values = array('now' => self::now()); + return $this->column($query, $values); + }); + } + /** * Every address and network of the block list, whether its block is * active or not. @@ -159,6 +181,52 @@ public function recordAttempt(array $blockIds) }, null); } + /** + * Counts a submission of the password recovery forms (see + * RequestClassifier::passwordRecovery()) by a client with the active + * blocks $blockIds, against the newest of them: the count starts again + * once $windowMinutes have passed since the first submission it holds. + * + * Fail-open: 0, the submission goes through (the recovery stays reachable, + * which is what it is let through for). + * + * @param int[] $blockIds + * @return int how many submissions the current window holds, this one included + */ + public function countRecoverySubmission(array $blockIds, int $windowMinutes): int + { + if (count($blockIds) === 0) + { + return 0; + } + return $this->failOpen('countRecoverySubmission', function () use ($blockIds, $windowMinutes) + { + $now = self::now(); + $values = array( + 'id' => max(array_map('intval', $blockIds)), + 'start' => self::minutesBefore($now, $windowMinutes), + 'start2' => self::minutesBefore($now, $windowMinutes), + 'now' => $now, + ); + $count = $this->db->quoteName('recovery_requests'); + $since = $this->db->quoteName('recovery_since'); + // the count first: MySQL evaluates the assignments in order, so the + // second one would see the new recovery_since (PostgreSQL uses the + // old values in both) + $query = $this->db->createQuery() + ->update($this->db->quoteName(self::Table)) + ->set($count.' = CASE WHEN '.$since.' IS NULL OR '.$since.' < :start THEN 1 ELSE '.$count.' + 1 END') + ->set($since.' = CASE WHEN '.$since.' IS NULL OR '.$since.' < :start2 THEN :now ELSE '.$since.' END') + ->where($this->db->quoteName('id').' = :id'); + $this->execute($query, $values); + $read = array('id' => $values['id']); + return $this->count($this->db->createQuery() + ->select($count) + ->from($this->db->quoteName(self::Table)) + ->where($this->db->quoteName('id').' = :id'), $read); + }, 0); + } + /** * Adds a block. * diff --git a/library/src/Service/BlockPolicy.php b/library/src/Service/BlockPolicy.php index d388d6c..b0d639a 100644 --- a/library/src/Service/BlockPolicy.php +++ b/library/src/Service/BlockPolicy.php @@ -11,6 +11,7 @@ defined('_JEXEC') or die; use Codeling\Library\Bfstop\Helper\HtaccessHelper; +use Codeling\Library\Bfstop\Helper\NginxDenyFile; use Codeling\Library\Bfstop\Helper\IpHelper; use Codeling\Library\Bfstop\Helper\LoggerHelper; use Codeling\Library\Bfstop\Repository\BlockRepository; @@ -29,6 +30,12 @@ */ class BlockPolicy { + // how often a blocked client may submit the forms of the password + // recovery (request a reset, confirm it with the code, set the password, + // ask for the username) in an hour: the three steps of a reset, and some + // room for mistakes - not a stream of mails (issue #285) + public const RecoverySubmissionsPerHour = 10; + // values of the "notifyBlockedUser" setting besides 0 (off): 1 only to // users who logged in from the blocked address before, 2 for any address // - which needs the site's $live_site, see effectiveNotifyBlockedUser() @@ -212,6 +219,15 @@ public function escalatedDuration($address, $duration) return $duration; } + /** + * The nginx deny file the blocks go into (see NginxDenyFile), if the + * settings name one and the blocking mode is "Full Site". + */ + public function nginxDenyFile(): ?NginxDenyFile + { + return $this->mode() === 'full' ? NginxDenyFile::forSettings($this->params, $this->logger) : null; + } + /** * Whether $address may be blocked through the .htaccess file, not only in * the database: the web server turns away whatever the entry covers, diff --git a/library/src/Service/BlockService.php b/library/src/Service/BlockService.php index 23d00bb..7fdfe77 100644 --- a/library/src/Service/BlockService.php +++ b/library/src/Service/BlockService.php @@ -101,6 +101,9 @@ public function blockAsDecided($logEntry, $clientAddress, BlockPolicy $policy, b return null; } $logger->log('Inserted IP address '.$logEntry->ipaddress.' into block list', Log::INFO); + // written from the block list, which has the new block now (and no + // longer has those which ran out) + $policy->nginxDenyFile()?->sync($this->repositories, true); return array('id' => $id, 'duration' => $decision['duration'], 'targetedOtherAccounts' => $decision['targetedOtherAccounts'], 'failedLogins' => $failedLogins); } diff --git a/library/src/Service/DailyMaintenance.php b/library/src/Service/DailyMaintenance.php index 69d62b8..115cc0a 100644 --- a/library/src/Service/DailyMaintenance.php +++ b/library/src/Service/DailyMaintenance.php @@ -13,6 +13,7 @@ use Codeling\Library\Bfstop\Helper\HtaccessHelper; use Codeling\Library\Bfstop\Helper\LockHelper; use Codeling\Library\Bfstop\Helper\LoggerHelper; +use Codeling\Library\Bfstop\Helper\NginxDenyFile; use Codeling\Library\Bfstop\Repository\Repositories; use Codeling\Library\Bfstop\Settings; use Joomla\CMS\Log\Log; @@ -106,6 +107,8 @@ private function run(): void // ago: without them, their entries couldn't be told from those // added by hand $this->tidyHtaccess(); + // the blocks which ran out leave the nginx deny file + NginxDenyFile::syncForSettings($this->settings, $this->repositories); $maintenance = new Maintenance($this->repositories); $purgeAge = Settings::int($this->settings, 'deleteOld'); if ($purgeAge > 0) diff --git a/library/src/Settings.php b/library/src/Settings.php index ed00a6d..b13798c 100644 --- a/library/src/Settings.php +++ b/library/src/Settings.php @@ -135,6 +135,7 @@ public static function string(Registry $params, string $name): string 'deleteOld' => 4, // empty: the root of the site 'htaccessPath' => '', + 'nginxDenyFile' => '', // delay 'delayDuration' => 0, 'adaptiveDelay' => 0, diff --git a/package/README.md b/package/README.md index a62bb28..e2476fb 100644 --- a/package/README.md +++ b/package/README.md @@ -61,7 +61,10 @@ version line, never a test release. of the previous release is updated with it), and creates a **draft** GitHub release with the zips, the SHA-256 sums and notes from the CHANGELOG (`release-notes.php`). A test release is marked as pre-release and says so - in its notes. + in its notes. The zips and the sums get a build provenance attestation + (`actions/attest-build-provenance`): anybody can check that a zip was built + by this workflow, from the tag's commit, with + `gh attestation verify pkg_bfstop-.zip --repo codeling/bfstop`. 4. Check the draft and publish it. 5. Publishing the release (or changing or unpublishing it) updates the update server by itself, see below. Only for a release: put it into diff --git a/package/release-notes.php b/package/release-notes.php index dfe762a..78b0a0b 100644 --- a/package/release-notes.php +++ b/package/release-notes.php @@ -76,4 +76,6 @@ if (count($sums) === 1) { echo "\n## SHA-256\n\n```text\n".rtrim((string) file_get_contents($sums[0]))."\n```\n"; + echo "\nThe zips have a build provenance attestation: `gh attestation verify pkg_bfstop-$version.zip --repo codeling/bfstop` ". + "checks that the file was built by the release workflow of this repository.\n"; } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index a437dae..bbd743a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -243,7 +243,7 @@ parameters: - message: '#^Call to an undefined method Joomla\\CMS\\Application\\CMSApplicationInterface\:\:setHeader\(\)\.$#' identifier: method.notFound - count: 3 + count: 2 path: component/site/src/View/Tokenunblock/HtmlView.php - diff --git a/plugin/language/ca-ES/ca-ES.plg_system_bfstop.sys.ini b/plugin/language/ca-ES/ca-ES.plg_system_bfstop.sys.ini index eb27ede..f608812 100644 --- a/plugin/language/ca-ES/ca-ES.plg_system_bfstop.sys.ini +++ b/plugin/language/ca-ES/ca-ES.plg_system_bfstop.sys.ini @@ -80,7 +80,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Balancejador de càrrega" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Darrere d'un proxy / balancejador de càrrega" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Activeu-ho només si el vostre lloc és darrere d'un proxy invers o d'un balancejador de càrrega, de manera que el navegador del visitant mai no es connecta directament a Joomla!. Quan està activat, bfstop llegeix l'adreça IP del visitant de la capçalera seleccionada més avall, en lloc de la connexió TCP directa, però només per a les sol·licituds que realment provenen de l'adreça IP del proxy configurada més avall. Deixeu-ho desactivat si no teniu una configuració d'aquest tipus: qualsevol visitant pot falsificar aquesta capçalera, de manera que confiar-hi sense una IP de proxy verificada permetria a un atacant fer bloquejar una adreça IP arbitrària en lloc de la seva." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Capçalera de la IP del client" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="La capçalera HTTP que el vostre proxy o balancejador de càrrega utilitza per comunicar l'adreça IP original del client. Consulteu la documentació del vostre proxy si teniu dubtes: X-Forwarded-For és l'opció més habitual. L'adreça del client es pren del final de la capçalera, és a dir, l'entrada afegida pel vostre propi proxy; les entrades més a l'esquerra les proporciona el client i s'ignoren. Trieu una capçalera que el vostre proxy estableixi o a la qual afegeixi valors ell mateix." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="La capçalera HTTP que el vostre proxy o balancejador de càrrega utilitza per comunicar l'adreça IP original del client. Consulteu la documentació del vostre proxy si teniu dubtes: X-Forwarded-For és l'opció més habitual. L'adreça del client es pren del final de la capçalera, és a dir, l'entrada afegida pel vostre propi proxy; les entrades més a l'esquerra les proporciona el client i s'ignoren. Trieu una capçalera que el vostre proxy estableixi o a la qual afegeixi valors ell mateix. Client-Ip i X-Cluster-Client-Ip contenen una sola adreça: només són segures si el vostre proxy sempre les estableix ell mateix, sobreescrivint el valor que hagi enviat el client; si les transmet sense canvis, qualsevol visitant pot triar la seva adreça." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="Adreça IP del proxy / balancejador de càrrega" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="L'adreça IP del vostre proxy invers o balancejador de càrrega, és a dir, l'adreça que Joomla! veu com a REMOTE_ADDR en cada sol·licitud legítima. Si hi ha diversos proxies en cadena (per exemple, una CDN davant d'un balancejador de càrrega), enumereu-los tots separats per comes; també s'admeten subxarxes en notació CIDR (per exemple, 10.0.0.0/8). La capçalera d'IP del client indicada més amunt només es considera fiable per a les sol·licituds que provenen d'una d'aquestes adreces, de manera que un visitant no pugui eludir el proxy i falsificar la capçalera directament. Obligatori si «Darrere d'un proxy / balancejador de càrrega» està activat més amunt. Indiqueu només adreces des de les quals no envia ningú tret dels vostres propis servidors intermediaris: confiar en tot un rang d'adreces d'una CDN o d'un proveïdor d'allotjament també és confiar en els seus altres clients, que potser poden arribar al vostre servidor a través d'ell amb qualsevol adreça de client a la capçalera." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Grup d'usuaris per a la notificació" @@ -88,7 +88,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="Si està activat, el grup d'u PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Grup d'usuaris" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Tria un grup d'usuaris per a notificar-los sobre els inicis de sessió fallits i IP prohibides (si està activat anteriorment). Probablement hauràs de crear un grup dedicat per això, o usar un grup amb administradors experimentats, com el grup per defecte 'Superusuaris'." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Recordatori per al restabliment de la clau " -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Si s'ha de mostrar, i quan, un recordatori sobre l'ús de la funcionalitat de recuperació de la contrasenya en un inici de sessió fallit" +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Si s'ha de mostrar, i quan, un recordatori sobre l'ús de la funcionalitat de recuperació de la contrasenya en un inici de sessió fallit. Una adreça bloquejada encara pot fer servir el restabliment de la contrasenya i el recordatori del nom d'usuari, i enviar-ne els formularis unes quantes vegades per hora. Per mantenir els bots lluny d'aquests formularis, trieu un captcha a les opcions d'Usuaris (Captcha), que s'hi aplica." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Sempre" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="Quan resti 1 intent" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="Quan restin 2 intents" diff --git a/plugin/language/de-DE/de-DE.plg_system_bfstop.sys.ini b/plugin/language/de-DE/de-DE.plg_system_bfstop.sys.ini index cbb376f..c6cbb5c 100644 --- a/plugin/language/de-DE/de-DE.plg_system_bfstop.sys.ini +++ b/plugin/language/de-DE/de-DE.plg_system_bfstop.sys.ini @@ -78,7 +78,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Load-Balancer" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Hinter einem Proxy / Load-Balancer" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Aktiviere dies nur, wenn deine Website hinter einem Reverse-Proxy oder Load-Balancer läuft, sodass der Browser des Besuchers nie direkt mit Joomla! verbunden ist. Wenn aktiviert, liest bfstop die IP-Adresse des Besuchers aus dem unten gewählten Header statt aus der direkten TCP-Verbindung - aber nur bei Anfragen, die tatsächlich von der unten eingetragenen Proxy-IP-Adresse kommen. Lass die Option deaktiviert, wenn du keine solche Umgebung hast: Jeder Besucher kann diesen Header fälschen, sodass ein Angreifer bei blindem Vertrauen ohne geprüfte Proxy-IP eine beliebige IP-Adresse statt seiner eigenen sperren lassen könnte." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Header der Client-IP" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="Der HTTP-Header, mit dem dein Proxy / Load-Balancer die ursprüngliche IP-Adresse des Clients meldet. Schau im Zweifel in der Dokumentation deines Proxys nach - X-Forwarded-For ist am gebräuchlichsten. Die Client-Adresse wird vom Ende des Headers genommen, also der Eintrag, den dein eigener Proxy hinzugefügt hat; Einträge weiter links stammen vom Client und werden ignoriert. Wähle einen Header, den dein Proxy selbst setzt oder ergänzt." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="Der HTTP-Header, mit dem dein Proxy / Load-Balancer die ursprüngliche IP-Adresse des Clients meldet. Schau im Zweifel in der Dokumentation deines Proxys nach - X-Forwarded-For ist am gebräuchlichsten. Die Client-Adresse wird vom Ende des Headers genommen, also der Eintrag, den dein eigener Proxy hinzugefügt hat; Einträge weiter links stammen vom Client und werden ignoriert. Wähle einen Header, den dein Proxy selbst setzt oder ergänzt. Client-Ip und X-Cluster-Client-Ip enthalten nur eine Adresse: Sie sind nur sicher, wenn dein Proxy sie immer selbst setzt und einen vom Client gesendeten Wert überschreibt; reicht er sie unverändert weiter, kann jeder Besucher seine Adresse selbst wählen." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="IP-Adresse des Proxys / Load-Balancers" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="Die IP-Adresse deines Reverse-Proxys oder Load-Balancers, d.h. die Adresse, die Joomla! bei jeder legitimen Anfrage als REMOTE_ADDR sieht. Wenn mehrere Proxys hintereinander geschaltet sind (z.B. ein CDN vor einem Load-Balancer), führe alle auf, durch Kommas getrennt; Subnetze in CIDR-Notation (z.B. 10.0.0.0/8) sind ebenfalls erlaubt. Dem oben gewählten Header wird nur bei Anfragen von einer dieser Adressen vertraut, damit ein Besucher den Proxy nicht umgehen und den Header direkt fälschen kann. Erforderlich, wenn oben „Hinter einem Proxy / Load-Balancer“ aktiviert ist. Trage nur Adressen ein, von denen niemand außer deinen eigenen Proxies sendet: wer einem ganzen Adressbereich eines CDN oder Hosters vertraut, vertraut auch dessen anderen Kunden, die deinen Server darüber vielleicht mit einer beliebigen Client-Adresse im Header erreichen können." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Benutzergruppen-Nachricht" @@ -86,7 +86,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="Wenn aktiviert, werden Benach PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Benutzergruppe" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Diejenige Benutzergruppe, an deren Mitglieder Benachrichtigungen über fehlgeschlagene Logins und geblockte IPs gesendet werden (falls oben aktiviert). Gewöhnlich sollte hierfür eine dedizierte Gruppe geschaffen werden, oder eine Gruppe die nur die erfahrensten Administratoren enthält, etwa die 'Super User' Gruppe." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Passwort Reset Nachricht" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Ob und wann bei fehlgeschlagenen Logins eine Benachrichtigung darüber angezeigt werden soll, die Funktionalität zum Zurücksetzen des Passworts zu benutzen." +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Ob und wann bei fehlgeschlagenen Logins eine Benachrichtigung darüber angezeigt werden soll, die Funktionalität zum Zurücksetzen des Passworts zu benutzen. Eine gesperrte Adresse kann das Zurücksetzen des Passworts und die Erinnerung an den Benutzernamen weiterhin nutzen und ihre Formulare einige Male pro Stunde absenden. Um Bots von diesen Formularen fernzuhalten, wähle in den Optionen von Benutzer ein Captcha (Captcha), das für sie gilt." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Immer anzeigen" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="Wenn 1 Versuch übrig" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="Wenn 2 Versuche übrig" diff --git a/plugin/language/en-GB/en-GB.plg_system_bfstop.sys.ini b/plugin/language/en-GB/en-GB.plg_system_bfstop.sys.ini index 6ad8109..24118fe 100644 --- a/plugin/language/en-GB/en-GB.plg_system_bfstop.sys.ini +++ b/plugin/language/en-GB/en-GB.plg_system_bfstop.sys.ini @@ -80,7 +80,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Load Balancer" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Behind a proxy / load balancer" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Enable this only if your site sits behind a reverse proxy or load balancer, so that the visitor's browser never connects to Joomla! directly. When enabled, bfstop reads the visitor's IP address from the header selected below instead of from the direct TCP connection - but only for requests that actually come from the proxy IP address configured below. Leave disabled unless you have such a setup: any visitor can forge this header, so trusting it without a verified proxy IP would let an attacker get an arbitrary IP address blocked instead of their own." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Client IP header" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="The HTTP header your proxy/load balancer uses to report the original client IP address. Check your proxy's documentation if unsure - X-Forwarded-For is the most common choice. The client address is taken from the end of the header, i.e. the entry added by your own proxy; entries further left are supplied by the client and ignored. Choose a header your proxy sets or appends to itself." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="The HTTP header your proxy/load balancer uses to report the original client IP address. Check your proxy's documentation if unsure - X-Forwarded-For is the most common choice. The client address is taken from the end of the header, i.e. the entry added by your own proxy; entries further left are supplied by the client and ignored. Choose a header your proxy sets or appends to itself. Client-Ip and X-Cluster-Client-Ip hold only one address: they are only safe if your proxy always sets them itself, overwriting a value the client sent; a proxy which passes them on unchanged lets every visitor choose their own address." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="Proxy / load balancer IP address" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="The IP address of your reverse proxy or load balancer, i.e. the address Joomla! sees as REMOTE_ADDR for every legitimate request. If there are several proxies in a row (e.g. a CDN in front of a load balancer), list all of them, separated by commas; subnets in CIDR notation (e.g. 10.0.0.0/8) are allowed too. The client IP header above is only trusted for requests coming from one of these addresses, so that a visitor cannot bypass the proxy and spoof the header directly. Required if 'Behind a proxy / load balancer' is enabled above. Only list addresses which nobody but your own proxies sends from: trusting a whole address range of a CDN or hosting provider also trusts its other customers, who may be able to reach your server through it with any client address they like in the header." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="User group notification" @@ -88,7 +88,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="If enabled, the whole user gr PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="User group" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Choose a user group from which to notify every member about failed logins and banned IPs (if activated above). Probably you will want to create a dedicated group for this, or use a group which holds only your most experienced administrators, like the default 'Super Users' group." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Password reset reminder" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Whether and when to show a reminder about using the password reminder functionality on a failed login" +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Whether and when to show a reminder about using the password reminder functionality on a failed login. A blocked address can still use the password reset and the username reminder, and submit their forms a few times an hour. To keep bots off these forms, choose a captcha in the options of Users (Captcha), which applies to them." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Always" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="When 1 attempt left" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="When 2 attempts left" diff --git a/plugin/language/es-ES/es-ES.plg_system_bfstop.sys.ini b/plugin/language/es-ES/es-ES.plg_system_bfstop.sys.ini index 14c9e07..d325a8e 100644 --- a/plugin/language/es-ES/es-ES.plg_system_bfstop.sys.ini +++ b/plugin/language/es-ES/es-ES.plg_system_bfstop.sys.ini @@ -80,7 +80,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Balanceador de carga" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Detrás de un proxy / balanceador de carga" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Active esta opción solo si su sitio está detrás de un proxy inverso o de un balanceador de carga, de modo que el navegador del visitante nunca se conecta directamente a Joomla!. Cuando está activada, bfstop lee la dirección IP del visitante de la cabecera seleccionada más abajo en lugar de la conexión TCP directa, pero solo para las solicitudes que realmente proceden de la dirección IP del proxy configurada más abajo. Déjela desactivada si no tiene una configuración así: cualquier visitante puede falsificar esta cabecera, por lo que confiar en ella sin una IP de proxy verificada permitiría a un atacante hacer que se bloquee una dirección IP arbitraria en lugar de la suya." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Cabecera de la IP del cliente" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="La cabecera HTTP que su proxy o balanceador de carga utiliza para comunicar la dirección IP original del cliente. Consulte la documentación de su proxy si tiene dudas: X-Forwarded-For es la opción más habitual. La dirección del cliente se toma del final de la cabecera, es decir, la entrada añadida por su propio proxy; las entradas más a la izquierda las proporciona el cliente y se ignoran. Elija una cabecera que su proxy establezca o a la que añada valores él mismo." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="La cabecera HTTP que su proxy o balanceador de carga utiliza para comunicar la dirección IP original del cliente. Consulte la documentación de su proxy si tiene dudas: X-Forwarded-For es la opción más habitual. La dirección del cliente se toma del final de la cabecera, es decir, la entrada añadida por su propio proxy; las entradas más a la izquierda las proporciona el cliente y se ignoran. Elija una cabecera que su proxy establezca o a la que añada valores él mismo. Client-Ip y X-Cluster-Client-Ip contienen una sola dirección: solo son seguras si su proxy siempre las establece él mismo, sobrescribiendo el valor que haya enviado el cliente; si las transmite sin cambios, cualquier visitante puede elegir su dirección." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="Dirección IP del proxy / balanceador de carga" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="La dirección IP de su proxy inverso o balanceador de carga, es decir, la dirección que Joomla! ve como REMOTE_ADDR en cada solicitud legítima. Si hay varios proxies encadenados (por ejemplo, una CDN delante de un balanceador de carga), indíquelos todos separados por comas; también se admiten subredes en notación CIDR (por ejemplo, 10.0.0.0/8). La cabecera de IP del cliente indicada arriba solo es de confianza para las solicitudes procedentes de una de estas direcciones, para que un visitante no pueda eludir el proxy y falsificar la cabecera directamente. Obligatorio si «Detrás de un proxy / balanceador de carga» está activado arriba. Indique solo direcciones desde las que no envía nadie salvo sus propios proxies: confiar en todo un rango de direcciones de una CDN o de un proveedor de alojamiento también es confiar en sus demás clientes, que quizá puedan llegar a su servidor a través de él con cualquier dirección de cliente en la cabecera." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Grupo de usuarios para la notificación" @@ -88,7 +88,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="Si está activado, el grupo d PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Grupo de usuarios" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Selecciona un grupo de usuarios para notificarles sobre los inicios de sesión fallidos e IP prohibidas (si está activado anteriormente). Probablemente deberás crear un grupo dedicado para ello, o usar un grupo con administradores experimentados, como el grupo por defecto 'Superusuarios'." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Recordatorio para el restablecimiento de la clave" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Si se ha de mostrar, y cuando, un recordatorio sobre el uso de la funcionalidad de recuperación de la contraseña en un inicio de sesión fallido" +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Si se ha de mostrar, y cuando, un recordatorio sobre el uso de la funcionalidad de recuperación de la contraseña en un inicio de sesión fallido. Una dirección bloqueada aún puede usar el restablecimiento de la contraseña y el recordatorio del nombre de usuario, y enviar sus formularios unas pocas veces por hora. Para mantener a los bots lejos de estos formularios, elija un captcha en las opciones de Usuarios (Captcha), que se aplica a ellos." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Siempre" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="Cuando reste 1 intento" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="Cuando queden 2 intento" diff --git a/plugin/language/fr-FR/fr-FR.plg_system_bfstop.sys.ini b/plugin/language/fr-FR/fr-FR.plg_system_bfstop.sys.ini index f52036d..8ecf242 100644 --- a/plugin/language/fr-FR/fr-FR.plg_system_bfstop.sys.ini +++ b/plugin/language/fr-FR/fr-FR.plg_system_bfstop.sys.ini @@ -86,7 +86,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Répartiteur de charge" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Derrière un proxy / répartiteur de charge" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="N'activez cette option que si votre site se trouve derrière un proxy inverse ou un répartiteur de charge, de sorte que le navigateur du visiteur ne se connecte jamais directement à Joomla!. Lorsqu'elle est activée, bfstop lit l'adresse IP du visiteur dans l'en-tête choisi ci-dessous plutôt que dans la connexion TCP directe - mais uniquement pour les requêtes qui proviennent réellement de l'adresse IP du proxy configurée ci-dessous. Laissez-la désactivée si vous n'avez pas une telle architecture : n'importe quel visiteur peut falsifier cet en-tête, et lui faire confiance sans adresse IP de proxy vérifiée permettrait à un attaquant de faire bloquer une adresse IP arbitraire au lieu de la sienne." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="En-tête de l'IP du client" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="L'en-tête HTTP que votre proxy / répartiteur de charge utilise pour transmettre l'adresse IP d'origine du client. En cas de doute, consultez la documentation de votre proxy - X-Forwarded-For est le choix le plus courant. L'adresse du client est prise à la fin de l'en-tête, c'est-à-dire l'entrée ajoutée par votre propre proxy ; les entrées plus à gauche sont fournies par le client et ignorées. Choisissez un en-tête que votre proxy définit ou complète lui-même." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="L'en-tête HTTP que votre proxy / répartiteur de charge utilise pour transmettre l'adresse IP d'origine du client. En cas de doute, consultez la documentation de votre proxy - X-Forwarded-For est le choix le plus courant. L'adresse du client est prise à la fin de l'en-tête, c'est-à-dire l'entrée ajoutée par votre propre proxy ; les entrées plus à gauche sont fournies par le client et ignorées. Choisissez un en-tête que votre proxy définit ou complète lui-même. Client-Ip et X-Cluster-Client-Ip ne contiennent qu'une seule adresse : ils ne sont sûrs que si votre proxy les définit toujours lui-même, en écrasant la valeur envoyée par le client ; s'il les transmet sans les modifier, n'importe quel visiteur peut choisir son adresse." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="Adresse IP du proxy / répartiteur de charge" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="L'adresse IP de votre proxy inverse ou répartiteur de charge, c'est-à-dire l'adresse que Joomla! voit comme REMOTE_ADDR pour chaque requête légitime. S'il y a plusieurs proxys à la suite (par exemple un CDN devant un répartiteur de charge), indiquez-les tous, séparés par des virgules ; les sous-réseaux en notation CIDR (par exemple 10.0.0.0/8) sont également acceptés. L'en-tête d'IP du client ci-dessus n'est pris en compte que pour les requêtes provenant de l'une de ces adresses, afin qu'un visiteur ne puisse pas contourner le proxy et falsifier directement l'en-tête. Obligatoire si « Derrière un proxy / répartiteur de charge » est activé ci-dessus. N'indiquez que des adresses depuis lesquelles personne d'autre que vos propres proxies n'envoie de requêtes : faire confiance à toute une plage d'adresses d'un CDN ou d'un hébergeur, c'est aussi faire confiance à ses autres clients, qui pourraient atteindre votre serveur par son intermédiaire avec l'adresse client de leur choix dans l'en-tête." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Notification du groupe d'utilisateurs" @@ -95,7 +95,7 @@ PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Groupe d'utilisateurs" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Indiquer le groupe d'utilisateurs à informer des échecs de connexion / banissements d'adresses IP. Cela suppose l'existence dans Joomla d'un groupe d'utilisateurs adapté à cet usage (par exemple, le groupe 'Super Users')." ; Ajouté à compter de la version 1.3.0 Beta1 PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Réinitialisation du mot de passe : aide-mémoire" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Opportunité et modalités de rappel de l'usage de la fonctionnalité de réinitialisation du mot de passe en cas d'échec de connexion" +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Opportunité et modalités de rappel de l'usage de la fonctionnalité de réinitialisation du mot de passe en cas d'échec de connexion. Une adresse bloquée peut toujours utiliser la réinitialisation du mot de passe et le rappel de l'identifiant, et envoyer leurs formulaires quelques fois par heure. Pour tenir les robots à l'écart de ces formulaires, choisissez un captcha dans les options d'Utilisateurs (Captcha), qui s'y applique." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Toujours" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="Après 1 échec de connexion" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="Après 2 échecs de connexion" diff --git a/plugin/language/it-IT/it-IT.plg_system_bfstop.sys.ini b/plugin/language/it-IT/it-IT.plg_system_bfstop.sys.ini index e5fc515..8e91179 100644 --- a/plugin/language/it-IT/it-IT.plg_system_bfstop.sys.ini +++ b/plugin/language/it-IT/it-IT.plg_system_bfstop.sys.ini @@ -78,7 +78,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Bilanciatore di carico" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Dietro un proxy / bilanciatore di carico" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Attiva questa opzione solo se il tuo sito si trova dietro un reverse proxy o un bilanciatore di carico, in modo che il browser del visitatore non si connetta mai direttamente a Joomla!. Quando è attiva, bfstop legge l'indirizzo IP del visitatore dall'header selezionato più sotto anziché dalla connessione TCP diretta, ma solo per le richieste che provengono effettivamente dall'indirizzo IP del proxy configurato più sotto. Lasciala disattivata se non hai una configurazione di questo tipo: qualsiasi visitatore può falsificare questo header, quindi fidarsene senza un IP del proxy verificato permetterebbe a un attaccante di far bloccare un indirizzo IP qualsiasi al posto del proprio." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Header dell'IP del client" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="L'header HTTP che il tuo proxy / bilanciatore di carico usa per comunicare l'indirizzo IP originale del client. In caso di dubbio consulta la documentazione del tuo proxy - X-Forwarded-For è la scelta più comune. L'indirizzo del client viene preso dalla fine dell'header, cioè dalla voce aggiunta dal tuo proxy; le voci più a sinistra sono fornite dal client e vengono ignorate. Scegli un header che il tuo proxy imposta o a cui aggiunge valori autonomamente." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="L'header HTTP che il tuo proxy / bilanciatore di carico usa per comunicare l'indirizzo IP originale del client. In caso di dubbio consulta la documentazione del tuo proxy - X-Forwarded-For è la scelta più comune. L'indirizzo del client viene preso dalla fine dell'header, cioè dalla voce aggiunta dal tuo proxy; le voci più a sinistra sono fornite dal client e vengono ignorate. Scegli un header che il tuo proxy imposta o a cui aggiunge valori autonomamente. Client-Ip e X-Cluster-Client-Ip contengono un solo indirizzo: sono sicuri solo se il tuo proxy li imposta sempre da sé, sovrascrivendo il valore inviato dal client; se li inoltra invariati, qualsiasi visitatore può scegliere il proprio indirizzo." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="Indirizzo IP del proxy / bilanciatore di carico" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="L'indirizzo IP del tuo reverse proxy o bilanciatore di carico, cioè l'indirizzo che Joomla! vede come REMOTE_ADDR per ogni richiesta legittima. Se ci sono più proxy in sequenza (ad esempio una CDN davanti a un bilanciatore di carico), elencali tutti separati da virgole; sono consentite anche le sottoreti in notazione CIDR (ad esempio 10.0.0.0/8). L'header dell'IP del client indicato sopra è considerato affidabile solo per le richieste provenienti da uno di questi indirizzi, in modo che un visitatore non possa aggirare il proxy e falsificare direttamente l'header. Obbligatorio se «Dietro un proxy / bilanciatore di carico» è attivo sopra. Indica solo indirizzi da cui non invia nessuno tranne i tuoi proxy: fidarsi di un intero intervallo di indirizzi di una CDN o di un provider di hosting significa fidarsi anche dei suoi altri clienti, che potrebbero raggiungere il tuo server attraverso di esso con qualsiasi indirizzo client nell'intestazione." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Notifica al gruppo di utenti" @@ -86,7 +86,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="Se attivo, l'intero gruppo di PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Gruppo di utenti" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Scegli il gruppo di utenti i cui membri riceveranno la notifica di accessi falliti e IP bloccati (se attivata sopra). Probabilmente conviene creare un gruppo apposito, oppure usare un gruppo che contiene solo i tuoi amministratori più esperti, come il gruppo predefinito «Super Utenti»." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Promemoria reimpostazione password" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Se e quando mostrare, dopo un accesso fallito, un promemoria sulla funzione di reimpostazione della password" +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Se e quando mostrare, dopo un accesso fallito, un promemoria sulla funzione di reimpostazione della password. Un indirizzo bloccato può comunque usare la reimpostazione della password e il promemoria del nome utente, e inviarne i moduli alcune volte all'ora. Per tenere i bot lontani da questi moduli, scegli un captcha nelle opzioni di Utenti (Captcha), che si applica a essi." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Sempre" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="Quando resta 1 tentativo" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="Quando restano 2 tentativi" diff --git a/plugin/language/nl-NL/nl-NL.plg_system_bfstop.sys.ini b/plugin/language/nl-NL/nl-NL.plg_system_bfstop.sys.ini index e5fb54b..8cd6f0d 100644 --- a/plugin/language/nl-NL/nl-NL.plg_system_bfstop.sys.ini +++ b/plugin/language/nl-NL/nl-NL.plg_system_bfstop.sys.ini @@ -78,7 +78,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Load balancer" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Achter een proxy / load balancer" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Schakel dit alleen in als je site achter een reverse proxy of load balancer staat, zodat de browser van de bezoeker nooit rechtstreeks met Joomla! verbindt. Als dit is ingeschakeld, leest bfstop het IP-adres van de bezoeker uit de hieronder gekozen header in plaats van uit de directe TCP-verbinding - maar alleen voor verzoeken die echt van het hieronder ingestelde IP-adres van de proxy komen. Laat dit uitgeschakeld tenzij je zo'n opstelling hebt: elke bezoeker kan deze header vervalsen, dus als je hem vertrouwt zonder gecontroleerd proxy-IP kan een aanvaller een willekeurig IP-adres laten blokkeren in plaats van zijn eigen adres." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Header met client-IP" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="De HTTP-header die je proxy / load balancer gebruikt om het oorspronkelijke IP-adres van de client door te geven. Raadpleeg bij twijfel de documentatie van je proxy - X-Forwarded-For is de meest gebruikelijke keuze. Het adres van de client wordt van het einde van de header genomen, dus de waarde die je eigen proxy heeft toegevoegd; waarden verder naar links komen van de client en worden genegeerd. Kies een header die je proxy zelf instelt of waaraan hij zelf iets toevoegt." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="De HTTP-header die je proxy / load balancer gebruikt om het oorspronkelijke IP-adres van de client door te geven. Raadpleeg bij twijfel de documentatie van je proxy - X-Forwarded-For is de meest gebruikelijke keuze. Het adres van de client wordt van het einde van de header genomen, dus de waarde die je eigen proxy heeft toegevoegd; waarden verder naar links komen van de client en worden genegeerd. Kies een header die je proxy zelf instelt of waaraan hij zelf iets toevoegt. Client-Ip en X-Cluster-Client-Ip bevatten maar één adres: ze zijn alleen veilig als je proxy ze altijd zelf instelt en een waarde van de client overschrijft; geeft hij ze ongewijzigd door, dan kan elke bezoeker zijn eigen adres kiezen." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="IP-adres van de proxy / load balancer" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="Het IP-adres van je reverse proxy of load balancer, dus het adres dat Joomla! bij elk legitiem verzoek als REMOTE_ADDR ziet. Als er meerdere proxy's achter elkaar staan (bijvoorbeeld een CDN voor een load balancer), vermeld ze dan allemaal, gescheiden door komma's; subnetten in CIDR-notatie (bijvoorbeeld 10.0.0.0/8) zijn ook toegestaan. De client-IP-header hierboven wordt alleen vertrouwd voor verzoeken die van een van deze adressen komen, zodat een bezoeker de proxy niet kan omzeilen en de header rechtstreeks kan vervalsen. Verplicht als 'Achter een proxy / load balancer' hierboven is ingeschakeld. Vermeld alleen adressen van waaruit niemand anders dan je eigen proxies verzoeken stuurt: wie een hele adresreeks van een CDN of hostingprovider vertrouwt, vertrouwt ook diens andere klanten, die je server er mogelijk via kunnen bereiken met elk clientadres dat ze willen in de header." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Gebruikersgroep informeren" @@ -86,7 +86,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="Indien actief, de volledige h PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Gebruikersgroep" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Kies een gebruikersgroep waarvan alle leden zullen worden geïnformeerd over over de mislukte aanlogpogingen of geblokkeerde IP-adressen (indien hierboven geactiveerd). Het is raadzaam om hiervoor een speciale gebruikersgroep samen te stellen of in ieder geval een groep te kiezen waarin met name systeembeheerders zitten zoals in de standaard 'Super Gebruikers' groep." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Geef wachtwoord reset hint" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Bepaalt of en wanneer een informatieve boodschap gestuurd moet worden als er meerdere malen met een foutief wachtwoord is ingelogd." +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Bepaalt of en wanneer een informatieve boodschap gestuurd moet worden als er meerdere malen met een foutief wachtwoord is ingelogd. Een geblokkeerd adres kan het herstellen van het wachtwoord en de herinnering van de gebruikersnaam nog steeds gebruiken, en de formulieren daarvan een paar keer per uur versturen. Kies in de opties van Gebruikers een captcha (Captcha), die voor deze formulieren geldt, om bots ervan weg te houden." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="altijd" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="wanneer er nog 1 aanlogpoging over is" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="wanneer er nog 2 aanlogpogingen over zijn" diff --git a/plugin/language/pt-BR/pt-BR.plg_system_bfstop.sys.ini b/plugin/language/pt-BR/pt-BR.plg_system_bfstop.sys.ini index 28df99f..f452d87 100644 --- a/plugin/language/pt-BR/pt-BR.plg_system_bfstop.sys.ini +++ b/plugin/language/pt-BR/pt-BR.plg_system_bfstop.sys.ini @@ -81,7 +81,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Balanceador de carga" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Atrás de um proxy / balanceador de carga" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Ative somente se o seu site estiver atrás de um proxy reverso ou de um balanceador de carga, de modo que o navegador do visitante nunca se conecte diretamente ao Joomla!. Quando ativado, o bfstop lê o endereço IP do visitante do cabeçalho selecionado abaixo, em vez da conexão TCP direta, mas apenas para requisições que realmente venham do endereço IP do proxy configurado abaixo. Deixe desativado, a menos que você tenha uma configuração assim: qualquer visitante pode forjar esse cabeçalho, e confiar nele sem um IP de proxy verificado permitiria que um atacante fizesse um endereço IP arbitrário ser bloqueado no lugar do seu." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Cabeçalho do IP do cliente" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="O cabeçalho HTTP que o seu proxy / balanceador de carga usa para informar o endereço IP original do cliente. Em caso de dúvida, consulte a documentação do seu proxy - X-Forwarded-For é a escolha mais comum. O endereço do cliente é tirado do fim do cabeçalho, ou seja, a entrada acrescentada pelo seu próprio proxy; as entradas mais à esquerda são fornecidas pelo cliente e ignoradas. Escolha um cabeçalho que o seu proxy defina ou ao qual ele mesmo acrescente valores." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="O cabeçalho HTTP que o seu proxy / balanceador de carga usa para informar o endereço IP original do cliente. Em caso de dúvida, consulte a documentação do seu proxy - X-Forwarded-For é a escolha mais comum. O endereço do cliente é tirado do fim do cabeçalho, ou seja, a entrada acrescentada pelo seu próprio proxy; as entradas mais à esquerda são fornecidas pelo cliente e ignoradas. Escolha um cabeçalho que o seu proxy defina ou ao qual ele mesmo acrescente valores. Client-Ip e X-Cluster-Client-Ip contêm apenas um endereço: só são seguros se o seu proxy sempre os definir ele mesmo, sobrescrevendo o valor enviado pelo cliente; se ele os repassar sem alteração, qualquer visitante pode escolher o próprio endereço." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="Endereço IP do proxy / balanceador de carga" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="O endereço IP do seu proxy reverso ou balanceador de carga, ou seja, o endereço que o Joomla! vê como REMOTE_ADDR em toda requisição legítima. Se houver vários proxies em sequência (por exemplo, uma CDN na frente de um balanceador de carga), liste todos, separados por vírgulas; sub-redes em notação CIDR (por exemplo, 10.0.0.0/8) também são permitidas. O cabeçalho de IP do cliente indicado acima só é considerado confiável para requisições vindas de um desses endereços, para que um visitante não possa contornar o proxy e forjar o cabeçalho diretamente. Obrigatório se 'Atrás de um proxy / balanceador de carga' estiver ativado acima. Informe apenas endereços dos quais ninguém além dos seus próprios proxies envia requisições: confiar em toda uma faixa de endereços de uma CDN ou de um provedor de hospedagem também é confiar nos outros clientes dele, que talvez consigam alcançar o seu servidor por meio dele com qualquer endereço de cliente no cabeçalho." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Notificação para grupo de usuários" @@ -89,7 +89,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="Se ativado, todo o grupo de u PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Grupo de usuários" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Escolha um grupo de usuários cujos membros serão todos notificados sobre logins com falha e IPs banidos (se ativado acima). Provavelmente você vai querer criar um grupo específico para isso ou usar um grupo que tenha apenas os seus administradores mais experientes, como o grupo padrão 'Super Usuários'." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Lembrete de redefinição de senha" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Se e quando mostrar, após um login com falha, um lembrete sobre a função de redefinição de senha" +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Se e quando mostrar, após um login com falha, um lembrete sobre a função de redefinição de senha. Um endereço bloqueado ainda pode usar a redefinição de senha e o lembrete do nome de usuário, e enviar os formulários deles algumas vezes por hora. Para manter os bots longe desses formulários, escolha um captcha nas opções de Usuários (Captcha), que se aplica a eles." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Sempre" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="Quando restar 1 tentativa" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="Quando restarem 2 tentativas" diff --git a/plugin/language/pt-PT/pt-PT.plg_system_bfstop.sys.ini b/plugin/language/pt-PT/pt-PT.plg_system_bfstop.sys.ini index 8aea00c..8ae31b1 100644 --- a/plugin/language/pt-PT/pt-PT.plg_system_bfstop.sys.ini +++ b/plugin/language/pt-PT/pt-PT.plg_system_bfstop.sys.ini @@ -82,7 +82,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Proxy / Balanceador de carga" PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="Atrás de um proxy / balanceador de carga" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Ative somente se o seu site estiver atrás de um proxy reverso ou de um balanceador de carga, de modo que o navegador do visitante nunca se conecte diretamente ao Joomla!. Quando ativado, o bfstop lê o endereço IP do visitante do cabeçalho selecionado abaixo, em vez da conexão TCP direta, mas apenas para pedidos que realmente venham do endereço IP do proxy configurado abaixo. Deixe desativado, a menos que o utilizador tenha uma configuração assim: qualquer visitante pode forjar esse cabeçalho, e confiar nele sem um IP de proxy verificado permitiria que um atacante fizesse um endereço IP arbitrário ser bloqueado no lugar do seu." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Cabeçalho do IP do cliente" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="O cabeçalho HTTP que o seu proxy / balanceador de carga usa para informar o endereço IP original do cliente. Em caso de dúvida, consulte a documentação do seu proxy - X-Forwarded-For é a escolha mais comum. O endereço do cliente é tirado do fim do cabeçalho, ou seja, a entrada acrescentada pelo seu próprio proxy; as entradas mais à esquerda são fornecidas pelo cliente e ignoradas. Escolha um cabeçalho que o seu proxy defina ou ao qual ele mesmo acrescente valores." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="O cabeçalho HTTP que o seu proxy / balanceador de carga usa para informar o endereço IP original do cliente. Em caso de dúvida, consulte a documentação do seu proxy - X-Forwarded-For é a escolha mais comum. O endereço do cliente é tirado do fim do cabeçalho, ou seja, a entrada acrescentada pelo seu próprio proxy; as entradas mais à esquerda são fornecidas pelo cliente e ignoradas. Escolha um cabeçalho que o seu proxy defina ou ao qual ele mesmo acrescente valores. Client-Ip e X-Cluster-Client-Ip contêm apenas um endereço: só são seguros se o seu proxy os definir sempre ele próprio, substituindo o valor enviado pelo cliente; se os passar sem alterações, qualquer visitante pode escolher o seu endereço." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="Endereço IP do proxy / balanceador de carga" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="O endereço IP do seu proxy reverso ou balanceador de carga, ou seja, o endereço que o Joomla! vê como REMOTE_ADDR em toda pedido legítima. Se houver vários proxies em sequência (por exemplo, uma CDN na frente de um balanceador de carga), liste todos, separados por vírgulas; sub-redes em notação CIDR (por exemplo, 10.0.0.0/8) também são permitidas. O cabeçalho de IP do cliente indicado acima só é considerado confiável para pedidos vindas de um desses endereços, para que um visitante não possa contornar o proxy e forjar o cabeçalho diretamente. Obrigatório se 'Atrás de um proxy / balanceador de carga' estiver ativado acima. Indique apenas endereços a partir dos quais ninguém além dos seus próprios proxies envia pedidos: confiar em toda uma gama de endereços de uma CDN ou de um fornecedor de alojamento é também confiar nos outros clientes dele, que talvez consigam chegar ao seu servidor através dele com qualquer endereço de cliente no cabeçalho." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Notificação para grupo de utilizadores" @@ -90,7 +90,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="Se ativado, todo o grupo de u PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Grupo de utilizadores" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Escolha um grupo de utilizadores cujos membros serão todos notificados sobre inícios de sessão falhados e IPs banidos (se ativado acima). Provavelmente o utilizador vai querer criar um grupo específico para isso ou usar um grupo que tenha apenas os seus administradores mais experientes, como o grupo padrão 'Super Utilizadores'." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Lembrete de reposição da palavra-passe" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Se e quando mostrar, após um início de sessão falhado, um lembrete sobre a função de reposição da palavra-passe" +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Se e quando mostrar, após um início de sessão falhado, um lembrete sobre a função de reposição da palavra-passe. Um endereço bloqueado ainda pode usar a reposição da palavra-passe e o lembrete do nome de utilizador, e enviar os respetivos formulários algumas vezes por hora. Para manter os bots afastados destes formulários, escolha um captcha nas opções de Utilizadores (Captcha), que se aplica a eles." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Sempre" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="Quando restar 1 tentativa" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="Quando restarem 2 tentativas" diff --git a/plugin/language/ru-RU/ru-RU.plg_system_bfstop.sys.ini b/plugin/language/ru-RU/ru-RU.plg_system_bfstop.sys.ini index dfd4265..cb5fd1c 100644 --- a/plugin/language/ru-RU/ru-RU.plg_system_bfstop.sys.ini +++ b/plugin/language/ru-RU/ru-RU.plg_system_bfstop.sys.ini @@ -78,7 +78,7 @@ PLG_SYSTEM_BFSTOP_PROXY_FIELDSET_LABEL="Прокси / Балансировщи PLG_SYSTEM_BFSTOP_USE_PROXY_LABEL="За прокси / балансировщиком нагрузки" PLG_SYSTEM_BFSTOP_USE_PROXY_DESC="Включайте этот параметр, только если ваш сайт находится за обратным прокси или балансировщиком нагрузки, то есть браузер посетителя никогда не подключается к Joomla! напрямую. Когда параметр включён, bfstop берёт IP-адрес посетителя из выбранного ниже заголовка, а не из прямого TCP-соединения, но только для запросов, которые действительно приходят с IP-адреса прокси, указанного ниже. Оставьте параметр выключенным, если у вас нет такой схемы: любой посетитель может подделать этот заголовок, поэтому доверие к нему без проверенного IP-адреса прокси позволило бы злоумышленнику заблокировать произвольный IP-адрес вместо своего." PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_LABEL="Заголовок с IP клиента" -PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="HTTP-заголовок, с помощью которого ваш прокси / балансировщик нагрузки передаёт исходный IP-адрес клиента. Если сомневаетесь, обратитесь к документации вашего прокси - наиболее распространён X-Forwarded-For. Адрес клиента берётся из конца заголовка, то есть это запись, добавленная вашим собственным прокси; записи левее передаются клиентом и игнорируются. Выберите заголовок, который ваш прокси устанавливает или дополняет сам." +PLG_SYSTEM_BFSTOP_PROXY_HEADER_SOURCE_DESC="HTTP-заголовок, с помощью которого ваш прокси / балансировщик нагрузки передаёт исходный IP-адрес клиента. Если сомневаетесь, обратитесь к документации вашего прокси - наиболее распространён X-Forwarded-For. Адрес клиента берётся из конца заголовка, то есть это запись, добавленная вашим собственным прокси; записи левее передаются клиентом и игнорируются. Выберите заголовок, который ваш прокси устанавливает или дополняет сам. Client-Ip и X-Cluster-Client-Ip содержат только один адрес: они безопасны, только если ваш прокси всегда устанавливает их сам, перезаписывая значение, отправленное клиентом; если он передаёт их без изменений, любой посетитель может сам выбрать свой адрес." PLG_SYSTEM_BFSTOP_PROXY_IP_LABEL="IP-адрес прокси / балансировщика нагрузки" PLG_SYSTEM_BFSTOP_PROXY_IP_DESC="IP-адрес вашего обратного прокси или балансировщика нагрузки, то есть адрес, который Joomla! видит как REMOTE_ADDR при каждом легитимном запросе. Если прокси несколько подряд (например, CDN перед балансировщиком нагрузки), перечислите все через запятую; подсети в нотации CIDR (например, 10.0.0.0/8) тоже допускаются. Заголовку с IP клиента, выбранному выше, доверяют только для запросов, приходящих с одного из этих адресов, чтобы посетитель не мог обойти прокси и подделать заголовок напрямую. Обязательно, если выше включён параметр «За прокси / балансировщиком нагрузки». Указывайте только адреса, с которых не отправляет запросы никто, кроме ваших собственных прокси: доверие целому диапазону адресов CDN или хостинг-провайдера означает доверие и другим его клиентам, которые, возможно, смогут обращаться к вашему серверу через него с любым адресом клиента в заголовке." PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_LABEL="Уведомление группы пользователей" @@ -86,7 +86,7 @@ PLG_SYSTEM_BFSTOP_GROUP_NOTIFICATION_ENABLED_DESC="Если включено, г PLG_SYSTEM_BFSTOP_USERGROUP_LABEL="Группа пользователей" PLG_SYSTEM_BFSTOP_USERGROUP_DESC="Выберите группу, чтобы уведомить всех её участников о неудачных входах и запрещённых IP-адресов (если активирована выше). Вероятно, Вам нужно будет создать отдельную группу для этого, или использовать группу, которая содержит только наиболее опытных администраторов, подобно группе по умолчанию 'супер-пользователи'." PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_LABEL="Напоминание о сбросе пароля" -PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Будет ли и когда отображаться напоминание об использовании функции 'восстановление пароля' при неудачной попытке входа" +PLG_SYSTEM_BFSTOP_NOTIFY_USE_PASSWORD_REMINDER_DESC="Будет ли и когда отображаться напоминание об использовании функции 'восстановление пароля' при неудачной попытке входа. Заблокированный адрес по-прежнему может пользоваться сбросом пароля и напоминанием имени пользователя и отправлять их формы несколько раз в час. Чтобы не пускать ботов к этим формам, выберите капчу в настройках компонента «Пользователи» (Капча): она применяется к ним." PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_ALWAYS="Всегда" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_1LEFT="Когда осталась 1 попытка" PLG_SYSTEM_BFSTOP_REMINDER_NOTIFY_2LEFT="Когда осталось 2 попытки" diff --git a/plugin/sql/install.mysql.utf8.sql b/plugin/sql/install.mysql.utf8.sql index 2d3aaa8..066ba93 100644 --- a/plugin/sql/install.mysql.utf8.sql +++ b/plugin/sql/install.mysql.utf8.sql @@ -26,6 +26,11 @@ CREATE TABLE IF NOT EXISTS #__bfstop_bannedip ( -- latest one (issue #219); NULL = no attempt since the block started attempts int unsigned NOT NULL DEFAULT 0, last_attempt datetime NULL DEFAULT NULL, +-- submissions of the password recovery forms while the block is active +-- (issue #285): how many since recovery_since, the start of the hour they +-- are counted in; NULL = none yet + recovery_requests int unsigned NOT NULL DEFAULT 0, + recovery_since datetime NULL DEFAULT NULL, PRIMARY KEY (id), -- looked up for every request: addresses and networks are stored in -- canonical form (IpHelper::canonicalEntry()) diff --git a/plugin/sql/install.postgresql.utf8.sql b/plugin/sql/install.postgresql.utf8.sql index cae30fa..e4a6e90 100644 --- a/plugin/sql/install.postgresql.utf8.sql +++ b/plugin/sql/install.postgresql.utf8.sql @@ -30,6 +30,8 @@ CREATE TABLE IF NOT EXISTS "#__bfstop_bannedip" ( "duration" integer NOT NULL, "attempts" integer NOT NULL DEFAULT 0, "last_attempt" timestamp without time zone DEFAULT NULL, + "recovery_requests" integer NOT NULL DEFAULT 0, + "recovery_since" timestamp without time zone DEFAULT NULL, PRIMARY KEY ("id") ); -- looked up for every request: addresses and networks are stored in canonical diff --git a/plugin/sql/updates/2.0.0.sql b/plugin/sql/updates/2.0.0.sql index f2625a2..c3614f1 100755 --- a/plugin/sql/updates/2.0.0.sql +++ b/plugin/sql/updates/2.0.0.sql @@ -14,6 +14,12 @@ ALTER TABLE `#__bfstop_bannedip` ADD COLUMN attempts int unsigned NOT NULL DEFAU ALTER TABLE `#__bfstop_bannedip` ADD COLUMN last_attempt datetime NULL DEFAULT NULL /** CAN FAIL **/; +-- submissions of the password recovery forms while a block is active, to +-- limit them (issue #285) +ALTER TABLE `#__bfstop_bannedip` ADD COLUMN recovery_requests int unsigned NOT NULL DEFAULT 0 /** CAN FAIL **/; + +ALTER TABLE `#__bfstop_bannedip` ADD COLUMN recovery_since datetime NULL DEFAULT NULL /** CAN FAIL **/; + -- use utf8mb4 like Joomla's own tables; with utf8 (3-byte), a failed login -- for a username containing e.g. an emoji could not be stored at all diff --git a/plugin/src/Extension/Bfstop.php b/plugin/src/Extension/Bfstop.php index fe5cfea..8448b6f 100644 --- a/plugin/src/Extension/Bfstop.php +++ b/plugin/src/Extension/Bfstop.php @@ -70,6 +70,10 @@ class Bfstop extends CMSPlugin implements SubscriberInterface // the client's actual address while handling a failed login; the failed // login entry holds the key it is tracked under instead (IPv6: its network) private ?string $clientAddress = null; + // what onAfterInitialise found out about the client (see answerEarly()), + // for the check after routing not to ask again: its address, whether it + // is on the allow list and its active blocks + private ?array $earlyCheck = null; public static function getSubscribedEvents(): array { @@ -385,6 +389,63 @@ public function onAfterInitialise($event) // use the scheduler, or the task is gone - a request does it, which costs // no query as long as it did (see MaintenanceSchedule) (new DailyMaintenance($this->repositories, $this->params))->runIfOverdue(); + $this->answerEarly(); + } + + /** + * Refuses a blocked client already now, before Joomla routes the request, + * where nothing routing would tell can change the answer: in the backend + * and the API (the unblock page and the password recovery, which a + * blocked client may reach, are pages of the site), when the block + * applies to every request ("Full Site", with or without .htaccess; not + * "Login Only", which has to know whether the request is a login). That + * spares a blocked client's requests the routing - and the backend's + * loading of the session's user for it. On the site, a search-engine + * friendly URL (a menu item's alias) only says after routing whether it + * is the password recovery, so its requests wait for onAfterRoute. + * + * What it finds is kept for enforceBlock(), which doesn't ask the + * database again. + */ + private function answerEarly() + { + $this->earlyCheck = null; + $app = $this->getApplication(); + if (!in_array($this->policy->mode(), array('full', 'htaccess'), true) || + !($app->isClient('administrator') || $app->isClient('api'))) + { + return; + } + $ipaddress = IpHelper::getAddress($this->logger); + $allowed = $this->repositories->allowList()->contains($ipaddress); + $blockIds = $allowed ? array() : $this->repositories->blocks()->activeIdsFor($ipaddress); + if ($blockIds === null) + { + // can't be read: enforceBlock() tries again, and decides what that means + return; + } + $this->earlyCheck = array('address' => $ipaddress, 'allowed' => $allowed, 'blockIds' => $blockIds); + if (count($blockIds) > 0) + { + $this->logBlockedAccess($ipaddress); + $this->refuse($ipaddress, $blockIds); + } + } + + private function logBlockedAccess($ipaddress) + { + $this->logger->log('Blocked IP Address '.$ipaddress.' trying to access '. + Origin::name($this->getApplication()->getClientId()), Log::INFO); + } + + /** + * Refuses the request of a blocked client, whose blocks are $blockIds, + * and ends the request. + */ + private function refuse($ipaddress, array $blockIds) + { + $this->repositories->blocks()->recordAttempt($blockIds); + $this->responder->refuseBlocked($ipaddress); } /** @@ -419,11 +480,13 @@ private function enforceBlock() return; } $ipaddress = IpHelper::getAddress($this->logger); - if ($this->repositories->allowList()->contains($ipaddress)) + $early = ($this->earlyCheck !== null && $this->earlyCheck['address'] === $ipaddress) ? $this->earlyCheck : null; + $this->earlyCheck = null; + if ($early !== null ? $early['allowed'] : $this->repositories->allowList()->contains($ipaddress)) { return; } - $blockIds = $this->repositories->blocks()->activeIdsFor($ipaddress); + $blockIds = $early !== null ? $early['blockIds'] : $this->repositories->blocks()->activeIdsFor($ipaddress); if ($blockIds !== null && count($blockIds) === 0 && !$this->policy->isOff() && $this->request->isPasswordLogin() && $this->loginTurn->await($this->trackedAddress($ipaddress), $ipaddress, $this->logger)) @@ -449,8 +512,7 @@ private function enforceBlock() { return; } - $this->logger->log('Blocked IP Address '.$ipaddress.' trying to access '. - Origin::name($this->getApplication()->getClientId()), Log::INFO); + $this->logBlockedAccess($ipaddress); if ($this->isPassedThrough($blockIds)) { return; @@ -461,8 +523,7 @@ private function enforceBlock() // attempt gets rejected below return; } - $this->repositories->blocks()->recordAttempt($blockIds); - $this->responder->refuseBlocked($ipaddress); + $this->refuse($ipaddress, $blockIds); } /** @@ -483,12 +544,22 @@ private function isPassedThrough($blockIds) return true; } $recovery = $this->request->passwordRecovery(); - if ($recovery !== null) + if ($recovery === null) { - $this->logger->log('Allowing blocked IP through to the password recovery ('.$recovery.'), so a '. - 'blocked legitimate user can still recover their account', Log::INFO); - return true; + return false; + } + // the forms send mails and check reset codes: a blocked client may + // submit them a few times an hour, not as often as it likes (Joomla + // limits the password reset per account, the username reminder not at all) + if (str_starts_with($recovery, 'task ') && + $this->repositories->blocks()->countRecoverySubmission($blockIds, 60) > BlockPolicy::RecoverySubmissionsPerHour) + { + $this->logger->log('Blocked IP submitted the password recovery more than '. + BlockPolicy::RecoverySubmissionsPerHour.' times in an hour ('.$recovery.'), refusing it', Log::WARNING); + return false; } - return false; + $this->logger->log('Allowing blocked IP through to the password recovery ('.$recovery.'), so a '. + 'blocked legitimate user can still recover their account', Log::INFO); + return true; } } diff --git a/plugin/src/Service/Responder.php b/plugin/src/Service/Responder.php index 5c73c78..5d47d9f 100644 --- a/plugin/src/Service/Responder.php +++ b/plugin/src/Service/Responder.php @@ -154,7 +154,11 @@ public static function blockedResponseCode($useHttpError) * site either: not for search engines (it is what a crawler gets for * every address of the site while its own is blocked), and with its type * and character set named - the server's defaults are not necessarily - * those of the message - and not to be guessed by the browser. + * those of the message - and not to be guessed by the browser. Nor may + * another site show it in a frame (it is echoed without the template, so + * the headers the site's template or Joomla's HTTP headers plugin would + * send are missing): frame-ancestors for current browsers, X-Frame-Options + * for older ones. */ public static function blockedResponseHeaders() { @@ -163,6 +167,8 @@ public static function blockedResponseHeaders() 'Pragma: no-cache', 'Content-Type: text/html; charset=utf-8', 'X-Content-Type-Options: nosniff', + "Content-Security-Policy: frame-ancestors 'none'", + 'X-Frame-Options: DENY', 'X-Robots-Tag: noindex, nofollow', ); } diff --git a/tests/Integration/BlockedRequestTest.php b/tests/Integration/BlockedRequestTest.php index c38538f..6c2f79a 100644 --- a/tests/Integration/BlockedRequestTest.php +++ b/tests/Integration/BlockedRequestTest.php @@ -11,6 +11,7 @@ use Codeling\Library\Bfstop\Origin; use Codeling\Library\Bfstop\Repository\Repositories; use Codeling\Library\Bfstop\Repository\UnblockTokenRepository; +use Codeling\Library\Bfstop\Service\BlockPolicy; use Codeling\Plugin\System\Bfstop\Service\Responder; use Joomla\CMS\Factory; @@ -134,6 +135,27 @@ public function testBlockIsEnforcedOnlyAfterRouting() $this->assertBlocked(); } + public function testBackendAndApiAreRefusedBeforeRouting() + { + // no exemption of a blocked client is a page of the backend or the + // API: "Full Site" refuses them already in onAfterInitialise + $this->configure(); + $this->block(); + $output = $this->request('', self::Ip, false, ''); + $this->assertStringContainsString(self::BlockedMessage, $output, 'backend'); + $output = $this->request('', self::Ip, false, null, array('--api')); + $this->assertStringNotContainsString('NOT BLOCKED', $output, 'API'); + $this->assertStringContainsString('"errors"', $output, 'API'); + $this->assertStringContainsString('NOT BLOCKED', $this->request('', '203.0.113.42', false, ''), 'not blocked'); + // the site waits for the router (see testBlockIsEnforcedOnlyAfterRouting), + // and so does "Login Only", which has to know whether it is a login + $this->configure(array('blockMode' => 'loginonly')); + $this->assertStringContainsString('NOT BLOCKED', $this->request('', self::Ip, false, ''), 'Login Only'); + $this->assertStringContainsString('NOT BLOCKED', + $this->request('option=com_login&task=login', self::Ip, false, ''), 'Login Only, before routing'); + $this->assertBlocked('option=com_login&task=login', self::Ip, ''); + } + private function knownIps() { $this->db->setQuery('SELECT ipaddress FROM #__bfstop_knownip ORDER BY ipaddress'); @@ -290,6 +312,9 @@ public function testBlockPageIsNeverCached() $this->assertContains('X-Robots-Tag: noindex, nofollow', $headers); $this->assertContains('Content-Type: text/html; charset=utf-8', $headers); $this->assertContains('X-Content-Type-Options: nosniff', $headers); + // and not shown in another site's frame + $this->assertContains("Content-Security-Policy: frame-ancestors 'none'", $headers); + $this->assertContains('X-Frame-Options: DENY', $headers); foreach ($headers as $header) { $this->assertStringStartsNotWith('HTTP/', $header, 'the status is set with http_response_code()'); @@ -513,6 +538,25 @@ public function testPasswordRecoveryFormsCanBeSubmitted() $this->assertNotBlocked('option=com_users&controller=reset&task=request'); } + public function testPasswordRecoveryFormsCanBeSubmittedAFewTimesAnHour() + { + // they send mails: not as many as a blocked client likes + $this->configure(); + $id = $this->block(); + for ($i = 0; $i < BlockPolicy::RecoverySubmissionsPerHour; ++$i) + { + $this->assertNotBlocked('option=com_users&task=remind.remind'); + } + $this->assertBlocked('option=com_users&task=remind.remind'); + $this->assertBlocked('option=com_users&task=reset.request'); + // the forms themselves can still be seen + $this->assertNotBlocked('option=com_users&view=reset'); + // an hour later, the forms can be submitted again + $db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class); + $db->setQuery("UPDATE #__bfstop_bannedip SET recovery_since='".self::minutesAgo(61)."' WHERE id=".(int) $id)->execute(); + $this->assertNotBlocked('option=com_users&task=reset.request'); + } + public function testPasswordRecoveryViewIsNoPassForOtherTasks() { // Joomla runs the task, not the view: with view=reset in the request, diff --git a/tests/Integration/ComponentTest.php b/tests/Integration/ComponentTest.php index 687026c..0d6964f 100644 --- a/tests/Integration/ComponentTest.php +++ b/tests/Integration/ComponentTest.php @@ -8,7 +8,9 @@ namespace Codeling\Bfstop\Tests\Integration; use Codeling\Component\Bfstop\Administrator\Controller\DisplayController; +use Codeling\Component\Bfstop\Administrator\Helper\ActionLogHelper; use Codeling\Component\Bfstop\Administrator\Helper\DurationHelper; +use Codeling\Component\Bfstop\Administrator\Helper\HtaccessCheckHelper; use Codeling\Component\Bfstop\Administrator\Helper\IpValidateHelper; use Codeling\Component\Bfstop\Administrator\Helper\UnblockHelper; use Codeling\Component\Bfstop\Administrator\Model\AllowModel; @@ -632,6 +634,177 @@ public function testTheHtaccessFileWhichNoLongerBlocksIsTidiedWhenTheSettingsAre } } + /** com_actionlogs' params and whether the component is in its list of extensions */ + private function actionLogsState(): array + { + return array( + $this->queryValue("SELECT params FROM #__extensions WHERE type='component' AND element='com_actionlogs'"), + (int) $this->queryValue("SELECT COUNT(*) FROM #__action_logs_extensions WHERE extension='com_bfstop'"), + ); + } + + private function restoreActionLogsState(array $state): void + { + $this->db->setQuery('UPDATE #__extensions SET params='.$this->db->quote((string) $state[0]). + " WHERE type='component' AND element='com_actionlogs'")->execute(); + $this->db->setQuery("DELETE FROM #__action_logs_extensions WHERE extension='com_bfstop'")->execute(); + if ($state[1] > 0) + { + $this->db->setQuery("INSERT INTO #__action_logs_extensions (extension) VALUES ('com_bfstop')")->execute(); + } + $this->db->setQuery("DELETE FROM #__action_logs WHERE extension='com_bfstop'")->execute(); + // ComponentHelper keeps the params it read + (new \ReflectionProperty(\Joomla\CMS\Component\ComponentHelper::class, 'components'))->setValue(null, array()); + } + + private function loggedExtensions(): array + { + $params = json_decode((string) $this->queryValue( + "SELECT params FROM #__extensions WHERE type='component' AND element='com_actionlogs'"), true) ?: array(); + return (array) ($params['loggable_extensions'] ?? array()); + } + + public function testTheInstallationRegistersWithTheUserActionsLog() + { + require_once BFSTOP_COMPONENT_ROOT.'/installscript.php'; + $state = $this->actionLogsState(); + try + { + \com_bfstopInstallerScript::unregisterFromActionLogs($this->db); + $this->assertSame(0, $this->actionLogsState()[1]); + $this->assertNotContains('com_bfstop', $this->loggedExtensions()); + + $this->assertTrue(\com_bfstopInstallerScript::registerWithActionLogs($this->db), 'new to the list'); + $this->assertSame(1, $this->actionLogsState()[1]); + $this->assertContains('com_bfstop', $this->loggedExtensions(), 'and recorded'); + $this->assertContains('com_users', $this->loggedExtensions(), "Joomla's own stay"); + $this->assertFalse(\com_bfstopInstallerScript::registerWithActionLogs($this->db), 'once'); + + // an administrator unticked it: an update leaves that as it is + \com_bfstopInstallerScript::unregisterFromActionLogs($this->db); + $this->db->setQuery("INSERT INTO #__action_logs_extensions (extension) VALUES ('com_bfstop')")->execute(); + $this->assertFalse(\com_bfstopInstallerScript::registerWithActionLogs($this->db)); + $this->assertNotContains('com_bfstop', $this->loggedExtensions()); + } + finally + { + $this->restoreActionLogsState($state); + } + } + + public function testWhatAdministratorsDoGoesToTheUserActionsLog() + { + require_once BFSTOP_COMPONENT_ROOT.'/installscript.php'; + $state = $this->actionLogsState(); + $logged = function () + { + $this->db->setQuery("SELECT message_language_key, message FROM #__action_logs WHERE extension='com_bfstop' ORDER BY id"); + return $this->db->loadObjectList(); + }; + try + { + \com_bfstopInstallerScript::unregisterFromActionLogs($this->db); + \com_bfstopInstallerScript::registerWithActionLogs($this->db); + (new \ReflectionProperty(\Joomla\CMS\Component\ComponentHelper::class, 'components'))->setValue(null, array()); + $this->db->setQuery("DELETE FROM #__action_logs WHERE extension='com_bfstop'")->execute(); + $this->assertTrue(ActionLogHelper::isEnabled()); + + $id = $this->insert('#__bfstop_bannedip', array('ipaddress' => '203.0.113.77', + 'crdate' => self::minutesAgo(0), 'duration' => 60), 'id'); + $this->model(BlocklistModel::class)->unblock(array($id), $this->logger); + $rows = $logged(); + $this->assertCount(1, $rows); + $this->assertSame('COM_BFSTOP_ACTIONLOG_BLOCKS_LIFTED', $rows[0]->message_language_key); + $message = json_decode($rows[0]->message, true); + $this->assertSame('blocks_lifted', $message['action']); + $this->assertSame('203.0.113.77', $message['ipaddresses']); + + // not among the extensions the User Actions Log records: nothing + \com_bfstopInstallerScript::unregisterFromActionLogs($this->db); + (new \ReflectionProperty(\Joomla\CMS\Component\ComponentHelper::class, 'components'))->setValue(null, array()); + $this->assertFalse(ActionLogHelper::isEnabled()); + ActionLogHelper::log('log_cleared'); + $this->assertCount(1, $logged()); + } + finally + { + $this->restoreActionLogsState($state); + } + } + + public function testTheHtaccessCheckTriesAProbe() + { + $root = sys_get_temp_dir().'/bfstop-check-'.bin2hex(random_bytes(4)); + mkdir($root.'/sub', 0755, true); + try + { + $check = HtaccessCheckHelper::class; + $this->assertSame('https://example.org', $check::urlOf($root, $root, 'https://example.org/')); + $this->assertSame('https://example.org/site/sub', $check::urlOf($root.'/sub', $root, 'https://example.org/site/')); + $this->assertNull($check::urlOf(dirname($root), $root, 'https://example.org/'), 'outside the site'); + $this->assertNull($check::urlOf($root.'-other', $root, 'https://example.org/'), 'a name which only starts the same'); + + // a server which answers like Apache honouring the probe's .htaccess + $requests = array(); + $server = function ($deny, $allow = 200, $body = null) use ($root, &$requests) + { + return function ($url) use ($root, $deny, $allow, $body, &$requests) + { + $requests[] = $url; + $this->assertMatchesRegularExpression('#^https://example\.org/sub/bfstop-check-[0-9a-f]{32}/probe\.html\?(allow|deny)=[0-9a-f]{32}$#', $url); + preg_match('#/(bfstop-check-[0-9a-f]{32})/probe\.html\?(allow|deny)=#', $url, $m); + $dir = $root.'/sub/'.$m[1]; + $this->assertFileExists($dir.'/.htaccess', 'the probe is there while it is requested'); + return $m[2] === 'deny' ? array($deny, 'Forbidden') : array($allow, $body ?? file_get_contents($dir.'/probe.html')); + }; + }; + $run = fn ($fetch) => $check::run($root.'/sub', $fetch, $root, 'https://example.org/'); + $this->assertSame(array($check::Effective, '403'), $run($server(403))); + $this->assertCount(2, $requests); + $this->assertSame(array($check::Ignored, '200'), $run($server(200))); + $this->assertSame(array($check::Broken, '500'), $run($server(500))); + $this->assertSame(array($check::Broken, '500'), $run($server(403, 500)), 'the first request already'); + $this->assertSame(array($check::Unknown, '401'), $run($server(403, 401)), 'something else in the way'); + $this->assertSame(array($check::Unknown, '200'), $run($server(403, 200, 'a login page')), 'not the probe'); + $this->assertSame(array($check::Unknown, 'request'), $run(fn ($url) => null)); + $this->assertSame(array($check::Unknown, 'outside'), $check::run(dirname($root), $server(403), $root, 'https://example.org/')); + // the probe is gone again, whatever the outcome + $this->assertSame(array(), glob($root.'/sub/bfstop-check-*')); + + Factory::getLanguage()->load('com_bfstop', BFSTOP_COMPONENT_ROOT.'/admin'); + $controller = \Codeling\Component\Bfstop\Administrator\Controller\SettingsController::class; + list($message, $type) = $controller::htaccessCheckMessage(array($check::Effective, '403'), '/var/www/'); + $this->assertSame('message', $type); + $this->assertStringContainsString('/var/www/<site>', $message); + list($message, $type) = $controller::htaccessCheckMessage(array($check::Unknown, '404'), '/var/www'); + $this->assertSame('warning', $type); + $this->assertStringContainsString('404', $message); + $this->assertStringNotContainsString('COM_BFSTOP_', $message, 'translated'); + list($message) = $controller::htaccessCheckMessage(array($check::Unknown, 'outside'), '/var/www'); + $this->assertStringNotContainsString('COM_BFSTOP_', $message); + } + finally + { + foreach (glob($root.'/sub/bfstop-check-*') ?: array() as $dir) + { + HtaccessHelper::removeProbe($dir); + } + @rmdir($root.'/sub'); + @rmdir($root); + } + } + + public function testTheUserActionsLogNamesTheChangedSettings() + { + $this->assertSame(array('blockNumber', 'emailaddress', 'useProxy'), SettingsModel::changedSettings( + array('blockNumber' => 10, 'emailaddress' => 'a@example.org', 'useProxy' => '0', 'blockMode' => 'full'), + array('blockNumber' => '5', 'emailaddress' => 'b@example.org', 'blockMode' => 'full', 'useProxy' => '1'))); + $this->assertSame(array(), SettingsModel::changedSettings(array('blockNumber' => 10), array('blockNumber' => '10')), + '5 and "5" are the same'); + $this->assertSame(array('enabledForOrigin', 'new'), SettingsModel::changedSettings( + array('enabledForOrigin' => 7), array('new' => 'x'))); + } + public function testInstallerScriptHintAndVersionCheck() { require_once BFSTOP_COMPONENT_ROOT.'/installscript.php'; @@ -1027,6 +1200,72 @@ public function testTheRiskFloorMayNotBeAboveTheThreshold() $this->assertIsArray($valid); } + public function testBlockingThroughHtaccessIsRefusedOnNginx() + { + // nginx never reads the file: the mode would only pretend to block + Factory::getLanguage()->load('com_bfstop', BFSTOP_COMPONENT_ROOT.'/admin'); + $software = $_SERVER['SERVER_SOFTWARE'] ?? null; + $validate = function ($server, $mode) + { + $_SERVER['SERVER_SOFTWARE'] = $server; + $model = $this->model(SettingsModel::class); + $valid = $model->validate($this->settingsForm(), array('params' => array('enabledForOrigin' => array('1'), + 'blockMode' => $mode))); + return array($valid, implode(' ', array_map('strval', $model->getErrors()))); + }; + try + { + list($valid, $errors) = $validate('nginx/1.25.4', 'htaccess'); + $this->assertFalse($valid); + $this->assertStringContainsString('nginx', $errors); + $this->assertStringNotContainsString('COM_BFSTOP_SETTINGS_HTACCESS_NEEDS_APACHE', $errors); + list($valid) = $validate('nginx/1.25.4', 'full'); + $this->assertIsArray($valid, 'another mode'); + list($valid) = $validate('Apache/2.4.58 (Ubuntu)', 'htaccess'); + $this->assertIsArray($valid, 'Apache'); + list($valid) = $validate('LiteSpeed', 'htaccess'); + $this->assertIsArray($valid, 'LiteSpeed reads the file: only a warning'); + } + finally + { + if ($software === null) + { + unset($_SERVER['SERVER_SOFTWARE']); + } + else + { + $_SERVER['SERVER_SOFTWARE'] = $software; + } + } + } + + public function testSettingsPageChecksTheClientAddress() + { + // where the administrator's request came from, the forwarding headers + // it carried and the address the plugin makes of it, for them to see + // whether the proxy settings fit + Factory::getLanguage()->load('com_bfstop', BFSTOP_COMPONENT_ROOT.'/admin'); + $view = \Codeling\Component\Bfstop\Administrator\View\Settings\HtmlView::class; + $check = $view::addressCheck(array('REMOTE_ADDR' => '198.51.100.7', + 'HTTP_X_FORWARDED_FOR' => '203.0.113.5, x', 'HTTP_CLIENT_IP' => '', 'HTTP_HOST' => 'example.org'), + '203.0.113.5'); + $this->assertStringContainsString('198.51.100.7', $check); + $this->assertStringContainsString('X-Forwarded-For', $check); + $this->assertStringContainsString('203.0.113.5, <b>x</b>', $check, 'escaped'); + $this->assertStringNotContainsString('Client-Ip', $check, 'an empty header is no header'); + $this->assertStringContainsString('203.0.113.5', $check); + $this->assertStringNotContainsString('COM_BFSTOP_SETTINGS_ADDRESS_CHECK', $check, 'translated'); + + $check = $view::addressCheck(array('REMOTE_ADDR' => '198.51.100.7', 'HTTP_FORWARDED' => str_repeat('a', 500)), + '198.51.100.7'); + $this->assertStringContainsString('Forwarded', $check); + $this->assertStringContainsString(str_repeat('a', 200).'…', $check, 'shortened'); + $this->assertStringNotContainsString(str_repeat('a', 201), $check); + + $check = $view::addressCheck(array('REMOTE_ADDR' => '198.51.100.7'), '198.51.100.7'); + $this->assertStringContainsString(\Joomla\CMS\Language\Text::_('COM_BFSTOP_SETTINGS_ADDRESS_CHECK_NO_HEADER'), $check); + } + public function testSettingsPageProposesTheLiveSite() { Factory::getLanguage()->load('com_bfstop', BFSTOP_COMPONENT_ROOT.'/admin'); diff --git a/tests/Integration/HtaccessHelperTest.php b/tests/Integration/HtaccessHelperTest.php index 0bb753b..6d58006 100644 --- a/tests/Integration/HtaccessHelperTest.php +++ b/tests/Integration/HtaccessHelperTest.php @@ -67,11 +67,49 @@ public function testCheckRequirements() $_SERVER['SERVER_SOFTWARE'] = 'nginx/1.25'; $req = $this->helper()->checkRequirements(); $this->assertFalse($req['apacheserver']); + $this->assertSame(HtaccessHelper::ServerNginx, $req['server']); $this->assertTrue($req['found']); $this->assertTrue($req['readable']); $this->assertTrue($req['writeable']); } + public function testWebServer() + { + foreach (array('Apache/2.4.58 (Ubuntu)' => HtaccessHelper::ServerApache, 'Apache' => HtaccessHelper::ServerApache, + 'nginx/1.25.4' => HtaccessHelper::ServerNginx, 'nginx' => HtaccessHelper::ServerNginx, + 'LiteSpeed' => HtaccessHelper::ServerLiteSpeed, 'Microsoft-IIS/10.0' => HtaccessHelper::ServerOther, + 'PHP 8.3.6 Development Server' => HtaccessHelper::ServerOther, '' => HtaccessHelper::ServerOther) as $software => $server) + { + $this->assertSame($server, HtaccessHelper::webServer($software), $software); + } + } + + public function testProbe() + { + $token = str_repeat('0123456789abcdef', 2); + $this->assertSame(array("", 'Require all denied', ''), + HtaccessHelper::probeLines($token)); + $probe = $this->dir.'/probe'; + $this->assertTrue(HtaccessHelper::writeProbe($probe, $token)); + $this->assertSame(implode("\n", HtaccessHelper::probeLines($token))."\n", file_get_contents($probe.'/.htaccess')); + $this->assertSame($token, file_get_contents($probe.'/'.HtaccessHelper::ProbeFile)); + $this->assertFalse(HtaccessHelper::writeProbe($probe, $token), 'not into a directory which exists'); + HtaccessHelper::removeProbe($probe); + $this->assertDirectoryDoesNotExist($probe); + foreach (array('', 'xyz', "abc'def0123456789", str_repeat('a', 65)) as $bad) + { + try + { + HtaccessHelper::probeLines($bad); + $this->fail('taken: '.$bad); + } + catch (\InvalidArgumentException $e) + { + $this->assertStringContainsString('hex digits', $e->getMessage()); + } + } + } + public function testNoFileMeansNoDeniedIPs() { $this->assertSame(array(), $this->helper()->getDeniedIPs()); diff --git a/tests/Integration/IpHelperAddressTest.php b/tests/Integration/IpHelperAddressTest.php index cd56c20..ec05784 100644 --- a/tests/Integration/IpHelperAddressTest.php +++ b/tests/Integration/IpHelperAddressTest.php @@ -8,6 +8,7 @@ namespace Codeling\Bfstop\Tests\Integration; use Codeling\Library\Bfstop\Helper\IpHelper; +use Codeling\Library\Bfstop\Helper\LockHelper; use Joomla\CMS\Log\Log; use Joomla\CMS\Plugin\PluginHelper; use PHPUnit\Framework\Attributes\DataProvider; @@ -55,6 +56,16 @@ protected function setUp(): void { unset($_SERVER[$header]); } + // no warning about a request which bypassed the proxy was logged yet + self::forgetDirectRequestWarnings(); + } + + private static function forgetDirectRequestWarnings() + { + foreach (glob(LockHelper::file('proxywarning', '*', 'stamp')) ?: array() as $file) + { + @unlink($file); + } } protected function tearDown(): void @@ -97,6 +108,45 @@ public function testProxyEnabledButRequestNotFromProxyIgnoresHeader() $this->assertTrue($this->logger->hasMessage(Log::WARNING, 'did not originate from the configured proxy')); } + public function testRequestsBypassingTheProxyAreWarnedAboutOnceAnHour() + { + // anybody can send them: a warning for each would push the entries + // that matter out of the rotated log + $this->configure(array('useProxy' => 1, 'proxyIpAddress' => '192.0.2.1')); + $_SERVER['HTTP_X_FORWARDED_FOR'] = '203.0.113.5'; + $this->assertSame('198.51.100.7', IpHelper::getAddress($this->logger)); + $this->assertTrue($this->logger->hasMessage(Log::WARNING, 'did not originate from the configured proxy')); + $this->assertFileExists(IpHelper::directRequestWarningFile('198.51.100.7')); + + // the next request of the address (another one: the address of a + // request is worked out once) is not logged again ... + $this->logger->messages = array(); + $_SERVER['HTTP_X_FORWARDED_FOR'] = '203.0.113.6'; + $this->assertSame('198.51.100.7', IpHelper::getAddress($this->logger)); + $this->assertFalse($this->logger->hasMessage(Log::WARNING, 'did not originate from the configured proxy')); + + // ... but an address of another stamp is + $other = null; + for ($i = 1; $i < 255 && $other === null; ++$i) + { + $candidate = '198.51.100.'.(100 + $i % 150); + if (IpHelper::directRequestWarningFile($candidate) !== IpHelper::directRequestWarningFile('198.51.100.7')) + { + $other = $candidate; + } + } + $_SERVER['REMOTE_ADDR'] = $other; + $this->assertSame($other, IpHelper::getAddress($this->logger)); + $this->assertTrue($this->logger->hasMessage(Log::WARNING, 'actual: "'.$other.'"')); + + // and the first address once the hour is over + $this->logger->messages = array(); + touch(IpHelper::directRequestWarningFile('198.51.100.7'), time() - IpHelper::DirectRequestWarningInterval); + $_SERVER['REMOTE_ADDR'] = '198.51.100.7'; + $this->assertSame('198.51.100.7', IpHelper::getAddress($this->logger)); + $this->assertTrue($this->logger->hasMessage(Log::WARNING, 'did not originate from the configured proxy')); + } + public function testProxyEnabledWithoutConfiguredProxyIpIgnoresHeader() { $this->configure(array('useProxy' => 1, 'proxyIpAddress' => '')); diff --git a/tests/Integration/NginxDenyFileTest.php b/tests/Integration/NginxDenyFileTest.php new file mode 100644 index 0000000..e5cf53c --- /dev/null +++ b/tests/Integration/NginxDenyFileTest.php @@ -0,0 +1,112 @@ +dir = sys_get_temp_dir().'/bfstop-nginx-'.bin2hex(random_bytes(4)); + mkdir($this->dir); + } + + protected function tearDown(): void + { + foreach (glob($this->dir.'/*') ?: array() as $file) + { + @unlink($file); + } + @rmdir($this->dir); + } + + private function block($ip, $minutesAgo = 0, $duration = 60) + { + return (int) $this->insert('#__bfstop_bannedip', array('ipaddress' => $ip, + 'crdate' => self::minutesAgo($minutesAgo), 'duration' => $duration), 'id'); + } + + public function testContent() + { + $this->assertSame(NginxDenyFile::Header."\ndeny 203.0.113.5;\ndeny 2001:db8:1:200::/56;\n", + NginxDenyFile::content(array('203.0.113.5', '2001:db8:1:200::/56', '203.0.113.5', + // only addresses and networks get into the server's configuration + '203.0.113.6; allow all', "203.0.113.7\ninclude /etc/passwd", ''))); + $this->assertSame(NginxDenyFile::Header."\n", NginxDenyFile::content(array())); + } + + public function testOnlyItsOwnFilesAreOverwritten() + { + $this->assertNull(NginxDenyFile::problem($this->dir.'/bfstop.conf'), 'a new file'); + $this->assertSame('path', NginxDenyFile::problem('bfstop.conf'), 'relative'); + $this->assertSame('path', NginxDenyFile::problem($this->dir.'/configuration.php'), 'no .conf'); + $this->assertSame('path', NginxDenyFile::problem($this->dir.'/.conf')); + $this->assertSame('path', NginxDenyFile::problem('phar://'.$this->dir.'/x.conf')); + $this->assertSame('directory', NginxDenyFile::problem($this->dir.'/none/bfstop.conf')); + + file_put_contents($this->dir.'/site.conf', "server { listen 80; }\n"); + $this->assertSame('foreign', NginxDenyFile::problem($this->dir.'/site.conf')); + $this->assertFalse((new NginxDenyFile($this->dir.'/site.conf', $this->logger))->write(array('203.0.113.5'))); + $this->assertSame("server { listen 80; }\n", file_get_contents($this->dir.'/site.conf'), 'left as it was'); + $this->logger->errors = array(); + + $file = new NginxDenyFile($this->dir.'/bfstop.conf', $this->logger); + $this->assertTrue($file->write(array('203.0.113.5'))); + $this->assertSame(NginxDenyFile::Header."\ndeny 203.0.113.5;\n", file_get_contents($this->dir.'/bfstop.conf')); + $this->assertNull(NginxDenyFile::problem($this->dir.'/bfstop.conf'), 'its own file'); + $this->assertTrue($file->write(array())); + $this->assertSame(NginxDenyFile::Header."\n", file_get_contents($this->dir.'/bfstop.conf')); + $this->assertSame(array('bfstop.conf', 'site.conf'), array_map('basename', glob($this->dir.'/*')), + 'no temporary file left'); + } + + public function testItFollowsTheBlockList() + { + $this->block('203.0.113.1', 10); + $this->block('2001:db8:1:200::/56', 5); + $this->block('203.0.113.2', 120, 60); + $lifted = $this->block('203.0.113.3'); + $this->insert('#__bfstop_unblock', array('block_id' => $lifted, 'source' => 0, 'crdate' => self::minutesAgo(0))); + $this->block('203.0.113.4', 60 * 24 * 365, 0); + // a network with an address of the allow list: nginx would turn it away + $this->block('198.51.100.0/24'); + $this->insert('#__bfstop_allowlist', array('ipaddress' => '198.51.100.7', 'notes' => '')); + + $repositories = new Repositories($this->logger); + $file = new NginxDenyFile($this->dir.'/bfstop.conf', $this->logger); + $this->assertTrue($file->sync($repositories, true)); + $this->assertSame(NginxDenyFile::Header."\ndeny 203.0.113.4;\ndeny 2001:db8:1:200::/56;\ndeny 203.0.113.1;\n", + file_get_contents($this->dir.'/bfstop.conf'), 'the active blocks, the newest first'); + + // another blocking mode: nginx blocks nobody + $this->assertTrue($file->sync($repositories, false)); + $this->assertSame(NginxDenyFile::Header."\n", file_get_contents($this->dir.'/bfstop.conf')); + $this->assertTrue((new NginxDenyFile($this->dir.'/new.conf'))->sync($repositories, false)); + $this->assertFileDoesNotExist($this->dir.'/new.conf', 'not made for nothing'); + + // from the settings + $settings = new Registry(array('blockMode' => 'full', 'nginxDenyFile' => $this->dir.'/bfstop.conf')); + $this->assertTrue(NginxDenyFile::syncForSettings($settings, $repositories)); + $this->assertStringContainsString('deny 203.0.113.1;', file_get_contents($this->dir.'/bfstop.conf')); + $this->assertNull(NginxDenyFile::syncForSettings(new Registry(array('blockMode' => 'full')), $repositories), + 'no file in the settings'); + $this->assertTrue(NginxDenyFile::syncForSettings(new Registry(array('blockMode' => 'loginonly', + 'nginxDenyFile' => $this->dir.'/bfstop.conf')), $repositories)); + $this->assertSame(NginxDenyFile::Header."\n", file_get_contents($this->dir.'/bfstop.conf'), 'Login Only'); + } +} diff --git a/tests/Integration/RepositoriesTest.php b/tests/Integration/RepositoriesTest.php index c62580c..97fe069 100644 --- a/tests/Integration/RepositoriesTest.php +++ b/tests/Integration/RepositoriesTest.php @@ -256,6 +256,24 @@ public function testBlockIPAndRecordAttempts() $this->assertNotNull($row->last_attempt); } + public function testRecoverySubmissionsAreCountedPerHourAgainstTheNewestBlock() + { + $older = (int) $this->block('203.0.113.51', 5, 30); + $newer = (int) $this->block('203.0.113.51', 0, 30); + $blocks = $this->repos->blocks(); + $this->assertSame(1, $blocks->countRecoverySubmission(array($older, $newer), 60)); + $this->assertSame(2, $blocks->countRecoverySubmission(array($newer, $older), 60)); + $this->db->setQuery('SELECT recovery_requests FROM #__bfstop_bannedip WHERE id='.(int) $older); + $this->assertSame(0, (int) $this->db->loadResult(), 'the newest block counts them'); + // a new hour starts the count again + $this->db->setQuery("UPDATE #__bfstop_bannedip SET recovery_since='".self::minutesAgo(61)."' WHERE id=".(int) $newer)->execute(); + $this->assertSame(1, $blocks->countRecoverySubmission(array($newer), 60)); + $this->db->setQuery('SELECT recovery_since FROM #__bfstop_bannedip WHERE id='.(int) $newer); + $this->assertGreaterThan(time() - 120, strtotime($this->db->loadResult()), 'from now'); + $this->assertSame(2, $blocks->countRecoverySubmission(array($newer), 60)); + $this->assertSame(0, $blocks->countRecoverySubmission(array(), 60), 'no block'); + } + public function testAllowList() { $this->insert('#__bfstop_allowlist', array('ipaddress' => '10.1.0.0/16', 'notes' => '')); diff --git a/tests/Integration/UnblockPageHttpTest.php b/tests/Integration/UnblockPageHttpTest.php index 94c6662..4fb9851 100644 --- a/tests/Integration/UnblockPageHttpTest.php +++ b/tests/Integration/UnblockPageHttpTest.php @@ -218,6 +218,10 @@ public function testTheLinkIsKeptSecret() $this->assertStringContainsString('no-store', implode(',', $headers['cache-control'] ?? array()), 'not cached'); $this->assertSame(array('no-referrer'), $headers['referrer-policy'] ?? null); $this->assertSame(array('noindex, nofollow'), $headers['x-robots-tag'] ?? null); + // nor shown in another site's frame, where a click could be + // steered onto its button + $this->assertSame(array('DENY'), $headers['x-frame-options'] ?? null); + $this->assertSame(array('nosniff'), $headers['x-content-type-options'] ?? null); } } diff --git a/tests/Integration/fixtures/htaccess_probe.php b/tests/Integration/fixtures/htaccess_probe.php new file mode 100644 index 0000000..eba34e9 --- /dev/null +++ b/tests/Integration/fixtures/htaccess_probe.php @@ -0,0 +1,23 @@ +file); } + public function testDueOnceInTheInterval() + { + $this->assertTrue(LockHelper::due($this->file, 3600), 'never done'); + $this->assertFileExists($this->file, 'the stamp is written'); + $this->assertFalse(LockHelper::due($this->file, 3600), 'done just now'); + touch($this->file, time() - 3600); + $this->assertTrue(LockHelper::due($this->file, 3600), 'the interval is over'); + $this->assertFalse(LockHelper::due($this->file, 3600)); + // a stamp from the future (the clock was set back) doesn't silence it + touch($this->file, time() + 7200); + $this->assertTrue(LockHelper::due($this->file, 3600)); + } + + public function testDueWhereTheStampCantBeWritten() + { + $file = sys_get_temp_dir().'/bfstop-no-such-directory-'.bin2hex(random_bytes(6)).'/x.stamp'; + $this->assertTrue(LockHelper::due($file, 3600)); + $this->assertTrue(LockHelper::due($file, 3600), 'always: there is nothing to tell it was done'); + } + public function testLockIsExclusiveUntilReleased() { $first = LockHelper::acquire($this->file, 0); diff --git a/tests/ci/apache-htaccess.sh b/tests/ci/apache-htaccess.sh index a6c74c7..f5e7098 100755 --- a/tests/ci/apache-htaccess.sh +++ b/tests/ci/apache-htaccess.sh @@ -15,6 +15,8 @@ # denied/ - closed by the server configuration # open/ - nothing else # and each is requested from 127.0.0.1, with that address blocked and not. +# So is the probe with which the settings page checks that the web server +# honours the section (HtaccessHelper::writeProbe()). # The section lets the link of an unblock email through to the site's # index.php - and nothing else: it is written into the document root too, as # for a site at the root of the server. @@ -125,6 +127,15 @@ expect "blocked, the unblock page with another token" 403 "$url/index.php?option expect "blocked, the unblock query elsewhere" 403 "$url/template.css?$unblock" expect "blocked, the unblock query in open/" 403 "$url/open/?$unblock" +# the probe of the settings page's check (HtaccessHelper::writeProbe()): its +# .htaccess turns away the request with its query, and only that one +probe_token="fedcba9876543210fedcba9876543210" +setup "" +php "$plugin_root/tests/Integration/fixtures/htaccess_probe.php" "$work/www/open/bfstop-probe" "$probe_token" +expect "probe, another query" 200 "$url/open/bfstop-probe/probe.html?allow=$probe_token" +expect "probe, its query" 403 "$url/open/bfstop-probe/probe.html?deny=$probe_token" +expect "probe, its query with more" 200 "$url/open/bfstop-probe/probe.html?deny=$probe_token&x" + if grep -q 'AH0[0-9]*: .*\(Syntax\|syntax error\|Invalid\)' "$work/error.log"; then echo "FAIL the error log reports configuration errors:" cat "$work/error.log"