Finding
sereto.models.finding
¶
FindingGroupModel
¶
Bases: SeretoBaseModel
Representation of a single finding group from findings.toml.
Attributes:
| Name | Type | Description |
|---|---|---|
risks |
Explicit risks associated with the finding group for specific versions. |
|
findings |
list[str]
|
The list of sub-findings in the format of their unique name to include in the report. |
locators |
list[LocatorModel]
|
A list of locators used to find the finding group. |
show_locator_types |
list[str]
|
A list of locator types to return from the FindingGroup.locators() property. |
Source code in sereto/models/finding.py
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 160 161 162 163 164 165 166 | |
load_risk(risk)
classmethod
¶
Convert risk to correct type.
Source code in sereto/models/finding.py
148 149 150 151 152 153 154 155 156 157 158 | |
unique_finding_names(findings)
classmethod
¶
Ensure that all finding names are unique.
Source code in sereto/models/finding.py
160 161 162 163 164 165 166 | |
FindingTemplateFrontmatterModel
¶
Bases: SeretoBaseModel
Representation of the frontmatter of a finding template.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the sub-finding. |
risk |
Risk
|
The risk level of the sub-finding. |
keywords |
list[str]
|
A list of keywords used to search for the sub-finding. |
variables |
list[VarsMetadataModel]
|
A list of variables used in the sub-finding. |
Source code in sereto/models/finding.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
load_from(path)
classmethod
¶
Load FindingTemplateFrontmatterModel from a file.
Source code in sereto/models/finding.py
59 60 61 62 63 64 65 66 67 | |
FindingsConfigModel
¶
Bases: RootModel[dict[str, FindingGroupModel]]
Model representing the included findings configuration.
The data itself is expected to be a dict where each key is the name of a finding group and the value is a FindingGroupModel.
Source code in sereto/models/finding.py
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 | |
SubFindingFrontmatterModel
¶
Bases: SeretoBaseModel
Frontmatter metadata for a sub-finding included in a project.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Sub-finding display name. |
risk |
Risk
|
Risk classification of the sub-finding. |
category |
TypeCategoryName
|
Category from which the sub-finding originates. |
variables |
dict[str, Any]
|
Variable values injected into the sub-finding. |
template_path |
str | None
|
Relative path to the sub-finding template file. |
locators |
list[LocatorModel]
|
A list of locators used to find the sub-finding. |
format |
FileFormat
|
The file format of the sub-finding (defaults to markdown). |
reported_on |
SeretoDate | None
|
Date the finding was first reported. Only useful if introduced later. |
Source code in sereto/models/finding.py
70 71 72 73 74 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 | |
convert_risk_type(risk)
classmethod
¶
Convert risk to Risk enum.
Source code in sereto/models/finding.py
93 94 95 96 97 98 99 100 101 102 103 | |
dumps_toml()
¶
Dump the model to a TOML-formatted string using a TOML library.
Source code in sereto/models/finding.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
load_from(path)
classmethod
¶
Load FindingFrontmatterModel from a file.
Source code in sereto/models/finding.py
122 123 124 125 126 127 128 129 130 | |
VarsMetadataModel
¶
Bases: SeretoBaseModel
Source code in sereto/models/finding.py
18 19 20 21 22 23 24 25 26 27 28 29 30 | |
type_annotation
property
¶
Get description of the variable type and required state.