Chilkat Online Tools

autoit / Datadog API Collection / Create a detection rule

Back to Collection Items

; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess

; Use this online tool to generate code from sample JSON: Generate Code to Create JSON

; The following JSON is sent in the request body.

; {
;   "name": "<string>",
;   "isEnabled": "<boolean>",
;   "queries": [
;     {
;       "aggregation": "count",
;       "distinctFields": [
;         "<string>",
;         "<string>"
;       ],
;       "groupByFields": [
;         "<string>",
;         "<string>"
;       ],
;       "metric": "<string>",
;       "metrics": [
;         "<string>",
;         "<string>"
;       ],
;       "name": "<string>",
;       "query": "<string>"
;     },
;     {
;       "aggregation": "count",
;       "distinctFields": [
;         "<string>",
;         "<string>"
;       ],
;       "groupByFields": [
;         "<string>",
;         "<string>"
;       ],
;       "metric": "<string>",
;       "metrics": [
;         "<string>",
;         "<string>"
;       ],
;       "name": "<string>",
;       "query": "<string>"
;     }
;   ],
;   "options": {
;     "complianceRuleOptions": {
;       "complexRule": "<boolean>",
;       "regoRule": {
;         "policy": "<string>",
;         "resourceTypes": [
;           "<string>",
;           "<string>"
;         ]
;       },
;       "resourceType": "<string>",
;       "incididuntfd5": {},
;       "Duis_3_": {},
;       "ipsum_965": {}
;     },
;     "decreaseCriticalityBasedOnEnv": "<boolean>",
;     "detectionMethod": "impossible_travel",
;     "evaluationWindow": 0,
;     "hardcodedEvaluatorType": "log4shell",
;     "impossibleTravelOptions": {
;       "baselineUserLocations": "<boolean>"
;     },
;     "keepAlive": 21600,
;     "maxSignalDuration": 21600,
;     "newValueOptions": {
;       "forgetAfter": 2,
;       "learningDuration": 0,
;       "learningMethod": "duration",
;       "learningThreshold": 0
;     }
;   },
;   "cases": [
;     {
;       "status": "critical",
;       "condition": "<string>",
;       "name": "<string>",
;       "notifications": [
;         "<string>",
;         "<string>"
;       ]
;     },
;     {
;       "status": "low",
;       "condition": "<string>",
;       "name": "<string>",
;       "notifications": [
;         "<string>",
;         "<string>"
;       ]
;     }
;   ],
;   "message": "<string>",
;   "filters": [
;     {
;       "action": "suppress",
;       "query": "<string>"
;     },
;     {
;       "action": "require",
;       "query": "<string>"
;     }
;   ],
;   "hasExtendedTitle": "<boolean>",
;   "tags": [
;     "<string>",
;     "<string>"
;   ],
;   "type": "workload_security"
; }

