Skip to content

Commit

Permalink
Merge pull request #392 from crocs-muni/reference-notebook
Browse files Browse the repository at this point in the history
Reference notebook
  • Loading branch information
adamjanovsky authored Feb 20, 2024
2 parents 609ee02 + cdb54b7 commit 78d2cfd
Show file tree
Hide file tree
Showing 6 changed files with 1,581 additions and 197 deletions.
8 changes: 1 addition & 7 deletions docs/api/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
The examples related to this package can be found at [model notebook](./../notebooks/examples/model.ipynb).
```

```{warning}
Transforming `CPE` records to existing vulnerabilities is handled by [Dataset](https://github.com/crocs-muni/sec-certs/blob/main/sec_certs/dataset/dataset.py) class, `compute_related_cves()` method.
However, come CVEs are missed due to omitted vulnerable configurations in [CVEDataset](https://github.com/crocs-muni/sec-certs/blob/main/sec_certs/dataset/cve.py) class. We omit configurations that comprise of two components joined with `AND` operator. For closer description, see [issue #252](https://github.com/crocs-muni/sec-certs/issues/252) at GitHub.
```

## CPEClassifier

```{eval-rst}
Expand Down Expand Up @@ -45,4 +39,4 @@ However, come CVEs are missed due to omitted vulnerable configurations in [CVEDa
.. currentmodule:: sec_certs.model
.. autoclass:: TransitiveVulnerabilityFinder
:members:
```
```
7 changes: 4 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ import typing
type_hints = typing.get_type_hints(Configuration)
text = ""
for field, value in config.__fields__.items():
for field, value in config.model_fields.items():
text += f"`{field}`\n\n"
text += f"- type: `{type_hints[field]}`\n"
text += f"- default: `{value.default}`\n"
text += f"- description: {value.field_info.description}\n"
text += f"- env name: `{list(value.field_info.extra['env_names'])[0]}`\n\n"
text += f"- description: {value.description}\n"
env_var = "SECCERTS_" + field.upper()
text += f"- env name: `{env_var}`\n\n"
glue("text", Markdown(text))
```
Loading

0 comments on commit 78d2cfd

Please sign in to comment.