YARA rule management
Scan Windows endpoints on demand with custom YARA rules.
YARA File Scanning runs custom YARA rules against files on the disks of Windows endpoints. You import YARA rules into Cortex XDR, select the rules and target endpoints, and optionally include or exclude specific paths. The Cortex XDR agent scans the file system on each target endpoint. Each file that matches a rule is listed in the Action Center and recorded as an event in the xdr_yara_scan_data dataset.
Common uses include:
Scoping an incident: search endpoints for files that match known malware or indicators of compromise (IOCs) to find out which endpoints are affected.
Finding dormant threats: find malicious files that are stored on disk but haven't run yet, so you can respond before they execute.
Responding to new threat intelligence: when your threat intelligence team or a security advisory publishes YARA rules for a new threat, run them to check whether that threat is present in your environment.
Each match includes file details (name, paths, size, SHA-256 and MD5 hashes, and signer) and endpoint details (hostname, OS version, IP address, agent ID, and version).
YARA is an open-source pattern-matching language that security teams use to identify and classify files. A YARA rule describes what a file of interest looks like. Each rule has a name and three main sections:
meta
Descriptive information about the rule, such as the author, a description, and references. It doesn't affect matching.
strings
The patterns to look for: text strings, hexadecimal byte sequences, or regular expressions.
condition
The logic that decides whether a file matches, for example "all of the strings are present and the file starts with the MZ header".
You can manage YARA rules and run scans in several ways.
Cortex XDR console
Work interactively: review rules, start ad-hoc scans, and investigate results.
Import and view rules on the YARA Rules page, start scans with the scan wizard, and review results in the Action Center.
Public API
Integrate YARA File Scanning with external tools, such as a threat intelligence platform or a CI pipeline that publishes rules.
Add, list, and delete rules, and start or abort scans. For details see API Yara Rules
AgentiX Endpoint Investigation Agent
Run scans, work with rules, and review results in natural language during an investigation.
Ask the agent to:
Run specific rules on specific endpoints.
Explain what a rule detects.
Validate that a rule's logic matches its intended purpose.
Generate new YARA rules.
Suggest optimizations to existing rules.
Summarize scan results.
For information about correlation rules see the AgentiX documentation.
Playbooks
Automate scans as part of a repeatable response, for example scanning affected endpoints when an incident is created.
Use the YARA commands in playbook tasks to start scans and act on the results.
XQL
Hunt, correlate, and report on scan results.
Query the xdr_yara_scan_data dataset. See Query YARA scan results with XQL.
Prerequisites
Operating system
Windows
Cortex XDR agent
Version 9.4 or later
License
Cortex XDR Pro
Role permissions
For full access to view, import, delete and run scans:
Instance Administrator
Security Admin
Privileged Responder
To scan Windows endpoints with custom YARA rules:
Import
.yarfiles into the YARA Rules page.Select the rules to run and the Windows endpoints to scan.
(Optional) Define include or exclude paths.
Run the scan.
The Cortex XDR agent scans files on disk on each target endpoint.
Review results in the Action Center.
Query the
xdr_yara_scan_datadataset with XQL.
Import YARA rules
Import YARA rules by uploading .yar files.
Before you begin
Make sure each rule uses valid YARA syntax and has a unique, descriptive name.
Make sure you have the required permissions.
Navigate to Threat Management → Detection Rules → YARA.
Click Import Rules.
In the Import Rules dialog, upload one or more
.yarfiles.Click Import.
The imported rules appear on the YARA Rules page and can be selected for scans.
Start a YARA scan
Navigate to Threat Management → Detection Rules → YARA
Select the rules to run, and then select Run this rule.
In the scan wizard, enter a scan name. Choose a name that is easy to recognize later, such as
Quarterly Malware Sweep.Select the target endpoints. Use the endpoint filter to narrow the list. Only eligible endpoints (Windows, agent 9.4 or later) can be scanned.
Optionally, define the scan scope by including or excluding paths.
Review the summary and start the scan.
Cortex XDR sends the scan to the selected endpoints. The scan action is summarized as this example:
Scan "Quarterly Malware Sweep" ran 3 YARA rules on 24 endpoints (for example, DESKTOP-PRHKT0F), scanning C:\Users and C:\ProgramData.
Investigate YARA scan results
Each result is available in two places:
YARA Scan Results table: a dedicated table in the console for reviewing and filtering hits.
Query YARA scan results with XQL.
View YARA scan results
The YARA Scan Results table lists the hits from your scans.
Navigate to Investigation & Response → Response → Action Center.
Filter the table by scan, rule, endpoint, or file hash.
Review the file and endpoint details of each hit.
Use XQL to search, correlate, and aggregate YARA hits across your environment. Start every query with dataset = xdr_yara_scan_data.
Limitations and considerations
The following apply to YARA file system scanning:
Supported operating system
Windows only
Scan trigger
On demand only
Scan type
File system only
Rules per tenant
10,000
Rules per scan
1 through 500
Include or exclude paths per scan
Up to 50
Upload file size
500 KB per .yar or .yara file
File size scanned
Files up to 250 MB
Concurrent scans
One YARA scan per endpoint
Action delivery
Expires after 48 hours
Action details retention
30 days
The agent runs YARA scans at a lower priority than most endpoint scans. Scan duration can vary on busy endpoints.
Best practices
Test new rules on a small endpoint group before scanning the fleet.
Limit scans to relevant paths, such as user profiles.
Use efficient rules with file-type and file-size checks.
Store rules in source control and use the API to synchronize updates.
Narrow the rule or path scope if a scan reaches its match limit.
Investigate matches with causality data, file search, and IOC rules.
Last updated
Was this helpful?