$oJson = ObjCreate("Chilkat.JsonObject")
$oJson.UpdateString("name","<string>")
$oJson.UpdateString("isEnabled","<boolean>")
$oJson.UpdateString("queries[0].aggregation","count")
$oJson.UpdateString("queries[0].distinctFields[0]","<string>")
$oJson.UpdateString("queries[0].distinctFields[1]","<string>")
$oJson.UpdateString("queries[0].groupByFields[0]","<string>")
$oJson.UpdateString("queries[0].groupByFields[1]","<string>")
$oJson.UpdateString("queries[0].metric","<string>")
$oJson.UpdateString("queries[0].metrics[0]","<string>")
$oJson.UpdateString("queries[0].metrics[1]","<string>")
$oJson.UpdateString("queries[0].name","<string>")
$oJson.UpdateString("queries[0].query","<string>")
$oJson.UpdateString("queries[1].aggregation","count")
$oJson.UpdateString("queries[1].distinctFields[0]","<string>")
$oJson.UpdateString("queries[1].distinctFields[1]","<string>")
$oJson.UpdateString("queries[1].groupByFields[0]","<string>")
$oJson.UpdateString("queries[1].groupByFields[1]","<string>")
$oJson.UpdateString("queries[1].metric","<string>")
$oJson.UpdateString("queries[1].metrics[0]","<string>")
$oJson.UpdateString("queries[1].metrics[1]","<string>")
$oJson.UpdateString("queries[1].name","<string>")
$oJson.UpdateString("queries[1].query","<string>")
$oJson.UpdateString("options.complianceRuleOptions.complexRule","<boolean>")
$oJson.UpdateString("options.complianceRuleOptions.regoRule.policy","<string>")
$oJson.UpdateString("options.complianceRuleOptions.regoRule.resourceTypes[0]","<string>")
$oJson.UpdateString("options.complianceRuleOptions.regoRule.resourceTypes[1]","<string>")
$oJson.UpdateString("options.complianceRuleOptions.resourceType","<string>")
$oJson.UpdateNewObject("options.complianceRuleOptions.incididuntfd5")
$oJson.UpdateNewObject("options.complianceRuleOptions.Duis_3_")
$oJson.UpdateNewObject("options.complianceRuleOptions.ipsum_965")
$oJson.UpdateString("options.decreaseCriticalityBasedOnEnv","<boolean>")
$oJson.UpdateString("options.detectionMethod","impossible_travel")
$oJson.UpdateInt("options.evaluationWindow",0)
$oJson.UpdateString("options.hardcodedEvaluatorType","log4shell")
$oJson.UpdateString("options.impossibleTravelOptions.baselineUserLocations","<boolean>")
$oJson.UpdateInt("options.keepAlive",21600)
$oJson.UpdateInt("options.maxSignalDuration",21600)
$oJson.UpdateInt("options.newValueOptions.forgetAfter",2)
$oJson.UpdateInt("options.newValueOptions.learningDuration",0)
$oJson.UpdateString("options.newValueOptions.learningMethod","duration")
$oJson.UpdateInt("options.newValueOptions.learningThreshold",0)
$oJson.UpdateString("cases[0].status","critical")
$oJson.UpdateString("cases[0].condition","<string>")
$oJson.UpdateString("cases[0].name","<string>")
$oJson.UpdateString("cases[0].notifications[0]","<string>")
$oJson.UpdateString("cases[0].notifications[1]","<string>")
$oJson.UpdateString("cases[1].status","low")
$oJson.UpdateString("cases[1].condition","<string>")
$oJson.UpdateString("cases[1].name","<string>")
$oJson.UpdateString("cases[1].notifications[0]","<string>")
$oJson.UpdateString("cases[1].notifications[1]","<string>")
$oJson.UpdateString("message","<string>")
$oJson.UpdateString("filters[0].action","suppress")
$oJson.UpdateString("filters[0].query","<string>")
$oJson.UpdateString("filters[1].action","require")
$oJson.UpdateString("filters[1].query","<string>")
$oJson.UpdateString("hasExtendedTitle","<boolean>")
$oJson.UpdateString("tags[0]","<string>")
$oJson.UpdateString("tags[1]","<string>")
$oJson.UpdateString("type","workload_security")

$oHttp.SetRequestHeader "Content-Type","application/json"
$oHttp.SetRequestHeader "Accept","application/json"

Local $oResp = $oHttp.PostJson3("https://api.app.ddog-gov.com/api/v2/security_monitoring/rules","application/json",$oJson)
If ($oHttp.LastMethodSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

$oSbResponseBody = ObjCreate("Chilkat.StringBuilder")
$oResp.GetBodySb($oSbResponseBody)

$oJResp = ObjCreate("Chilkat.JsonObject")
$oJResp.LoadSb($oSbResponseBody)
$oJResp.EmitCompact = False

ConsoleWrite("Response Body:" & @CRLF)
ConsoleWrite($oJResp.Emit() & @CRLF)

Local $iRespStatusCode = $oResp.StatusCode
ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF)
If ($iRespStatusCode >= 400) Then
    ConsoleWrite("Response Header:" & @CRLF)
    ConsoleWrite($oResp.Header & @CRLF)
    ConsoleWrite("Failed." & @CRLF)

    Exit
EndIf

; Sample JSON response:
; (Sample code for parsing the JSON response is shown below)

