Auto Yara Manager
psengine.malware_intel.auto_yara_mgr.AutoYaraMgr
¶
Manages requests for Recorded Future Malware Intelligence API Auto YARA feature.
| PARAMETER | DESCRIPTION |
|---|---|
rf_token
|
Recorded Future API token.
TYPE:
|
Source code in psengine/malware_intel/auto_yara_mgr.py
create_rule_job
¶
create_rule_job(
hashes: list[str], name: str, query: str | None = None
) -> AutoYaraJobCreateOut
Create a new Auto YARA rule generation job based on the hashes and/or query provided.
| PARAMETER | DESCRIPTION |
|---|---|
hashes
|
The list of hashes to use.
TYPE:
|
name
|
The job name.
TYPE:
|
query
|
The filtering query to perform.
TYPE:
|
Endpoint
/malware-intelligence/v1/auto-yara/jobs
| RAISES | DESCRIPTION |
|---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AutoYaraJobCreationError
|
If API error occurs. |
| RETURNS | DESCRIPTION |
|---|---|
AutoYaraJobCreateOut
|
Job creation confirmation containing the job ID. |
Source code in psengine/malware_intel/auto_yara_mgr.py
fetch_rule_jobs
¶
fetch_rule_jobs() -> AutoYaraJobsOut
Fetch all the Auto Yara rule generation jobs created by the user.
Endpoint
/malware-intelligence/v1/auto-yara/jobs
| RAISES | DESCRIPTION |
|---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AutoYaraFetchJobsError
|
If API error occurs. |
| RETURNS | DESCRIPTION |
|---|---|
AutoYaraJobsOut
|
The list of Auto Yara rule generation jobs created by the user. |
Source code in psengine/malware_intel/auto_yara_mgr.py
fetch_rule_job_result
¶
fetch_rule_job_result(
job_id: str,
sanitize: bool | None = None,
wait_until_finished: bool = False,
) -> AutoYaraJobOut
Fetch the result of a specific Auto YARA rule generation job.
A newly created job will typically progress through CREATED and then RUNNING while
the YARA rule is being generated. During those states, job.yara_rule_str is None.
| PARAMETER | DESCRIPTION |
|---|---|
job_id
|
The job ID to fetch.
TYPE:
|
sanitize
|
Return a sanitized version of the rule when true.
TYPE:
|
wait_until_finished
|
When true, keep polling until the job status is FINISHED.
TYPE:
|
The terminal statuses are
FAILED: rule generation failed, sojob.yara_rule_strremainsNone.FINISHED: rule generation succeeded, andjob.yara_rule_stris available.
Endpoint
/malware-intelligence/v1/auto-yara/jobs/{job_id}
| RAISES | DESCRIPTION |
|---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AutoYaraFetchJobError
|
If API error occurs or if polling times out / job fails. |
| RETURNS | DESCRIPTION |
|---|---|
AutoYaraJobOut
|
The details of the requested YARA rule job. |
Source code in psengine/malware_intel/auto_yara_mgr.py
edit_rule_str
¶
edit_rule_str(
job_id: str, yara_rule_str: str
) -> AutoYaraJobEditOut
Edit an existing Yara rule job by modifying its YARA rule string.
| PARAMETER | DESCRIPTION |
|---|---|
job_id
|
The job ID to which the Auto Yara rule belongs.
TYPE:
|
yara_rule_str
|
The new YARA rule string value to apply.
TYPE:
|
Endpoint
/malware-intelligence/v1/auto-yara/jobs/edit
| RAISES | DESCRIPTION |
|---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AutoYaraJobEditError
|
If API error occurs. |
| RETURNS | DESCRIPTION |
|---|---|
AutoYaraJobEditOut
|
Edit confirmation containing the job ID. |
Source code in psengine/malware_intel/auto_yara_mgr.py
delete_rule_job
¶
delete_rule_job(job_id: str) -> AutoYaraJobDeleteOut
Delete a created Auto Yara job and with it the generated YARA rule.
| PARAMETER | DESCRIPTION |
|---|---|
job_id
|
The job ID to delete.
TYPE:
|
Endpoint
/malware-intelligence/v1/auto-yara/jobs/{job_id}
| RAISES | DESCRIPTION |
|---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AutoYaraJobDeletionError
|
If API error occurs. |
| RETURNS | DESCRIPTION |
|---|---|
AutoYaraJobDeleteOut
|
A confirmation of deletion. |
Source code in psengine/malware_intel/auto_yara_mgr.py
retry_failed_rule_job
¶
retry_failed_rule_job(job_id: str) -> AutoYaraJobRetryOut
Retry a failed Auto YARA rule generation job.
| PARAMETER | DESCRIPTION |
|---|---|
job_id
|
The job ID to retry.
TYPE:
|
Endpoint
/malware-intelligence/v1/auto-yara/jobs/{job_id}/retry
| RAISES | DESCRIPTION |
|---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
AutoYaraJobRetryError
|
If API error occurs. |
| RETURNS | DESCRIPTION |
|---|---|
AutoYaraJobRetryOut
|
A confirmation of retry. |