コピー
## default
#
# Path parameters export ruleset_name = "CHANGE_ME" export rule_name = "CHANGE_ME" # Curl command curl -X PUT "https://api.ap1.datadoghq.com "https://api.ap2.datadoghq.com "https://api.datadoghq.eu "https://api.ddog-gov.com "https://api.us2.ddog-gov.com "https://api.uk1.datadoghq.com "https://api.datadoghq.com "https://api.us3.datadoghq.com "https://api.us5.datadoghq.com /api/v2/static-analysis/custom/rulesets/${ruleset_name}/rules/${rule_name}/revisions " \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY} " \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY} " \
-d @- << EOF
{
"data": {
"attributes": {
"arguments": [
{
"description": "Maximum call depth to analyze",
"name": "max_depth"
}
],
"category": "SECURITY",
"code": "def rule(node): return node.type == 'call'",
"creation_message": "Initial revision",
"cve": "CVE-2024-1234",
"cwe": "CWE-79",
"description": "Detects insecure coding patterns that may lead to vulnerabilities",
"documentation_url": "https://docs.example.com/rules/my-rule",
"is_published": false,
"is_testing": false,
"language": "PYTHON",
"severity": "ERROR",
"short_description": "Rule to detect insecure patterns",
"should_use_ai_fix": false,
"tags": [
"security",
"custom"
],
"tests": [
{
"annotation_count": 1,
"code": "result = insecure_function()",
"filename": "test.yaml"
}
],
"tree_sitter_query": "(call_expression) @call"
},
"type": "custom_rule_revision"
}
}
EOF