Get All Rules

GET {{cb_url}}/containers/v1/orgs/{{cb_org_key}}/guardrails/management/rules

This request returns the list of misconfiguration types (rules) that can be added to a policy.

RBAC Permissions Required

Permission (.notation name)Operation(s)
kubernetes.securityREAD

API Documentation

Response Schema

{
  "rules": {
    "rule_id1": {
      "rule_id": "<uuid>",
      "name": "<string>",
      "description": "<string>",
      "risk": "<string>",
      "supported_actions": [
        "<string>"
      ],
      "preset_support": {
        "is_required": <boolean>,
        "default_settings": {
          "name": "<string>",
          "security_settings": [
            {
              "path": "<string>",
              "action": "<string>",
              "value": {
                "nullable": true,
                "description": "<string>"
              }
            },
            {
              "path": "<string>",
              "action": "<string>",
              "value": {
                "nullable": <boolean>,
                "description": "<string>"
              }
            }
          ]
        },
        "security_settings": [
          {
            "path": "<string>",
            "supported_actions": [
              "<string>"
            ]
          },
          {
            "path": "<string>",
            "supported_actions": [
              "<string>"
            ]
          }
        ]
      },
      "presets": [
        {
          "id": "<string>",
          "name": "<string>",
          "rule_id": "<string>",
          "policies": [
            {
              "policy_id": "<uuid>",
              "policy_name": "<string>"
            },
            {
              "policy_id": "<uuid>",
              "policy_name": "<string>"
            }
          ],
          "security_settings": [
            {
              "path": "<string>",
              "action": "<string>",
              "value": {
                "nullable": <boolean>,
                "description": "<string>"
              }
            },
            {
              "path": "<string>",
              "action": "<string>",
              "value": {
                "nullable": <boolean>,
                "description": "<string>"
              }
            }
          ]
        }
      ],
      "category": "Workload Security",
      "policies": [
        {
          "policy_id": "<uuid>",
          "policy_name": "<string>"
        }
      ],
      "templates": [
        {
          "template_id": "<uuid>",
          "template_name": "<string>"
        }
      ],
      "custom_rules_metadata": {
        "kinds": [
          "<string>"
        ],
        "creator": "<string>",
        "created_on": <number>,
        "created_on_iso": "<string>",
        "type": "advanced",
        "mapl_rule": {
          "aliquipdc": "<string>",
          "mollit_": "<string>"
        }
      }
    }
  }
}

HEADERS

KeyDatatypeRequiredDescription
X-AUTH-TOKENstring(Required) Carbon Black Access Key
Acceptstring

RESPONSES

status: OK

