CEL Query Language

Overview

Stairwell allows you to query data and relationships in your environments using Common Expression Language (CEL).

CEL provides a powerful syntax for filtering and searching entities across the Stairwell platform. Analysts use CEL queries to locate malware indicators, hunt for suspicious files, filter YARA rules, and explore network indicators.

A typical CEL query consists of three parts:

entity.property == "value"

Example:

object.md5 == "6f5902ac237024bdd0c176cb93063dc4"
ComponentMeaning
entityData type being queried
propertyAttribute of that entity
valueValue you are matching

Entities

CEL queries operate on top-level entities within Stairwell.

EntityDescription
objectFiles and binaries ingested into Stairwell
ruleYARA rules
netNetwork indicators such as IP addresses or hostnames
mal_evalMachine learning malware evaluation results

Each entity supports different properties.

Example:

object.sha256 == "HASH"

Query Structure

General CEL query format:

entity.property OPERATOR value

Example:

rule.name == "example_rule"

⚠️ Queries only return results if the current Stairwell view matches the entity.

Example:

QueryCorrect View
rule.name == "example"Rules view
object.sha256 == "hash"Objects view

Supported Properties

rule

rule.name == "<NAME>"
rule.status == ACTIVE
rule.status != INACTIVE
rule.version > 5
rule.tag == "MALWARE"

object

object.sha256 == "<SHA256>"
object.sha1 == "<SHA1>"
object.md5 == "<MD5>"
object.imphash == "<IMPHASH>"
object.authenticode_verification_result == VALID
object.tag == "<TAG>"
object.tag in ["TAG1","TAG2"]
📘

Note
object.tag queries cannot be combined with other logical operators.


net

net.hostname == "sub.domain.com"
net.ip == "1.2.3.4"

mal_eval

mal_eval.malicious == true
mal_eval.label.contains("trojan")
mal_eval.probability_bucket > r"PROBABILITY_VERY_HIGH"

Operators

OperatorMeaningExample
==Equalobject.sha256 == "hash"
!=Not equalrule.status != ACTIVE
<Less thanrule.version < 5
>Greater thanrule.version > 2
<=Less than or equalrule.version <= 3
>=Greater than or equalrule.version >= 10
inValue in listobject.sha256 in ["h1","h2"]
&&Logical ANDCombine queries

Querying Multiple Values

Example:

object.sha256 in ["hash1","hash2","hash3"]

Example with AND:

object.imphash == "abcd1234" && mal_eval.malicious == true

Regex Queries

Regular expression queries use .matches().

Example:

rule.name.matches("[Aa]pt")

This matches:

apt
APT
Apt

Example Threat Hunting Queries

Search by hash:

object.sha256 == "HASH"

Search by import hash:

object.imphash == "IMPHASH"

Search by YARA rule:

rule.name == "example_rule"

Search by hostname:

net.hostname == "malicious.domain.com"

Search for malicious files:

mal_eval.malicious == true

Search for trojan-labeled files:

mal_eval.label.contains("trojan")

Common Environment IDs

Malware Feeds

FeedEnvironment ID
VirusShare6HP5R3-ZM7DAN-RB4732-X6QPCJ36
MalshareD7W6M6-BA9BS4-BQ23Z4-NKCNWQ96
Malware BazaarD4447Q-WJJL6P-W7ME89-WHXJK8TW
JottiVR9Z98-4KU7ZC-PCNFEG-FURQ66FW
vxintelTV6WCV-7Y79LE-BK79EY-C8GUEY46
Threat Report FeedsMKYSAR-3XN9MB-3VAK3R-888ZJUTJ
Stairwell Public VerdictsTT9GM5-JUMD8H-9828FL-GAW5NNX

Rule Feeds

FeedEnvironment ID
Stairwell OSINTEB3DXY-3ZYFVH-6HNKJQ-GAPKHESS
Stairwell MethodologyGEG6FU-MRARGF-TLTM6X-H6MGDT5E
Stairwell ResearchNQNJM6-5LSCAF-3MC5FJ-W8EKGW6N
Florian's Open RulesNCS2SM-YHB2KT-SAFUDX-JC7F6WYA
Pro RulesXAKLND-DKWP3Z-56RL88-6XJ5NH46