> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snapsec.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Detection Rules

> Define, customize, and manage vulnerability detection logic using rule-based scanning.

## Overview

Detection Rules are the core of how vulnerabilities are identified.

They simulate attacker behavior by modifying requests and analyzing responses to detect security flaws.

***

## Rule Categories

<Frame caption="Browse vulnerability categories">
  <img src="https://mintcdn.com/snapsec-23724fa2/682C7otjlzFbtKhr/images/was/detection-rules.png?fit=max&auto=format&n=682C7otjlzFbtKhr&q=85&s=ff87252c95368ded906d1de26f2595bf" width="1912" height="828" data-path="images/was/detection-rules.png" />
</Frame>

Rules are grouped into categories for better organization:

* CRLF
* Authentication & Authorization
* Command Injection
* CORS
* Database Injection
* Error Handling & Logs
* File Inclusion
* Open Redirect
* Security Headers
* Sensitive Data Exposure
* SSRF
* XSS
* XXE

***

## Creating a Rule

<Frame caption="Create a new detection rule">
  <img src="https://mintcdn.com/snapsec-23724fa2/682C7otjlzFbtKhr/images/was/detection-rules-2.png?fit=max&auto=format&n=682C7otjlzFbtKhr&q=85&s=2b1398a1602c26d0e6ddc91c57104777" width="1020" height="562" data-path="images/was/detection-rules-2.png" />
</Frame>

Use **Create Rule** to define custom detection logic.

Each rule allows you to simulate real attack scenarios and detect application weaknesses.

***

## YAML-Based Rule Engine

<Frame caption="Define detection logic using YAML">
  <img src="https://mintcdn.com/snapsec-23724fa2/682C7otjlzFbtKhr/images/was/detection-rules-3.png?fit=max&auto=format&n=682C7otjlzFbtKhr&q=85&s=4d327ce81373017c89407336b50f47a1" width="1147" height="870" data-path="images/was/detection-rules-3.png" />
</Frame>

Rules are written in YAML and consist of:

### Core Sections

* **Transform**
  * Modify headers, query params, or body
* **Match Conditions**
  * Status codes
  * Response content
* **Report**
  * Title
  * Description
  * Severity
  * CWE
  * CVSS
  * Impact
  * Mitigation
  * Reproduction Steps

***

## Rule Execution Logic

Rules work by:

1. Modifying the original request
2. Sending the transformed request
3. Analyzing the response
4. Flagging unexpected behavior as vulnerabilities

***

## Rule Management

<Frame caption="Manage and monitor active rules">
  <img src="https://mintcdn.com/snapsec-23724fa2/682C7otjlzFbtKhr/images/was/inside-detection-rules.png?fit=max&auto=format&n=682C7otjlzFbtKhr&q=85&s=e8dc9589198d54383389a59ce5870af6" width="1600" height="536" data-path="images/was/inside-detection-rules.png" />
</Frame>

Each rule provides:

* Enable / Disable toggle
* Severity classification
* Detection description
* Number of findings

***

## Editing Rules

<Frame caption="Edit existing rule configuration">
  <img src="https://mintcdn.com/snapsec-23724fa2/682C7otjlzFbtKhr/images/was/inside-detection-rules-2.png?fit=max&auto=format&n=682C7otjlzFbtKhr&q=85&s=0c999b4cfd681c790fcf2fd47dc1d1da" width="1523" height="537" data-path="images/was/inside-detection-rules-2.png" />
</Frame>

Rules can be modified anytime to:

* Improve detection accuracy
* Reduce false positives
* Adjust logic for application-specific behavior

***

## Deep Rule Customization

<Frame caption="Advanced YAML rule editor">
  <img src="https://mintcdn.com/snapsec-23724fa2/682C7otjlzFbtKhr/images/was/inside-detection-rules-3.png?fit=max&auto=format&n=682C7otjlzFbtKhr&q=85&s=7f0bcce527341bc7428806dc3a35e6c9" width="1160" height="888" data-path="images/was/inside-detection-rules-3.png" />
</Frame>

The editor allows full control over:

* Request transformations
* Matching conditions
* Reporting output

This enables detection of:

* Business logic flaws
* Authorization bypass
* Misconfigurations
* Edge-case vulnerabilities

***

## Why It Matters

Detection Rules turn your scanner into a customizable security engine.

### Key Benefits

* Adapt scanning to your application logic
* Detect beyond standard vulnerability signatures
* Reduce noise with precise matching
* Align findings with real-world attack patterns
* Enable security teams to build reusable detection logic

***

## Explore Live Demo

<Card title="Explore WAS Live — No Signup Needed" icon="wand-magic-sparkles" href="https://suite.snapsec.co/demo">
  Create, test, and deploy custom detection logic tailored to your applications.
</Card>
