Learn R Programming

⚠️There's a newer version (1.0.0) of this package.Take me there.

mitre

mitre package is designed to provide easy access to cybersecurity data standards. You can expect functions to get data frames for every standard object. It provide a directed graph with all relationships for deep exploratory analysis. You could avoid full parsing process using the latest public Rdata sets.

Installation

You can install the released version of mitre from CRAN with:

install.packages("mitre")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("motherhack3r/mitre")

Basic usage

This is a basic example which shows you how to view shield tactics ids and names:

library(mitre)
mitredata <- mitre::getLatestDataSet()
shield <- mitredata$standards$shield
shield$tactics[, c("id", "name")]
#>        id       name
#> 1 DTA0001    Channel
#> 2 DTA0002    Collect
#> 3 DTA0003    Contain
#> 4 DTA0004     Detect
#> 5 DTA0005    Disrupt
#> 6 DTA0006 Facilitate
#> 7 DTA0007 Legitimize
#> 8 DTA0008       Test

This example shows the number of ATT&CK Techniques by domain:

table(mitredata$standards$attck$techniques$domain)
#> 
#> enterprise-attack        ics-attack     mobile-attack 
#>               659                81               103

Network visualization

This is a example which shows you how to visualize shield network:

# library(visNetwork)
# g <- visNetwork::visNetwork(nodes = shield$shieldnet$nodes,
#                             edges = shield$shieldnet$edges)
# g

Find some more examples in vignettes to build your own graph like this.

Advanced exploratory analysis

Check this proof of concept project. It is a Rmarkdown document performing an exploratory analysis with mitre network and this data set.

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Copy Link

Version

Install

install.packages('mitre')

Monthly Downloads

186

Version

0.6.0

License

CC0

Issues

Pull Requests

Stars

Forks

Maintainer

Humbert Costas

Last Published

April 24th, 2021

Functions in mitre (0.6.0)

buildAttckTactics

Parse tactics
getShieldUseCases

parseAttck.Relationships

Read MITRE CTI Repository browsing domain directories to extract data from relationship files, build model and return tidy data.frame with relationship variables.
getShieldData

ETL process that download current shield definitions and return a list of data frames for each object. The list also contains a visNetwork object with SHIELD objects as nodes and all relations as edges.
parseAttck.Mitigation

Read MITRE CTI Repository browsing domain directories to extract data from course-of-action files, build model and return tidy data.frame with Mitigation variables.
getNodeNeighbors

Returns a list of nodes and edges (neighbors) based on input node.
MapCommonproperties

Extract common properties from attack pattern object (parsed with RJSONIO::fromJSON)
MapGroups

Extract Group properties from intrusion set object (parsed with RJSONIO::fromJSON)
getShieldNodes

MITRE Shield objects as nodes in a data frame
getShieldTechniquesDetail

MITRE Shield Techniques detailed data frame
getCWEData

ETL process that download current CVE definitions and return a list with a data frame for CVE objects. The list also contains a visNetwork object with CVE objects as nodes and all relations as edges.
downloadRawData

Download from official sources raw files saving them in [working_directory]/data-raw/
getShieldRelations

MITRE Shield objects relations data frame
getLatestDataSet

Download latest R data sets from Github previously parsed with this package.
parseAttck.Techniques

Read MITRE CTI Repository browsing domain directories to extract data from attack-pattern files, map variables from STIX to ATT&CK model and return tidy data.frame with Technique variables.
getShieldTactics

getAttckData

ETL process that download current attck definitions and return a list of data frames for each object. The list also contains a graph as list with ATT&CK objects as nodes and all relations as edges.
parseAttckmodel.tech

Read MITRE CTI Repository files related to attack-pattern, extract data, map variables from STIX to ATT&CK model and return tidy data.frame.
parseAttckmodel.group

Read MITRE CTI Repository files related to intrusion-set, extract data, map variables from STIX to ATT&CK model and return tidy data.frame.
parseRawData

ETL process for all standards, it also create a list of nodes and edges representing the relationships between standard objects. It needs raw files pre-downloaded from official MITRE repositories stored in a folder named "data-raw".
getCARData

ETL process that download current CAR definitions and return a list with a data frame for CAR objects. The list also contains a visNetwork object with CAR objects as nodes and all relations as edges.
getCAPECData

ETL process that download current CAPEC definitions and return a list with a data frame for CAPEC objects. The list also contains a visNetwork object with CAPEC objects as nodes and all relations as edges.
createATTCKedges

Create edges from ATTCK data frames
getShieldOpportunities

parseAttck.Software

Read MITRE CTI Repository browsing domain directories to extract data from malware and tool files, build model and return tidy data.frame with Software variables.
parseAttck.Tactics

Read MITRE CTI Repository browsing domain directories to extract data from x-mitre-tactic files, map variables from STIX to ATT&CK model and return tidy data.frame with Tactic variables.
getShieldProcedures

getShieldTactictDetail

MITRE Shield Tactics detailed data frame
parseAttckmodel.tact

Read MITRE CTI Repository files related to x-mitre-tactic, extract data, map variables from STIX to ATT&CK model and return tidy data.frame.
parseAttckmodel.soft

Read MITRE CTI Repository files related to malware and tool, extract data, map variables from STIX to ATT&CK model and return tidy data.frame.
parseAttckmodel.miti

Read MITRE CTI Repository files related to course.action, extract data, map variables from STIX to ATT&CK model and return tidy data.frame.
parseAttckmodel.rels

Read MITRE CTI Repository files related to relationship, extract data, map variables from STIX to ATT&CK model and return tidy data.frame.
getShieldTechniques

parseAttck.Groups

Read MITRE CTI Repository browsing domain directories to extract data from intrusion-set files, map variables from STIX to ATT&CK model and return tidy data.frame with Group variables.
omitDeprecated

Given a mitre network it returns the same without deprecated nodes
as_igraph

Given a mitre network it returns the same as igraph
MapTechniques

Extract Technique properties from attack pattern object (parsed with RJSONIO::fromJSON)
MapSoftware

Extract Software properties from malware and tool object (parsed with RJSONIO::fromJSON)
getCPEData

ETL process that download current CPE definitions and return a list with a data frame for CPE objects. The list also contains a list with CPE objects as nodes and all relations as edges.
MapRelations

Extract object relationships from relationship object (parsed with RJSONIO::fromJSON)
getCVEData

ETL process that download current CVE definitions and return a list with a data frame for CVE objects. The list also contains a visNetwork object with CVE objects as nodes and all relations as edges.
MapMitigation

Extract Mitigation properties from course.action object (parsed with RJSONIO::fromJSON)
MapTactics

Extract Tactic properties from x-mitre-tactic object (parsed with RJSONIO::fromJSON)
getShieldNetwork