Browse Source
Fix disclosure date and rapid7 analysis NULL bugs
master
No known key found for this signature in database
GPG Key ID: 1D7529BE14E2BBA9
2 changed files with
15 additions and
3 deletions
-
DESCRIPTION
-
R/utils.R
|
|
@ -1,7 +1,7 @@ |
|
|
|
Package: attackerkb |
|
|
|
Type: Package |
|
|
|
Title: Tools to Query the Rapid7 AttackerKB API |
|
|
|
Version: 0.1.2 |
|
|
|
Version: 0.1.3 |
|
|
|
Date: 2020-05-21 |
|
|
|
Authors@R: c( |
|
|
|
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), |
|
|
|
|
|
@ -1,5 +1,9 @@ |
|
|
|
date_convert <- function(.x) { |
|
|
|
as.POSIXct(.x, format="%Y-%m-%dT%H:%M:%OS", tz="GMT") |
|
|
|
if (length(.x)) { |
|
|
|
as.POSIXct(.x, format="%Y-%m-%dT%H:%M:%OS", tz="GMT") |
|
|
|
} else { |
|
|
|
as.POSIXct(NA) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.kb_reshape <- function(.x, path) { |
|
|
@ -68,11 +72,19 @@ date_convert <- function(.x) { |
|
|
|
## $ tags :List of 12 |
|
|
|
|
|
|
|
.x[["created"]] <- date_convert(.x[["created"]]) |
|
|
|
.x[["disclosed"]] <- date_convert(.x[["disclosureDate"]]) |
|
|
|
.x[["disclosureDate"]] <- date_convert(.x[["disclosureDate"]]) |
|
|
|
.x[["metadata"]] <- I(list(.x[["metadata"]])) |
|
|
|
.x[["score"]] <- I(list(.x[["score"]])) |
|
|
|
.x[["tags"]] <- I(list(.x[["tags"]])) |
|
|
|
|
|
|
|
if ("rapid7Analysis" %in% names(.x)) { |
|
|
|
if (length(.x[["rapid7Analysis"]])) { |
|
|
|
.x[["rapid7Analysis"]] <- paste0(.x[["rapid7Analysis"]], collapse = " ") |
|
|
|
} else { |
|
|
|
.x[["rapid7Analysis"]] <- NA_character_ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.x <- as.data.frame(.x, stringsAsFactors = FALSE) |
|
|
|
|
|
|
|
.x |
|
|
|