Finding
sereto.finding
¶
FindingGroup
dataclass
¶
Represents a finding group.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the finding group. |
explicit_risk |
Risk | None
|
Risk to be used for the group. Overrides the calculated risks from sub-findings. |
sub_findings |
list[SubFinding]
|
A list of sub-findings in the group. |
Source code in sereto/finding.py
62 63 64 65 66 67 68 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 125 126 127 128 129 |
|
risk
property
¶
Get the finding group risk.
Returns:
Type | Description |
---|---|
Risk
|
The explicit risk if set, otherwise the highest risk from the sub-findings. |
uname
property
¶
Unique name of the finding group.
dumps_toml()
¶
Dump the finding group to a TOML string.
Source code in sereto/finding.py
99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
load(name, group_desc, findings_dir)
classmethod
¶
Load a finding group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the finding group. |
required |
group_desc
|
FindingGroupModel
|
The description of the finding group. |
required |
findings_dir
|
DirectoryPath
|
The path to the findings directory. |
required |
Returns:
Type | Description |
---|---|
Self
|
The loaded finding group object. |
Source code in sereto/finding.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
Findings
dataclass
¶
Represents a collection of findings.
Attributes:
Name | Type | Description |
---|---|---|
groups |
list[FindingGroup]
|
A list of finding groups. |
target_dir |
FilePath
|
The path to the target directory containing the findings. |
Source code in sereto/finding.py
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 159 160 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 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
config_file
property
¶
Get the path to the findings.toml configuration file
findings_dir
property
¶
Get the path to the directory containing the findings
risks
property
¶
Get the summary of risks for the specified version.
add_from_template(template, category, name=None, risk=None, variables=None)
¶
Add a sub-finding from a template.
This will create a new finding group with a single sub-finding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
template
|
FilePath
|
The path to the sub-finding template. |
required |
name
|
str | None
|
The name of the sub-finding. If not provided, the name will use the default value from the template. |
None
|
risk
|
Risk | None
|
The risk of the sub-finding. If not provided, the risk will use the default value from the template. |
None
|
Source code in sereto/finding.py
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 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
load_from(target_dir)
classmethod
¶
Load findings belonging to the same target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_dir
|
DirectoryPath
|
The path to the target directory. |
required |
Returns:
Type | Description |
---|---|
Self
|
The loaded findings object. |
Source code in sereto/finding.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
select_group(selector=None)
¶
Select a finding group by index or name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selector
|
int | str | None
|
The index or name of the finding group to select. |
None
|
Returns:
Type | Description |
---|---|
FindingGroup
|
The selected finding group. |
Source code in sereto/finding.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|
SubFinding
dataclass
¶
Source code in sereto/finding.py
28 29 30 31 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 |
|
uname
property
¶
Unique name of the finding.
load_from(path)
classmethod
¶
Load a sub-finding from a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
FilePath
|
The path to the sub-finding file. |
required |
Returns:
Type | Description |
---|---|
Self
|
The loaded sub-finding object. |
Source code in sereto/finding.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
render_finding_group_to_tex(config, project_path, target, target_ix, finding_group, finding_group_ix, version)
¶
Render selected finding group (top-level document) to TeX format.
Source code in sereto/finding.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
|