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
388 changes: 388 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,41 @@ datadog\_api\_client.v2.model.application\_security\_policy\_update\_request mod
:members:
:show-inheritance:

datadog\_api\_client.v2.model.application\_security\_service\_attributes module
-------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.application_security_service_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.application\_security\_service\_resource module
-----------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.application_security_service_resource
:members:
:show-inheritance:

datadog\_api\_client.v2.model.application\_security\_service\_type module
-------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.application_security_service_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.application\_security\_services\_metadata module
------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.application_security_services_metadata
:members:
:show-inheritance:

datadog\_api\_client.v2.model.application\_security\_services\_response module
------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.application_security_services_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.application\_security\_waf\_custom\_rule\_action module
-------------------------------------------------------------------------------------

Expand Down
16 changes: 16 additions & 0 deletions examples/v2/application-security/GetAsmServiceByName.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
Get Application Security details for a service returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.application_security_api import ApplicationSecurityApi

configuration = Configuration()
configuration.unstable_operations["get_asm_service_by_name"] = True
with ApiClient(configuration) as api_client:
api_instance = ApplicationSecurityApi(api_client)
response = api_instance.get_asm_service_by_name(
service_filter="service_filter",
)

print(response)
1 change: 1 addition & 0 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ def __init__(
"v2.update_connection": False,
"v2.get_pruned_trace_by_id": False,
"v2.get_trace_by_id": False,
"v2.get_asm_service_by_name": False,
"v2.create_report_schedule": False,
"v2.patch_report_schedule": False,
"v2.delete_sourcemaps": False,
Expand Down
45 changes: 45 additions & 0 deletions src/datadog_api_client/v2/api/application_security_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from datadog_api_client.v2.model.application_security_policy_update_request import (
ApplicationSecurityPolicyUpdateRequest,
)
from datadog_api_client.v2.model.application_security_services_response import ApplicationSecurityServicesResponse


class ApplicationSecurityApi:
Expand Down Expand Up @@ -254,6 +255,29 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._get_asm_service_by_name_endpoint = _Endpoint(
settings={
"response_type": (ApplicationSecurityServicesResponse,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v2/security/asm/services/{service_filter}",
"operation_id": "get_asm_service_by_name",
"http_method": "GET",
"version": "v2",
},
params_map={
"service_filter": {
"required": True,
"openapi_types": (str,),
"attribute": "service_filter",
"location": "path",
},
},
headers_map={
"accept": ["application/json"],
},
api_client=api_client,
)

self._list_application_security_waf_custom_rules_endpoint = _Endpoint(
settings={
"response_type": (ApplicationSecurityWafCustomRuleListResponse,),
Expand Down Expand Up @@ -536,6 +560,27 @@ def get_application_security_waf_policy(

return self._get_application_security_waf_policy_endpoint.call_with_http_info(**kwargs)

def get_asm_service_by_name(
self,
service_filter: str,
) -> ApplicationSecurityServicesResponse:
"""Get Application Security details for a service.

Retrieve Application Security details for services matching the given name.
Returns Application Security activation, compatibility, and product enablement
information for each matching ``(service, environment)`` pair, along with a count
of services that have Application Security Management (Threats) enabled.

:param service_filter: The name of the service to retrieve Application Security details for.
Returns all matching services across environments.
:type service_filter: str
:rtype: ApplicationSecurityServicesResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["service_filter"] = service_filter

return self._get_asm_service_by_name_endpoint.call_with_http_info(**kwargs)

def list_application_security_waf_custom_rules(
self,
) -> ApplicationSecurityWafCustomRuleListResponse:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


class ApplicationSecurityServiceAttributes(ModelNormal):
@cached_property
def openapi_types(_):
return {
"agent_versions": ([str],),
"app_type": (str,),
"asm_threat_compatible": (bool,),
"backend_waf_event_count": (int,),
"business_logic": ([str],),
"color": (str,),
"env": (str,),
"event_count": (int,),
"event_trend": ([int],),
"has_appsec_enabled": (bool,),
"hits": (int,),
"iast_product_activation": (bool,),
"iast_product_compatibility": (str,),
"iast_product_compatibility_reasons": ([str],),
"languages": ([str],),
"last_ingested_spans": (int,),
"rc_capabilities": ([str],),
"recommended_business_logic": ([str],),
"risk_product_activation": (bool,),
"risk_product_compatibility": (str,),
"risk_product_compatibility_reasons": ([str],),
"rules_version": ([str],),
"service": (str,),
"signal_count": (int,),
"signal_trend": ([int],),
"source": ([str],),
"teams": ([str],),
"tracer_versions": ([str],),
"vm_activation": (str,),
"vuln_critical_count": (int,),
"vuln_high_count": (int,),
"without_filter_services": (int,),
}

attribute_map = {
"agent_versions": "agent_versions",
"app_type": "app_type",
"asm_threat_compatible": "asm_threat_compatible",
"backend_waf_event_count": "backend_waf_event_count",
"business_logic": "business_logic",
"color": "color",
"env": "env",
"event_count": "event_count",
"event_trend": "event_trend",
"has_appsec_enabled": "has_appsec_enabled",
"hits": "hits",
"iast_product_activation": "iast_product_activation",
"iast_product_compatibility": "iast_product_compatibility",
"iast_product_compatibility_reasons": "iast_product_compatibility_reasons",
"languages": "languages",
"last_ingested_spans": "last_ingested_spans",
"rc_capabilities": "rc_capabilities",
"recommended_business_logic": "recommended_business_logic",
"risk_product_activation": "risk_product_activation",
"risk_product_compatibility": "risk_product_compatibility",
"risk_product_compatibility_reasons": "risk_product_compatibility_reasons",
"rules_version": "rules_version",
"service": "service",
"signal_count": "signal_count",
"signal_trend": "signal_trend",
"source": "source",
"teams": "teams",
"tracer_versions": "tracer_versions",
"vm_activation": "vm-activation",
"vuln_critical_count": "vuln_critical_count",
"vuln_high_count": "vuln_high_count",
"without_filter_services": "without_filter_services",
}

def __init__(
self_,
agent_versions: List[str],
app_type: str,
asm_threat_compatible: bool,
backend_waf_event_count: int,
business_logic: List[str],
color: str,
env: str,
event_count: int,
event_trend: List[int],
has_appsec_enabled: bool,
hits: int,
iast_product_activation: bool,
iast_product_compatibility: str,
iast_product_compatibility_reasons: List[str],
languages: List[str],
last_ingested_spans: int,
rc_capabilities: List[str],
recommended_business_logic: List[str],
risk_product_activation: bool,
risk_product_compatibility: str,
risk_product_compatibility_reasons: List[str],
rules_version: List[str],
service: str,
signal_count: int,
signal_trend: List[int],
source: List[str],
teams: List[str],
tracer_versions: List[str],
vm_activation: str,
vuln_critical_count: int,
vuln_high_count: int,
without_filter_services: int,
**kwargs,
):
"""
Application Security details describing a service in a given environment.

:param agent_versions: The Datadog Agent versions reporting for the service.
:type agent_versions: [str]

:param app_type: The application type of the service, such as ``web`` or ``serverless``.
:type app_type: str

:param asm_threat_compatible: Whether the service is compatible with Application Security Management (Threats).
:type asm_threat_compatible: bool

:param backend_waf_event_count: The number of backend WAF events detected for the service.
:type backend_waf_event_count: int

:param business_logic: The enabled business logic detection rules for the service.
:type business_logic: [str]

:param color: Deprecated: a display color associated with the service in the UI. **Deprecated**.
:type color: str

:param env: The environment the service runs in.
:type env: str

:param event_count: The number of Application Security events detected for the service.
:type event_count: int

:param event_trend: Deprecated: the trend of Application Security events over time. **Deprecated**.
:type event_trend: [int]

:param has_appsec_enabled: Whether Application Security Management (Threats) is enabled for the service.
:type has_appsec_enabled: bool

:param hits: Deprecated: the number of hits for the service. **Deprecated**.
:type hits: int

:param iast_product_activation: Whether Interactive Application Security Testing (IAST) is enabled for the service.
:type iast_product_activation: bool

:param iast_product_compatibility: The Interactive Application Security Testing (IAST) compatibility status of the service.
:type iast_product_compatibility: str

:param iast_product_compatibility_reasons: The reasons explaining the Interactive Application Security Testing (IAST) compatibility status.
:type iast_product_compatibility_reasons: [str]

:param languages: The programming languages detected for the service.
:type languages: [str]

:param last_ingested_spans: The Unix timestamp, in seconds, of the last ingested span for the service.
:type last_ingested_spans: int

:param rc_capabilities: The Remote Configuration capabilities reported by the service.
:type rc_capabilities: [str]

:param recommended_business_logic: The recommended business logic detection rules for the service.
:type recommended_business_logic: [str]

:param risk_product_activation: Whether Software Composition Analysis (SCA) is enabled for the service.
:type risk_product_activation: bool

:param risk_product_compatibility: The Software Composition Analysis (SCA) compatibility status of the service.
:type risk_product_compatibility: str

:param risk_product_compatibility_reasons: The reasons explaining the Software Composition Analysis (SCA) compatibility status.
:type risk_product_compatibility_reasons: [str]

:param rules_version: The WAF rules versions applied to the service.
:type rules_version: [str]

:param service: The name of the service.
:type service: str

:param signal_count: Deprecated: the number of security signals for the service. **Deprecated**.
:type signal_count: int

:param signal_trend: Deprecated: the trend of security signals over time. **Deprecated**.
:type signal_trend: [int]

:param source: The data sources that contributed information about the service.
:type source: [str]

:param teams: The teams that own the service.
:type teams: [str]

:param tracer_versions: The Datadog tracing library versions reporting for the service.
:type tracer_versions: [str]

:param vm_activation: The Vulnerability Management activation status of the service.
:type vm_activation: str

:param vuln_critical_count: Deprecated: the number of critical-severity vulnerabilities for the service. **Deprecated**.
:type vuln_critical_count: int

:param vuln_high_count: Deprecated: the number of high-severity vulnerabilities for the service. **Deprecated**.
:type vuln_high_count: int

:param without_filter_services: The total number of services available without applying the service filter.
:type without_filter_services: int
"""
super().__init__(kwargs)

self_.agent_versions = agent_versions
self_.app_type = app_type
self_.asm_threat_compatible = asm_threat_compatible
self_.backend_waf_event_count = backend_waf_event_count
self_.business_logic = business_logic
self_.color = color
self_.env = env
self_.event_count = event_count
self_.event_trend = event_trend
self_.has_appsec_enabled = has_appsec_enabled
self_.hits = hits
self_.iast_product_activation = iast_product_activation
self_.iast_product_compatibility = iast_product_compatibility
self_.iast_product_compatibility_reasons = iast_product_compatibility_reasons
self_.languages = languages
self_.last_ingested_spans = last_ingested_spans
self_.rc_capabilities = rc_capabilities
self_.recommended_business_logic = recommended_business_logic
self_.risk_product_activation = risk_product_activation
self_.risk_product_compatibility = risk_product_compatibility
self_.risk_product_compatibility_reasons = risk_product_compatibility_reasons
self_.rules_version = rules_version
self_.service = service
self_.signal_count = signal_count
self_.signal_trend = signal_trend
self_.source = source
self_.teams = teams
self_.tracer_versions = tracer_versions
self_.vm_activation = vm_activation
self_.vuln_critical_count = vuln_critical_count
self_.vuln_high_count = vuln_high_count
self_.without_filter_services = without_filter_services
Loading
Loading