Chilkat Online Tools

PowerBuilder / Datadog API Collection / Create a detection rule

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Condition
string ls_Status
integer j
integer li_Count_j
string ls_StrVal
string ls_Action
string ls_Query
string ls_Aggregation
string ls_Metric
string ls_DefaultActivationStatus
string ls_UserActivationStatus
string ls_CreatedAt
string ls_CreationAuthorId
string ls_DeprecationDate
string ls_HasExtendedTitle
string ls_Id
string ls_IsDefault
string ls_IsDeleted
string ls_IsEnabled
string ls_Message
string ls_Name
string ls_ComplexRule
string ls_Policy
string ls_ResourceType
string ls_DecreaseCriticalityBasedOnEnv
string ls_DetectionMethod
integer li_EvaluationWindow
string ls_HardcodedEvaluatorType
string ls_BaselineUserLocations
integer li_KeepAlive
integer li_MaxSignalDuration
integer li_ForgetAfter
integer li_LearningDuration
string ls_LearningMethod
integer li_LearningThreshold
string ls_V_type
string ls_UpdateAuthorId
string ls_Version
integer i
integer li_Count_i

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

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// 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"
// }

loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")

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

loo_Http.SetRequestHeader("Content-Type","application/json")
loo_Http.SetRequestHeader("Accept","application/json")

loo_Resp = loo_Http.PostJson3("https://api.app.ddog-gov.com/api/v2/security_monitoring/rules","application/json",loo_Json)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Json
    return
end if

loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)

loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")

loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0

Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    destroy loo_Json
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

destroy loo_Resp

// 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

ls_DefaultActivationStatus = loo_JResp.StringOf("complianceSignalOptions.defaultActivationStatus")
ls_UserActivationStatus = loo_JResp.StringOf("complianceSignalOptions.userActivationStatus")
ls_CreatedAt = loo_JResp.StringOf("createdAt")
ls_CreationAuthorId = loo_JResp.StringOf("creationAuthorId")
ls_DeprecationDate = loo_JResp.StringOf("deprecationDate")
ls_HasExtendedTitle = loo_JResp.StringOf("hasExtendedTitle")
ls_Id = loo_JResp.StringOf("id")
ls_IsDefault = loo_JResp.StringOf("isDefault")
ls_IsDeleted = loo_JResp.StringOf("isDeleted")
ls_IsEnabled = loo_JResp.StringOf("isEnabled")
ls_Message = loo_JResp.StringOf("message")
ls_Name = loo_JResp.StringOf("name")
ls_ComplexRule = loo_JResp.StringOf("options.complianceRuleOptions.complexRule")
ls_Policy = loo_JResp.StringOf("options.complianceRuleOptions.regoRule.policy")
ls_ResourceType = loo_JResp.StringOf("options.complianceRuleOptions.resourceType")
ls_DecreaseCriticalityBasedOnEnv = loo_JResp.StringOf("options.decreaseCriticalityBasedOnEnv")
ls_DetectionMethod = loo_JResp.StringOf("options.detectionMethod")
li_EvaluationWindow = loo_JResp.IntOf("options.evaluationWindow")
ls_HardcodedEvaluatorType = loo_JResp.StringOf("options.hardcodedEvaluatorType")
ls_BaselineUserLocations = loo_JResp.StringOf("options.impossibleTravelOptions.baselineUserLocations")
li_KeepAlive = loo_JResp.IntOf("options.keepAlive")
li_MaxSignalDuration = loo_JResp.IntOf("options.maxSignalDuration")
li_ForgetAfter = loo_JResp.IntOf("options.newValueOptions.forgetAfter")
li_LearningDuration = loo_JResp.IntOf("options.newValueOptions.learningDuration")
ls_LearningMethod = loo_JResp.StringOf("options.newValueOptions.learningMethod")
li_LearningThreshold = loo_JResp.IntOf("options.newValueOptions.learningThreshold")
ls_V_type = loo_JResp.StringOf("type")
ls_UpdateAuthorId = loo_JResp.StringOf("updateAuthorId")
ls_Version = loo_JResp.StringOf("version")
i = 0
li_Count_i = loo_JResp.SizeOfArray("cases")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Condition = loo_JResp.StringOf("cases[i].condition")
    ls_Name = loo_JResp.StringOf("cases[i].name")
    ls_Status = loo_JResp.StringOf("cases[i].status")
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("cases[i].notifications")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_StrVal = loo_JResp.StringOf("cases[i].notifications[j]")
        j = j + 1
    loop
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("complianceSignalOptions.defaultGroupByFields")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("complianceSignalOptions.defaultGroupByFields[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("complianceSignalOptions.userGroupByFields")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("complianceSignalOptions.userGroupByFields[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("filters")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Action = loo_JResp.StringOf("filters[i].action")
    ls_Query = loo_JResp.StringOf("filters[i].query")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("options.complianceRuleOptions.regoRule.resourceTypes")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("options.complianceRuleOptions.regoRule.resourceTypes[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("queries")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Aggregation = loo_JResp.StringOf("queries[i].aggregation")
    ls_Metric = loo_JResp.StringOf("queries[i].metric")
    ls_Name = loo_JResp.StringOf("queries[i].name")
    ls_Query = loo_JResp.StringOf("queries[i].query")
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("queries[i].distinctFields")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_StrVal = loo_JResp.StringOf("queries[i].distinctFields[j]")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("queries[i].groupByFields")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_StrVal = loo_JResp.StringOf("queries[i].groupByFields[j]")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("queries[i].metrics")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_StrVal = loo_JResp.StringOf("queries[i].metrics[j]")
        j = j + 1
    loop
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("tags")
do while i < li_Count_i
    loo_JResp.I = i
    ls_StrVal = loo_JResp.StringOf("tags[i]")
    i = i + 1
loop


destroy loo_Http
destroy loo_Json
destroy loo_SbResponseBody
destroy loo_JResp

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}"
    }
  ]
}