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
11 changes: 10 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118689,6 +118689,8 @@ components:
maximum: 5
minimum: 1
type: integer
suppressions:
$ref: "#/components/schemas/SensitiveDataScannerSuppressions"
tags:
description: List of tags.
items:
Expand Down Expand Up @@ -118735,7 +118737,9 @@ components:
type: object
SensitiveDataScannerSuppressions:
description: |-
Object describing the suppressions for a rule. There are three types of suppressions, `starts_with`, `ends_with`, and `exact_match`.
Object describing suppressions for a rule, or the recommended suppression lists published by a standard pattern.
There are three types of suppressions, `starts_with`, `ends_with`, and `exact_match`.
Rules based on the Datadog library can use recommended or custom suppressions. Custom rules can only use custom suppressions.
Suppressed matches are not obfuscated, counted in metrics, or displayed in the Findings page.
properties:
ends_with:
Expand All @@ -118759,6 +118763,11 @@ components:
description: A string prefix; matches starting with this value are suppressed.
type: string
type: array
use_recommended_suppressions:
description: |-
Should the rule use the underlying standard pattern suppression configuration. If set to `true`, the rule must be tied
to a standard pattern. If set to `false`, the specified suppressions are applied.
type: boolean
type: object
SensitiveDataScannerTextReplacement:
description: Object describing how the scanned event will be replaced.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ 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``.
:param suppressions: Object describing suppressions for a rule, or the recommended suppression lists published by a standard pattern.
There are three types of suppressions, ``starts_with`` , ``ends_with`` , and ``exact_match``.
Rules based on the Datadog library can use recommended or custom suppressions. Custom rules can only use custom suppressions.
Suppressed matches are not obfuscated, counted in metrics, or displayed in the Findings page.
:type suppressions: SensitiveDataScannerSuppressions, optional

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union
from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -13,6 +13,10 @@
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.sensitive_data_scanner_suppressions import SensitiveDataScannerSuppressions


class SensitiveDataScannerStandardPatternAttributes(ModelNormal):
validations = {
"priority": {
Expand All @@ -23,12 +27,15 @@ class SensitiveDataScannerStandardPatternAttributes(ModelNormal):

@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.sensitive_data_scanner_suppressions import SensitiveDataScannerSuppressions

return {
"description": (str,),
"included_keywords": ([str],),
"name": (str,),
"pattern": (str,),
"priority": (int,),
"suppressions": (SensitiveDataScannerSuppressions,),
"tags": ([str],),
}

Expand All @@ -38,6 +45,7 @@ def openapi_types(_):
"name": "name",
"pattern": "pattern",
"priority": "priority",
"suppressions": "suppressions",
"tags": "tags",
}

Expand All @@ -48,6 +56,7 @@ def __init__(
name: Union[str, UnsetType] = unset,
pattern: Union[str, UnsetType] = unset,
priority: Union[int, UnsetType] = unset,
suppressions: Union[SensitiveDataScannerSuppressions, UnsetType] = unset,
tags: Union[List[str], UnsetType] = unset,
**kwargs,
):
Expand All @@ -69,6 +78,12 @@ def __init__(
:param priority: Integer from 1 (high) to 5 (low) indicating standard pattern issue severity.
:type priority: int, optional

:param suppressions: Object describing suppressions for a rule, or the recommended suppression lists published by a standard pattern.
There are three types of suppressions, ``starts_with`` , ``ends_with`` , and ``exact_match``.
Rules based on the Datadog library can use recommended or custom suppressions. Custom rules can only use custom suppressions.
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 @@ -82,6 +97,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
super().__init__(kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,28 @@ def openapi_types(_):
"ends_with": ([str],),
"exact_match": ([str],),
"starts_with": ([str],),
"use_recommended_suppressions": (bool,),
}

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

def __init__(
self_,
ends_with: Union[List[str], UnsetType] = unset,
exact_match: Union[List[str], UnsetType] = unset,
starts_with: Union[List[str], UnsetType] = unset,
use_recommended_suppressions: Union[bool, UnsetType] = unset,
**kwargs,
):
"""
Object describing the suppressions for a rule. There are three types of suppressions, ``starts_with`` , ``ends_with`` , and ``exact_match``.
Object describing suppressions for a rule, or the recommended suppression lists published by a standard pattern.
There are three types of suppressions, ``starts_with`` , ``ends_with`` , and ``exact_match``.
Rules based on the Datadog library can use recommended or custom suppressions. Custom rules can only use custom suppressions.
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.
Expand All @@ -47,11 +52,17 @@ def __init__(

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

:param use_recommended_suppressions: Should the rule use the underlying standard pattern suppression configuration. If set to ``true`` , the rule must be tied
to a standard pattern. If set to ``false`` , the specified suppressions are applied.
:type use_recommended_suppressions: bool, 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
if use_recommended_suppressions is not unset:
kwargs["use_recommended_suppressions"] = use_recommended_suppressions
super().__init__(kwargs)
1 change: 1 addition & 0 deletions tests/v2/features/sensitive_data_scanner.feature
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Feature: Sensitive Data Scanner
Given new "ListStandardPatterns" request
When the request is sent
Then the response status is 200 OK
And the response "data[0].attributes" has field "suppressions"

@team:ddoghq/sensitive-data-scanner
Scenario: Reorder Groups returns "Bad Request" response
Expand Down
Loading