This package is to support data analysis within the VERIS framework (http://veriscommunity.net). It is intended to work directly with raw JSON and can be used against the VERIS Community Database (VCDB) found at (http://veriscommunity.net/doku.php?id=public) and (https://github.com/vz-risk/VCDB).
This package has two purposes. First is to convert one or more directories of VERIS (JSON) files into a usable object (in this version it is currently a data.table, but I hope to move to a dplyr object). Second, it offers a set of convenience functions for doing basic information retrieval from the object.
Install it from straight from github:
# install devtools from https://github.com/hadley/devtools
devtools::install_github("jayjacobs/verisr")
To begin, load the package and point it at a directory of JSON files storing VERIS data.
library(verisr)
vcdb.dir <- "../VCDB/data/json/"
# may optionally load a custom json schema file.
if (interactive()) { # show progress bar if the session is interactive
vcdb <- json2veris(vcdb.dir, progressbar=TRUE)
} else {
vcdb <- json2veris(vcdb.dir)
}
You can also use a vector of directory names to load files from multiple sources
library(verisr)
data_dirs <- c("../VCDB/data/json", "private_data")
veris <- json2veris(data_dirs)
What json2veris() returns is a plain data.table object, which enables you (the developer) to work directly with the data.
class(vcdb)
## [1] "verisr" "data.table" "data.frame"
dim(vcdb)
## [1] 4313 1705
There are several convenience functions to get a feel for what's in the current verisr object.
summary(vcdb)
## 4313 incidents in this object.
## actor action asset
## External:2300 Environmental: 7 Kiosk/Term: 100
## Internal:1756 Error :1176 Media :1185
## Partner : 184 Hacking :1353 Network : 126
## Unknown : 150 Malware : 353 Person : 325
## Misuse : 747 Server :1969
## Physical : 813 Unknown : 375
## Social : 303 User Dev : 930
## Unknown : 167
##
## attribute
## Availability :1384
## Confidentiality:3901
## Integrity : 974
##
##
##
##
##
##
library(ggplot2)
plot(vcdb)
Let's look for a specific variable by getting the data aggregated on a VERIS enumeration. In this case the variety of external actor.
< 8061 div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ext.variety <- getenum(vcdb, "actor.external.variety") print(ext.variety)">ext.variety <- getenum(vcdb, "actor.external.variety")
print(ext.variety)