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
2 changes: 1 addition & 1 deletion features/v2/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
1 change: 1 addition & 0 deletions services/sensitive_data_scanner/src/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ export { SensitiveDataScannerStandardPatternData } from "./models/SensitiveDataS
export { SensitiveDataScannerStandardPatternsResponseData } from "./models/SensitiveDataScannerStandardPatternsResponseData";
export { SensitiveDataScannerStandardPatternsResponseItem } from "./models/SensitiveDataScannerStandardPatternsResponseItem";
export { SensitiveDataScannerStandardPatternType } from "./models/SensitiveDataScannerStandardPatternType";
export { SensitiveDataScannerSuppressions } from "./models/SensitiveDataScannerSuppressions";
export { SensitiveDataScannerTextReplacement } from "./models/SensitiveDataScannerTextReplacement";
export { SensitiveDataScannerTextReplacementType } from "./models/SensitiveDataScannerTextReplacementType";
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AttributeTypeMap } from "@datadog/datadog-api-client";

import { SensitiveDataScannerIncludedKeywordConfiguration } from "./SensitiveDataScannerIncludedKeywordConfiguration";
import { SensitiveDataScannerSuppressions } from "./SensitiveDataScannerSuppressions";
import { SensitiveDataScannerTextReplacement } from "./SensitiveDataScannerTextReplacement";

/**
Expand Down Expand Up @@ -43,6 +44,11 @@ export class SensitiveDataScannerRuleAttributes {
* Integer from 1 (high) to 5 (low) indicating rule issue severity.
*/
"priority"?: number;
/**
* 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.
*/
"suppressions"?: SensitiveDataScannerSuppressions;
/**
* List of tags.
*/
Expand Down Expand Up @@ -99,6 +105,10 @@ export class SensitiveDataScannerRuleAttributes {
type: "number",
format: "int64",
},
suppressions: {
baseName: "suppressions",
type: "SensitiveDataScannerSuppressions",
},
tags: {
baseName: "tags",
type: "Array<string>",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { AttributeTypeMap } from "@datadog/datadog-api-client";

/**
* 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.
*/
export class SensitiveDataScannerSuppressions {
/**
* List of strings to use for suppression of matches ending with these strings.
*/
"endsWith"?: Array<string>;
/**
* List of strings to use for suppression of matches exactly matching these strings.
*/
"exactMatch"?: Array<string>;
/**
* List of strings to use for suppression of matches starting with these strings.
*/
"startsWith"?: Array<string>;
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
"additionalProperties"?: { [key: string]: any };
/**
* @ignore
*/
"_unparsed"?: boolean;

/**
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
endsWith: {
baseName: "ends_with",
type: "Array<string>",
},
exactMatch: {
baseName: "exact_match",
type: "Array<string>",
},
startsWith: {
baseName: "starts_with",
type: "Array<string>",
},
additionalProperties: {
baseName: "additionalProperties",
type: "{ [key: string]: any; }",
},
};

/**
* @ignore
*/
static getAttributeTypeMap(): AttributeTypeMap {
return SensitiveDataScannerSuppressions.attributeTypeMap;
}

public constructor() {}
}
2 changes: 2 additions & 0 deletions services/sensitive_data_scanner/src/v2/models/TypingInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { SensitiveDataScannerStandardPatternAttributes } from "./SensitiveDataSc
import { SensitiveDataScannerStandardPatternData } from "./SensitiveDataScannerStandardPatternData";
import { SensitiveDataScannerStandardPatternsResponseData } from "./SensitiveDataScannerStandardPatternsResponseData";
import { SensitiveDataScannerStandardPatternsResponseItem } from "./SensitiveDataScannerStandardPatternsResponseItem";
import { SensitiveDataScannerSuppressions } from "./SensitiveDataScannerSuppressions";
import { SensitiveDataScannerTextReplacement } from "./SensitiveDataScannerTextReplacement";

export const TypingInfo: ModelTypingInfo = {
Expand Down Expand Up @@ -151,6 +152,7 @@ export const TypingInfo: ModelTypingInfo = {
SensitiveDataScannerStandardPatternsResponseData,
SensitiveDataScannerStandardPatternsResponseItem:
SensitiveDataScannerStandardPatternsResponseItem,
SensitiveDataScannerSuppressions: SensitiveDataScannerSuppressions,
SensitiveDataScannerTextReplacement: SensitiveDataScannerTextReplacement,
},
};
Loading