Shieldlist

mariadb Gratuit

Connexions refusées dans le journal d'erreurs de MariaDB ou MySQL.

Télécharger le pack tar.gz des fichiers listés ci-dessous

Règles (2)

À propos de ce pack

Refused logins from MariaDB's or MySQL's error log (/var/log/mysql/error.log on Debian, /var/log/mariadb/mariadb.log elsewhere), declared as log: mysql with the database port beside it.

The parsers

Both read the line's own time, so a replay places every attempt. Both count only when the host part of 'user'@'host' is an address, IPv4 or IPv6: 'x'@'localhost' is a local service with the wrong password, and a client the server writes by name (skip_name_resolve off, reverse and forward names agreeing) is not counted either — the agent looks nothing up. Set skip_name_resolve to have every attempt written by address.

On a machine whose database listens on the loopback only, these never match: shield stats then shows the rules at 0 hits, a visible statement that this door is shut.

The rules

Policy database: 6h, then 7d, 30d, 365d on a return within thirty days, on the database port only — a customer's client with a stale password keeps its website and its mail.

Parseurs (2)

Les briques : chaque parseur nomme un log, un préfiltre peu coûteux et la regex qui extrait l'adresse.

mariadb-auth-fail mysql
# A refused database login, from MariaDB's error log (log_warnings 2, the
# default, writes every one):
#   2026-08-13 10:00:01 6516432 [Warning] Access denied for user 'someone'@'203.0.113.9' (using password: YES)
#   2026-08-13  4:00:01 6516433 [Warning] Access denied for user 'root'@'2001:db8::7' (using password: YES)
#
# The host part is required to look like an address, which is what
# leaves the local ones alone: 'user'@'localhost' is a service on this
# machine getting its own credentials wrong, not an attack. When the
# server resolves names (skip_name_resolve off), a client whose reverse
# and forward names agree is written by name: such a line is not
# counted either — the agent looks nothing up, by design. Set
# skip_name_resolve to have every attempt written by address.
#
# MariaDB space-pads the hour (" 4:00:01"): Go's reader takes a run of
# spaces for one and an hour of one digit, so the plain layout reads
# both shapes. The time is the server's local time.
parser: mariadb-auth-fail
log: mysql
prefilter: "Access denied for user"
regex: "^(?P<time>\\d{4}-\\d\\d-\\d\\d +\\d{1,2}:\\d\\d:\\d\\d) \\d+ \\[Warning\\] Access denied for user '(?P<user>.*)'@'(?P<ip>[0-9a-fA-F.:]+)' "
time_field: time
time_format: "2006-01-02 15:04:05"
mysql-auth-fail mysql
# A refused database login, from MySQL's error log (5.7 and 8.x):
#   2026-08-13T10:00:01.123456Z 12 [Note] [MY-010926] [Server] Access denied for user 'root'@'203.0.113.9' (using password: YES)
#   2026-08-13T10:00:01.123456+02:00 12 [Note] Access denied for user 'root'@'203.0.113.9' (using password: YES)
#
# MySQL 8 writes these at log_error_verbosity 3 only (2 by default):
# without it, the log holds nothing to read. The host part must be an
# address, as for MariaDB: 'user'@'localhost', and a client written by
# its name, are never counted.
parser: mysql-auth-fail
log: mysql
prefilter: "Access denied for user"
regex: "^(?P<time>\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.\\d+)?(?:Z|[+-]\\d\\d:\\d\\d)) \\d+ \\[(?:Note|Warning)\\](?: \\[MY-\\d+\\] \\[Server\\])? Access denied for user '(?P<user>.*)'@'(?P<ip>[0-9a-fA-F.:]+)' "
time_field: time
time_format: rfc3339

Politiques de ban

database 6h → 7d → 30d → 365d
# The database port alone, the ladder of SSH: whoever guesses at the
# database is shut out of it, a customer's client with a stale password
# keeps its website and its mail.
policy: database
durations: [6h, 7d, 30d, 365d]
ports: service
memory: 30d
tighten: 2x

Signalements

database-intrusion-network Several addresses of this network took turns guessing passwords on our database server (MariaDB/MySQL), a few refused logins each: credential brute force spread over the network to stay under per-address limits. The network is blocked from our database port; please look into the machines behind these addresses — compromised hosts or a deliberate attack tool.
# The range version of database-intrusion: several addresses of one
# network took turns guessing passwords on the database. Nothing about
# the accounts tried or the server hit goes out.
report: database-intrusion-network
categories: [brute-force]
says: "Several addresses of this network took turns guessing passwords on our database server (MariaDB/MySQL), a few refused logins each: credential brute force spread over the network to stay under per-address limits. The network is blocked from our database port; please look into the machines behind these addresses — compromised hosts or a deliberate attack tool."
brief: 'Database password guessing'
include: []
database-intrusion This address is guessing passwords on our database server (MariaDB/MySQL): repeated refused logins, credential brute force. It is blocked from our database port; please look into the process behind it — a compromised machine or a deliberate attack tool.
# Categories reuse the mapping proven in production by this host's
# CrowdSec notifier. `include` is empty: a report says what happened,
# never who it happened to. The accounts tried, the mailboxes aimed at
# and the site that was hit are all captured by the parsers and none of
# them are a public database's business.
report: database-intrusion
categories: [brute-force]
says: "This address is guessing passwords on our database server (MariaDB/MySQL): repeated refused logins, credential brute force. It is blocked from our database port; please look into the process behind it — a compromised machine or a deliberate attack tool."
brief: 'Database password guessing'
include: []

Fichiers