Manager
psengine.risklists.risklist_mgr.RisklistMgr
¶
Manages requests for Recorded Future risk lists.
PARAMETER | DESCRIPTION |
---|---|
rf_token
|
Recorded Future API token.
TYPE:
|
Source code in psengine/risklists/risklist_mgr.py
fetch_risklist
¶
fetch_risklist(
list: str,
entity_type: Optional[str] = None,
format: Optional[str] = None,
headers: bool = True,
validate: Optional[Any] = None,
) -> Generator[
Union[dict, list[str], BaseModel], None, None
]
Get a Recorded Future RiskList as generator.
For a custom risklist, specify a fusion_path
the format
field is ignored
when custom risklists are used.
PARAMETER | DESCRIPTION |
---|---|
list
|
Name of the risklist to download.
TYPE:
|
entity_type
|
Type of entity to get risklist for.
TYPE:
|
format
|
Format of the risklist.
TYPE:
|
headers
|
Whether headers are included in the CSV.
TYPE:
|
validate
|
Validation model to use. Must be a subclass of pydantic BaseModel.
TYPE:
|
Warning
- If a specified list does't exist, the API returns the default risklist.
- An empty risklist may be returned:
- If
validate
is None and headers are included, headers are returned. - If
validate
is set, an empty list is returned.
- If
Example
Download and return entries as JSON:
RAISES | DESCRIPTION |
---|---|
RisklistNotAvailableError
|
If an HTTP error occurs during risklist fetch. |
ValidationError
|
If any parameter is of incorrect type. |
RETURNS | DESCRIPTION |
---|---|
Generator[Union[dict, list[str], BaseModel], None, None]
|
Yields risklist rows or validated risklist models. |