Links
Introduction¶
The LinksMgr class of the links module allows you to search for technically validated relationships between threat intelligence entities in the Recorded Future Intelligence Cloud — connections established through sandbox analysis, infrastructure analysis, network traffic analysis, and Insikt Group research.
See the API Reference for internal details of the module.
Notes¶
The search method expects Recorded Future entity IDs (for example, QCwdoU), not entity names. If you only have a name, use the entity_match module first to resolve the ID.
The response is batched: you get one result per input entity. A specific entity can fail while others succeed, so always check result.error before iterating over result.links.
For filters such as sections, events, and entity types, use the metadata methods (list_sections, list_events, and list_entity_types) to retrieve valid IDs before calling search.
Examples¶
Warning
The following examples demonstrate how to use this module. Be sure to add appropriate error handling as needed; all possible errors for each method or function are listed in the API Reference page.
Additionally, you must configure the RF_TOKEN environment variable before getting started. For instructions, see Learn.
1: Search links for an entity and handle per-entity errors¶
In this example, we call search with a single entity ID. For each result, we first check result.error. If there is no error, we print the source entity and the first 5 linked entities returned by the API.
The output will be:
2: Filter link results and apply limits¶
In this example, we pass filter and limit arguments directly to search (for example sources, entity_types, timeframe, search_scope, and per_entity_type) to narrow results to technical malware links seen in the last 90 days and cap result size per entity type.
3: Extract IOCs, Threat Actors and Malwares from links¶
Each item returned by LinksMgr.search() is an EntityLinks object. After checking result.error, you can use helper methods to extract common subsets from result.links:
result.iocs(): returns linked IOCs grouped by IOC type (type:InternetDomainName,type:CyberVulnerability,type:IpAddress,type:Hash,type:Url). Each IOC item includesid,type,name,risk_score, andsource.result.ttps(): returns linked MITRE ATT&CK techniques (type:MitreAttackIdentifier). Each item includesid,type,name,display_name, andsource.result.malwares(): returns linked malware entities (type:Malware) withid,type,name, andsource.result.threat_actors(): returns linked organizations (type:Organization) that are marked as threat actors through thethreat_actorattribute.
This will output: