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. |
Source code in sereto/models/finding.py
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 |
|
load_risk(risk)
classmethod
¶
Convert risk to correct type.
Source code in sereto/models/finding.py
140 141 142 143 144 145 146 147 148 149 150 |
|
unique_finding_names(findings)
classmethod
¶
Ensure that all finding names are unique.
Source code in sereto/models/finding.py
152 153 154 155 156 157 158 |
|
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
32 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 |
|
load_from(path)
classmethod
¶
Load FindingTemplateFrontmatterModel from a file.
Source code in sereto/models/finding.py
58 59 60 61 62 63 64 65 66 |
|
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
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 |
|
SubFindingFrontmatterModel
¶
Bases: SeretoBaseModel
Representation of the frontmatter of a sub-finding included in project.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the sub-finding. |
risk |
Risk
|
The risk level of the sub-finding. |
category |
TypeCategoryName
|
From which category the sub-finding originates. |
variables |
dict[str, Any]
|
A dictionary of variables used in the sub-finding. |
template_path |
str | None
|
Relative path to the finding in templates directory. |
locators |
list[LocatorModel]
|
A list of locators used to find the sub-finding. |
Source code in sereto/models/finding.py
69 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 |
|
convert_risk_type(risk)
classmethod
¶
Convert risk to Risk enum.
Source code in sereto/models/finding.py
88 89 90 91 92 93 94 95 96 97 98 |
|
dumps_toml()
¶
Dump the model to a TOML-formatted string.
Source code in sereto/models/finding.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
load_from(path)
classmethod
¶
Load FindingFrontmatterModel from a file.
Source code in sereto/models/finding.py
116 117 118 119 120 121 122 123 124 |
|
VarsMetadataModel
¶
Bases: SeretoBaseModel
Source code in sereto/models/finding.py
17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
type_annotation
property
¶
Get description of the variable type and required state.