Manager
psengine.detection.detection_mgr.DetectionMgr
¶
Class to manage DetectionRules and interaction with the Detection API.
PARAMETER | DESCRIPTION |
---|---|
rf_token
|
Recorded Future API token.
TYPE:
|
Source code in psengine/detection/detection_mgr.py
fetch
¶
fetch(doc_id: str) -> Optional[DetectionRule]
Fetch a detection rule based on its ID.
PARAMETER | DESCRIPTION |
---|---|
doc_id
|
Detection rule ID to look up.
TYPE:
|
Endpoint
detection-rule/search
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
DetectionRuleLookupError
|
If no rule is found for the given ID. |
RETURNS | DESCRIPTION |
---|---|
Optional[DetectionRule]
|
The detection rule found for the given ID. |
Source code in psengine/detection/detection_mgr.py
search
¶
search(
detection_rule: Union[list[str], str, None] = None,
entities: Optional[list[str]] = None,
created_before: Optional[str] = None,
created_after: Optional[str] = None,
updated_before: Optional[str] = None,
updated_after: Optional[str] = None,
doc_id: Optional[str] = None,
title: Optional[str] = None,
tagged_entities: Optional[bool] = None,
max_results: Optional[int] = DEFAULT_LIMIT,
) -> list[DetectionRule]
Search for detection rules based on various filter criteria.
PARAMETER | DESCRIPTION |
---|---|
detection_rule
|
Types of detection rules to search for.
TYPE:
|
entities
|
List of entities to filter the search.
TYPE:
|
created_before
|
Filter for rules created before this date.
TYPE:
|
created_after
|
Filter for rules created after this date.
TYPE:
|
updated_before
|
Filter for rules updated before this date.
TYPE:
|
updated_after
|
Filter for rules updated after this date.
TYPE:
|
doc_id
|
Filter by document ID.
TYPE:
|
title
|
Filter by title.
TYPE:
|
tagged_entities
|
Whether to filter by tagged entities.
TYPE:
|
max_results
|
Limit the total number of results returned.
TYPE:
|
Endpoint
detection-rule/search
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
DetectionRuleSearchError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[DetectionRule]
|
A list of detection rules matching the search criteria. |