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 dateformat (in YYY-MM-DD) –
enddate (
str
) – The end date till when rs3 score is needed,please mention dateformat –
filters (
list
) – filters to define for the rs3csvdump (
bool
) – Dump the data in csvclient_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 aggregateapplymecheck (
bool
) – Apply manual exploit check for client rs3 with default value truecsvdump (
bool
) – Dump the data in csvclient_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 neededenddate (
str
) – The end date till when rs3 score is neededfilters – filters to define for the rs3
csvdump (
bool
) – dumps the data in csvclient_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 infovrrHighMax (
float
) – The vrrhighmax infovrrMediumMax (
float
) – The vrrMediumMax infovrrLowMax (
float
) – The vrrLowMax infofindingCount (
int
) – The number of findingsassetType (
str
) – The type of asset either external or internalassetCriticality (
int
) – The asset criticalityassetCategory (
str
) – The asset categoryclient_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')