; {
;   "cases": [
;     {
;       "condition": "<string>",
;       "name": "<string>",
;       "notifications": [
;         "<string>",
;         "<string>"
;       ],
;       "status": "medium"
;     },
;     {
;       "condition": "<string>",
;       "name": "<string>",
;       "notifications": [
;         "<string>",
;         "<string>"
;       ],
;       "status": "critical"
;     }
;   ],
;   "complianceSignalOptions": {
;     "defaultActivationStatus": "<boolean>",
;     "defaultGroupByFields": [
;       "<string>",
;       "<string>"
;     ],
;     "userActivationStatus": "<boolean>",
;     "userGroupByFields": [
;       "<string>",
;       "<string>"
;     ]
;   },
;   "createdAt": "<long>",
;   "creationAuthorId": "<long>",
;   "deprecationDate": "<long>",
;   "filters": [
;     {
;       "action": "suppress",
;       "query": "<string>"
;     },
;     {
;       "action": "require",
;       "query": "<string>"
;     }
;   ],
;   "hasExtendedTitle": "<boolean>",
;   "id": "<string>",
;   "isDefault": "<boolean>",
;   "isDeleted": "<boolean>",
;   "isEnabled": "<boolean>",
;   "message": "<string>",
;   "name": "<string>",
;   "options": {
;     "complianceRuleOptions": {
;       "complexRule": "<boolean>",
;       "regoRule": {
;         "policy": "<string>",
;         "resourceTypes": [
;           "<string>",
;           "<string>"
;         ]
;       },
;       "resourceType": "<string>"
;     },
;     "decreaseCriticalityBasedOnEnv": "<boolean>",
;     "detectionMethod": "third_party",
;     "evaluationWindow": 300,
;     "hardcodedEvaluatorType": "log4shell",
;     "impossibleTravelOptions": {
;       "baselineUserLocations": "<boolean>"
;     },
;     "keepAlive": 300,
;     "maxSignalDuration": 900,
;     "newValueOptions": {
;       "forgetAfter": 28,
;       "learningDuration": 0,
;       "learningMethod": "duration",
;       "learningThreshold": 0
;     }
;   },
;   "queries": [
;     {
;       "aggregation": "max",
;       "distinctFields": [
;         "<string>",
;         "<string>"
;       ],
;       "groupByFields": [
;         "<string>",
;         "<string>"
;       ],
;       "metric": "<string>",
;       "metrics": [
;         "<string>",
;         "<string>"
;       ],
;       "name": "<string>",
;       "query": "<string>"
;     },
;     {
;       "aggregation": "max",
;       "distinctFields": [
;         "<string>",
;         "<string>"
;       ],
;       "groupByFields": [
;         "<string>",
;         "<string>"
;       ],
;       "metric": "<string>",
;       "metrics": [
;         "<string>",
;         "<string>"
;       ],
;       "name": "<string>",
;       "query": "<string>"
;     }
;   ],
;   "tags": [
;     "<string>",
;     "<string>"
;   ],
;   "type": "application_security",
;   "updateAuthorId": "<long>",
;   "version": "<long>"
; }

; Sample code for parsing the JSON response...
; Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

Local $sCondition
Local $status
Local $iJ
Local $iCount_j
Local $strVal
Local $sAction
Local $sQuery
Local $sAggregation
Local $sMetric

