diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 81f698c5f321..fb313bb7bf43 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7232,6 +7232,9 @@ components: description: The identifier of the user or system that created the rule. Server-assigned by the rulesets endpoints; ignored by this operation. readOnly: true type: string + creation_message: + description: The message associated with the custom rule revision. Forwarded from the custom rulesets endpoints; ignored by this operation. + type: string cve: description: The CVE identifier associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation. type: string @@ -7289,6 +7292,11 @@ components: should_use_ai_fix: description: Whether an AI-generated fix should be offered. Forwarded from the rulesets endpoints; ignored by this operation. type: boolean + tags: + description: Tags associated with the custom rule revision. Forwarded from the custom rulesets endpoints; ignored by this operation. + items: + type: string + type: array tests: description: The test cases associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation. items: @@ -7302,6 +7310,10 @@ components: description: The rule type indicating the detection mechanism (for example, `TREE_SITTER_QUERY`). example: TREE_SITTER_QUERY type: string + version_id: + description: The custom rule revision version. Forwarded from the custom rulesets endpoints; ignored by this operation. + format: int64 + type: integer required: - id - category @@ -29696,13 +29708,14 @@ components: - PERFORMANCE CustomRuleRevisionAttributesSeverity: description: Rule severity - enum: [ERROR, WARNING, NOTICE] + enum: [ERROR, WARNING, NOTICE, NONE] example: ERROR type: string x-enum-varnames: - ERROR - WARNING - NOTICE + - NONE CustomRuleRevisionDataType: description: Resource type enum: [custom_rule_revision] @@ -65192,6 +65205,18 @@ components: - PHP - KOTLIN - SWIFT + - DART + - DOCKERFILE + - ELIXIR + - JSON + - RUST + - TERRAFORM + - STARLARK + - BASH + - MARKDOWN + - APEX + - R + - SQL example: PYTHON type: string x-enum-varnames: @@ -65206,6 +65231,18 @@ components: - PHP - KOTLIN - SWIFT + - DART + - DOCKERFILE + - ELIXIR + - JSON + - RUST + - TERRAFORM + - STARLARK + - BASH + - MARKDOWN + - APEX + - R + - SQL LatestVersionMatchPolicy: description: The policy for matching the latest form version during an upsert operation. enum: diff --git a/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.ts b/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.ts index 209dc98b5d4a..96495b56ee06 100644 --- a/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.ts +++ b/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.ts @@ -30,6 +30,7 @@ const params: v2.SecurityMonitoringApiCreateStaticAnalysisServerAnalysisRequest name: "no-exit", regex: undefined, severity: "WARNING", + tags: [], tests: [{}], treeSitterQuery: "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", type: "TREE_SITTER_QUERY", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index a72d703edd34..b625aec224da 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -56,7 +56,7 @@ Feature: Security Monitoring Scenario: Analyze code returns "Bad Request" response Given operation "CreateStaticAnalysisServerAnalysis" enabled And new "CreateStaticAnalysisServerAnalysis" request - And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"arguments": [{}], "category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "name": "no-exit", "regex": null, "severity": "WARNING", "tests": [{}], "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} + And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"arguments": [{}], "category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "name": "no-exit", "regex": null, "severity": "WARNING", "tags": [], "tests": [{}], "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} When the request is sent Then the response status is 400 Bad Request @@ -64,7 +64,7 @@ Feature: Security Monitoring Scenario: Analyze code returns "OK" response Given operation "CreateStaticAnalysisServerAnalysis" enabled And new "CreateStaticAnalysisServerAnalysis" request - And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"arguments": [{}], "category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "name": "no-exit", "regex": null, "severity": "WARNING", "tests": [{}], "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} + And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"arguments": [{}], "category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "name": "no-exit", "regex": null, "severity": "WARNING", "tags": [], "tests": [{}], "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} When the request is sent Then the response status is 200 OK diff --git a/packages/datadog-api-client-v2/models/AnalysisRequestRule.ts b/packages/datadog-api-client-v2/models/AnalysisRequestRule.ts index 4d2d22421c88..dc143cd0d485 100644 --- a/packages/datadog-api-client-v2/models/AnalysisRequestRule.ts +++ b/packages/datadog-api-client-v2/models/AnalysisRequestRule.ts @@ -42,6 +42,10 @@ export class AnalysisRequestRule { * The identifier of the user or system that created the rule. Server-assigned by the rulesets endpoints; ignored by this operation. */ "createdBy"?: string; + /** + * The message associated with the custom rule revision. Forwarded from the custom rulesets endpoints; ignored by this operation. + */ + "creationMessage"?: string; /** * The CVE identifier associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation. */ @@ -106,6 +110,10 @@ export class AnalysisRequestRule { * Whether an AI-generated fix should be offered. Forwarded from the rulesets endpoints; ignored by this operation. */ "shouldUseAiFix"?: boolean; + /** + * Tags associated with the custom rule revision. Forwarded from the custom rulesets endpoints; ignored by this operation. + */ + "tags"?: Array; /** * The test cases associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation. */ @@ -118,6 +126,10 @@ export class AnalysisRequestRule { * The rule type indicating the detection mechanism (for example, `TREE_SITTER_QUERY`). */ "type": string; + /** + * The custom rule revision version. Forwarded from the custom rulesets endpoints; ignored by this operation. + */ + "versionId"?: number; /** * A container for additional, undeclared properties. @@ -163,6 +175,10 @@ export class AnalysisRequestRule { baseName: "created_by", type: "string", }, + creationMessage: { + baseName: "creation_message", + type: "string", + }, cve: { baseName: "cve", type: "string", @@ -231,6 +247,10 @@ export class AnalysisRequestRule { baseName: "should_use_ai_fix", type: "boolean", }, + tags: { + baseName: "tags", + type: "Array", + }, tests: { baseName: "tests", type: "Array", @@ -245,6 +265,11 @@ export class AnalysisRequestRule { type: "string", required: true, }, + versionId: { + baseName: "version_id", + type: "number", + format: "int64", + }, additionalProperties: { baseName: "additionalProperties", type: "{ [key: string]: any; }", diff --git a/packages/datadog-api-client-v2/models/CustomRuleRevisionAttributesSeverity.ts b/packages/datadog-api-client-v2/models/CustomRuleRevisionAttributesSeverity.ts index e81a752df522..65543d172ec6 100644 --- a/packages/datadog-api-client-v2/models/CustomRuleRevisionAttributesSeverity.ts +++ b/packages/datadog-api-client-v2/models/CustomRuleRevisionAttributesSeverity.ts @@ -14,7 +14,9 @@ export type CustomRuleRevisionAttributesSeverity = | typeof ERROR | typeof WARNING | typeof NOTICE + | typeof NONE | UnparsedObject; export const ERROR = "ERROR"; export const WARNING = "WARNING"; export const NOTICE = "NOTICE"; +export const NONE = "NONE"; diff --git a/packages/datadog-api-client-v2/models/Language.ts b/packages/datadog-api-client-v2/models/Language.ts index bcc2fa52b171..631d6597d2a9 100644 --- a/packages/datadog-api-client-v2/models/Language.ts +++ b/packages/datadog-api-client-v2/models/Language.ts @@ -22,6 +22,18 @@ export type Language = | typeof PHP | typeof KOTLIN | typeof SWIFT + | typeof DART + | typeof DOCKERFILE + | typeof ELIXIR + | typeof JSON + | typeof RUST + | typeof TERRAFORM + | typeof STARLARK + | typeof BASH + | typeof MARKDOWN + | typeof APEX + | typeof R + | typeof SQL | UnparsedObject; export const PYTHON = "PYTHON"; export const JAVASCRIPT = "JAVASCRIPT"; @@ -34,3 +46,15 @@ export const CSHARP = "CSHARP"; export const PHP = "PHP"; export const KOTLIN = "KOTLIN"; export const SWIFT = "SWIFT"; +export const DART = "DART"; +export const DOCKERFILE = "DOCKERFILE"; +export const ELIXIR = "ELIXIR"; +export const JSON = "JSON"; +export const RUST = "RUST"; +export const TERRAFORM = "TERRAFORM"; +export const STARLARK = "STARLARK"; +export const BASH = "BASH"; +export const MARKDOWN = "MARKDOWN"; +export const APEX = "APEX"; +export const R = "R"; +export const SQL = "SQL"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index d1ea28c8af37..64bd354b514f 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -6827,7 +6827,7 @@ const enumsMap: { [key: string]: any[] } = { "ERROR_PRONE", "PERFORMANCE", ], - CustomRuleRevisionAttributesSeverity: ["ERROR", "WARNING", "NOTICE"], + CustomRuleRevisionAttributesSeverity: ["ERROR", "WARNING", "NOTICE", "NONE"], CustomRuleRevisionDataType: ["custom_rule_revision"], CustomRulesetDataType: ["custom_ruleset"], CustomerOrgDisableResponseType: ["org_disable"], @@ -7525,6 +7525,18 @@ const enumsMap: { [key: string]: any[] } = { "PHP", "KOTLIN", "SWIFT", + "DART", + "DOCKERFILE", + "ELIXIR", + "JSON", + "RUST", + "TERRAFORM", + "STARLARK", + "BASH", + "MARKDOWN", + "APEX", + "R", + "SQL", ], LatestVersionMatchPolicy: ["none", "if_etag_match"], LaunchDarklyAPIKeyType: ["LaunchDarklyAPIKey"],