Most Drupal sites receive hostile traffic every day, and most of it is harmless noise. Automated tools probe login pages, request files that do not exist and submit forms with junk. The skill is not blocking every request. It is knowing where to look and recognizing the few patterns that point to a real problem.
This guide covers the records Drupal keeps, the records your host keeps, what common attack patterns look like in them, and which signals deserve action.
What Drupal records on its own
Drupal core includes the Database Logging module (dblog). When it is enabled, Drupal writes events to the database and shows them under Reports in the admin menu. Check that it is enabled, because a site can have it switched off in favor of another logging setup.
The useful reports are:
- Recent log messages lists events such as failed logins, PHP errors, cron runs and module activity. You can filter by type and severity.
- Top ‘access denied’ errors shows the pages visitors were refused, ranked by how often.
- Top ‘page not found’ errors shows the missing URLs requested most often.
- Status report flags configuration problems and pending updates that make an attack easier.
If you use Drush, drush watchdog:show prints the same log entries in your terminal, and drush watchdog:tail follows new ones as they arrive. That is faster than paging through the admin screen during an incident.
Two limits matter. The database log is capped by a row limit you set in the logging configuration, so older entries are discarded. And it records what Drupal itself sees. Requests that never reach PHP, such as those blocked by your host or served from a cache, will not appear.
What your host and web server record
Drupal’s log is only part of the picture. The web server’s access log records every request: the address it came from, the URL, the response code and the browser string it claimed. The error log records server and PHP failures.
What you can see depends on your hosting plan and setup. Managed Drupal hosts often provide log viewers or downloads in their dashboard. Shared hosting usually offers raw log files in the control panel. On a server you manage yourself, you read the files directly. If you cannot find them, ask your host which logs are kept and for how long.
If a CDN or web application firewall sits in front of the site, it has its own dashboard showing blocked and challenged requests. Whether you have one depends on your plan and configuration. Where it exists, it is often the clearest view of scanning traffic, because that traffic is stopped before it reaches Drupal.
If you use syslog, the core Syslog module can send Drupal events to the server’s system log instead of the database. This keeps the database lean, but you then read events through the server rather than the Reports menu.
What common attack patterns look like
Brute-force logins
Look for repeated Login attempt failed entries in the recent log messages, often for the same username or from the same address. Attackers commonly try the default admin account name, the site’s domain name or a staff name found on the website.
In the access log, the same signature is many POST requests to the login page in a short stretch. Drupal’s core flood control limits failed attempts per address and per account, so repeated failures often end in a temporary lockout rather than a breach. Note that an account locked out by this limit may be a real staff member who mistyped a password, so check before assuming the worst.
Scanning and probing
Scanners request paths that do not exist on your site. In the page not found report, you will see a stream of unrelated URLs: other CMS login pages, backup archive names, configuration file names, and database tool paths. Hits on a single IP address spread over seconds are typical.
These are almost always automated and almost always fail. They tell you that your site is being looked at, not that it has been compromised.
Spam and fake registrations
Spam shows up in your own data: contact form submissions full of links, comments awaiting approval, or new user accounts with random names. Check People in the admin menu for recent accounts you do not recognize. Core user registration settings let you restrict sign-ups to administrators or require administrator approval, which removes most of the damage from fake accounts.
Which signals need action
Treat the following as reasons to act promptly:
- A successful login from an unexpected location or at an odd hour, particularly to an administrator account.
- A new administrator account, or a role change you did not make.
- Unfamiliar modules, themes or files appearing on the server, or changes to files you have not edited.
- Content you did not write, especially hidden links, redirects or injected scripts.
- The status report or Available updates showing a security update you have not applied.
- Sudden server slowdowns that line up with a flood of requests to one URL.
Failed logins that go nowhere, scanner requests that return not found, and rejected spam are normal background. Log them if you like, but do not treat them as incidents.
A simple routine you can keep up
- Open Recent log messages weekly and filter for errors and the user type to scan failed logins.
- Review the access denied and page not found reports for any URL that repeats suspiciously.
- Check the People list for accounts and roles you do not recognize.
- Confirm the status report shows no pending security updates, and read new advisories on the Drupal security team pages.
- Look at your host’s or CDN’s dashboard for blocked traffic and unusual spikes.
- Make sure administrator accounts use unique, strong passwords and, where your setup supports it, two-step verification.
The Drupal documentation explains each logging and user setting, and OWASP offers general guidance on what web application attacks look like.
Frequently asked questions
Does Drupal tell me when my site is being attacked?
Not by itself. Drupal logs events and shows them in reports, but it does not send alerts or label traffic as an attack. You decide what to review, or set up monitoring through your host or a logging tool.
Should I block every address that fails a login?
Usually not. Most addresses are rotated or disposable, so blocking them one by one is slow and rarely helps. Strong passwords, flood control and updates matter more. Blocking is worth it when one source is clearly hammering a single page and slowing the site.
How long should I keep logs?
Long enough to investigate something you notice late. Database logs are limited by the row cap you configure, so raise it or ship logs elsewhere if you need history. Ask your host how long server logs are retained.