Local $sDefaultActivationStatus = $oJResp.StringOf("complianceSignalOptions.defaultActivationStatus")
Local $sUserActivationStatus = $oJResp.StringOf("complianceSignalOptions.userActivationStatus")
Local $sCreatedAt = $oJResp.StringOf("createdAt")
Local $sCreationAuthorId = $oJResp.StringOf("creationAuthorId")
Local $sDeprecationDate = $oJResp.StringOf("deprecationDate")
Local $sHasExtendedTitle = $oJResp.StringOf("hasExtendedTitle")
Local $sId = $oJResp.StringOf("id")
Local $sIsDefault = $oJResp.StringOf("isDefault")
Local $sIsDeleted = $oJResp.StringOf("isDeleted")
Local $sIsEnabled = $oJResp.StringOf("isEnabled")
Local $sMessage = $oJResp.StringOf("message")
Local $sName = $oJResp.StringOf("name")
Local $sComplexRule = $oJResp.StringOf("options.complianceRuleOptions.complexRule")
Local $sPolicy = $oJResp.StringOf("options.complianceRuleOptions.regoRule.policy")
Local $sResourceType = $oJResp.StringOf("options.complianceRuleOptions.resourceType")
Local $sDecreaseCriticalityBasedOnEnv = $oJResp.StringOf("options.decreaseCriticalityBasedOnEnv")
Local $sDetectionMethod = $oJResp.StringOf("options.detectionMethod")
Local $iEvaluationWindow = $oJResp.IntOf("options.evaluationWindow")
Local $sHardcodedEvaluatorType = $oJResp.StringOf("options.hardcodedEvaluatorType")
Local $sBaselineUserLocations = $oJResp.StringOf("options.impossibleTravelOptions.baselineUserLocations")
Local $iKeepAlive = $oJResp.IntOf("options.keepAlive")
Local $iMaxSignalDuration = $oJResp.IntOf("options.maxSignalDuration")
Local $iForgetAfter = $oJResp.IntOf("options.newValueOptions.forgetAfter")
Local $iLearningDuration = $oJResp.IntOf("options.newValueOptions.learningDuration")
Local $sLearningMethod = $oJResp.StringOf("options.newValueOptions.learningMethod")
Local $iLearningThreshold = $oJResp.IntOf("options.newValueOptions.learningThreshold")
Local $sV_type = $oJResp.StringOf("type")
Local $sUpdateAuthorId = $oJResp.StringOf("updateAuthorId")
Local $sVersion = $oJResp.StringOf("version")
Local $i = 0
Local $iCount_i = $oJResp.SizeOfArray("cases")
While $i < $iCount_i
    $oJResp.I = $i
    $sCondition = $oJResp.StringOf("cases[i].condition")
    $sName = $oJResp.StringOf("cases[i].name")
    $status = $oJResp.StringOf("cases[i].status")
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("cases[i].notifications")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $strVal = $oJResp.StringOf("cases[i].notifications[j]")
        $iJ = $iJ + 1
    Wend
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJResp.SizeOfArray("complianceSignalOptions.defaultGroupByFields")
While $i < $iCount_i
    $oJResp.I = $i
    $strVal = $oJResp.StringOf("complianceSignalOptions.defaultGroupByFields[i]")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJResp.SizeOfArray("complianceSignalOptions.userGroupByFields")
While $i < $iCount_i
    $oJResp.I = $i
    $strVal = $oJResp.StringOf("complianceSignalOptions.userGroupByFields[i]")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJResp.SizeOfArray("filters")
While $i < $iCount_i
    $oJResp.I = $i
    $sAction = $oJResp.StringOf("filters[i].action")
    $sQuery = $oJResp.StringOf("filters[i].query")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJResp.SizeOfArray("options.complianceRuleOptions.regoRule.resourceTypes")
While $i < $iCount_i
    $oJResp.I = $i
    $strVal = $oJResp.StringOf("options.complianceRuleOptions.regoRule.resourceTypes[i]")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJResp.SizeOfArray("queries")
While $i < $iCount_i
    $oJResp.I = $i
    $sAggregation = $oJResp.StringOf("queries[i].aggregation")
    $sMetric = $oJResp.StringOf("queries[i].metric")
    $sName = $oJResp.StringOf("queries[i].name")
    $sQuery = $oJResp.StringOf("queries[i].query")
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("queries[i].distinctFields")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $strVal = $oJResp.StringOf("queries[i].distinctFields[j]")
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("queries[i].groupByFields")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $strVal = $oJResp.StringOf("queries[i].groupByFields[j]")
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJResp.SizeOfArray("queries[i].metrics")
    While $iJ < $iCount_j
        $oJResp.J = $iJ
        $strVal = $oJResp.StringOf("queries[i].metrics[j]")
        $iJ = $iJ + 1
    Wend
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJResp.SizeOfArray("tags")
While $i < $iCount_i
    $oJResp.I = $i
    $strVal = $oJResp.StringOf("tags[i]")
    $i = $i + 1
Wend

Curl Command

