[docs]classDrilldownSearch(BaseModel):"""Represents a drilldown search in a finding."""name:strsearch:strearliest:strlatest:str
[docs]classDrilldownDashboardToken(BaseModel):"""Represents a token for a drilldown dashboard."""name:strvalue:str
[docs]classDrilldownDashboard(BaseModel):"""Represents a drilldown dashboard in a finding."""app:strdashboard_id:strname:strtokens:list[DrilldownDashboardToken]|None=None
[docs]classFindingAttachment(BaseModel):"""Represents a file attachment to upload to the SOAR vault during on_es_poll. The SDK uploads these to the container vault before creating the finding, then populates the finding's email.attachments and email.raw_email_link with the resulting vault links. """file_name:strdata:bytesis_raw_email:bool=False
[docs]classFindingEmailAttachment(BaseModel):"""Represents an email attachment metadata object in a finding."""filename:strfilesize:int|None=Noneurl:str|None=None
[docs]classFindingEmailReporter(BaseModel):"""Information about the person who reported the phishing email."""model_config=ConfigDict(extra="forbid",populate_by_name=True)from_:str=pydantic.Field(alias="from",serialization_alias="from")to:str|list[str]|None=Nonecc:str|list[str]|None=Nonebcc:str|list[str]|None=Nonesubject:str|None=Nonemessage_id:str|None=Noneid:str|None=Nonebody:str|None=Nonedate:str|None=None@field_validator("body",mode="before")@classmethoddef_truncate_body(cls,v:str|None)->str|None:ifisinstance(v,str)andlen(v)>500:returnv[:500]returnv
[docs]classFindingEmail(BaseModel):"""Email object containing all email-related fields for phishing findings."""model_config=ConfigDict(extra="forbid")headers:dict[str,Any]|None=Nonebody:str|None=Noneurls:list[str]|None=Noneattachments:list[FindingEmailAttachment]|None=Noneraw_email_link:str|None=Nonereporter:FindingEmailReporter|None=None
[docs]classFinding(BaseModel):"""Represents a finding to be created during on_es_poll. Findings are stored in ES and can be associated with SOAR containers/artifacts for investigation workflow. Only rule_title is required. All other fields are optional and will use ES defaults or asset ingest configuration if not provided. """model_config=ConfigDict(extra="forbid")rule_title:strsecurity_domain:str|None=Nonerule_description:str|None=Nonerisk_object:str|None=Nonerisk_object_type:str|None=Nonerisk_score:float|None=Nonestatus:str|None=Noneurgency:str|None=Noneowner:str|None=Nonedisposition:str|None=Nonedrilldown_searches:list[DrilldownSearch]|None=Nonedrilldown_dashboards:list[DrilldownDashboard]|None=Noneannotations:dict[str,list[str]]|None=Nonerisk_event_count:int|None=Noneall_risk_objects:list[str]|None=Nonesource:list[str]|None=Noneexclude_map_fields:list[str]|None=Nonequeue_id:str|None=Noneemail:FindingEmail|None=Nonerun_threat_analysis:bool=Falselaunch_automation:bool=Falseinvestigation_type:str|None=Noneautomation_rule:str|None=Nonefinding_source:str|None=Noneadditional_fields:dict[str,Any]|None=Noneattachments:list[FindingAttachment]|None=None
[docs]defto_dict(self)->dict[str,Any]:"""Convert the finding to a dictionary (excludes attachments)."""returnself.model_dump(exclude_none=True,exclude={"attachments"},by_alias=True)