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
28 changes: 28 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50351,6 +50351,8 @@ components:
maximum: 5
minimum: 1
type: integer
suppressions:
$ref: '#/components/schemas/SensitiveDataScannerSuppressions'
tags:
description: List of tags.
items:
Expand Down Expand Up @@ -50572,6 +50574,32 @@ components:
type:
$ref: '#/components/schemas/SensitiveDataScannerStandardPatternType'
type: object
SensitiveDataScannerSuppressions:
description: 'Object describing the suppressions for a rule. There are three
types of suppressions, `starts_with`, `ends_with`, and `exact_match`.

Suppressed matches are not obfuscated, counted in metrics, or displayed in
the Findings page.'
properties:
ends_with:
description: List of strings to use for suppression of matches ending with
these strings.
items:
type: string
type: array
exact_match:
description: List of strings to use for suppression of matches exactly matching
these strings.
items:
type: string
type: array
starts_with:
description: List of strings to use for suppression of matches starting
with these strings.
items:
type: string
type: array
type: object
SensitiveDataScannerTextReplacement:
description: Object describing how the scanned event will be replaced.
properties:
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22299,6 +22299,13 @@ datadog\_api\_client.v2.model.sensitive\_data\_scanner\_standard\_patterns\_resp
:members:
:show-inheritance:

datadog\_api\_client.v2.model.sensitive\_data\_scanner\_suppressions module
---------------------------------------------------------------------------

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

datadog\_api\_client.v2.model.sensitive\_data\_scanner\_text\_replacement module
--------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from datadog_api_client.v2.model.sensitive_data_scanner_included_keyword_configuration import (
SensitiveDataScannerIncludedKeywordConfiguration,
)
from datadog_api_client.v2.model.sensitive_data_scanner_suppressions import SensitiveDataScannerSuppressions
from datadog_api_client.v2.model.sensitive_data_scanner_text_replacement import SensitiveDataScannerTextReplacement


