From ccc03dc7151b965babea65bfde96c7d088231881 Mon Sep 17 00:00:00 2001 From: Olivier Leduc Date: Fri, 30 Jun 2023 11:31:19 -0400 Subject: [PATCH] BST-6424: Remove scan-types for server-side scanners (#42) Server-side scanners scan-types are defined in the backend, having them defined in the module file is not needed. --- boostsec/registry_validator/schema.py | 2 +- .../boostsecurityio/simple-scanner/module.yaml | 2 -- .../server-side-scanners/invalids/duplicate-a/module.yaml | 2 -- .../server-side-scanners/invalids/duplicate-b/module.yaml | 3 --- .../server-side-scanners/invalids/empty-rules/module.yaml | 2 -- .../invalids/missing-namespace/module.yaml | 2 -- 6 files changed, 1 insertion(+), 12 deletions(-) diff --git a/boostsec/registry_validator/schema.py b/boostsec/registry_validator/schema.py index e58f6e7..934dec9 100644 --- a/boostsec/registry_validator/schema.py +++ b/boostsec/registry_validator/schema.py @@ -22,7 +22,6 @@ class ModuleBaseSchema(BaseModel): name: str namespace: str - scan_types: list[ScanType] = Field(..., min_items=1) class ModuleConfigSchema(BaseModel): @@ -38,6 +37,7 @@ class ModuleSchema(ModuleBaseSchema): id_: str = Field(..., alias="id") config: ModuleConfigSchema steps: list[Any] # steps aren't currently validated + scan_types: list[ScanType] = Field(..., min_items=1) class ServerSideModuleSchema(ModuleBaseSchema): diff --git a/tests/integration/samples/server-side-scanners/boostsecurityio/simple-scanner/module.yaml b/tests/integration/samples/server-side-scanners/boostsecurityio/simple-scanner/module.yaml index 34ff66a..bc6cab5 100644 --- a/tests/integration/samples/server-side-scanners/boostsecurityio/simple-scanner/module.yaml +++ b/tests/integration/samples/server-side-scanners/boostsecurityio/simple-scanner/module.yaml @@ -1,4 +1,2 @@ name: Simple Scanner namespace: boostsecurityio/simple-scanner -scan_types: - - sast diff --git a/tests/integration/samples/server-side-scanners/invalids/duplicate-a/module.yaml b/tests/integration/samples/server-side-scanners/invalids/duplicate-a/module.yaml index 0170966..51520a4 100644 --- a/tests/integration/samples/server-side-scanners/invalids/duplicate-a/module.yaml +++ b/tests/integration/samples/server-side-scanners/invalids/duplicate-a/module.yaml @@ -1,4 +1,2 @@ name: Duplicate Module namespace: invalids/duplicate-module -scan_types: - - sast diff --git a/tests/integration/samples/server-side-scanners/invalids/duplicate-b/module.yaml b/tests/integration/samples/server-side-scanners/invalids/duplicate-b/module.yaml index e05b002..51520a4 100644 --- a/tests/integration/samples/server-side-scanners/invalids/duplicate-b/module.yaml +++ b/tests/integration/samples/server-side-scanners/invalids/duplicate-b/module.yaml @@ -1,5 +1,2 @@ name: Duplicate Module namespace: invalids/duplicate-module -scan_types: - - sast - diff --git a/tests/integration/samples/server-side-scanners/invalids/empty-rules/module.yaml b/tests/integration/samples/server-side-scanners/invalids/empty-rules/module.yaml index 71e0311..dfa1d49 100644 --- a/tests/integration/samples/server-side-scanners/invalids/empty-rules/module.yaml +++ b/tests/integration/samples/server-side-scanners/invalids/empty-rules/module.yaml @@ -1,4 +1,2 @@ name: Empty Rules namespace: invalids/empty-rules -scan_types: - - sast diff --git a/tests/integration/samples/server-side-scanners/invalids/missing-namespace/module.yaml b/tests/integration/samples/server-side-scanners/invalids/missing-namespace/module.yaml index 591ab6d..905b08c 100644 --- a/tests/integration/samples/server-side-scanners/invalids/missing-namespace/module.yaml +++ b/tests/integration/samples/server-side-scanners/invalids/missing-namespace/module.yaml @@ -1,3 +1 @@ name: Missing Namespace -scan_types: - - sast