Skip to content
Merged
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
12 changes: 12 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86566,6 +86566,10 @@ components:
type: integer
creator:
$ref: "#/components/schemas/SecurityMonitoringUser"
description:
description: A description of the critical asset.
example: Production database servers handling PII
type: string
enabled:
description: Whether the critical asset is enabled.
example: true
Expand Down Expand Up @@ -86610,6 +86614,10 @@ components:
SecurityMonitoringCriticalAssetCreateAttributes:
description: Object containing the attributes of the critical asset to be created.
properties:
description:
description: A description of the critical asset.
example: Production database servers handling PII
type: string
enabled:
default: true
description: Whether the critical asset is enabled. Defaults to `true` if not specified.
Expand Down Expand Up @@ -86702,6 +86710,10 @@ components:
SecurityMonitoringCriticalAssetUpdateAttributes:
description: The critical asset properties to be updated.
properties:
description:
description: A description of the critical asset.
example: Production database servers handling PII
type: string
enabled:
description: Whether the critical asset is enabled.
example: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def openapi_types(_):
"creation_author_id": (int,),
"creation_date": (int,),
"creator": (SecurityMonitoringUser,),
"description": (str,),
"enabled": (bool,),
"query": (str,),
"rule_query": (str,),
Expand All @@ -53,6 +54,7 @@ def openapi_types(_):
"creation_author_id": "creation_author_id",
"creation_date": "creation_date",
"creator": "creator",
"description": "description",
"enabled": "enabled",
"query": "query",
"rule_query": "rule_query",
Expand All @@ -69,6 +71,7 @@ def __init__(
creation_author_id: Union[int, UnsetType] = unset,
creation_date: Union[int, UnsetType] = unset,
creator: Union[SecurityMonitoringUser, UnsetType] = unset,
description: Union[str, UnsetType] = unset,
enabled: Union[bool, UnsetType] = unset,
query: Union[str, UnsetType] = unset,
rule_query: Union[str, UnsetType] = unset,
Expand All @@ -92,6 +95,9 @@ def __init__(
:param creator: A user.
:type creator: SecurityMonitoringUser, optional

:param description: A description of the critical asset.
:type description: str, optional

:param enabled: Whether the critical asset is enabled.
:type enabled: bool, optional

Expand Down Expand Up @@ -125,6 +131,8 @@ def __init__(
kwargs["creation_date"] = creation_date
if creator is not unset:
kwargs["creator"] = creator
if description is not unset:
kwargs["description"] = description
if enabled is not unset:
kwargs["enabled"] = enabled
if query is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def openapi_types(_):
)

return {
"description": (str,),
"enabled": (bool,),
"query": (str,),
"rule_query": (str,),
Expand All @@ -35,6 +36,7 @@ def openapi_types(_):
}

attribute_map = {
"description": "description",
"enabled": "enabled",
"query": "query",
"rule_query": "rule_query",
Expand All @@ -47,13 +49,17 @@ def __init__(
query: str,
rule_query: str,
severity: SecurityMonitoringCriticalAssetSeverity,
description: Union[str, UnsetType] = unset,
enabled: Union[bool, UnsetType] = unset,
tags: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
Object containing the attributes of the critical asset to be created.

:param description: A description of the critical asset.
:type description: str, optional

:param enabled: Whether the critical asset is enabled. Defaults to ``true`` if not specified.
:type enabled: bool, optional

Expand All @@ -69,6 +75,8 @@ def __init__(
:param tags: List of tags associated with the critical asset.
:type tags: [str], optional
"""
if description is not unset:
kwargs["description"] = description
if enabled is not unset:
kwargs["enabled"] = enabled
if tags is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def openapi_types(_):
)

return {
"description": (str,),
"enabled": (bool,),
"query": (str,),
"rule_query": (str,),
Expand All @@ -42,6 +43,7 @@ def openapi_types(_):
}

attribute_map = {
"description": "description",
"enabled": "enabled",
"query": "query",
"rule_query": "rule_query",
Expand All @@ -52,6 +54,7 @@ def openapi_types(_):

def __init__(
self_,
description: Union[str, UnsetType] = unset,
enabled: Union[bool, UnsetType] = unset,
query: Union[str, UnsetType] = unset,
rule_query: Union[str, UnsetType] = unset,
Expand All @@ -63,6 +66,9 @@ def __init__(
"""
The critical asset properties to be updated.

:param description: A description of the critical asset.
:type description: str, optional

:param enabled: Whether the critical asset is enabled.
:type enabled: bool, optional

Expand All @@ -81,6 +87,8 @@ def __init__(
:param version: The version of the critical asset being updated. Used for optimistic locking to prevent concurrent modifications.
:type version: int, optional
"""
if description is not unset:
kwargs["description"] = description
if enabled is not unset:
kwargs["enabled"] = enabled
if query is not unset:
Expand Down
4 changes: 2 additions & 2 deletions tests/v2/features/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ Feature: Security Monitoring
@generated @skip @team:DataDog/k9-cloud-siem
Scenario: Create a critical asset returns "Conflict" response
Given new "CreateSecurityMonitoringCriticalAsset" request
And body with value {"data": {"attributes": {"enabled": true, "query": "security:monitoring", "rule_query": "type:(log_detection OR signal_correlation OR workload_security OR application_security) source:cloudtrail", "severity": "increase", "tags": ["team:database", "source:cloudtrail"]}, "type": "critical_assets"}}
And body with value {"data": {"attributes": {"description": "Production database servers handling PII", "enabled": true, "query": "security:monitoring", "rule_query": "type:(log_detection OR signal_correlation OR workload_security OR application_security) source:cloudtrail", "severity": "increase", "tags": ["team:database", "source:cloudtrail"]}, "type": "critical_assets"}}
When the request is sent
Then the response status is 409 Conflict

Expand Down Expand Up @@ -3089,7 +3089,7 @@ Feature: Security Monitoring
Scenario: Update a critical asset returns "Concurrent Modification" response
Given new "UpdateSecurityMonitoringCriticalAsset" request
And request contains "critical_asset_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"enabled": true, "query": "security:monitoring", "rule_query": "type:log_detection source:cloudtrail", "severity": "increase", "tags": ["technique:T1110-brute-force", "source:cloudtrail"], "version": 1}, "type": "critical_assets"}}
And body with value {"data": {"attributes": {"description": "Production database servers handling PII", "enabled": true, "query": "security:monitoring", "rule_query": "type:log_detection source:cloudtrail", "severity": "increase", "tags": ["technique:T1110-brute-force", "source:cloudtrail"], "version": 1}, "type": "critical_assets"}}
When the request is sent
Then the response status is 409 Concurrent Modification

Expand Down
Loading