{&quot;rules&quot;:{&quot;09c851ee-46f8-4d18-847f-c0df4446472c&quot;:{&quot;rule_id&quot;:&quot;09c851ee-46f8-4d18-847f-c0df4446472c&quot;,&quot;name&quot;:&quot;Demo Rule  01&quot;,&quot;description&quot;:&quot;Creating a junk rule&quot;,&quot;risk&quot;:null,&quot;category&quot;:&quot;Container Images&quot;,&quot;supported_actions&quot;:[&quot;block&quot;,&quot;alert&quot;],&quot;preset_support&quot;:null,&quot;presets&quot;:null,&quot;policies&quot;:[],&quot;templates&quot;:[],&quot;custom_rule_metadata&quot;:{&quot;mapl_rule&quot;:{&quot;ruleID&quot;:&quot;09c851ee-46f8-4d18-847f-c0df4446472c&quot;,&quot;sender&quot;:{},&quot;receiver&quot;:{},&quot;resource&quot;:{},&quot;conditions&quot;:{&quot;conditionsTree&quot;:{&quot;OR&quot;:[{&quot;ANY&quot;:{&quot;parentJsonpathAttribute&quot;:&quot;jsonpath:$.containers[:]&quot;,&quot;returnValueJsonpath&quot;:{&quot;criticalVulnerabilities&quot;:&quot;jsonpath:$RELATIVE.scanData.vulnerabilitiesBySeverity.critical&quot;,&quot;highVulnerabilities&quot;:&quot;jsonpath:$RELATIVE.scanData.vulnerabilitiesBySeverity.high&quot;,&quot;image&quot;:&quot;jsonpath:$RELATIVE.Container.image.full_tag&quot;},&quot;condition&quot;:{&quot;OR&quot;:[{&quot;condition&quot;:{&quot;attribute&quot;:&quot;jsonpath:$RELATIVE.imageVulnerabilitiesSummary.vulnerabilitiesSummary.critical.amount&quot;,&quot;method&quot;:&quot;GT&quot;,&quot;value&quot;:&quot;0&quot;}},{&quot;condition&quot;:{&quot;attribute&quot;:&quot;jsonpath:$RELATIVE.imageVulnerabilitiesSummary.vulnerabilitiesSummary.high.amount&quot;,&quot;method&quot;:&quot;GT&quot;,&quot;value&quot;:&quot;0&quot;}}]}}},{&quot;ANY&quot;:{&quot;parentJsonpathAttribute&quot;:&quot;jsonpath:$.initContainers[:]&quot;,&quot;returnValueJsonpath&quot;:{&quot;criticalVulnerabilities&quot;:&quot;jsonpath:$RELATIVE.scanData.vulnerabilitiesBySeverity.critical&quot;,&quot;highVulnerabilities&quot;:&quot;jsonpath:$RELATIVE.scanData.vulnerabilitiesBySeverity.high&quot;,&quot;image&quot;:&quot;jsonpath:$RELATIVE.Container.image.full_tag&quot;},&quot;condition&quot;:{&quot;OR&quot;:[{&quot;condition&quot;:{&quot;attribute&quot;:&quot;jsonpath:$RELATIVE.imageVulnerabilitiesSummary.vulnerabilitiesSummary.critical.amount&quot;,&quot;method&quot;:&quot;GT&quot;,&quot;value&quot;:&quot;0&quot;}},{&quot;condition&quot;:{&quot;attribute&quot;:&quot;jsonpath:$RELATIVE.imageVulnerabilitiesSummary.vulnerabilitiesSummary.high.amount&quot;,&quot;method&quot;:&quot;GT&quot;,&quot;value&quot;:&quot;0&quot;}}]}}},{&quot;ANY&quot;:{&quot;parentJsonpathAttribute&quot;:&quot;jsonpath:$.ephemeralContainers[:]&quot;,&quot;returnValueJsonpath&quot;:{&quot;criticalVulnerabilities&quot;:&quot;jsonpath:$RELATIVE.scanData.vulnerabilitiesBySeverity.critical&quot;,&quot;highVulnerabilities&quot;:&quot;jsonpath:$RELATIVE.scanData.vulnerabilitiesBySeverity.high&quot;,&quot;image&quot;:&quot;jsonpath:$RELATIVE.Container.image.full_tag&quot;},&quot;condition&quot;:{&quot;OR&quot;:[{&quot;condition&quot;:{&quot;attribute&quot;:&quot;jsonpath:$RELATIVE.imageVulnerabilitiesSummary.vulnerabilitiesSummary.critical.amount&quot;,&quot;method&quot;:&quot;GT&quot;,&quot;value&quot;:&quot;0&quot;}},{&quot;condition&quot;:{&quot;attribute&quot;:&quot;jsonpath:$RELATIVE.imageVulnerabilitiesSummary.vulnerabilitiesSummary.high.amount&quot;,&quot;method&quot;:&quot;GT&quot;,&quot;value&quot;:&quot;0&quot;}}]}}}]}},&quot;metadata&quot;:{&quot;description&quot;:&quot;Demonstration Rule&quot;,&quot;initial-type&quot;:&quot;critical-vulnerabilities&quot;,&quot;name&quot;:&quot;Demo Rule  01&quot;}},&quot;kinds&quot;:[],&quot;type&quot;:&quot;image-scanning&quot;,&quot;creator&quot;:&quot;demouser@demoorg.com&quot;,&quot;created_on&quot;:1683746762769,&quot;created_on_iso&quot;:&quot;2023-05-10T19:26:02.769Z&quot;}}}}