Search Shortcut cmd + k | ctrl + k

YARA rule validation + malware-signature scanning in SQL, via pure-Rust yara-x (no libyara) — validate rulesets and scan BLOBs, one row per pattern hit

Maintainer(s): alitrack

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.

Platform 1.4.4 1.4.5 1.5.5 1.5.6 2.0.0
Linux AMD64
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows ARM64
WebAssembly

Installing and Loading

INSTALL yara FROM community;
LOAD yara;

Example

INSTALL yara FROM community;
LOAD yara;

-- Pure validation: do these rules compile? (never errors)
SELECT yara_check('rule bad { strings: $a = "abc" }');   -- false

-- The yara-x modules a rule may import
SELECT * FROM yara_modules();

-- Scan data against a ruleset — one row per matched pattern
SELECT * FROM yara_string_matches(
    'MZ90abc',
    'rule MZ { strings: $mz = "MZ" condition: $mz }'
);
-- rule | identifier | offset | matched

About yara

yara — YARA in SQL

Pure-Rust yara-x (no native libyara), so the rules engine compiles into the extension itself.

Function Returns Notes
yara_check(rules) BOOLEAN Do the rules compile? NULL in → NULL out. Never errors.
yara_modules() table The yara-x modules a rule may import
yara_string_matches(data, rules) table One row per pattern hit: rule, identifier, offset, matched

→ GitHub

Added Functions

function_name function_type description comment examples
yara_check scalar NULL NULL  
yara_modules table NULL NULL  
yara_string_matches table NULL NULL  

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

name description input_type scope aliases typed_value
temp_directory Set the directory to which temporary files are written. VARCHAR GLOBAL [] post.db.tmp
© 2026 DuckDB Foundation, Amsterdam NL
DuckDB Home Code of Conduct Trademark Use Blog