curl -X POST
	-H "Content-Type: application/json"
	-H "Accept: application/json"
	-d '{
  "name": "<string>",
  "isEnabled": "<boolean>",
  "queries": [
    {
      "aggregation": "count",
      "distinctFields": [
        "<string>",
        "<string>"
      ],
      "groupByFields": [
        "<string>",
        "<string>"
      ],
      "metric": "<string>",
      "metrics": [
        "<string>",
        "<string>"
      ],
      "name": "<string>",
      "query": "<string>"
    },
    {
      "aggregation": "count",
      "distinctFields": [
        "<string>",
        "<string>"
      ],
      "groupByFields": [
        "<string>",
        "<string>"
      ],
      "metric": "<string>",
      "metrics": [
        "<string>",
        "<string>"
      ],
      "name": "<string>",
      "query": "<string>"
    }
  ],
  "options": {
    "complianceRuleOptions": {
      "complexRule": "<boolean>",
      "regoRule": {
        "policy": "<string>",
        "resourceTypes": [
          "<string>",
          "<string>"
        ]
      },
      "resourceType": "<string>",
      "incididuntfd5": {},
      "Duis_3_": {},
      "ipsum_965": {}
    },
    "decreaseCriticalityBasedOnEnv": "<boolean>",
    "detectionMethod": "impossible_travel",
    "evaluationWindow": 0,
    "hardcodedEvaluatorType": "log4shell",
    "impossibleTravelOptions": {
      "baselineUserLocations": "<boolean>"
    },
    "keepAlive": 21600,
    "maxSignalDuration": 21600,
    "newValueOptions": {
      "forgetAfter": 2,
      "learningDuration": 0,
      "learningMethod": "duration",
      "learningThreshold": 0
    }
  },
  "cases": [
    {
      "status": "critical",
      "condition": "<string>",
      "name": "<string>",
      "notifications": [
        "<string>",
        "<string>"
      ]
    },
    {
      "status": "low",
      "condition": "<string>",
      "name": "<string>",
      "notifications": [
        "<string>",
        "<string>"
      ]
    }
  ],
  "message": "<string>",
  "filters": [
    {
      "action": "suppress",
      "query": "<string>"
    },
    {
      "action": "require",
      "query": "<string>"
    }
  ],
  "hasExtendedTitle": "<boolean>",
  "tags": [
    "<string>",
    "<string>"
  ],
  "type": "workload_security"
}'
https://api.app.ddog-gov.com/api/v2/security_monitoring/rules

Postman Collection Item JSON

