Chilkat Online Tools

Swift3 / Datadog API Collection / Create a detection rule

Back to Collection Items

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

    let http = CkoHttp()!
    var success: Bool

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

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

    http.setRequestHeader("Content-Type", value: "application/json")
    http.setRequestHeader("Accept", value: "application/json")

    var resp: CkoHttpResponse? = http.postJson3("https://api.app.ddog-gov.com/api/v2/security_monitoring/rules", contentType: "application/json", json: json)
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    let sbResponseBody = CkoStringBuilder()!
    resp!.getBodySb(sbResponseBody)

    let jResp = CkoJsonObject()!
    jResp.loadSb(sbResponseBody)
    jResp.emitCompact = false

    print("Response Body:")
    print("\(jResp.emit()!)")

    var respStatusCode: Int = resp!.statusCode.intValue
    print("Response Status Code = \(respStatusCode)")
    if respStatusCode >= 400 {
        print("Response Header:")
        print("\(resp!.header!)")
        print("Failed.")
        resp = nil
        return
    }

    resp = nil

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

    var condition: String?
    var status: String?
    var j: Int
    var count_j: Int
    var strVal: String?
    var action: String?
    var query: String?
    var aggregation: String?
    var metric: String?

    var DefaultActivationStatus: String? = jResp.string(of: "complianceSignalOptions.defaultActivationStatus")
    var UserActivationStatus: String? = jResp.string(of: "complianceSignalOptions.userActivationStatus")
    var createdAt: String? = jResp.string(of: "createdAt")
    var creationAuthorId: String? = jResp.string(of: "creationAuthorId")
    var deprecationDate: String? = jResp.string(of: "deprecationDate")
    var hasExtendedTitle: String? = jResp.string(of: "hasExtendedTitle")
    var id: String? = jResp.string(of: "id")
    var isDefault: String? = jResp.string(of: "isDefault")
    var isDeleted: String? = jResp.string(of: "isDeleted")
    var isEnabled: String? = jResp.string(of: "isEnabled")
    var message: String? = jResp.string(of: "message")
    var name: String? = jResp.string(of: "name")
    var ComplexRule: String? = jResp.string(of: "options.complianceRuleOptions.complexRule")
    var Policy: String? = jResp.string(of: "options.complianceRuleOptions.regoRule.policy")
    var ResourceType: String? = jResp.string(of: "options.complianceRuleOptions.resourceType")
    var DecreaseCriticalityBasedOnEnv: String? = jResp.string(of: "options.decreaseCriticalityBasedOnEnv")
    var DetectionMethod: String? = jResp.string(of: "options.detectionMethod")
    var EvaluationWindow: Int = jResp.int(of: "options.evaluationWindow").intValue
    var HardcodedEvaluatorType: String? = jResp.string(of: "options.hardcodedEvaluatorType")
    var BaselineUserLocations: String? = jResp.string(of: "options.impossibleTravelOptions.baselineUserLocations")
    var KeepAlive: Int = jResp.int(of: "options.keepAlive").intValue
    var MaxSignalDuration: Int = jResp.int(of: "options.maxSignalDuration").intValue
    var ForgetAfter: Int = jResp.int(of: "options.newValueOptions.forgetAfter").intValue
    var LearningDuration: Int = jResp.int(of: "options.newValueOptions.learningDuration").intValue
    var LearningMethod: String? = jResp.string(of: "options.newValueOptions.learningMethod")
    var LearningThreshold: Int = jResp.int(of: "options.newValueOptions.learningThreshold").intValue
    var v_type: String? = jResp.string(of: "type")
    var updateAuthorId: String? = jResp.string(of: "updateAuthorId")
    var version: String? = jResp.string(of: "version")
    var i: Int = 0
    var count_i: Int = jResp.size(ofArray: "cases").intValue
    while i < count_i {
        jResp.i = i
        condition = jResp.string(of: "cases[i].condition")
        name = jResp.string(of: "cases[i].name")
        status = jResp.string(of: "cases[i].status")
        j = 0
        count_j = jResp.size(ofArray: "cases[i].notifications").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "cases[i].notifications[j]")
            j = j + 1
        }

        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "complianceSignalOptions.defaultGroupByFields").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "complianceSignalOptions.defaultGroupByFields[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "complianceSignalOptions.userGroupByFields").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "complianceSignalOptions.userGroupByFields[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "filters").intValue
    while i < count_i {
        jResp.i = i
        action = jResp.string(of: "filters[i].action")
        query = jResp.string(of: "filters[i].query")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "options.complianceRuleOptions.regoRule.resourceTypes").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "options.complianceRuleOptions.regoRule.resourceTypes[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "queries").intValue
    while i < count_i {
        jResp.i = i
        aggregation = jResp.string(of: "queries[i].aggregation")
        metric = jResp.string(of: "queries[i].metric")
        name = jResp.string(of: "queries[i].name")
        query = jResp.string(of: "queries[i].query")
        j = 0
        count_j = jResp.size(ofArray: "queries[i].distinctFields").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "queries[i].distinctFields[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "queries[i].groupByFields").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "queries[i].groupByFields[j]")
            j = j + 1
        }

        j = 0
        count_j = jResp.size(ofArray: "queries[i].metrics").intValue
        while j < count_j {
            jResp.j = j
            strVal = jResp.string(of: "queries[i].metrics[j]")
            j = j + 1
        }

        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "tags").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "tags[i]")
        i = i + 1
    }


}

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