> For the complete documentation index, see [llms.txt](https://docs.inopli.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inopli.com/drp/advanced-features/automatic-search-rules/yara.md).

# YARA

<mark style="color:green;">**YARA Rules**</mark> allow analysts to define pattern-based detection logic using string matching and binary-level conditions. Originally designed for malware classification, YARA is also highly effective for detecting suspicious strings, tokens, and structural markers in exposed content within the Inopli DRP dataset.

YARA rules operate continuously on findings involving <mark style="color:green;">text bodies, source code, cloud storage leaks, and other artifacts</mark> where content analysis is meaningful.

***

### Rule Structure

A basic YARA rule consists of three main sections:

* <mark style="color:green;">**Meta**</mark> (optional)\
  Contains descriptive fields like `author`, `description`, or `severity`
* <mark style="color:green;">**Strings**</mark>\
  Defines patterns to match, including plaintext strings, hexadecimal byte patterns, or **r**<mark style="color:green;">**egular expressions (regex)**</mark>
* <mark style="color:green;">**Condition**</mark>\
  Boolean logic that defines when the rule should trigger

### Regex Support

YARA natively supports <mark style="color:green;">**regular expressions**</mark> using the `/regex/` syntax within the `strings` section. This enables analysts to detect:

* Obfuscated credentials
* Token formats (e.g., JWT, OAuth, API keys)
* File path structures
* Encoded indicators like Base64 or hex

Regex can be combined with modifiers like `nocase`, `wide`, or `ascii` to refine detection logic.

***

#### Use Cases

* Detect password patterns in HTML or JS sources
* Identify obfuscated malware strings in leaked ZIPs
* Flag exposure of client secrets in public cloud storage
* Match encoded backdoor calls in script-based payloads

***

### Incident Triggering

Once a YARA rule matches content in a DRP finding, the result is automatically enriched. If classified as a threat based on rule severity or context, it triggers an <mark style="color:green;">**incident in the Response module**</mark> for operational follow-up.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.inopli.com/drp/advanced-features/automatic-search-rules/yara.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
