Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

Section
Purpose

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".

YARA File Scanning complements the agent's real-time malware protection. Real-time protection checks files when they are written or run. YARA File Scanning checks files already stored on disk, using your own rules, whenever you start a scan.

You can manage YARA rules and run scans in several ways.

Method
Action
Details

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

Requirement
Details

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:

  1. Import .yar files into the YARA Rules page.

  2. Select the rules to run and the Windows endpoints to scan.

  3. (Optional) Define include or exclude paths.

  4. Run the scan.

    The Cortex XDR agent scans files on disk on each target endpoint.

  5. Review results in the Action Center.

  6. Query the xdr_yara_scan_data dataset 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.

  1. Navigate to Threat Management → Detection Rules → YARA.

  2. Click Import Rules.

  3. In the Import Rules dialog, upload one or more .yar files.

  4. Click Import.

The imported rules appear on the YARA Rules page and can be selected for scans.

Start a YARA scan

  1. Navigate to Threat Management → Detection Rules → YARA

  2. Select the rules to run, and then select Run this rule.

  3. In the scan wizard, enter a scan name. Choose a name that is easy to recognize later, such as Quarterly Malware Sweep.

  4. Select the target endpoints. Use the endpoint filter to narrow the list. Only eligible endpoints (Windows, agent 9.4 or later) can be scanned.

  5. Optionally, define the scan scope by including or excluding paths.

  6. 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.

  1. Navigate to Investigation & Response → Response → Action Center.

  2. Filter the table by scan, rule, endpoint, or file hash.

  3. 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:

Limit
Value

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?