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
39 changes: 38 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const params: v2.SecurityMonitoringApiCreateStaticAnalysisServerAnalysisRequest
name: "no-exit",
regex: undefined,
severity: "WARNING",
tags: [],
tests: [{}],
treeSitterQuery: "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==",
type: "TREE_SITTER_QUERY",
Expand Down
4 changes: 2 additions & 2 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ 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

@generated @skip @team:DataDog/k9-vm-ast
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

Expand Down
25 changes: 25 additions & 0 deletions packages/datadog-api-client-v2/models/AnalysisRequestRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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<string>;
/**
* The test cases associated with the rule. Forwarded from the rulesets endpoints; ignored by this operation.
*/
Expand All @@ -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.
Expand Down Expand Up @@ -163,6 +175,10 @@ export class AnalysisRequestRule {
baseName: "created_by",
type: "string",
},
creationMessage: {
baseName: "creation_message",
type: "string",
},
cve: {
baseName: "cve",
type: "string",
Expand Down Expand Up @@ -231,6 +247,10 @@ export class AnalysisRequestRule {
baseName: "should_use_ai_fix",
type: "boolean",
},
tags: {
baseName: "tags",
type: "Array<string>",
},
tests: {
baseName: "tests",
type: "Array<AnalysisRequestRuleTest>",
Expand All @@ -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; }",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
24 changes: 24 additions & 0 deletions packages/datadog-api-client-v2/models/Language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
14 changes: 13 additions & 1 deletion packages/datadog-api-client-v2/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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"],
Expand Down
Loading