Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12638,6 +12638,7 @@ components:
data:
attributes:
compliance_host: false
function: true
vuln_containers_os: true
vuln_host_os: true
id: 12345678-90ab-cdef-1234-567890abcdef
Expand All @@ -12652,6 +12653,7 @@ components:
data:
- attributes:
compliance_host: false
function: true
vuln_containers_os: true
vuln_host_os: true
id: 12345678-90ab-cdef-1234-567890abcdef
Expand Down Expand Up @@ -12686,6 +12688,9 @@ components:
compliance_host:
description: Indicates whether host compliance scanning is enabled.
type: boolean
function:
description: Indicates if scanning of Azure Functions is enabled.
type: boolean
vuln_containers_os:
description: Indicates if scanning for vulnerabilities in containers is enabled.
type: boolean
Expand Down Expand Up @@ -12733,6 +12738,9 @@ components:
compliance_host:
description: Indicates whether host compliance scanning is enabled.
type: boolean
function:
description: Indicates if scanning of Azure Functions is enabled.
type: boolean
vuln_containers_os:
description: Indicates if scanning for vulnerabilities in containers is enabled.
type: boolean
Expand Down Expand Up @@ -40828,6 +40836,7 @@ components:
example:
data:
attributes:
cloud_function: true
compliance_host: false
vuln_containers_os: true
vuln_host_os: true
Expand All @@ -40842,6 +40851,7 @@ components:
example:
data:
- attributes:
cloud_function: true
compliance_host: false
vuln_containers_os: true
vuln_host_os: true
Expand Down Expand Up @@ -40874,6 +40884,9 @@ components:
GcpScanOptionsDataAttributes:
description: Attributes for GCP scan options configuration.
properties:
cloud_function:
description: Indicates if scanning of Cloud Functions is enabled.
type: boolean
compliance_host:
description: Indicates whether host compliance scanning is enabled.
type: boolean
Expand Down Expand Up @@ -40921,6 +40934,9 @@ components:
GcpScanOptionsInputUpdateDataAttributes:
description: Attributes for updating GCP scan options configuration.
properties:
cloud_function:
description: Indicates if scanning of Cloud Functions is enabled.
type: boolean
compliance_host:
description: Indicates whether host compliance scanning is enabled.
type: boolean
Expand Down
1 change: 1 addition & 0 deletions examples/v2/agentless-scanning/CreateAzureScanOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
body = AzureScanOptions(
data=AzureScanOptionsData(
attributes=AzureScanOptionsDataAttributes(
function=True,
vuln_containers_os=True,
vuln_host_os=True,
),
Expand Down
1 change: 1 addition & 0 deletions examples/v2/agentless-scanning/CreateGcpScanOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
id="new-project",
type=GcpScanOptionsDataType.GCP_SCAN_OPTIONS,
attributes=GcpScanOptionsDataAttributes(
cloud_function=True,
vuln_host_os=True,
vuln_containers_os=True,
),
Expand Down
1 change: 1 addition & 0 deletions examples/v2/agentless-scanning/UpdateGcpScanOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
id="api-spec-test",
type=GcpScanOptionsInputUpdateDataType.GCP_SCAN_OPTIONS,
attributes=GcpScanOptionsInputUpdateDataAttributes(
cloud_function=True,
vuln_containers_os=False,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ class AzureScanOptionsDataAttributes(ModelNormal):
def openapi_types(_):
return {
"compliance_host": (bool,),
"function": (bool,),
"vuln_containers_os": (bool,),
"vuln_host_os": (bool,),
}

attribute_map = {
"compliance_host": "compliance_host",
"function": "function",
"vuln_containers_os": "vuln_containers_os",
"vuln_host_os": "vuln_host_os",
}

def __init__(
self_,
compliance_host: Union[bool, UnsetType] = unset,
function: Union[bool, UnsetType] = unset,
vuln_containers_os: Union[bool, UnsetType] = unset,
vuln_host_os: Union[bool, UnsetType] = unset,
**kwargs,
Expand All @@ -41,6 +44,9 @@ def __init__(
:param compliance_host: Indicates whether host compliance scanning is enabled.
:type compliance_host: bool, optional

:param function: Indicates if scanning of Azure Functions is enabled.
:type function: bool, optional

:param vuln_containers_os: Indicates if scanning for vulnerabilities in containers is enabled.
:type vuln_containers_os: bool, optional

Expand All @@ -49,6 +55,8 @@ def __init__(
"""
if compliance_host is not unset:
kwargs["compliance_host"] = compliance_host
if function is not unset:
kwargs["function"] = function
if vuln_containers_os is not unset:
kwargs["vuln_containers_os"] = vuln_containers_os
if vuln_host_os is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ class AzureScanOptionsInputUpdateDataAttributes(ModelNormal):
def openapi_types(_):
return {
"compliance_host": (bool,),
"function": (bool,),
"vuln_containers_os": (bool,),
"vuln_host_os": (bool,),
}

attribute_map = {
"compliance_host": "compliance_host",
"function": "function",
"vuln_containers_os": "vuln_containers_os",
"vuln_host_os": "vuln_host_os",
}

def __init__(
self_,
compliance_host: Union[bool, UnsetType] = unset,
function: Union[bool, UnsetType] = unset,
vuln_containers_os: Union[bool, UnsetType] = unset,
vuln_host_os: Union[bool, UnsetType] = unset,
**kwargs,
Expand All @@ -41,6 +44,9 @@ def __init__(
:param compliance_host: Indicates whether host compliance scanning is enabled.
:type compliance_host: bool, optional

:param function: Indicates if scanning of Azure Functions is enabled.
:type function: bool, optional

:param vuln_containers_os: Indicates if scanning for vulnerabilities in containers is enabled.
:type vuln_containers_os: bool, optional

Expand All @@ -49,6 +55,8 @@ def __init__(
"""
if compliance_host is not unset:
kwargs["compliance_host"] = compliance_host
if function is not unset:
kwargs["function"] = function
if vuln_containers_os is not unset:
kwargs["vuln_containers_os"] = vuln_containers_os
if vuln_host_os is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@ class GcpScanOptionsDataAttributes(ModelNormal):
@cached_property
def openapi_types(_):
return {
"cloud_function": (bool,),
"compliance_host": (bool,),
"vuln_containers_os": (bool,),
"vuln_host_os": (bool,),
}

attribute_map = {
"cloud_function": "cloud_function",
"compliance_host": "compliance_host",
"vuln_containers_os": "vuln_containers_os",
"vuln_host_os": "vuln_host_os",
}

def __init__(
self_,
cloud_function: Union[bool, UnsetType] = unset,
compliance_host: Union[bool, UnsetType] = unset,
vuln_containers_os: Union[bool, UnsetType] = unset,
vuln_host_os: Union[bool, UnsetType] = unset,
Expand All @@ -38,6 +41,9 @@ def __init__(
"""
Attributes for GCP scan options configuration.

:param cloud_function: Indicates if scanning of Cloud Functions is enabled.
:type cloud_function: bool, optional

:param compliance_host: Indicates whether host compliance scanning is enabled.
:type compliance_host: bool, optional

Expand All @@ -47,6 +53,8 @@ def __init__(
:param vuln_host_os: Indicates if scanning for vulnerabilities in hosts is enabled.
:type vuln_host_os: bool, optional
"""
if cloud_function is not unset:
kwargs["cloud_function"] = cloud_function
if compliance_host is not unset:
kwargs["compliance_host"] = compliance_host
if vuln_containers_os is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@ class GcpScanOptionsInputUpdateDataAttributes(ModelNormal):
@cached_property
def openapi_types(_):
return {
"cloud_function": (bool,),
"compliance_host": (bool,),
"vuln_containers_os": (bool,),
"vuln_host_os": (bool,),
}

attribute_map = {
"cloud_function": "cloud_function",
"compliance_host": "compliance_host",
"vuln_containers_os": "vuln_containers_os",
"vuln_host_os": "vuln_host_os",
}

def __init__(
self_,
cloud_function: Union[bool, UnsetType] = unset,
compliance_host: Union[bool, UnsetType] = unset,
vuln_containers_os: Union[bool, UnsetType] = unset,
vuln_host_os: Union[bool, UnsetType] = unset,
Expand All @@ -38,6 +41,9 @@ def __init__(
"""
Attributes for updating GCP scan options configuration.

:param cloud_function: Indicates if scanning of Cloud Functions is enabled.
:type cloud_function: bool, optional

:param compliance_host: Indicates whether host compliance scanning is enabled.
:type compliance_host: bool, optional

Expand All @@ -47,6 +53,8 @@ def __init__(
:param vuln_host_os: Indicates if scanning for vulnerabilities in hosts is enabled.
:type vuln_host_os: bool, optional
"""
if cloud_function is not unset:
kwargs["cloud_function"] = cloud_function
if compliance_host is not unset:
kwargs["compliance_host"] = compliance_host
if vuln_containers_os is not unset:
Expand Down
9 changes: 6 additions & 3 deletions tests/v2/features/agentless_scanning.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,18 @@ Feature: Agentless Scanning
@skip-validation @team:DataDog/k9-agentless
Scenario: Create Azure scan options returns "Created" response
Given new "CreateAzureScanOptions" request
And body with value {"data": {"attributes": {"vuln_containers_os": true, "vuln_host_os": true}, "id": "12345678-90ab-cdef-1234-567890abcdef", "type": "azure_scan_options"}}
And body with value {"data": {"attributes": {"function": true, "vuln_containers_os": true, "vuln_host_os": true}, "id": "12345678-90ab-cdef-1234-567890abcdef", "type": "azure_scan_options"}}
When the request is sent
Then the response status is 201 Created
And the response "data.attributes.function" is equal to true

@team:DataDog/k9-agentless
Scenario: Create GCP scan options returns "Agentless scan options enabled successfully." response
Given new "CreateGcpScanOptions" request
And body with value {"data": {"id": "new-project", "type": "gcp_scan_options", "attributes": {"vuln_host_os": true, "vuln_containers_os": true}}}
And body with value {"data": {"id": "new-project", "type": "gcp_scan_options", "attributes": {"cloud_function": true, "vuln_host_os": true, "vuln_containers_os": true}}}
When the request is sent
Then the response status is 201 Created
And the response "data.attributes.cloud_function" is equal to true

@team:DataDog/k9-agentless
Scenario: Create GCP scan options returns "Bad Request" response
Expand Down Expand Up @@ -301,9 +303,10 @@ Feature: Agentless Scanning
Scenario: Update GCP scan options returns "OK" response
Given new "UpdateGcpScanOptions" request
And request contains "project_id" parameter with value "api-spec-test"
And body with value {"data": {"id": "api-spec-test", "type": "gcp_scan_options", "attributes": {"vuln_containers_os": false}}}
And body with value {"data": {"id": "api-spec-test", "type": "gcp_scan_options", "attributes": {"cloud_function": true, "vuln_containers_os": false}}}
When the request is sent
Then the response status is 200 OK
And the response "data.id" is equal to "api-spec-test"
And the response "data.attributes.vuln_host_os" is equal to true
And the response "data.attributes.vuln_containers_os" is equal to false
And the response "data.attributes.cloud_function" is equal to true
Loading