Manager
psengine.identity.identity_mgr.IdentityMgr
¶
Manages requests for Recorded Future Identity API.
Note
The Identity API has some rate limiting that the user needs to take into account. See: Support Article
PARAMETER | DESCRIPTION |
---|---|
rf_token
|
A Recorded Future API token.
TYPE:
|
Source code in psengine/identity/identity_mgr.py
fetch_detections
¶
fetch_detections(
domains: Union[str, list[str], None] = None,
created_gte: Optional[str] = None,
created_lt: Optional[str] = None,
cookies: Optional[str] = None,
detection_type: Optional[str] = None,
organization_id: Union[list[str], str, None] = None,
include_enterprise_level: Optional[bool] = None,
novel_only: Optional[bool] = None,
max_results: Optional[int] = Field(
ge=1, le=MAXIMUM_IDENTITIES, default=DEFAULT_LIMIT
),
detections_per_page: Optional[int] = Field(
ge=1,
le=MAXIMUM_IDENTITIES,
default=DETECTIONS_PER_PAGE,
),
offset: Optional[str] = None,
) -> Detections
Fetch latest detections.
PARAMETER | DESCRIPTION |
---|---|
domains
|
A domain or a list of domains to filter.
TYPE:
|
created_gte
|
A timestamp to return detections created on or after it (e.g., "7d" or ISO 8601).
TYPE:
|
created_lt
|
A timestamp to return detections created before it.
TYPE:
|
cookies
|
A filter by cookie type.
TYPE:
|
detection_type
|
A detection type to filter by ("workforce", "external").
TYPE:
|
organization_id
|
Organization ID or a list of IDs for multi-org filtering.
TYPE:
|
include_enterprise_level
|
Whether to include enterprise-level detections.
TYPE:
|
novel_only
|
If True, only return novel (previously unseen) detections.
TYPE:
|
max_results
|
The maximum number of detections returned.
TYPE:
|
detections_per_page
|
The number of detections per page for pagination.
TYPE:
|
offset
|
An offset token for paginated results.
TYPE:
|
Endpoint
/identity/detections
Example
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
DetectionsFetchError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
Detections
|
A structured response containing the detection records. |
Source code in psengine/identity/identity_mgr.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
fetch_incident_report
¶
fetch_incident_report(
source: str,
include_details: bool = True,
organization_id: Union[list[str], str, None] = None,
offset: Optional[str] = None,
max_results: Optional[int] = Field(
ge=1, le=MAXIMUM_IDENTITIES, default=DEFAULT_LIMIT
),
identities_per_page: Optional[int] = Field(
ge=1,
le=MAXIMUM_IDENTITIES,
default=DETECTIONS_PER_PAGE,
),
) -> IncidentReportOut
Provides an exposure incident report for a single malware log.
PARAMETER | DESCRIPTION |
---|---|
source
|
The raw archive name containing malware log data.
TYPE:
|
include_details
|
Whether to include infected machine details.
TYPE:
|
organization_id
|
The org_id(s) in multi-org setup.
TYPE:
|
offset
|
Offset token for paginated results.
TYPE:
|
max_results
|
Maximum number of credentials to return.
TYPE:
|
identities_per_page
|
Number of credentials per page.
TYPE:
|
Endpoint
/identity/incident/report
Example
Fetch incident report from a recent detection:
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
IncidentReportFetchError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
IncidentReportOut
|
A detailed incident report from the specified malware source. |
Source code in psengine/identity/identity_mgr.py
lookup_credentials
¶
lookup_credentials(
subjects: Union[str, list[str], None] = None,
subjects_sha1: Union[str, list[str], None] = None,
subjects_login: Union[
list[dict[str, str]], list[CredentialSearch], None
] = None,
first_downloaded_gte: Optional[str] = None,
latest_downloaded_gte: Optional[str] = None,
exfiltration_date_gte: Optional[str] = None,
properties: Union[str, list[str], None] = None,
breach_name: Optional[str] = None,
breach_date: Optional[str] = None,
dump_name: Optional[str] = None,
dump_date: Optional[str] = None,
username_properties: Union[str, list[str], None] = None,
authorization_technologies: Union[
str, list[str], None
] = None,
authorization_protocols: Union[
str, list[str], None
] = None,
malware_families: Union[str, list[str], None] = None,
organization_id: Optional[str] = None,
max_results: Optional[int] = Field(
ge=1, le=MAXIMUM_IDENTITIES, default=DEFAULT_LIMIT
),
identities_per_page: Optional[int] = Field(
ge=1,
le=MAXIMUM_IDENTITIES,
default=DETECTIONS_PER_PAGE,
),
offset: Optional[str] = None,
) -> list[LeakedIdentity]
Lookup credential data for a set of subjects.
The subject can be an email, a SHA1 hash, or a combination of username and domain. Different types of subjects can be specified simultaneously, at least one must be present.
PARAMETER | DESCRIPTION |
---|---|
subjects
|
An email or a list of emails to be queried.
TYPE:
|
subjects_sha1
|
A SHA1 hash of a username or email to avoid sending the plain subject.
TYPE:
|
subjects_login
|
Username details when login is not an email (also requires authorization domain).
TYPE:
|
first_downloaded_gte
|
First date when these credentials were received and indexed by Recorded Future.
TYPE:
|
latest_downloaded_gte
|
Latest date when these credentials were received and indexed by Recorded Future.
TYPE:
|
exfiltration_date_gte
|
Date when the infostealer malware exfiltrated data from the victim device.
TYPE:
|
properties
|
Password properties.
TYPE:
|
breach_name
|
The name of a breach.
TYPE:
|
breach_date
|
The date of a breach.
TYPE:
|
dump_name
|
The name of a database dump.
TYPE:
|
dump_date
|
The date of a database dump.
TYPE:
|
username_properties
|
Username properties. Only valid value is 'Email'.
TYPE:
|
authorization_technologies
|
Authorization technologies to filter by.
TYPE:
|
authorization_protocols
|
Authorization protocols to filter by.
TYPE:
|
malware_families
|
Known infostealer malware families.
TYPE:
|
organization_id
|
An organization ID if utilizing a multi-org setup.
TYPE:
|
max_results
|
The maximum number of credentials returned.
TYPE:
|
identities_per_page
|
The number of credentials per page for pagination.
TYPE:
|
offset
|
An offset token for paginated results.
TYPE:
|
Endpoint
/identity/credentials/lookup
Example
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
IdentityLookupError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[LeakedIdentity]
|
A list containing the leaked identity records. |
Source code in psengine/identity/identity_mgr.py
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 |
|
lookup_hostname
¶
lookup_hostname(
hostname: str,
first_downloaded_gte: Optional[str] = None,
latest_downloaded_gte: Optional[str] = None,
exfiltration_date_gte: Optional[str] = None,
properties: Union[str, list[str], None] = None,
breach_name: Optional[str] = None,
breach_date: Optional[str] = None,
dump_name: Optional[str] = None,
dump_date: Optional[str] = None,
username_properties: Union[str, list[str], None] = None,
authorization_technologies: Union[
str, list[str], None
] = None,
authorization_protocols: Union[
str, list[str], None
] = None,
malware_families: Union[str, list[str], None] = None,
organization_id: Optional[str] = None,
max_results: Optional[int] = Field(
ge=1, le=MAXIMUM_IDENTITIES, default=DEFAULT_LIMIT
),
identities_per_page: Optional[int] = Field(
ge=1,
le=MAXIMUM_IDENTITIES,
default=DETECTIONS_PER_PAGE,
),
offset: Optional[str] = None,
) -> list[LeakedIdentity]
Return credentials for a given hostname.
PARAMETER | DESCRIPTION |
---|---|
hostname
|
The hostname of a compromised machine.
TYPE:
|
first_downloaded_gte
|
First date when these credentials were received and indexed by Recorded Future.
TYPE:
|
latest_downloaded_gte
|
Latest date when these credentials were received and indexed by Recorded Future.
TYPE:
|
exfiltration_date_gte
|
Date when the infostealer malware exfiltrated data from the victim device.
TYPE:
|
properties
|
Password properties.
TYPE:
|
breach_name
|
The name of a breach.
TYPE:
|
breach_date
|
The date of a breach.
TYPE:
|
dump_name
|
The name of a database dump.
TYPE:
|
dump_date
|
The date of a database dump.
TYPE:
|
username_properties
|
Username properties. Only valid value is 'Email'.
TYPE:
|
authorization_technologies
|
Authorization technologies to filter by.
TYPE:
|
authorization_protocols
|
Authorization protocols to filter by.
TYPE:
|
malware_families
|
Known infostealer malware families.
TYPE:
|
organization_id
|
An organization ID if utilizing a multi-org setup.
TYPE:
|
max_results
|
The maximum number of credential records returned.
TYPE:
|
identities_per_page
|
The number of credentials per page for pagination.
TYPE:
|
offset
|
An offset token for paginated results.
TYPE:
|
Endpoint
/identity/hostname/lookup
Example
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
IdentityLookupError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[LeakedIdentity]
|
A list containing the leaked identity records. |
Source code in psengine/identity/identity_mgr.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
|
lookup_ip
¶
lookup_ip(
ip: Optional[str] = None,
range_gte: Optional[str] = None,
range_gt: Optional[str] = None,
range_lte: Optional[str] = None,
range_lt: Optional[str] = None,
first_downloaded_gte: Optional[str] = None,
latest_downloaded_gte: Optional[str] = None,
exfiltration_date_gte: Optional[str] = None,
properties: Union[str, list[str], None] = None,
breach_name: Optional[str] = None,
breach_date: Optional[str] = None,
dump_name: Optional[str] = None,
dump_date: Optional[str] = None,
username_properties: Union[str, list[str], None] = None,
authorization_technologies: Union[
str, list[str], None
] = None,
authorization_protocols: Union[
str, list[str], None
] = None,
malware_families: Union[str, list[str], None] = None,
organization_id: Optional[str] = None,
max_results: Optional[int] = Field(
ge=1, le=MAXIMUM_IDENTITIES, default=DEFAULT_LIMIT
),
identities_per_page: Optional[int] = Field(
ge=1,
le=MAXIMUM_IDENTITIES,
default=DETECTIONS_PER_PAGE,
),
offset: Optional[str] = None,
) -> list[LeakedIdentity]
Lookup credentials associated with a specified IP address or an IP range.
PARAMETER | DESCRIPTION |
---|---|
ip
|
A subject IP address.
TYPE:
|
range_gte
|
An IP address lower bound included.
TYPE:
|
range_gt
|
An IP address lower bound excluded.
TYPE:
|
range_lte
|
An IP address upper bound included.
TYPE:
|
range_lt
|
An IP address upper bound excluded.
TYPE:
|
first_downloaded_gte
|
First date when these credentials were received and indexed by Recorded Future.
TYPE:
|
latest_downloaded_gte
|
Latest date when these credentials were received and indexed by Recorded Future.
TYPE:
|
exfiltration_date_gte
|
Date when the infostealer malware exfiltrated data from the victim device.
TYPE:
|
properties
|
Password properties.
TYPE:
|
breach_name
|
The name of a breach.
TYPE:
|
breach_date
|
The date of a breach.
TYPE:
|
dump_name
|
The name of a database dump.
TYPE:
|
dump_date
|
The date of a database dump.
TYPE:
|
username_properties
|
Username properties. Only valid value is 'Email'.
TYPE:
|
authorization_technologies
|
Authorization technologies to filter by.
TYPE:
|
authorization_protocols
|
Authorization protocols to filter by.
TYPE:
|
malware_families
|
Known infostealer malware families.
TYPE:
|
organization_id
|
An organization ID if utilizing a multi-org setup.
TYPE:
|
max_results
|
The maximum number of credentials returned.
TYPE:
|
identities_per_page
|
The number of credentials per page for pagination.
TYPE:
|
offset
|
An offset token for paginated results.
TYPE:
|
Endpoint
/identity/ip/lookup
Example
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
IdentityLookupError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[LeakedIdentity]
|
A list containing the leaked identity records. |
Source code in psengine/identity/identity_mgr.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
|
lookup_password
¶
lookup_password(
hash_prefix: Optional[str] = None,
algorithm: Optional[str] = None,
passwords: Optional[list[tuple[str, str]]] = None,
) -> list[PasswordLookup]
Lookup passwords to determine if they have been previously exposed.
Check if either specific password hash prefixes and algorithms, or a list of hash and algorithm tuples, have been exposed in the past.
PARAMETER | DESCRIPTION |
---|---|
hash_prefix
|
The prefix of the password hash to be looked up.
TYPE:
|
algorithm
|
The algorithm used for the password hash.
TYPE:
|
passwords
|
A list of tuples containing hash prefixes and their respective algorithms.
TYPE:
|
Endpoint
/identity/password/lookup
Example
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
ValueError
|
If a wrong combination of parameters is given. |
IdentityLookupError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[PasswordLookup]
|
A list of password lookup results. |
Source code in psengine/identity/identity_mgr.py
search_credentials
¶
search_credentials(
domains: Union[str, list[str]],
domain_types: Union[str, list[str], None] = None,
first_downloaded_gte: Optional[str] = None,
latest_downloaded_gte: Optional[str] = None,
exfiltration_date_gte: Optional[str] = None,
properties: Union[str, list[str], None] = None,
breach_name: Optional[str] = None,
breach_date: Optional[str] = None,
dump_name: Optional[str] = None,
dump_date: Optional[str] = None,
username_properties: Union[str, list[str], None] = None,
authorization_technologies: Union[
str, list[str], None
] = None,
authorization_protocols: Union[
str, list[str], None
] = None,
malware_families: Union[str, list[str], None] = None,
organization_id: Optional[str] = None,
max_results: Optional[int] = Field(
ge=1, le=MAXIMUM_IDENTITIES, default=DEFAULT_LIMIT
),
identities_per_page: Optional[int] = Field(
ge=1,
le=MAXIMUM_IDENTITIES,
default=DETECTIONS_PER_PAGE,
),
offset: Optional[str] = None,
) -> list[CredentialSearch]
Search credential data for a set of domains.
PARAMETER | DESCRIPTION |
---|---|
domains
|
One or more domains to be queried.
TYPE:
|
domain_types
|
Domain type filter: 'Email', 'Authorization', or both.
TYPE:
|
first_downloaded_gte
|
First date when these credentials were received and indexed by Recorded Future.
TYPE:
|
latest_downloaded_gte
|
Latest date when these credentials were received and indexed by Recorded Future.
TYPE:
|
exfiltration_date_gte
|
Date when the infostealer malware exfiltrated data from the victim device.
TYPE:
|
properties
|
Password properties.
TYPE:
|
breach_name
|
The name of a breach.
TYPE:
|
breach_date
|
The date of a breach.
TYPE:
|
dump_name
|
The name of a database dump.
TYPE:
|
dump_date
|
The date of a database dump.
TYPE:
|
username_properties
|
Username properties. Only valid value is 'Email'.
TYPE:
|
authorization_technologies
|
Authorization technologies to filter by.
TYPE:
|
authorization_protocols
|
Authorization protocols to filter by.
TYPE:
|
malware_families
|
Known infostealer malware families.
TYPE:
|
organization_id
|
An organization ID if utilizing a multi-org setup.
TYPE:
|
max_results
|
The maximum number of credentials returned.
TYPE:
|
identities_per_page
|
The number of credentials per page for pagination.
TYPE:
|
offset
|
An offset token for paginated results.
TYPE:
|
Endpoint
/identity/credentials/search
Example
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
IdentitySearchError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[CredentialSearch]
|
A list containing the search results. |
Source code in psengine/identity/identity_mgr.py
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 |
|
search_dump
¶
search_dump(
names: Union[str, list[str]],
max_results: Optional[int] = Field(
le=MAXIMUM_IDENTITIES, default=DEFAULT_LIMIT
),
) -> DumpSearchOut
Search if a particular database dump is present.
PARAMETER | DESCRIPTION |
---|---|
names
|
The name(s) of a database dump to search for.
TYPE:
|
max_results
|
Maximum number of dump records to return.
TYPE:
|
Endpoint
/identity/metadata/dump/search
Example
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
IdentitySearchError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
DumpSearchOut
|
A list containing the dump search results. |