STIX 2.0 Model and Patterns: Applying API Economy To Cybersecurity
STIX 2.0 Model and Patterns: Applying API Economy To Cybersecurity
0 model and
patterns
Applying API economy to
cybersecurity
In this bootcamp we will explore STIX 2.0 as an effort to provide that standard for both modelling the data and also
(through Pattern Consumer implementing the grammar) the generic application of it on security products. We will
provide an overview of the history and genesis of this standard, its applications in the industry, and the challenges it
faces.
We will also review the details of the STIX model, implementing libraries and focus on Patterning.
Students will use real world examples of threat intelligence reports to practice first hand both the model and
patterning API with bespoke exercises.
References:
https://oasis-open.github.io/cti-documentation/stix/intro.html
http://docs.oasis-open.org/cti/stix/v2.0/stix-v2.0-part5-stix-patterning.html
2
Flight plan
• Introduction to Cybersecurity
• First generation TI services
• Tooling and limitations
• The TI model
• Contexts of application of TI
• Several attempts to standardize: Cybox, Yara, Snort, MISP
• STIX 1.x
• STIX 2.0 (aka let’s try again) and patterning
• Practical exercises
• TAXII, STIX/TAXII preferred program
3
Bio
4
Campfire rules
5
Yes, we have mentimeter too ☺
6
Cybersecurity in one slide
Defense against compromise of digital resources against an
unauthorized entity
7
Parallel to a pre-digital world: Sophia’s secret diary
An almost digital resource
Defense against
compromise of digital
resources against an
unauthorized entity
Unauthorized entities?
May be viewed in
context of an
individual person or Individual vs group security?
related to security of
organizations.
8
Compromise defined
Some examples of “compromise” include:
9
Let’s take it to Sophia’s world…
Exfiltration
Data Exfiltration:
Unapproved access to
enterprise data.
Data loss
Data Loss:
Unapproved removal
of enterprise data.
Infiltration: Usage of Infiltration
the device to access
enterprise assets.
Unavailability:
Impairment of the
device’s ability to fulfill Unavailability
its approved use.
Improper use: Usage
of the device to
perform tasks Improper use
contrary to its
approved use.
10
Protect, Detect, Correct – Adaptive Security Model
11
11
Some basic types of attacks
12
Threat Intelligence
Information collected from known/previous attacks.
May refer to any material information that can assist to the defense.
▪ Binary samples
▪ Description of behavior seen
▪ Analysis of potential behavior of samples
▪ Information that may help identify the actor or their intentions
(language/locale, email addresses, remote servers details)
▪ Claims made by the attackers or any other information about the
attackers themselves, their motivations and sponsors.
▪ …
13
Uses of threat Intelligence
• To prevent an attack: by manually or
automatically adjusting the defense posture to
the information received.
• To detect if an attack has happened: by
performing forensic analysis of the logs and
environments.
• To correct/limit the effect of an attack: by
following on other’s steps to revert or limit the
damage caused.
14
How is TI used in the industry?
• Producers of threat intelligence
• Manually (researchers)
• Automatically (sandboxing, malware/threat scanning
and other related techs)
15
Conveying Threat Intelligence
• Vulnerability reports:
• https://nvd.nist.gov/vuln/detail/CVE-2018-4878
17
TI Feeds
• Feeds are compilations of threat intelligence.
• Intended to represent synthetized, actionable
items.
• Generally include one specific type of intelligence
(e.g. URLs)
• Are produced/updated very regularly (daily)
• Are (hopefully) produced by a reputable
organization
19
Regulatory requirements
• https://www.fca.org.uk/about/principles-good-regulation
“We also expect you to report material breaches to us, under Principle 11 – and to share information with
others, on the Cyber Information Sharing Partnership (otherwise known as the CISP platform).”
https://www.fca.org.uk/news/speeches/our-approach-cyber-security-financial-services-firms
20
TI Feed formats
• Most feeds are specific to one type of intelligence and have custom
schemas
Example:
One more time: these are actual and currently available phish
sites. Do not download
21
Exercise introduction
TI Feed formats
1.161.127.207
103.208.220.122
103.208.220.226 These could be seen as compromised or not depending
103.234.220.195 on the defender’s context.
103.234.220.197
103.236.201.110
103.236.201.88
103.28.52.93
23
Elaborate TI formats - Yara
https://github.com/Yara-Rules/rules
24
Elaborate TI formats - Snort
https://www.snort.org/
25
Elaborate TI formats - Sigma
https://github.com/Neo23x0/sigma
Format is YAML
26
Overview of MITRE ATT&CK
MITRE is a US based not-for-profit corporation generally
The ATT&CK matrix is a recognized as an independent authority in the cyber security
globally-accessible space
knowledge base of
adversary tactics and
techniques based on real-
world observations.
https://attack.mitre.org/
27
Overview of MITRE ATT&CK
Tactics
High level types of activities that an attack can be classified into.
Examples
ID Name Description
TA0001 Initial Access The initial access tactic represents the vectors adversaries use to gain an initial foothold within a
network.
TA0002 Execution The execution tactic represents techniques that result in execution of adversary-controlled code
on a local or remote system. This tactic is often used in conjunction with initial access as the
means of executing code once access is obtained, and lateral movement to expand access to
remote systems on a network.
TA0003 Persistence Persistence is any access, action, or configuration change to a system that gives an adversary a
persistent presence on that system. Adversaries will often need to maintain access to systems
through interruptions such as system restarts, loss of credentials, or other failures that would
require a remote access tool to restart or alternate backdoor for them to regain access.
TA0004 Privilege Escalation Privilege escalation is the result of actions that allows an adversary to obtain a higher level of
permissions on a system or network.
28
Overview of MITRE ATT&CK
Techniques
Specific ways in which a tactic has been observed to be achieved.
A technique may be associated with one or more tactics
Examples
ID Name Description
T1156 .bash_profile and .bashrc ~/.bash_profile and ~/.bashrc are executed in a user's context when a new shell opens or when a user logs in so
that their environment is set correctly. ~/.bash_profile is executed for login shells and ~/.bashrc is executed for
interactive non-login shells. This means that when a user logs in (via username and password) to the console
(either locally or remotely via something like SSH), ~/.bash_profile is executed before the initial command prompt
is returned to the user. After that, every time a new shell is opened, ~/.bashrc is executed. This allows users more
fine grained control over when they want certain commands executed.
T1134 Access Token Manipulation Windows uses access tokens to determine the ownership of a running process. A user can manipulate access
tokens to make a running process appear as though it belongs to someone other than the user that started the
process. When this occurs, the process also takes on the security context associated with the new token. For
example, Microsoft promotes the use of access tokens as a security best practice. Administrators should log in as
a standard user but run their tools with administrator privileges using the built-in access token manipulation
command runas.
T1015 Accessibility Features Windows contains accessibility features that may be launched with a key combination before a user has logged in
(for example, when the user is on the Windows logon screen). An adversary can modify the way these programs
are launched to get a command prompt or backdoor without logging in to the system.
29
Dealing with all of this - TIPs
Threat Intelligence Platforms
• Consume feeds automatically
(commercial and/or opensource)
• Allow input of TI manually or by
parsing natural language (ish)
• De-duplication, curation
• Exporting
• Nirvana: automatically integrate with
an orchestration platform
30
Elaborate TI formats - MISP
MISP format
Used by the MISP Threat Intelligence Platform
https://www.misp-project.org/
Examples:
https://www.circl.lu/doc/misp/feed-osint/
31
STIX
An attempt to standardize the data model and format
Created and maintained by the OASIS Cyber Threat Intelligence
Technical Committee
32
Basics of the data model
Actor
Individuals, groups, or organizations believed to be
operating with malicious intent.
Campaign
A grouping of adversarial behaviors that describes a set
of malicious activities or attacks that occur over a period
of time against a specific set of targets.
33
Basics of the data model
Malware
A type of TTP, also known as malicious code and malicious software,
used to compromise the confidentiality, integrity, or availability of a
victim’s data or system.
Tool
Legitimate software that can be used by
threat actors to perform attacks.
Vulnerability
A mistake in software that can be directly used by a
hacker to gain access to a system or network.
34
Basics of the data model
Identity
Individuals, organizations, or groups, as well as classes of
individuals, organizations, or groups.
Observed data
Conveys information observed on a system
or network (e.g., an IP address).
Intrusion set
A grouped set of adversarial behaviors and resources
with common properties believed to be orchestrated by a
single threat actor.
35
Relationships in the model
https://oasis-open.github.io/cti-documentation/examples/visualized-sdo-
relationships
36
TI report example using the model
37
STIX 1.x or how good intentions can go very wrong
• V1.x was never truly adopted by the market
38
STIX 1.x or how good intentions can go very wrong
https://www.first.org/resources/papers/conf2018/Thomson-Allan_FIRST_20180602.pdf
39
STIX/TAXII 2
40
STIX patterning language
http://docs.oasis-open.org/cti/stix/v2.0/stix-v2.0-part5-stix-
patterning.html
41
STIX patterning language - qualifiers
Qualifiers Description
a REPEATS x TIMES a MUST be an Observation Expression or a preceding
Qualifier. a MUST match exactly x times, where each match is a different
Observation. x MUST be a positive integer.
42
STIX patterning language – observation operators
43
STIX patterning language – comparison operators
Comparison Description Example
Operator
a=b a and b MUST be equal (transitive), where a MUST be an Object Path and b MUST be a constant of the file:name = 'foo.dll'
same data type as the Object property specified by a.
a != b a and b MUST NOT be equal (transitive), where a MUST be an Object Path and b MUST be a constant of file:size != 4112
the same data type as the Object property specified by a.
a>b a is numerically or lexically greater than b, where aMUST be an Object Path and b MUST be a constant of file:size > 256
the same data type as the Object property specified by a.
a<b a is numerically or lexically less than b, where a MUSTbe an Object Path and b MUST be a constant of the file:size < 1024
same data type as the Object property specified by a.
a <= b a is numerically or lexically less than or equal to b, where a MUST be an Object Path and b MUST be a file:size <= 25145
constant of the same data type as the Object property specified by a.
a >= b a is numerically or lexically greater than or equal to b, where a MUST be an Object Path and b MUST be a file:size >= 33312
constant of the same data type as the Object property specified by a.
a IN (x,y,...) a MUST be an Object Path and MUST evaluate to one of the values enumerated in the set of x,y,... process:name IN
(transitive). The set values in b MUST be constants of homogenous data type and MUST be valid data types ('proccy',
for the Object Property specified by a. The return value is true if a is equal to one of the values in the list. 'proximus',
If a is not equal to any of the items in the list, then the Comparison Expression evaluates to false. 'badproc')
a LIKE b a MUST be an Object Path and MUST match the pattern specified in b where any '%' is 0 or more characters directory:path LIKE
and ‘_' is any one character. 'C:\\Windows\\%\\foo'
a MATCHES b a MUST be an Object Path and MUST be matched by the pattern specified in b, where b is a string constant directory:path
containing a PCRE compliant regular expression. A MATCHES
'^C:\\Windows\\w+$'
MUST be NFC normalized before comparison if the property is of string type.
44
STIX patterning language – set operators
Set Operator Description Example
a ISSUBSET b When a is a set that is wholly contained by the set b, ipv4-addr:value ISSUBSET
the Comparison Expression evaluates to '198.51.100.0/24'
true. a MUSTbe an Object Path referring to
the value property of an Object of type ipv4-
addr or ipv6-addr. b MUST be a
valid string representation of the corresponding
Object type
In the case that both a and b evaluate to an identical
single IP address or an identical IP subnet, the
Comparison Expression evaluates to true.
a ISSUPERSET b When a is a set that wholly contains the set specified ipv4-addr:value ISSUPERSET
by b, the Comparison Expression evaluates to '198.51.100.0/24'
true. aMUST be an Object Path referring either
an ipv4-addror ipv6-addr
45
STIX observable types
http://docs.oasis-open.org/cti/stix/v2.0/stix-v2.0-part4-cyber-observable-objects.html
46
(Very brief) TAXII overview
47
TAXII example server
• https://test.freetaxii.com:8000/taxii/
48
MITRE ATT&CK in STIX/TAXII format
• Data in the MITRE ATT&CK matrix is available in a TAXII server and STIX format
• https://github.com/mitre/cti/tree/master/enterprise-attack (STIX)
49
Exercise
Exercise parameters
Given
- Observations (converted to STIX)
- STIX TI feed with IOCs (Patterns)
Achieve
- Basic:
- Consume the feed
- Sweep the IOCs against the observations
- Consume the feed from TAXII
- Advanced:
- Create elaborate patterns
- Publish findings over DXL (leveraging the prior bootcamp)
51
STIX tools
▪ Format converters
▪ https://github.com/m0jtaba/sigma-to-stix
▪ https://github.com/MISP/MISP-STIX-Converter
▪ https://github.com/oasis-open/cti-stix-elevator (1.x to 2.0)
▪ Pattern/syntax validation
▪ https://github.com/oasis-open/cti-pattern-validator
▪ Graphical visualization
▪ https://oasis-open.github.io/cti-stix-visualization/
▪ Pattern matching against observed data
▪ https://github.com/oasis-open/cti-pattern-matcher
52
STIX/TAXII preferred program
https://oasis-stixpreferred.org/
53
But wait. There are more “standard” formats!
http://www.threat-intelligence.eu/standards/
54
STIX/TAXII preferred program
55
STIX/TAXII preferred program
http://docs.oasis-open.org/cti/stix-taxii-2-interop-p1/v1.1/stix-taxii-2-interop-p1-
v1.1.html
56
STIX and behAPI
57
STIX and behAPI
58
Further reading
https://github.com/deralexxx/security-apis
https://github.com/hslatman/awesome-threat-intelligence
https://attack.mitre.org/
https://www.first.org/
CERT orgs:
http://www.ukcert.org.uk/
https://cert.europa.eu/
https://www.us-cert.gov/
59
McAfee, the McAfee logo and [insert <other relevant McAfee Names>] are trademarks or registered trademarks of McAfee, LLC or its subsidiaries in the U.S. and/or other countries.
Other names and brands may be claimed as the property of others.
Copyright © 2017 McAfee, LLC.