fluidattacks_core_models 13.2.0__tar.gz → 14.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/PKG-INFO +1 -1
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/__init__.py +2 -0
- fluidattacks_core_models-14.1.0/fluidattacks_core/models/scanners/resolves_config.py +6 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/scan_config.py +2 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/state_machines/__init__.py +1 -3
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/state_machines/component_orchestrator.py +4 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/state_machines/root_scanner.py +0 -8
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/pyproject.toml +1 -1
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_component_orchestrator.py +29 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_model_scanner.py +6 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_root_scanner.py +0 -43
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/uv.lock +1 -1
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/.envrc +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/.gitignore +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/build/default.nix +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/build/filter.nix +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/flake.lock +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/flake.nix +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/__init__.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/py.typed +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/apk_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/common_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/containers_sca_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/cspm_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/dast_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/loader.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/sast_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/sbom_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/sca_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/scanners/sniffs_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/fluidattacks_core/models/state_machines/types.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/import-linter.cfg +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/mypy.ini +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/ruff.toml +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/__init__.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_loader_env.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_state_machines.py +0 -0
|
@@ -20,6 +20,7 @@ from fluidattacks_core.models.scanners.dast_config import (
|
|
|
20
20
|
DastUrl,
|
|
21
21
|
)
|
|
22
22
|
from fluidattacks_core.models.scanners.loader import build_config, load_yaml_mapping
|
|
23
|
+
from fluidattacks_core.models.scanners.resolves_config import ResolvesConfig
|
|
23
24
|
from fluidattacks_core.models.scanners.sast_config import SastConfig
|
|
24
25
|
from fluidattacks_core.models.scanners.sbom_config import (
|
|
25
26
|
SbomAwsCredentials,
|
|
@@ -52,6 +53,7 @@ __all__ = [
|
|
|
52
53
|
"LocalesEnum",
|
|
53
54
|
"OutputConfig",
|
|
54
55
|
"OutputFormat",
|
|
56
|
+
"ResolvesConfig",
|
|
55
57
|
"SastConfig",
|
|
56
58
|
"SbomAwsCredentials",
|
|
57
59
|
"SbomConfig",
|
|
@@ -9,6 +9,7 @@ from fluidattacks_core.models.scanners.common_config import (
|
|
|
9
9
|
from fluidattacks_core.models.scanners.containers_sca_config import ContainersScaConfig
|
|
10
10
|
from fluidattacks_core.models.scanners.cspm_config import CspmConfig
|
|
11
11
|
from fluidattacks_core.models.scanners.dast_config import DastConfig
|
|
12
|
+
from fluidattacks_core.models.scanners.resolves_config import ResolvesConfig
|
|
12
13
|
from fluidattacks_core.models.scanners.sast_config import SastConfig
|
|
13
14
|
from fluidattacks_core.models.scanners.sbom_config import SbomConfig
|
|
14
15
|
from fluidattacks_core.models.scanners.sca_config import ScaConfig
|
|
@@ -37,3 +38,4 @@ class ScanConfig(BaseModel):
|
|
|
37
38
|
apk: ApkConfig | None = None
|
|
38
39
|
false_positives_identified: FalsePositivesConfig | None = None
|
|
39
40
|
ss: SniffsConfig | None = None
|
|
41
|
+
resolves: ResolvesConfig | None = None
|
|
@@ -2,6 +2,7 @@ from fluidattacks_core.models.state_machines.component_orchestrator import (
|
|
|
2
2
|
ComponentScanOptions,
|
|
3
3
|
ResolvesScanOptions,
|
|
4
4
|
StateMachineComponentOrchestrator,
|
|
5
|
+
TracesScanOptions,
|
|
5
6
|
)
|
|
6
7
|
from fluidattacks_core.models.state_machines.root_scanner import (
|
|
7
8
|
ContextualizesScanInput,
|
|
@@ -9,8 +10,6 @@ from fluidattacks_core.models.state_machines.root_scanner import (
|
|
|
9
10
|
PerRootScanOptions,
|
|
10
11
|
StateMachineExecutePerRootInput,
|
|
11
12
|
TJobNameSegment,
|
|
12
|
-
TracesScanInput,
|
|
13
|
-
TracesScanOptions,
|
|
14
13
|
TStorageKey,
|
|
15
14
|
)
|
|
16
15
|
from fluidattacks_core.models.state_machines.types import (
|
|
@@ -38,6 +37,5 @@ __all__ = [
|
|
|
38
37
|
"TCloningTrigger",
|
|
39
38
|
"TJobNameSegment",
|
|
40
39
|
"TStorageKey",
|
|
41
|
-
"TracesScanInput",
|
|
42
40
|
"TracesScanOptions",
|
|
43
41
|
]
|
|
@@ -44,10 +44,6 @@ class ContextualizesScanOptions(PerRootScanOptions):
|
|
|
44
44
|
pass
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
class TracesScanOptions(PerRootScanOptions):
|
|
48
|
-
pass
|
|
49
|
-
|
|
50
|
-
|
|
51
47
|
TOptions = TypeVar("TOptions", bound=PerRootScanOptions)
|
|
52
48
|
|
|
53
49
|
|
|
@@ -98,7 +94,3 @@ class StateMachineExecutePerRootInput(BaseModel, Generic[TOptions]):
|
|
|
98
94
|
|
|
99
95
|
class ContextualizesScanInput(StateMachineExecutePerRootInput[ContextualizesScanOptions]):
|
|
100
96
|
pass
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class TracesScanInput(StateMachineExecutePerRootInput[TracesScanOptions]):
|
|
104
|
-
pass
|
|
@@ -7,6 +7,7 @@ from fluidattacks_core.models.state_machines.component_orchestrator import (
|
|
|
7
7
|
ComponentScanOptions,
|
|
8
8
|
ResolvesScanOptions,
|
|
9
9
|
StateMachineComponentOrchestrator,
|
|
10
|
+
TracesScanOptions,
|
|
10
11
|
)
|
|
11
12
|
from fluidattacks_core.models.state_machines.root_scanner import (
|
|
12
13
|
MACHINE_NAME_DIGEST_LENGTH,
|
|
@@ -176,3 +177,31 @@ def test_resolves_options_add_no_fields_of_their_own() -> None:
|
|
|
176
177
|
)
|
|
177
178
|
with pytest.raises(ValidationError):
|
|
178
179
|
ResolvesScanOptions.model_validate({**options.model_dump(), "seed_domain": "acme.com"})
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _traces_options(**overrides: str) -> TracesScanOptions:
|
|
183
|
+
arguments: dict[str, str] = {
|
|
184
|
+
"config_id": "123456",
|
|
185
|
+
"entity_name": "nickname",
|
|
186
|
+
"group_name": "acme",
|
|
187
|
+
"user_email": "test@fluidattacks.com",
|
|
188
|
+
}
|
|
189
|
+
arguments.update(overrides)
|
|
190
|
+
return TracesScanOptions(**arguments)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def test_traces_options_declare_the_group_the_orchestrator_does_not_carry() -> None:
|
|
194
|
+
options = _traces_options()
|
|
195
|
+
assert set(options.model_dump()) == set(ComponentScanOptions.model_fields) | {"group_name"}
|
|
196
|
+
with pytest.raises(ValidationError):
|
|
197
|
+
TracesScanOptions.model_validate(_options().model_dump())
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def test_traces_group_name_is_a_storage_key_and_reaches_the_scanner_on_the_wire() -> None:
|
|
201
|
+
for value in ("a/b", "..", "acme corp", "_leading", ""):
|
|
202
|
+
with pytest.raises(ValidationError):
|
|
203
|
+
_traces_options(group_name=value)
|
|
204
|
+
machine_input = StateMachineComponentOrchestrator[TracesScanOptions].model_validate(
|
|
205
|
+
_wire_payload(options=_traces_options(), scanner_name="traces-scan")
|
|
206
|
+
)
|
|
207
|
+
assert json.loads(machine_input.execution_options)["group_name"] == "acme"
|
{fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_model_scanner.py
RENAMED
|
@@ -22,6 +22,7 @@ from fluidattacks_core.models.scanners import (
|
|
|
22
22
|
LocalesEnum,
|
|
23
23
|
OutputConfig,
|
|
24
24
|
OutputFormat,
|
|
25
|
+
ResolvesConfig,
|
|
25
26
|
SastConfig,
|
|
26
27
|
SbomAwsCredentials,
|
|
27
28
|
SbomConfig,
|
|
@@ -258,6 +259,7 @@ def test_scan_config_defaults() -> None:
|
|
|
258
259
|
assert config.checks is None
|
|
259
260
|
assert config.sast is None
|
|
260
261
|
assert config.dast is None
|
|
262
|
+
assert config.resolves is None
|
|
261
263
|
assert config.cspm is None
|
|
262
264
|
assert config.apk is None
|
|
263
265
|
|
|
@@ -517,6 +519,10 @@ def test_scan_config_ss_defaults() -> None:
|
|
|
517
519
|
assert config.ss is None
|
|
518
520
|
|
|
519
521
|
|
|
522
|
+
def test_resolves_config_defaults() -> None:
|
|
523
|
+
assert ResolvesConfig.model_validate({}).hosts == []
|
|
524
|
+
|
|
525
|
+
|
|
520
526
|
def test_unknown_nested_key_sast(tmp_path: Path) -> None:
|
|
521
527
|
f = tmp_path / "config.yaml"
|
|
522
528
|
f.write_text("sast:\n incldue:\n - .\n")
|
{fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_root_scanner.py
RENAMED
|
@@ -11,8 +11,6 @@ from fluidattacks_core.models.state_machines.root_scanner import (
|
|
|
11
11
|
ContextualizesScanOptions,
|
|
12
12
|
PerRootScanOptions,
|
|
13
13
|
StateMachineExecutePerRootInput,
|
|
14
|
-
TracesScanInput,
|
|
15
|
-
TracesScanOptions,
|
|
16
14
|
)
|
|
17
15
|
|
|
18
16
|
|
|
@@ -267,44 +265,3 @@ def test_execute_per_root_machine_name_is_injective() -> None:
|
|
|
267
265
|
assert len(names) == 2
|
|
268
266
|
assert len(masked) == 2
|
|
269
267
|
assert len(roots) == 2
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
def _traces_options(**overrides: str) -> TracesScanOptions:
|
|
273
|
-
arguments: dict[str, str] = {
|
|
274
|
-
"config_id": "123456",
|
|
275
|
-
"group_name": "acme",
|
|
276
|
-
"root_nickname": "nickname",
|
|
277
|
-
"user_email": "test@fluidattacks.com",
|
|
278
|
-
}
|
|
279
|
-
arguments.update(overrides)
|
|
280
|
-
return TracesScanOptions(**arguments)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
def _traces_input(options: TracesScanOptions | None = None) -> TracesScanInput:
|
|
284
|
-
return TracesScanInput.model_validate(
|
|
285
|
-
{
|
|
286
|
-
"job_definition": "traces_run",
|
|
287
|
-
"job_queue": "traces",
|
|
288
|
-
"scanner_name": "traces-scan-run",
|
|
289
|
-
"options": options if options is not None else _traces_options(),
|
|
290
|
-
}
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
def test_traces_scan_options_are_exactly_the_shared_per_root_fields() -> None:
|
|
295
|
-
options = _traces_options()
|
|
296
|
-
assert set(options.model_dump()) == set(PerRootScanOptions.model_fields)
|
|
297
|
-
assert TracesScanOptions.model_validate_json(options.model_dump_json()) == options
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
def test_traces_scan_input_keeps_the_seven_wire_keys_the_machine_reads() -> None:
|
|
301
|
-
dumped = _traces_input().to_wire()
|
|
302
|
-
assert set(dumped) == {
|
|
303
|
-
"configId",
|
|
304
|
-
"executionOptions",
|
|
305
|
-
"groupName",
|
|
306
|
-
"jobDefinition",
|
|
307
|
-
"jobQueue",
|
|
308
|
-
"rootNickname",
|
|
309
|
-
"scannerName",
|
|
310
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_loader_env.py
RENAMED
|
File without changes
|
{fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.1.0}/tests/test_state_machines.py
RENAMED
|
File without changes
|