{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Validator for misp events",
    "id": "https://www.github.com/MISP/MISP/format/2.4/schema.json",
    "definitions": {
        "org": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "orgc": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "sharing_group": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "releasability": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                },
                "organisation_uuid": {
                    "type": "string"
                },
                "org_id": {
                    "type": "string"
                },
                "sync_user_id": {
                    "type": "string"
                },
                "active": {
                    "type": "boolean"
                },
                "created": {
                    "type": "string"
                },
                "modified": {
                    "type": "string"
                },
                "local": {
                    "type": "boolean"
                },
                "roaming": {
                    "type": "boolean"
                },
                "Organisation": {
                    "$ref": "#/definitions/org"
                },
                "SharingGroupOrg": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/sharing_group_org"
                    }
                },
                "SharingGroupServer": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/sharing_group_server"
                    }
                }
            }
        },
        "sharing_group_org": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "sharing_group_id": {
                    "type": "string"
                },
                "org_id": {
                    "type": "string"
                },
                "extend": {
                    "type": "boolean"
                },
                "Organisation": {
                    "$ref": "#/definitions/org"
                }
            }
        },
        "sharing_group_server": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "sharing_group_id": {
                    "type": "string"
                },
                "server_id": {
                    "type": "string"
                },
                "all_orgs": {
                    "type": "boolean"
                },
                "Server": {
                    "$ref": "#/definitions/server"
                }
            }
        },
        "server": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "attribute": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "category": {
                    "type": "string"
                },
                "to_ids": {
                    "type": "boolean"
                },
                "uuid": {
                    "type": "string"
                },
                "event_id": {
                    "type": "string"
                },
                "distribution": {
                    "type": "string"
                },
                "timestamp": {
                    "type": "string"
                },
                "comment": {
                    "type": "string"
                },
                "sharing_group_id": {
                    "type": "string"
                },
                "deleted": {
                    "type": "boolean"
                },
                "disable_correlation": {
                    "type": "boolean"
                },
                "value": {
                    "type": "string"
                },
                "data": {
                    "type": "string"
                },
                "SharingGroup": {
                    "$ref": "#/definitions/sharing_group"
                },
                "ShadowAttribute": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/attribute"
                    }
                },
                "Tag": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/tag"
                    }
                }
            }
        },
        "event": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "orgc_id": {
                    "type": "string"
                },
                "org_id": {
                    "type": "string"
                },
                "date": {
                    "type": "string"
                },
                "threat_level_id": {
                    "type": "string"
                },
                "info": {
                    "type": "string"
                },
                "published": {
                    "type": "boolean"
                },
                "uuid": {
                    "type": "string"
                },
                "attribute_count": {
                    "type": "string"
                },
                "analysis": {
                    "type": "string"
                },
                "timestamp": {
                    "type": "string"
                },
                "distribution": {
                    "type": "string"
                },
                "proposal_email_lock": {
                    "type": "boolean"
                },
                "locked": {
                    "type": "boolean"
                },
                "publish_timestamp": {
                    "type": "string"
                },
                "sharing_group_id": {
                    "type": "string"
                },
                "disable_correlation": {
                    "type": "boolean"
                },
                "event_creator_email": {
                    "type": "string"
                },
                "Org": {
                    "$ref": "#/definitions/org"
                },
                "Orgc": {
                    "$ref": "#/definitions/org"
                },
                "SharingGroup": {
                    "$ref": "#/definitions/sharing_group"
                },
                "Attribute": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/attribute"
                    }
                },
                "ShadowAttribute": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/attribute"
                    }
                },
                "RelatedEvent": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "type": "object",
                        "properties": {
                            "Event": {
                                "$ref": "#/definitions/event"
                            }
                        }
                    }
                },
                "Galaxy": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/galaxy"
                    }
                },
                "Tag": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/tag"
                    }
                }
            }
        },
        "tag": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "colour": {
                    "type": "string"
                },
                "exportable": {
                    "type": "boolean"
                },
                "hide_tag": {
                    "type": "boolean"
                }
            }
        },
        "galaxy": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                },
                "GalaxyCluster": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "$ref": "#/definitions/galaxy_cluster"
                    }
                }
            }
        },
        "galaxy_cluster": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                },
                "tag_name": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "galaxy_id": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "authors": {
                    "type": "array",
                    "_uniqueItems": true,
                    "items": {
                        "type": "string"
                    }
                },
                "tag_id": {
                    "type": "string"
                },
                "meta": {
                    "type": "object"
                }
            }
        }
    },
    "type": "object",
    "properties": {
        "Event": {
            "$ref": "#/definitions/event"
        }
    },
    "required": [
        "Event"
    ]
}