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/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/services/security_monitoring/src/v2/models/AnalysisRequestRule.ts b/services/security_monitoring/src/v2/models/AnalysisRequestRule.ts index 9800a4313be7..ee8f356b1bde 100644 --- a/services/security_monitoring/src/v2/models/AnalysisRequestRule.ts +++ b/services/security_monitoring/src/v2/models/AnalysisRequestRule.ts @@ -37,6 +37,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. */ @@ -101,6 +105,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. */ @@ -113,6 +121,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. * This is a holder for any undeclared properties as specified with @@ -156,6 +168,10 @@ export class AnalysisRequestRule { baseName: "created_by", type: "string", }, + creationMessage: { + baseName: "creation_message", + type: "string", + }, cve: { baseName: "cve", type: "string", @@ -224,6 +240,10 @@ export class AnalysisRequestRule { baseName: "should_use_ai_fix", type: "boolean", }, + tags: { + baseName: "tags", + type: "Array", + }, tests: { baseName: "tests", type: "Array", @@ -238,6 +258,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/services/static_analysis/src/v2/models/CustomRuleRevisionAttributesSeverity.ts b/services/static_analysis/src/v2/models/CustomRuleRevisionAttributesSeverity.ts index 873ace8ca953..0a971657bf33 100644 --- a/services/static_analysis/src/v2/models/CustomRuleRevisionAttributesSeverity.ts +++ b/services/static_analysis/src/v2/models/CustomRuleRevisionAttributesSeverity.ts @@ -7,7 +7,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/services/static_analysis/src/v2/models/Language.ts b/services/static_analysis/src/v2/models/Language.ts index 5a590d4fc46f..28eff70ab948 100644 --- a/services/static_analysis/src/v2/models/Language.ts +++ b/services/static_analysis/src/v2/models/Language.ts @@ -15,6 +15,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"; @@ -27,3 +39,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/services/static_analysis/src/v2/models/TypingInfo.ts b/services/static_analysis/src/v2/models/TypingInfo.ts index 982ca125a853..a24f11f39f61 100644 --- a/services/static_analysis/src/v2/models/TypingInfo.ts +++ b/services/static_analysis/src/v2/models/TypingInfo.ts @@ -122,7 +122,12 @@ export const TypingInfo: ModelTypingInfo = { "ERROR_PRONE", "PERFORMANCE", ], - CustomRuleRevisionAttributesSeverity: ["ERROR", "WARNING", "NOTICE"], + CustomRuleRevisionAttributesSeverity: [ + "ERROR", + "WARNING", + "NOTICE", + "NONE", + ], CustomRuleRevisionDataType: ["custom_rule_revision"], CustomRulesetDataType: ["custom_ruleset"], Language: [ @@ -137,6 +142,18 @@ export const TypingInfo: ModelTypingInfo = { "PHP", "KOTLIN", "SWIFT", + "DART", + "DOCKERFILE", + "ELIXIR", + "JSON", + "RUST", + "TERRAFORM", + "STARLARK", + "BASH", + "MARKDOWN", + "APEX", + "R", + "SQL", ], LicensesListResponseDataType: ["licenserequest"], McpScanRequestDataType: ["mcpscanrequest"],