Commit 0fcf014
authored
Allow trusting custom integration fingerprints (#42)
This adds three new `ImportAsset` attributes to allow custom
integrations to specify that their fingerprint data should be trusted,
even if the data cannot be normalized by runZero's fingerprint engine:
* `trust_os` - Trusts the `os` attribute and use it to set Asset OS
* `trust_os_version` - Trusts the `os_version` attribute and use it to
set Asset OS
* `trust_device_type` - Trusts the `device_type` attribute and use to to
set Asset Type
Without these options set, `os`, `os_version` and `device_type` will
only be used to set the runZero asset fingerprint if they can be
normalized via runZero's fingerprint engine. `os`, `os_version` and
`device_type` are always available under the custom integrations
attributes, even when the corresponding `trust_*` options are not set.
## Example:
```py
asset = ImportAsset(
id=f"test-asset-{i}",
hostnames=[f"test-asset-{i}"],
device_type="Custom Type",
os="Custom OS",
os_version="0.1.2",
trust_device_type=True,
trust_os=True,
trust_os_version=True,
)
```1 parent 218466c commit 0fcf014
File tree
3 files changed
+48
-2
lines changed- runzero/types
- tests/runzero
3 files changed
+48
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
45 | 60 | | |
46 | 61 | | |
47 | 62 | | |
| |||
82 | 97 | | |
83 | 98 | | |
84 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
0 commit comments