# 3.1.1 Google Recaptcha Setup

### 🔐 Google reCAPTCHA Integration (ShieldsGuard)

#### 📖 Overview

ShieldsGuard supports Google reCAPTCHA integration to enhance **bot protection**, **DDoS challenge validation**, and **login security**.

By adding your Google reCAPTCHA keys to the system, you ensure that automated access attempts are filtered with an additional verification layer before being allowed to interact with protected web resources.

***

### 🧭 Step-by-Step Setup Guide

#### 1️⃣ Register Your Site at Google reCAPTCHA

1. Visit: <https://www.google.com/recaptcha/admin/create>

<figure><img src="https://1888569782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj6f1XtdOtNUZVCRH9J44%2Fuploads%2FeeETQlH333AftEV46H4l%2Fcaptchakurulum.png?alt=media&#x26;token=ce756607-110b-42ac-8ba7-9801f88dee13" alt=""><figcaption></figcaption></figure>

1. Log in with your Google account
2. Fill in the form:
   * **Label**: Example: `ShieldsGuard Protection`
   * **Choose Type**:
     * ✅ **reCAPTCHA v2** – "I’m not a robot" (recommended)
     * Or **v3** if desired
   * **Domains**: Enter your domain (e.g., `example.com`)
   * Accept the Terms of Service
3. Click **Submit**

<figure><img src="https://1888569782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj6f1XtdOtNUZVCRH9J44%2Fuploads%2FmkzC39DJvPwHKMxaXk4I%2Fcaptchakurulum1.png?alt=media&#x26;token=3764c79d-ba08-49ab-b96d-81cf9a79c72c" alt=""><figcaption></figcaption></figure>

You will receive two keys:

* 🔐 **Secret Key**
* 🌐 **Site Key**

***

#### 2️⃣ Enter Keys into ShieldsGuard

Once you’ve obtained your keys:

1. Log in to your **ShieldsGuard Panel**
2. Navigate to:\
   **Protection > DDoS Protection > Google Recaptcha Section**
3. Click the 🔴 **Set Key** button\
   \&#xNAN;*(You’ll see this as a red action button prompting configuration)*

<figure><img src="https://1888569782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj6f1XtdOtNUZVCRH9J44%2Fuploads%2FeDiqEhKbsr1OmfuqGXjS%2Fsetkey.png?alt=media&#x26;token=063848ac-62c2-493f-b31f-74a67092f5b9" alt=""><figcaption></figcaption></figure>

1. In the popup titled **Edit Google Captcha Key**, enter:
   * **Secret Key** (first field)
   * **Site Key** (second field)

<figure><img src="https://1888569782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj6f1XtdOtNUZVCRH9J44%2Fuploads%2Fnb2VTztakj1oqyY8ILvW%2Fimage.png?alt=media&#x26;token=ab21c2e7-a0d5-4126-983c-5201475f145a" alt=""><figcaption></figcaption></figure>

1. Click the 🔒 **Save** button

You will receive confirmation that the keys are stored and ready for use.

***

#### 3️⃣ Activate Google reCAPTCHA in DDoS Protection

> Adding the keys alone is not enough. You must activate Google reCAPTCHA in your protection mode.

1. Go to: **Protection > DDoS Protection**
2. In the **DDoS Protection Settings**, set:
   * **Protection Mode** → `Automatic or Google Captcha`
   * **Automatic Protection Type** → `Google Captcha`
3. Save the configuration

Now, when a threshold is triggered, ShieldsGuard will serve Google reCAPTCHA challenges to the client.

***

### 🧪 Test It

To verify that Google reCAPTCHA is active:

* Simulate a DDoS request (e.g., rapid refresh or tool-based probe)
* Access a protected endpoint with the configured domain
* reCAPTCHA challenge should appear in the browser

***

### 💡 Best Practices

| Tip                         | Recommendation                               |
| --------------------------- | -------------------------------------------- |
| ✅ Use reCAPTCHA v2          | More reliable for user interaction           |
| 🔁 Rotate keys periodically | For improved security                        |
| 🧪 Test CAPTCHA in dev mode | Ensure visual rendering and key match        |
| 🔐 Keep secret key private  | Never expose this value to frontend or users |

***

> 🎯 By integrating Google reCAPTCHA with ShieldsGuard, you're creating a highly effective layer of friction for automated threats, while preserving user experience for legitimate visitors.
