---
title: "My Site is Being Attacked"
date: "2022-02-04T00:18:32+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/92331-my-site-being-attacked"
id: "c1ad6382-7bcc-4aca-9e6e-e8c0dc8e284d"
---

Issue
-----

How can I tell if my website is being attacked?

Resolution
----------

There are many reasons a website can be slow. [Keeping your Acquia sites performant](/node/55842) outlines several suggestions for checking overall Drupal and server performance. If you've already tuned your website and you're still experiencing performance issues, high levels of traffic may be the cause.

If you're an Acquia customer, and you [expect a high traffic event](/node/55913), you can [create an Acquia Support ticket](http://insight.acquia.com/support). Include as much information as possible about the website, date and time for the event, and expected amount of traffic.

Note

Acquia Cloud Enterprise and Acquia Cloud Site Factory customers may want to consider [Acquia Cloud Edge](/node/55926). The Acquia Cloud Edge Protect product can help protect against DoS (denial of service) or DDoS (distributed denial of service) attacks.

If you're experiencing an unexpected high-traffic event, the cause could be a DoS or DDoS attack or a scan by a bot or crawler. These will generally look like repeated requests against one or more ports or URLs on your server, by one or a group of IP addresses.

### How to find a scan

The most obvious place to find repeated requests to a particular part of your website or server is to check the Apache `access.log`. This file generally records every attempt to access a file or path for the website. See [Searching the error logs to troubleshoot problems](/node/92891) for suggestions on finding errors and traffic trends.

### Specific things to look for

Two of the biggest indicators that a scan or attack is happening, from the perspective of the `access.log`, are repeated requests to the same URL, or repeated login attempts (potentially indicating a hack attempt).

A brute force attack against a Drupal user or other URL might look something like this:

    /user/password?name=abcdefghij 
    /user/password?name=abcdefghijk 
    /user/password?name=abcdefghijkl 
    /user/password?name=abcdefghijklm 

If you suspect a bot or a small group of IP addresses is the primary vector of the attack, you can try to determine what IPs are making the most requests. You can use the code below, at the command line, to search for the `forwarded-for` header, and see what addresses are listed. Replace the date with the date of the log file you want to search.

    grep "05/Dec/2019:02:1" access.log | egrep -o "forwarded_for\S*" | sort | uniq -c | sort -nr | head

### Mitigating the attack

There are several methods that you can use to mitigate an attack. You may choose one or more methods, depending on how your website is being accessed.

*   **Use** [**Acquia Cloud Edge Protect**](/node/55926)
    *   Acquia Cloud Edge Protect secures your website with a Web Application Firewall (WAF), high-speed DNS, and protection against DoS and DDOS attacks. Acquia Cloud Edge CDN provides services that can help your website stay up during an attack.
*   **Denying spammers**
    *   If someone is attempting brute force registrations or comments, [CAPTCHA solutions and alternatives](/node/92766) can be a deterrent.
*   **Speed up 404 responses**
    *   If someone attempts to [bypass the Varnish cache](/acquia-cloud-platform/help/92381-varnish-bypassing-cache "Varnish: Bypassing the cache") or access random URLs, Drupal will bootstrap on every attempt, [use Fast 404](/node/94106) to circumvent a complete bootstrap.
*   **Password protect non-production websites**
    *   To prevent attacks on non-production websites, you should [password-protect](/node/56142) them. Non-production websites may be more vulnerable to attack, due to their very nature of constantly changing (and not necessarily security-tested) code.
*   **Use caching**
    *   Caching can significantly increase website performance, and help give a website administrator enough time to put other mitigations in place before an outage occurs. To learn more about caching, see the [caching overview](/node/92871), and for large websites, consider using a [content delivery network (CDN)](/node/93301).
*   **Deny access**
    *   **​​​​​​​**You can use the [`.htaccess` file and rewrite rules](/node/92451) to block access to paths, or to block access from particular addresses to your website. There are various ways to [restrict access](/node/94006).

If you are an Acquia customer, and you suspect your website is under inappropriate load, you can also [contact Acquia support](/node/55874) to obtain troubleshooting assistance.