Package 'ropendata'

Title: Query and Download 'Rapid7' 'Cybersecurity' Data Sets
Description: 'Rapid7' collects 'cybersecurity' data and makes it available via their 'Open Data' <http://opendata.rapid7.com> portal which has an API. Tools are provided to assist in querying for available data sets and downloading any data set authorized to a free, registered account.
Authors: Bob Rudis [aut, cre] , Rapid7 [cph, fnd]
Maintainer: Bob Rudis <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-10-23 02:58:22 UTC
Source: https://github.com/cran/ropendata

Help Index


Retrieve details for a given file from a specific Rapid7 Open Data study

Description

Retrieve details for a given file from a specific Rapid7 Open Data study

Usage

get_file_details(study_name, file_name, include_download_link = FALSE,
  rapid7_opendata_api_key = rapid7_api_key())

Arguments

study_name

A valid study name. This should be a value from the field uniqid in the result from a call to list_studies(). Current known, good values are "sonar.national_exposure", "heisenberg.cowrie", "sonar.atg_10001_tcp", "sonar.http", "sonar.ssl", "sonar.tcp", "sonar.moressl", "sonar.rdns_v2", "sonar.udp", "sonar.cio", "sonar.https", "sonar.fdns", "sonar.rdns", and "sonar.fdns_v2".

file_name

A valid file name from a given study_name.

include_download_link

if TRUE, have the API generate a download link along with the metadata and include it in a url field in the data frame. NOTE that each use of the this parameter counts towards the Rapid7 Open Data daily download quota. For that reason, the default value is FALSE. Only set it to TRUE if you intend to start a download action (e.g. using utils::download.file() with the result) shortly after calling the function.

rapid7_opendata_api_key

Your Rapid7 Open Data API key. The various API interface function look for this key in RAPID7_OPENDATA_API_KEY. You can manually provide this key and if the function is used interactively and the key is not found, you will be prompted to enter the key.

Value

data frame

Examples

try(
  get_file_details("sonar.fdns_v2", "2018-06-15-1529049662-fdns_aaaa.json.gz"),
  silent=TRUE
) -> details

Retrieve details for a specific Rapid7 Open Data study

Description

Retrieve details for a specific Rapid7 Open Data study

Usage

get_study_details(study_name, rapid7_opendata_api_key = rapid7_api_key())

Arguments

study_name

A valid study name. This should be a value from the field uniqid in the result from a call to list_studies(). Current known, good values are "sonar.national_exposure", "heisenberg.cowrie", "sonar.atg_10001_tcp", "sonar.http", "sonar.ssl", "sonar.tcp", "sonar.moressl", "sonar.rdns_v2", "sonar.udp", "sonar.cio", "sonar.https", "sonar.fdns", "sonar.rdns", and "sonar.fdns_v2".

rapid7_opendata_api_key

Your Rapid7 Open Data API key. The various API interface function look for this key in RAPID7_OPENDATA_API_KEY. You can manually provide this key and if the function is used interactively and the key is not found, you will be prompted to enter the key.

Value

data frame

Examples

try(
  get_study_details("sonar.national_exposure"),
  silent=TRUE
) -> details

List available Rapid7 Cybersecurity Studies

Description

List available Rapid7 Cybersecurity Studies

Usage

list_studies(rapid7_opendata_api_key = rapid7_api_key())

Arguments

rapid7_opendata_api_key

Your Rapid7 Open Data API key. The various API interface function look for this key in RAPID7_OPENDATA_API_KEY. You can manually provide this key and if the function is used interactively and the key is not found, you will be prompted to enter the key.

Value

data frame

Examples

try(
  list_studies(), silent=TRUE
) -> studies

Get or set RAPID7_OPENDATA_API_KEY value

Description

The API wrapper functions in this package all rely on a Rapid7 Open Data PI key residing in the environment variable RAPID7_OPENDATA_API_KEY. The easiest way to accomplish this is to set it in the '.Renviron' file in your home directory.

Usage

rapid7_api_key(force = FALSE)

Arguments

force

Force setting a new Rapid7 Open Data API key for the current environment?

Details

API requests are authenticated by a key which can be found and managed from your user profile. With every call to the API, the user must be authenticated. The API has a simple means to do this by passing in your key as an HTTP “Authorization” header with the request.

When you signed up for Rapid7 Open Data, a ‘default-key’ was generated for your convenience. This is the key that is used throughout the example code within algorithm pages. For these examples to work correctly, this default key must exist with all the permissions, otherwise the usage examples may result in a 401 Unauthorized error.

You need a Rapid7 account to get an API key. You can request a free account via <https://opendata.rapid7.com/#register> and then navigate to the "Open Data API" link there to create both an organizational key and a user key. You can only use **user keys** with the Open Data API and you will receive error messages indicating so if you try to use an organizational key.

Value

atomic character vector containing the Rapid7 Open Data API key

Note

As the API documentation says, you need a **User** key vs an **Org** key.

References

https://opendata.rapid7.com/apihelp/