Expand All @@ -33,6 +34,7 @@ def openapi_types(_):
from datadog_api_client.v2.model.sensitive_data_scanner_included_keyword_configuration import (
SensitiveDataScannerIncludedKeywordConfiguration,
)
from datadog_api_client.v2.model.sensitive_data_scanner_suppressions import SensitiveDataScannerSuppressions
from datadog_api_client.v2.model.sensitive_data_scanner_text_replacement import (
SensitiveDataScannerTextReplacement,
)
Expand All @@ -46,6 +48,7 @@ def openapi_types(_):
"namespaces": ([str],),
"pattern": (str,),
"priority": (int,),
"suppressions": (SensitiveDataScannerSuppressions,),
"tags": ([str],),
"text_replacement": (SensitiveDataScannerTextReplacement,),
}
Expand All @@ -59,6 +62,7 @@ def openapi_types(_):
"namespaces": "namespaces",
"pattern": "pattern",
"priority": "priority",
"suppressions": "suppressions",
"tags": "tags",
"text_replacement": "text_replacement",
}
Expand All @@ -73,6 +77,7 @@ def __init__(
namespaces: Union[List[str], UnsetType] = unset,
pattern: Union[str, UnsetType] = unset,
priority: Union[int, UnsetType] = unset,
suppressions: Union[SensitiveDataScannerSuppressions, UnsetType] = unset,
tags: Union[List[str], UnsetType] = unset,
text_replacement: Union[SensitiveDataScannerTextReplacement, UnsetType] = unset,
**kwargs,
Expand Down Expand Up @@ -108,6 +113,10 @@ def __init__(
:param priority: Integer from 1 (high) to 5 (low) indicating rule issue severity.
:type priority: int, optional

:param suppressions: Object describing the suppressions for a rule. There are three types of suppressions, ``starts_with`` , ``ends_with`` , and ``exact_match``.
Suppressed matches are not obfuscated, counted in metrics, or displayed in the Findings page.
:type suppressions: SensitiveDataScannerSuppressions, optional

:param tags: List of tags.
:type tags: [str], optional

Expand All @@ -130,6 +139,8 @@ def __init__(
kwargs["pattern"] = pattern
if priority is not unset:
kwargs["priority"] = priority
if suppressions is not unset:
kwargs["suppressions"] = suppressions
if tags is not unset:
kwargs["tags"] = tags
if text_replacement is not unset:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class SensitiveDataScannerSuppressions(ModelNormal):
@cached_property
def openapi_types(_):
return {
"ends_with": ([str],),
"exact_match": ([str],),
"starts_with": ([str],),
}

attribute_map = {
"ends_with": "ends_with",
"exact_match": "exact_match",
"starts_with": "starts_with",
}

def __init__(
self_,
ends_with: Union[List[str], UnsetType] = unset,
exact_match: Union[List[str], UnsetType] = unset,
starts_with: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
Object describing the suppressions for a rule. There are three types of suppressions, ``starts_with`` , ``ends_with`` , and ``exact_match``.
Suppressed matches are not obfuscated, counted in metrics, or displayed in the Findings page.

:param ends_with: List of strings to use for suppression of matches ending with these strings.
:type ends_with: [str], optional

:param exact_match: List of strings to use for suppression of matches exactly matching these strings.
:type exact_match: [str], optional

:param starts_with: List of strings to use for suppression of matches starting with these strings.
:type starts_with: [str], optional
"""
if ends_with is not unset:
kwargs["ends_with"] = ends_with
if exact_match is not unset:
kwargs["exact_match"] = exact_match
if starts_with is not unset:
kwargs["starts_with"] = starts_with
super().__init__(kwargs)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4506,6 +4506,7 @@
from datadog_api_client.v2.model.sensitive_data_scanner_standard_patterns_response_item import (
SensitiveDataScannerStandardPatternsResponseItem,
)
from datadog_api_client.v2.model.sensitive_data_scanner_suppressions import SensitiveDataScannerSuppressions
from datadog_api_client.v2.model.sensitive_data_scanner_text_replacement import SensitiveDataScannerTextReplacement
from datadog_api_client.v2.model.sensitive_data_scanner_text_replacement_type import (
SensitiveDataScannerTextReplacementType,
Expand Down Expand Up @@ -8364,6 +8365,7 @@
"SensitiveDataScannerStandardPatternsResponse",
"SensitiveDataScannerStandardPatternsResponseData",
"SensitiveDataScannerStandardPatternsResponseItem",
"SensitiveDataScannerSuppressions",
"SensitiveDataScannerTextReplacement",
"SensitiveDataScannerTextReplacementType",
"ServiceAccountCreateAttributes",
Expand Down
2 changes: 1 addition & 1 deletion tests/v2/features/sensitive_data_scanner.feature
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Feature: Sensitive Data Scanner
Scenario: Update Scanning Rule returns "Not Found" response
Given new "UpdateScanningRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"excluded_namespaces": ["admin.name"], "included_keyword_configuration": {"character_count": 30, "keywords": ["credit card", "cc"]}, "namespaces": ["admin"], "tags": [], "text_replacement": {"type": "none"}}, "relationships": {"group": {"data": {"type": "sensitive_data_scanner_group"}}, "standard_pattern": {"data": {"type": "sensitive_data_scanner_standard_pattern"}}}, "type": "sensitive_data_scanner_rule"}, "meta": {"version": 0}}
And body with value {"data": {"attributes": {"excluded_namespaces": ["admin.name"], "included_keyword_configuration": {"character_count": 30, "keywords": ["credit card", "cc"]}, "namespaces": ["admin"], "suppressions": {"ends_with": [], "exact_match": [], "starts_with": []}, "tags": [], "text_replacement": {"type": "none"}}, "relationships": {"group": {"data": {"type": "sensitive_data_scanner_group"}}, "standard_pattern": {"data": {"type": "sensitive_data_scanner_standard_pattern"}}}, "type": "sensitive_data_scanner_rule"}, "meta": {"version": 0}}
When the request is sent
Then the response status is 404 Not Found

Expand Down