Skip to content

Util

psengine.stix2.util

create_rf_author

create_rf_author() -> Identity

Create the Recorded Future Author Identity.

RETURNS DESCRIPTION
Identity

Recorded Future as an identity.

Source code in psengine/stix2/util.py
def create_rf_author() -> Annotated[stix2.v21.Identity, Doc('Recorded Future as an identity.')]:
    """Create the Recorded Future Author Identity."""
    name = 'Recorded Future'
    id_class = 'organization'
    return stix2.Identity(
        name=name,
        identity_class=id_class,
        id=RF_IDENTITY_UUID,
        description=(
            'Recorded Future is the most comprehensive and independent threat'
            ' intelligence cloud platform. We enable organizations to identify and mitigate'
            ' threats across cyber, supply-chain, physical and fraud domains; and are trusted'
            ' to get real-time, unbiased and actionable intelligence.'
        ),
        contact_information='support@recordedfuture.com',
    )

generate_uuid

generate_uuid(**kwargs: dict) -> str

Generate a unique UUID to be used as a STIX2 ID.

PARAMETER DESCRIPTION
**kwargs

A list of parameters to be hashed for the UUID.

TYPE: dict DEFAULT: {}

RETURNS DESCRIPTION
str

A unique UUID to be used as a STIX2 ID.

Source code in psengine/stix2/util.py
def generate_uuid(
    **kwargs: Annotated[dict, Doc('A list of parameters to be hashed for the UUID.')],
) -> Annotated[str, Doc('A unique UUID to be used as a STIX2 ID.')]:
    """Generate a unique UUID to be used as a STIX2 ID."""
    data = {k: str(v) for k, v in kwargs.items()}
    data = canonicalize(data, utf8=False)
    return str(uuid.uuid5(uuid.UUID(RF_NAMESPACE), data))