---
title: "Attack Prevention Configuration"
description: "The following JSON is an example for this standardised configuration component."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/application-setting-components/attack-prevention-configuration
original: https://documentation.invantive.eu/en/docs/application-setting-components/attack-prevention-configuration
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Examples
The following JSON is an example for this standardised configuration component:
```json
{ //
  // Whether a trusted proxy (such as AWS CloudFront) is running 
  // in front of the My App site.
  //
  "RunsBehindProxy": true
  //
  // Duration of an IP-address based blocks, started from the first hit.
  //
, "BlockDurationSec": 3600
  //
  // Number of hits before a block on IP-address is applied.
  //
, "MaxHitsBeforeBlock": 3
}
```

## Definition
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://invantive.com/schemas/defs/AttackPreventionConfig.schema.json",
  "title": "AttackPreventionConfig",
  "description": "Attack prevention middleware.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "RunsBehindProxy": {
      "type": "boolean",
      "description": "Whether the server runs behind a proxy.",
      "default": false
    },
    "BlockDurationSec": {
      "type": "integer",
      "description": "Duration of a block in seconds."
    },
    "MaxHitsBeforeBlock": {
      "type": "integer",
      "description": "Number of hits before a block is applied."
    }
  }
}
```