Rs3 (risksense_api.__subject.__rs3.__rs3)

Rs3 module defined for different rs3 related api endpoints.

class risksense_api.__subject.__rs3.__rs3.Rs3(profile)[source]

Bases: Subject

Class for Rs3 function defintions.

To utlise rs3 function:

Parameters:

profile (object) – Profile Object

Usage:

self.{risksenseobjectname}.rs3.{function}

Examples

To get rs3 over time aggregate use get_rs3overtimeaggregate() function

>>> self.{risksenseobject}.rs3.get_rs3overtimeaggregate({args})
__init__(profile)[source]

Initialization of Rs3 object.

Profile:

Profile Object

Parameters:

profile (object) –

get_rs3overtimeaggregate(startdate, enddate, filters, csvdump=False, client_id=None)[source]

Gets rs3 aggregate score between dates

Parameters:
  • startdate (str) – The start date from when rs3 score is needed,please mention date

  • format (in YYY-MM-DD) –

  • enddate (str) – The end date till when rs3 score is needed,please mention date

  • format

  • filters (list) – filters to define for the rs3

  • csvdump (bool) – Dump the data in csv

  • client_id (type) – client id , if none takes default client_id

  • client_id – int

Return type:

dict

Returns:

The jsonified response from the platform

Example

To get rs3 overtime aggregate

>>> self.rs.rs3.get_rs3overtimeaggregate('2022-02-11','2022-03-11')

Note

To dump the data in csv, you can use csvdump=True argument

>>> self.rs.rs3.get_rs3overtimeaggregate('2022-02-11','2022-03-11',csvdump=True)
get_rs3aggregate(search_filter, applymecheck=True, csvdump=False, client_id=None)[source]

Gets rs3 aggregate score

Parameters:
  • search_filter (list) – Search filters for rs3 aggregate

  • applymecheck (bool) – Apply manual exploit check for client rs3 with default value true

  • csvdump (bool) – Dump the data in csv

  • client_id (typing.Optional[int]) – client id , if none takes default client_id

Return type:

dict

Returns:

The rs3 aggregate data

Example

>>> self.rs.rs3.get_rs3aggregate([])

Note

To dump the data in csv, you can use csvdump=True argument

>>> self.rs.rs3.get_rs3aggregate([],csvdump=True)
get_rs3historyaggregate(startdate, enddate, search_filter, csvdump=False, client_id=None)[source]

Gets rs3 aggregate history between dates

Parameters:
  • startdate (str) – The start date from when rs3 score is needed

  • enddate (str) – The end date till when rs3 score is needed

  • filters – filters to define for the rs3

  • csvdump (bool) – dumps the data in csv

  • client_id (typing.Optional[int]) – client id , if none takes default client_id

Return type:

list

Returns:

The rs3 history

Example

To get rs3 history aggregate

>>> self.rs.rs3.get_rs3historyaggregate('2022-02-11','2022-03-11',[])

Note

To dump the data in csv, you can use csvdump=True argument

>>> self.rs.rs3.get_rs3historyaggregate('2022-02-11','2022-03-11',[],csvdump=True)
Parameters:

search_filter (list) –

simulate_rs3(vrrCriticalMax, vrrHighMax, vrrMediumMax, vrrLowMax, findingCount, assetType, assetCriticality, assetCategory, client_id=None)[source]

Simulate rs3 score based on the vrr,findingcount,asset data

Parameters:
  • vrrCriticalMax (float) – The vrrCriticalMax info

  • vrrHighMax (float) – The vrrhighmax info

  • vrrMediumMax (float) – The vrrMediumMax info

  • vrrLowMax (float) – The vrrLowMax info

  • findingCount (int) – The number of findings

  • assetType (str) – The type of asset either external or internal

  • assetCriticality (int) – The asset criticality

  • assetCategory (str) – The asset category

  • client_id (typing.Optional[int]) – client id , if none takes default client_id

Return type:

int

Returns:

The rs3 simulated information

Example

To simulate the rs3 with asset category host and asset type external with our criticality

>>> self.rs.rs3.simulate_rs3(9.1,7.1,5.1,2.1,4,'External',3,'Host')