{ "$id": "deviceImportDocument", "definitions": { "ipNetwork": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "type": { "const": "network" }, "address": { "type": "string" } }, "required": [ "type", "address" ] } ] }, "networkGroupReference": { "type": "object", "properties": { "type": { "const": "networkGroup" }, "name": { "type": "string" } }, "required": [ "type", "name" ] }, "networkOrGroupReference": { "anyOf": [ { "$ref": "#/definitions/ipNetwork" }, { "$ref": "#/definitions/networkGroupReference" } ] }, "service": { "anyOf": [ { "$ref": "traffic-tcp" }, { "$ref": "traffic-udp" }, { "$ref": "traffic-icmp" }, { "$ref": "traffic-icmpv6" }, { "$comment": "Temporary catch all to allow non-validated protocols through", "type": "object", "protocol": { "type": "string" }, "required": [ "protocol" ], "additionalProperties": true } ] }, "serviceGroupReference": { "type": "object", "properties": { "type": { "const": "serviceGroup" }, "name": { "type": "string" } }, "required": [ "type", "name" ] }, "serviceOrGroupReference": { "anyOf": [ { "$ref": "#/definitions/service" }, { "$ref": "#/definitions/serviceGroupReference" } ] }, "scheduleRef": { "type": [ "null", "string" ] }, "templateReferenceRule": { "type": "object", "properties": { "templateReference": { "type": "string" } }, "required": [ "templateReference" ] }, "policyRule": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "action": { "enum": [ "permit", "deny", "drop" ] }, "sourceNetworks": { "type": "array", "items": { "$ref": "#/definitions/networkOrGroupReference" }, "minItems": 1 }, "destinationNetworks": { "type": "array", "items": { "$ref": "#/definitions/networkOrGroupReference" }, "minItems": 1 }, "services": { "type": "array", "items": { "$ref": "#/definitions/serviceOrGroupReference" }, "minItems": 1 }, "schedule": { "$ref": "#/definitions/scheduleRef" }, "enabled": { "type": "boolean" }, "logging": { "type": "boolean" } }, "required": [ "action", "sourceNetworks", "destinationNetworks", "services", "enabled", "logging" ] }, "policyRuleOrTemplateReference": { "oneOf": [ { "$ref": "#/definitions/templateReferenceRule" }, { "$ref": "#/definitions/policyRule" } ] } }, "type": "object", "required": [ "targets", "policies" ], "properties": { "targets": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "policyType": { "$ref": "common#/definitions/policyType" }, "addressType": { "$ref": "common#/definitions/addressType" }, "sourceNetworks": { "type": "array", "items": { "$ref": "#/definitions/ipNetwork" }, "minLength": 1 }, "destinationNetworks": { "type": "array", "items": { "$ref": "#/definitions/ipNetwork" }, "minLength": 1 }, "policy": { "type": [ "string", "null" ] } }, "required": [ "name", "policyType", "addressType", "sourceNetworks", "destinationNetworks", "policy" ] } }, "policies": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "policyType": { "$ref": "common#/definitions/policyType" }, "addressType": { "$ref": "common#/definitions/addressType" }, "rules": { "type": "array", "items": { "$ref": "#/definitions/policyRuleOrTemplateReference" } } }, "required": [ "name", "policyType", "addressType", "rules" ] } }, "ruleTemplates": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "policyType": { "$ref": "common#/definitions/policyType" }, "addressType": { "$ref": "common#/definitions/addressType" }, "rules": { "type": "array", "items": { "$ref": "#/definitions/policyRule" } } }, "required": [ "name", "policyType", "addressType", "rules" ] } }, "networkGroups": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "networks": { "type": "array", "items": { "$ref": "#/definitions/ipNetwork" } } } } }, "serviceGroups": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "services": { "type": "array", "items": { "$ref": "#/definitions/service" } } } } }, "schedules": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "daysOfWeek": { "type": "object", "properties": { "sunday": { "type": "boolean" }, "monday": { "type": "boolean" }, "tuesday": { "type": "boolean" }, "wednesday": { "type": "boolean" }, "thursday": { "type": "boolean" }, "friday": { "type": "boolean" }, "saturday": { "type": "boolean" } }, "required": [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "additionalProperties": false }, "timeOfDayStart": { "type": "object", "properties": { "hour": { "type": "integer", "minimum": 0, "maximum": 23 }, "minute": { "type": "integer", "minimum": 0, "maximum": 59 } }, "required": [ "hour", "minute" ], "additionalProperties": false }, "timeOfDayEnd": { "type": "object", "properties": { "hour": { "type": "integer", "minimum": 0, "maximum": 23 }, "minute": { "type": "integer", "minimum": 0, "maximum": 59 } }, "required": [ "hour", "minute" ], "additionalProperties": false }, "beginDate": { "anyOf": [ { "const": null }, { "type": "string", "format": "date-time" } ] }, "endDate": { "anyOf": [ { "const": null }, { "type": "string", "format": "date-time" } ] } }, "required": [ "daysOfWeek", "timeOfDayStart", "timeOfDayEnd" ], "additionalProperties": false } } } }