Skip to content

JSON-Schema for Custom Roles within your modules

still in development

Custom roles and permissions are still in the development process.

Validation required

When uploading an alert rule definition file, it will be validated against the following schema, so make sure to match it

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$ref": "#/definitions/CustomEntities",
  "definitions": {
    "CustomEntities": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "roles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CustomRole"
          }
        },
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CustomData"
          }
        }
      }
    },
    "CustomData": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "entityType": {
          "type": "string"
        },
        "intention": {
          "type": "string"
        },
        "internalOnly": {
          "type": "boolean"
        },
        "environmentKey": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "intention"
      ]
    },
    "CustomRole": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "entityType": {
          "type": "string"
        },
        "baseRole": {
          "type": "string"
        },
        "permissions": {
          "$ref": "#/definitions/Permissions"
        }
      },
      "required": [
        "name",
        "baseRole",
        "permissions"
      ]
    },
    "Permissions": {
      "type": "object",
      "additionalProperties": false,
      "patternProperties": {
        "^[a-zA-Z0-9]*$": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}