Skip to content

Process Freetext

ASTypeValidator

Bases: TypeValidator

This Class implements a validationmethod for AS Numbers

validate

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as an ASAttribute

:param input_str: input string to validate :type input_str: str :return: returns the AttributeType when an AS is found, otherwise None :rtype: AttributeType | None

BTCTypeValidator

Bases: TypeValidator

This Class implements a validationmethod for bitcoin-addresses

validate

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as an BTCAttribute

:param input_str: input string to validate :type input_str: str :return: returns the AttributeType when a BTC address is found, otherwise None :rtype: AttributeType | None

CVETypeValidator

Bases: TypeValidator

This Class implements a validationmethod for vulnerabilites

validate

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as an CVEAttribute

:param input_str: input string to validate :type input_str: str :return: returns the AttributeType when a CVE is found, otherwise None :rtype: AttributeType | None

DomainFilenameTypeValidator

Bases: TypeValidator

This Class implements a validationmethod for Domain- and Filenames

validate

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as a Domain- or FilenameAttribute it checks if the string is a Domain, URL, Link, Filename or a Regkey and returns the AttributeType, otherwise None

:param input_str: the string to validate :type input_str: str :return: returns the AttributeType when a Domain or Filename is found, otherwise None :rtype: AttributeType | None

EmailTypeValidator

Bases: TypeValidator

This Class implements a validationmethod for email-adresses

validate

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as an EmailAttribute

:param input_str: input string to validate :type input_str: str :return: returns the AttributeType when an Email address is found, otherwise None :rtype: AttributeType | None

HashTypeValidator

Bases: TypeValidator

This Class implements a validationmethod for md5,sha1,sha224,sha256,sha384 and sha512 hashes

HashTypes

Bases: BaseModel

This class encapsulates a HashTypes-Object, which is used to differentiate between single or composite hashes

validate

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as an HashAttribute it checks if the string is a single or composite hash and returns the AttributeType, otherwise None valid hashes are md5,sha1,sha224,sha256,sha384,sha512 and ssdeep

:param input_str: input string to validate :type input_str: str :return: returns the AttributeType when a Hash is found, otherwise None :rtype: AttributeType | None

IPTypeValidator

Bases: TypeValidator

This Class implements a validationmethod for simple IPv4 and IPv6 adresses, without a port

__validate_ip

__validate_ip(input_str: str) -> bool

This method is used to check if a string is an IPv4 or IPv6 IP returns True when an IP is found, otherwise False

:param input_str: the string to check :type input_str: str :return: returns True when an IP is found, otherwise False :rtype: bool

validate

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as an IPAttribute if the string is an IP, it returns the AttributeType, otherwise None

it checks if the string is an IPv4 or IPv6 IP with or without a Port, or a CIDR Block

:param input_str: input string to validate :type input_str: str :return: returns the AttributeType when an IP is found, otherwise None :rtype: AttributeType | None

PhonenumberTypeValidator

Bases: TypeValidator

This Class implements a validationmethod for phonenumbers

validate

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as an PhoneNumberAttribute

:param input_str: input string to validate :type input_str: str :return: returns the AttributeType when a PhoneNumber is found, otherwise None :rtype: AttributeType | None

TypeValidator

Bases: ABC

Abstract model of a Validator Object, which is used to decide, whether a String is a representation of a certain Attribute or not. It returns the Attribute Type when an Attribute is found, and None if not

validate abstractmethod

validate(input_str: str) -> AttributeType | None

This method is used when a String is validated as an Attribute

:param input_str: the string to validate :type input_str: str :return: returns the AttributeType when an Attribute is found, and None if not :rtype: AttributeType | None

resolve_filename

resolve_filename(input_str: str) -> bool

This method is used to check if a string is a filename, by checking if it has a file extension(an alphanumeric not numeric string) or a drive letter

:param input_str: the string to check :type input_str: str :return: returns True when the string is a filename, otherwise False :rtype: bool

ProcessFreeTextData

Bases: BaseModel

Represents the input data of the ProcessFreeTextJob

ProcessFreeTextResponse

Bases: BaseModel

Represents the response of the ProcessFreeTextJob

ProcessfreetextConfigData

Bases: BaseSettings

Encapsulates configuration for the processfreetext worker and its jobs.

processfreetext_job async

processfreetext_job(ctx: WrappedContext[None], user: UserData, data: ProcessFreeTextData) -> ProcessFreeTextResponse

:param user: the user that requested the job :type user: UserData :param data: the data to process, containing the free text string :type data: ProcessFreeTextData :return: returns a list of found attributes :rtype: ProcessFreeTextData