---
title: "YARA rule authoring: review, setup & limitations · Undominated.ai"
canonical: https://undominated.ai/skills/trailofbits-yara-rule-authoring/
description: "Authors YARA-X rules that must be tested on the intended samples and on goodware, and forbids speculative nocase, wide, and unbounded regex."
---

# YARA rule authoring: review, setup & limitations · Undominated.ai

> Authors YARA-X rules that must be tested on the intended samples and on goodware, and forbids speculative nocase, wide, and unbounded regex.

[← Explore all skills](/skills/)

SECURITY REVIEW / Trail of Bits

# YARA rule authoring

Authors YARA-X rules that must be tested on the intended samples and on goodware, and forbids speculative nocase, wide, and unbounded regex.

 [See setup guidance ↓](#setup)[Original source ↗](https://github.com/trailofbits/skills/tree/82fe8226252622fa807643bdca1710901198553a/plugins/yara-authoring/skills/yara-rule-authoring)

SOURCE REVIEW

 Reviewed 2026-10-14
 Evidence 2 linked sources
 Publisher Trail of Bits
 Licence [CC-BY-SA-4.0 ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/LICENSE)
 Revision 82fe82262526
 [Read what was—and wasn’t—checked ↓](#review)

“Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.”

 [Trail of Bits · upstream description ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/plugins/yara-authoring/skills/yara-rule-authoring/SKILL.md) Our analysis follows below.

01 / THE REASONING

## Why this made the selection.

 - Requires evidence for case or encoding variants before adding nocase or wide modifiers; measure their cost on the target corpus.
- Regex quantifiers must be bounded, and a regex without a 4-byte literal anchor is called a performance failure.
- The testing reference requires a positive match on the targets, zero matches on goodware, and an edge-case pass.

### A good fit for

 - Writing a YARA-X rule for a malware family
- Rejecting a rule that only matched the samples it was written on
- Validate a YARA-X signature against representative malicious and benign samples before deployment.

### Weigh up before choosing

 - When NOT to Use sends disassembly to Ghidra or IDA, dynamic analysis to a sandbox, network detection to Suricata or Snort, and memory forensics to Volatility.
- A hash list is the stated alternative for simple hash detection.
- This review did not execute the skill or yr.
- Speed and compatibility percentages in the guide are upstream claims, not measurements here. High entropy does not prove packing and a string-count rule is only a heuristic.

02 / THE REVIEW RECORD

## What we actually inspected.

Source review has boundaries. A clear record is more useful than a “safe” badge.

### Material inspected

 - plugins/yara-authoring/skills/yara-rule-authoring/SKILL.md
- LICENSE
- README.md
- plugins/yara-authoring/skills/yara-rule-authoring/references/testing.md

### Our findings

 - Modifier discipline forbids speculative nocase or wide, and regex guidance forbids an unbounded .* in favour of a bounded quantifier such as .{0,30}.
- The skill says not to write a rule against a packed layer, and to pivot to structure when three unique strings cannot be found.
- When NOT to Use excludes static disassembly, dynamic analysis, network signatures, memory forensics, and hash-only detection.
- references/testing.md says testing is non-negotiable and lists positive, negative goodware, and edge-case validation, with yr check as the syntax step.
- The definition explains little-endian uint reads and distinguishes cheap structural checks, string combinations and module parsing; it requires goodware testing before release.

### Not established by this review

 - The skill was not executed inside a host agent.
- yr was not run and no goodware corpus was scanned.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

## Add a skill to your workflow.

[Upstream setup instructions ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/README.md)

DOCUMENTED COMMAND

 /plugin marketplace add trailofbits/skills Copy command ↗

Copying does not execute this command. It may retrieve a newer version than the reviewed source.

 - Claude Code: add the marketplace with /plugin marketplace add trailofbits/skills, then install the yara-authoring plugin from /plugin menu.
- Codex: the README documents codex plugin marketplace add trailofbits/skills, then codex plugin add <plugin-name>@trailofbits.
- Install YARA-X (brew install yara-x or cargo install yara-x) and uv before using the bundled scripts.
- Name the false-positive risk before shipping a rule.

### Before you start

 - YARA-X, whose CLI is yr
- uv and Python 3.11 or later for the bundled scripts
- The detection target and a goodware corpus you are allowed to scan

### Compatibility

Claude Code plugin marketplace · Codex via Claude marketplace compatibility · YARA-X

### Local Markdown instructions

 - The skill reads samples and writes YARA-X rules, and the testing reference runs yr check and rule matches against local files.
- Reads potentially malicious sample bytes in an isolated analysis environment; external corpus services may receive uploaded samples.

### Cost model

CC-BY-SA-4.0. The pinned LICENSE is Creative Commons Attribution-ShareAlike 4.0 International. The skill does not say a paid Trail of Bits account is required.

04 / FOLLOW THE EVIDENCE

## The source trail.

Our notes are separate from the original resource. Check upstream before adopting a new version.

 - [Skill definition ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/plugins/yara-authoring/skills/yara-rule-authoring/SKILL.md) Checked 2026-10-14 https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/plugins/yara-authoring/skills/yara-rule-authoring/SKILL.md Supports: Workflow and stated scope
- [Repository licence ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/LICENSE) Checked 2026-10-14 https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/LICENSE Supports: Redistribution terms

KEEP COMPARING

## Other approaches to consider.

Related by category or shared topics. These are alternatives to inspect, not a measured quality order.

 [### Algorand vulnerability scanner ↗ Pins Trail of Bits' Algorand scanner, which treats a short or empty coverage table as an unfinished scan and does not let a clean Tealer run stand in for patterns it never examined.](/skills/trailofbits-algorand-vulnerability-scanner/)[### Audit Augmentation ↗ Overlays external findings — SARIF static-analysis results, weAudit annotation files and Trailmark 0.4.x binary-analysis exports — onto a Trailmark code graph by file and line overlap and builds severity-based subgraphs.](/skills/trailofbits-trailmark-audit-augmentation/)[### Claude Security ↗ Runs Anthropic's Claude Security scans inside a Claude Code session: a whole-repository or scoped scan, a scan of a branch, pull request or commit, and suggested fixes as patch files the user applies.](/skills/anthropic-claude-security/)

 [AI Tools ↗](/tools/)[Skills ↗](/skills/)[Agents ↗](/agents/)[MCP Servers ↗](/mcp-servers/)[Workflows ↗](/workflows/)

## Continue your investigation

 - [Choose a toolkit](/tools/)
- [Inspect execution hosts](/agents/)
- [Check tool access](/mcp-servers/)
- [Check project dependencies](/check-repo/)
