Stix v2.0 csprd01 Part5 Stix Patterning
Stix v2.0 csprd01 Part5 Stix Patterning
Part 5: STIX
Patterning
Committee Specification Draft 01 /
Public Review Draft 01
24 February 2017
Specification URIs
This version:
http://docs.oasis-open.org/cti/stix/v2.0/csprd01/part5-stix-patterning/stix-v2.0-csprd01-part5-stix-
patterning.docx (Authoritative)
http://docs.oasis-open.org/cti/stix/v2.0/csprd01/part5-stix-patterning/stix-v2.0-csprd01-part5-stix-
patterning.html
http://docs.oasis-open.org/cti/stix/v2.0/csprd01/part5-stix-patterning/stix-v2.0-csprd01-part5-stix-
patterning.pdf
Previous version:
N/A
Latest version:
http://docs.oasis-open.org/cti/stix/v2.0/stix-v2.0-part5-stix-patterning.docx (Authoritative)
http://docs.oasis-open.org/cti/stix/v2.0/stix-v2.0-part5-stix-patterning.html
http://docs.oasis-open.org/cti/stix/v2.0/stix-v2.0-part5-stix-patterning.pdf
Technical Committee:
OASIS Cyber Threat Intelligence (CTI) TC
Chair:
Richard Struse (Richard.Struse@HQ.DHS.GOV), DHS Office of Cybersecurity and
Communications (CS&C)
Editors:
Ivan Kirillov (ikirillov@mitre.org), MITRE Corporation
Trey Darley (trey@kingfisherops.com), Kingfisher Operations, sprl
Additional artifacts:
This prose specification is one component of a Work Product that also includes:
• STIX™ Version 2.0. Part 1: STIX Core Concepts. http://docs.oasis-
open.org/cti/stix/v2.0/csprd01/part1-stix-core/stix-v2.0-csprd01-part1-stix-core.html.
• STIX™ Version 2.0. Part 2: STIX Objects. http://docs.oasis-
open.org/cti/stix/v2.0/csprd01/part2-stix-objects/stix-v2.0-csprd01-part2-stix-objects.html.
• STIX™ Version 2.0. Part 3: Cyber Observable Core Concepts. http://docs.oasis-
open.org/cti/stix/v2.0/csprd01/part3-cyber-observable-core/stix-v2.0-csprd01-part3-cyber-
observable-core.html.
• STIX™ Version 2.0. Part 4: Cyber Observable Objects. http://docs.oasis-
open.org/cti/stix/v2.0/csprd01/part4-cyber-observable-objects/stix-v2.0-csprd01-part4-cyber-
observable-objects.html.
• (this document) STIX™ Version 2.0. Part 5: STIX Patterning. http://docs.oasis-
open.org/cti/stix/v2.0/csprd01/part5-stix-patterning/stix-v2.0-csprd01-part5-stix-
patterning.html.
stix-v2.0-csprd01-part5-stix-patterning 24 February 2017
Standards Track Work Product Copyright © OASIS Open 2017. All Rights Reserved. Page 1 of 30
Related work:
This specification replaces or supersedes:
• STIX™ Version 1.2.1. Part 1: Overview. Edited by Sean Barnum, Desiree Beck, Aharon
Chernin, and Rich Piazza. Latest version: http://docs.oasis-open.org/cti/stix/v1.2.1/stix-v1.2.1-
part1-overview.html.
• CybOX™ Version 2.1.1. Part 01: Overview. Edited by Trey Darley, Ivan Kirillov, Rich Piazza,
and Desiree Beck. Latest version: http://docs.oasis-open.org/cti/cybox/v2.1.1/cybox-v2.1.1-
part01-overview.html.
This specification is related to:
• TAXII™ Version 2.0. Edited by Bret Jordan and Mark Davidson. Work in progress.
Abstract:
Structured Threat Information Expression (STIX™) is a language for expressing cyber threat and
observable information. This document defines a patterning language to enable the detection of
possibly malicious activity on networks and endpoints.
Status:
This document was last revised or approved by the OASIS Cyber Threat Intelligence (CTI) TC on
the above date. The level of approval is also listed above. Check the “Latest version” location
noted above for possible later revisions of this document. Any other numbered Versions and
other technical work produced by the Technical Committee (TC) are listed at https://www.oasis-
open.org/committees/tc_home.php?wg_abbrev=cti#technical.
TC members should send comments on this specification to the TC’s email list. Others should
send comments to the TC’s public comment list, after subscribing to it by following the
instructions at the “Send A Comment” button on the TC’s web page at https://www.oasis-
open.org/committees/cti/.
For information on whether any patents have been disclosed that may be essential to
implementing this specification, and any offers of patent licensing terms, please refer to the
Intellectual Property Rights section of the TC’s web page (https://www.oasis-
open.org/committees/cti/ipr.php).
Note that any machine-readable content (Computer Language Definitions) declared Normative for
this Work Product is provided in separate plain text files. In the event of a discrepancy between
any such plain text file and display content in the Work Product's prose narrative document(s),
the content in the separate plain text file prevails.
Citation format:
When referencing this specification the following citation format should be used:
[STIX-v2.0-Pt5-Patterning]
STIX™ Version 2.0. Part 5: STIX Patterning. Edited by Ivan Kirillov and Trey Darley. 24 February
2017. OASIS Committee Specification Draft 01 / Public Review Draft 01. http://docs.oasis-
open.org/cti/stix/v2.0/csprd01/part5-stix-patterning/stix-v2.0-csprd01-part5-stix-patterning.html.
Latest version: http://docs.oasis-open.org/cti/stix/v2.0/stix-v2.0-part5-stix-patterning.html.
1.1 Terminology
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD
NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described
in [RFC2119].
1.5 Conventions
1.5.1 Naming Conventions
All type names, property names, and literals are in lowercase, except when referencing canonical names
defined in another standard (e.g., literal values from an IANA registry). Words in property names are
separated with an underscore(_), while words in type names and string enumerations are separated with
a dash (-). All type names, property names, object names, and vocabulary terms are between three and
250 characters long.
In the JSON serialization all property names and string literals MUST be exactly the same, including case,
as the names listed in the property tables in this specification. For example, the Cyber Observable Object
property extensions must result in the JSON key name "extensions". Properties marked required in the
property tables MUST be present in the JSON serialization.
2.1 Constants
The data types enumerated below are supported as operands within Comparison Expressions. This table
is included here as a handy reference for implementers.
Note that unlike Cyber Observable Objects (which are defined in terms of the MTI JSON serialization),
STIX Patterns are Unicode strings, regardless of the underlying serialization, hence the data types
defined in the table below in some cases differ from the definitions contained in STIX™ Version 2.0. Part
3: Cyber Observable Core Concepts.
Each constant defined in Patterning has a limited set of Cyber Observable Data types that they are
allowed to be compared against. In some cases, there are multiple Cyber Observable Data Types that
could be compared against a STIX Patterning Constant; this is due to the fact that certain Cyber
Observable Data Types are semantically indistinguishable because of their JSON serialization. The
Cyber Observable Comparable Data Type(s) column in the table below defines these limitations.
[ipv4-addr:value = '198.51.100.1/32']
Moving up a level of complexity, the next building block of a STIX Pattern is the Observation Expression,
which consists of one or more Comparison Expressions joined by Boolean Operators and bounded by
square brackets. An Observation Expression refines which set of Cyber Observable data (i.e., as part of
an Observation) will match the pattern, by selecting the set that has the Cyber Observable Objects
specified by the Comparison Expressions. An Observation Expression consisting of a single Comparison
Expression is the most basic valid STIX Pattern. Building upon the previous example, one might construct
an Observation Expression to match against multiple IPv4 addresses and an IPv6 address:
Observation Expressions may be followed by one or more Qualifiers, which allow for the expression of
further restrictions on the set of data matching the pattern. Continuing with the above example, one might
use a Qualifier to state that the IP addresses must be observed several times in repetition:
The final, highest level building block of STIX Patterning combines two or more Object Expressions via
Observation Operators, yielding a STIX Pattern capable of matching across multiple STIX Observed Data
SDOs. Building further upon our previous example, one might use an Observation Operator to specify
that an observation of a particular domain name must follow the observation of the IP addresses (note the
use of parentheses to encapsulate the two Observation Expressions), along with a different Qualifier to
state that both the IP address and domain name must be observed within a specific time window:
The diagram below depicts a truncated version of the various STIX Patterning components in the above
example.
This expression can match an Observable with an object of either type-a or type-b, but both Comparison
Expressions for that specific type must evaluate to true for the same object. Comparison Expressions that
are intended to match a single object type can be joined by either AND or OR. For example:
[type-a:property-j = 'W' AND type-a:property-k = 'X' OR type-a:property-l = 'Z']
As AND has higher precedence than OR, the preceding example requires an Observation to have either
both property-j = 'W' and property-k = 'X' or just property-l = 'Z'.
Observation Expressions, along with their Observation Operators and optional Qualifiers, MAY be
surrounded with parenthesis to delineate which Observation Expressions the Qualifiers apply to. For
example:
([ a ] AND [ b ] REPEATS 5 TIMES) WITHIN 5 MINUTES
The preceding example results in one a and 5 b’s that all match in a 5 minute period. As another
example:
The preceding example results in 5 a’s and 5 b’s (10 Observations) that all match in a 5 minute period.
Qualifiers Description
In this example, the REPEATS applies to c, and it does not apply to b. The
results will be b plus 5 c's where all 5 c's were observed after the b. Note that
there is only a single Qualifier in this example; more complex patterns may use
more than one.
The above Pattern Expression looks for a file hash and a registry key that were
observed within 120 seconds of each other. The parentheses are needed to
apply the WITHIN Qualifier to both Observation Expressions.
Notation Definition
Where the first property_name MUST be the name of an Object property of type list and
[list_index] MUST be one of the following:
stix-v2.0-csprd01-part5-stix-patterning 24 February 2017
Standards Track Work Product Copyright © OASIS Open 2017. All Rights Reserved. Page 22 of 30
● An integer in the range of 0..N-1, where N is the length of the list. If list_index is out of range, the
result of any operation is false.
● The literal '*' indicates that if any of the items contained within a list matches against the
Comparison Expression, the Comparison Expression evaluates to true.
Example
file:extensions.windows-pebinary.sections[*].entropy > 7.0
The above example will return true if any PE section has an entropy property whose value is greater than
7.0.
Where <property_name> MUST be the name of an Object property of type dictionary and
<key_name> MUST be the name of key in the dictionary.
Examples
file:hashes.MD5
file:extensions.raster-image.image_height
Where <property_name> MUST be the name of an Object property of type object-ref and
<dereferenced_object_property> MUST be the name of a valid property of the dereferenced Object
(i.e., the Object in an Observation that is referenced via <property_name>).
For cases where <property_name> is a list of type object-ref, the corresponding syntax applies:
<object-type>:<property_name>[list_index].<dereferenced_object_property>
Accordingly, the same semantics for list indices as defined in section 5.2 apply in this case.
Examples
email-message:from_ref.value = 'mary@example.com'
directory:contains_refs[*].name = 'foobar.dll'
Matching an Email Message with a particular From Email Address and Attachment File Name Using a
Regular Expression
[email-message:from_ref.value MATCHES '.+\\@example\\.com$' AND email-
message:body_multipart[*].body_raw_ref.name MATCHES '^Final Report.+\\.exe$']
Matching a File with SHA-256 or a MD5 hash (e.g., for the case of two different end point tools generating
either an MD5 or a SHA-256), and a different File that has a different SHA-256 hash, against two different
Observations
[file:hashes."SHA-256" = 'bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c' OR
file:hashes.MD5 = 'cead3f77f6cda6ec00f57d76c9a6879f']
AND [file:hashes."SHA-256" =
'aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f']
Matching a File with a MD5 hash, followed by (temporally) a Registry Key Object that matches a value,
within 5 minutes
[file:hashes.MD5 = '79054025255fb1a26e4bc422aef54eb4'] FOLLOWEDBY [win-registry-key:key =
'HKEY_LOCAL_MACHINE\\foo\\bar'] WITHIN 300 SECONDS
Matching on a URL
[url:value = 'http://example.com/foo' OR url:value = 'http://example.com/bar']
Matching on Two Processes Launched with a Specific Set of Command Line Arguments Within a Certain
Time Window
[process:command_line MATCHES '^.+>-add GlobalSign.cer -c -s -r localMachine Root$']
FOLLOWEDBY [process:command_line MATCHES'^.+>-add GlobalSign.cer -c -s -r
localMachineTrustedPublisher$'] WITHIN 300 SECONDS
Such software MUST support the following features by conforming to all normative statements and
behaviors in the referenced sections:
● Single Observation Expressions (omitting Qualifiers), as described in section 4.1
● All Comparison Operators, as described in section 4.2.1
This level of conformance is intended primarily for software that is deployed at endpoints or network
boundaries and which is architecturally unable to maintain state, as would be required in order to support
Qualifiers such as WITHIN.
Such software MUST support the following features by conforming to all normative statements and
behaviors in the referenced sections:
● Single and Compound Observation Expressions (omitting Qualifiers) as described in section 4.1
● All Comparison Operators, as described in section 4.2.1
● The AND Observation Operator, as described in section 4.1.2
● The OR Observation Operator, as described in section 4.1.2
This level of conformance is intended primarily for software such as HIDS that can detect patterns across
separate Observations but may not support temporal-based patterning.
Such software MUST support the following features by conforming to all normative statements and
behaviors in the referenced sections:
● Section 2. Definitions
● Section 3. STIX Patterns
● Section 4. Pattern Expressions
● Section 5. Object Path Syntax
This level of conformance is intended primarily for software such as SIEMs that support temporal-based
patterning and can also aggregate and detect patterns across multiple and disparate sources of
Observations.