{
  "name": "Create a detection rule",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"name\": \"<string>\",\n  \"isEnabled\": \"<boolean>\",\n  \"queries\": [\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"options\": {\n    \"complianceRuleOptions\": {\n      \"complexRule\": \"<boolean>\",\n      \"regoRule\": {\n        \"policy\": \"<string>\",\n        \"resourceTypes\": [\n          \"<string>\",\n          \"<string>\"\n        ]\n      },\n      \"resourceType\": \"<string>\",\n      \"incididuntfd5\": {},\n      \"Duis_3_\": {},\n      \"ipsum_965\": {}\n    },\n    \"decreaseCriticalityBasedOnEnv\": \"<boolean>\",\n    \"detectionMethod\": \"impossible_travel\",\n    \"evaluationWindow\": 0,\n    \"hardcodedEvaluatorType\": \"log4shell\",\n    \"impossibleTravelOptions\": {\n      \"baselineUserLocations\": \"<boolean>\"\n    },\n    \"keepAlive\": 21600,\n    \"maxSignalDuration\": 21600,\n    \"newValueOptions\": {\n      \"forgetAfter\": 2,\n      \"learningDuration\": 0,\n      \"learningMethod\": \"duration\",\n      \"learningThreshold\": 0\n    }\n  },\n  \"cases\": [\n    {\n      \"status\": \"critical\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    },\n    {\n      \"status\": \"low\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    }\n  ],\n  \"message\": \"<string>\",\n  \"filters\": [\n    {\n      \"action\": \"suppress\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"action\": \"require\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"hasExtendedTitle\": \"<boolean>\",\n  \"tags\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"type\": \"workload_security\"\n}",
      "options": {
        "raw": {
          "headerFamily": "json",
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/api/v2/security_monitoring/rules",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v2",
        "security_monitoring",
        "rules"
      ]
    },
    "description": "Create a detection rule."
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"<string>\",\n  \"isEnabled\": \"<boolean>\",\n  \"queries\": [\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"options\": {\n    \"complianceRuleOptions\": {\n      \"complexRule\": \"<boolean>\",\n      \"regoRule\": {\n        \"policy\": \"<string>\",\n        \"resourceTypes\": [\n          \"<string>\",\n          \"<string>\"\n        ]\n      },\n      \"resourceType\": \"<string>\",\n      \"incididuntfd5\": {},\n      \"Duis_3_\": {},\n      \"ipsum_965\": {}\n    },\n    \"decreaseCriticalityBasedOnEnv\": \"<boolean>\",\n    \"detectionMethod\": \"impossible_travel\",\n    \"evaluationWindow\": 0,\n    \"hardcodedEvaluatorType\": \"log4shell\",\n    \"impossibleTravelOptions\": {\n      \"baselineUserLocations\": \"<boolean>\"\n    },\n    \"keepAlive\": 21600,\n    \"maxSignalDuration\": 21600,\n    \"newValueOptions\": {\n      \"forgetAfter\": 2,\n      \"learningDuration\": 0,\n      \"learningMethod\": \"duration\",\n      \"learningThreshold\": 0\n    }\n  },\n  \"cases\": [\n    {\n      \"status\": \"critical\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    },\n    {\n      \"status\": \"low\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    }\n  ],\n  \"message\": \"<string>\",\n  \"filters\": [\n    {\n      \"action\": \"suppress\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"action\": \"require\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"hasExtendedTitle\": \"<boolean>\",\n  \"tags\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"type\": \"workload_security\"\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/security_monitoring/rules",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "security_monitoring",
            "rules"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"cases\": [\n    {\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"status\": \"medium\"\n    },\n    {\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"status\": \"critical\"\n    }\n  ],\n  \"complianceSignalOptions\": {\n    \"defaultActivationStatus\": \"<boolean>\",\n    \"defaultGroupByFields\": [\n      \"<string>\",\n      \"<string>\"\n    ],\n    \"userActivationStatus\": \"<boolean>\",\n    \"userGroupByFields\": [\n      \"<string>\",\n      \"<string>\"\n    ]\n  },\n  \"createdAt\": \"<long>\",\n  \"creationAuthorId\": \"<long>\",\n  \"deprecationDate\": \"<long>\",\n  \"filters\": [\n    {\n      \"action\": \"suppress\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"action\": \"require\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"hasExtendedTitle\": \"<boolean>\",\n  \"id\": \"<string>\",\n  \"isDefault\": \"<boolean>\",\n  \"isDeleted\": \"<boolean>\",\n  \"isEnabled\": \"<boolean>\",\n  \"message\": \"<string>\",\n  \"name\": \"<string>\",\n  \"options\": {\n    \"complianceRuleOptions\": {\n      \"complexRule\": \"<boolean>\",\n      \"regoRule\": {\n        \"policy\": \"<string>\",\n        \"resourceTypes\": [\n          \"<string>\",\n          \"<string>\"\n        ]\n      },\n      \"resourceType\": \"<string>\"\n    },\n    \"decreaseCriticalityBasedOnEnv\": \"<boolean>\",\n    \"detectionMethod\": \"third_party\",\n    \"evaluationWindow\": 300,\n    \"hardcodedEvaluatorType\": \"log4shell\",\n    \"impossibleTravelOptions\": {\n      \"baselineUserLocations\": \"<boolean>\"\n    },\n    \"keepAlive\": 300,\n    \"maxSignalDuration\": 900,\n    \"newValueOptions\": {\n      \"forgetAfter\": 28,\n      \"learningDuration\": 0,\n      \"learningMethod\": \"duration\",\n      \"learningThreshold\": 0\n    }\n  },\n  \"queries\": [\n    {\n      \"aggregation\": \"max\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"aggregation\": \"max\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"tags\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"type\": \"application_security\",\n  \"updateAuthorId\": \"<long>\",\n  \"version\": \"<long>\"\n}"
    },
    {
      "name": "Bad Request",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"<string>\",\n  \"isEnabled\": \"<boolean>\",\n  \"queries\": [\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"options\": {\n    \"complianceRuleOptions\": {\n      \"complexRule\": \"<boolean>\",\n      \"regoRule\": {\n        \"policy\": \"<string>\",\n        \"resourceTypes\": [\n          \"<string>\",\n          \"<string>\"\n        ]\n      },\n      \"resourceType\": \"<string>\",\n      \"incididuntfd5\": {},\n      \"Duis_3_\": {},\n      \"ipsum_965\": {}\n    },\n    \"decreaseCriticalityBasedOnEnv\": \"<boolean>\",\n    \"detectionMethod\": \"impossible_travel\",\n    \"evaluationWindow\": 0,\n    \"hardcodedEvaluatorType\": \"log4shell\",\n    \"impossibleTravelOptions\": {\n      \"baselineUserLocations\": \"<boolean>\"\n    },\n    \"keepAlive\": 21600,\n    \"maxSignalDuration\": 21600,\n    \"newValueOptions\": {\n      \"forgetAfter\": 2,\n      \"learningDuration\": 0,\n      \"learningMethod\": \"duration\",\n      \"learningThreshold\": 0\n    }\n  },\n  \"cases\": [\n    {\n      \"status\": \"critical\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    },\n    {\n      \"status\": \"low\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    }\n  ],\n  \"message\": \"<string>\",\n  \"filters\": [\n    {\n      \"action\": \"suppress\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"action\": \"require\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"hasExtendedTitle\": \"<boolean>\",\n  \"tags\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"type\": \"workload_security\"\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/security_monitoring/rules",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "security_monitoring",
            "rules"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Not Authorized",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"<string>\",\n  \"isEnabled\": \"<boolean>\",\n  \"queries\": [\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"options\": {\n    \"complianceRuleOptions\": {\n      \"complexRule\": \"<boolean>\",\n      \"regoRule\": {\n        \"policy\": \"<string>\",\n        \"resourceTypes\": [\n          \"<string>\",\n          \"<string>\"\n        ]\n      },\n      \"resourceType\": \"<string>\",\n      \"incididuntfd5\": {},\n      \"Duis_3_\": {},\n      \"ipsum_965\": {}\n    },\n    \"decreaseCriticalityBasedOnEnv\": \"<boolean>\",\n    \"detectionMethod\": \"impossible_travel\",\n    \"evaluationWindow\": 0,\n    \"hardcodedEvaluatorType\": \"log4shell\",\n    \"impossibleTravelOptions\": {\n      \"baselineUserLocations\": \"<boolean>\"\n    },\n    \"keepAlive\": 21600,\n    \"maxSignalDuration\": 21600,\n    \"newValueOptions\": {\n      \"forgetAfter\": 2,\n      \"learningDuration\": 0,\n      \"learningMethod\": \"duration\",\n      \"learningThreshold\": 0\n    }\n  },\n  \"cases\": [\n    {\n      \"status\": \"critical\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    },\n    {\n      \"status\": \"low\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    }\n  ],\n  \"message\": \"<string>\",\n  \"filters\": [\n    {\n      \"action\": \"suppress\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"action\": \"require\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"hasExtendedTitle\": \"<boolean>\",\n  \"tags\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"type\": \"workload_security\"\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/security_monitoring/rules",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "security_monitoring",
            "rules"
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Too many requests",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"<string>\",\n  \"isEnabled\": \"<boolean>\",\n  \"queries\": [\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"aggregation\": \"count\",\n      \"distinctFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"groupByFields\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"metric\": \"<string>\",\n      \"metrics\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"name\": \"<string>\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"options\": {\n    \"complianceRuleOptions\": {\n      \"complexRule\": \"<boolean>\",\n      \"regoRule\": {\n        \"policy\": \"<string>\",\n        \"resourceTypes\": [\n          \"<string>\",\n          \"<string>\"\n        ]\n      },\n      \"resourceType\": \"<string>\",\n      \"incididuntfd5\": {},\n      \"Duis_3_\": {},\n      \"ipsum_965\": {}\n    },\n    \"decreaseCriticalityBasedOnEnv\": \"<boolean>\",\n    \"detectionMethod\": \"impossible_travel\",\n    \"evaluationWindow\": 0,\n    \"hardcodedEvaluatorType\": \"log4shell\",\n    \"impossibleTravelOptions\": {\n      \"baselineUserLocations\": \"<boolean>\"\n    },\n    \"keepAlive\": 21600,\n    \"maxSignalDuration\": 21600,\n    \"newValueOptions\": {\n      \"forgetAfter\": 2,\n      \"learningDuration\": 0,\n      \"learningMethod\": \"duration\",\n      \"learningThreshold\": 0\n    }\n  },\n  \"cases\": [\n    {\n      \"status\": \"critical\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    },\n    {\n      \"status\": \"low\",\n      \"condition\": \"<string>\",\n      \"name\": \"<string>\",\n      \"notifications\": [\n        \"<string>\",\n        \"<string>\"\n      ]\n    }\n  ],\n  \"message\": \"<string>\",\n  \"filters\": [\n    {\n      \"action\": \"suppress\",\n      \"query\": \"<string>\"\n    },\n    {\n      \"action\": \"require\",\n      \"query\": \"<string>\"\n    }\n  ],\n  \"hasExtendedTitle\": \"<boolean>\",\n  \"tags\": [\n    \"<string>\",\n    \"<string>\"\n  ],\n  \"type\": \"workload_security\"\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/security_monitoring/rules",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "security_monitoring",
            "rules"
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    }
  ]
}