forked from aerleon/aerleon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaerleon-policy-yaml.schema.json
81 lines (81 loc) · 2.11 KB
/
aerleon-policy-yaml.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
"$id": "urn:aerleon:schemas:aerleon-policy-yaml:1.0.0",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "AerleonPolicyFile",
"description": "An Aerleon policy file represents a platform-agnostic network policy. It must define one or more filter objects.",
"oneOf": [
{ "$ref": "#/$defs/policyIncludeFile" },
{ "$ref": "#/$defs/policyFile" }
],
"$defs": {
"policyFile": {
"type": "object",
"title": "PolicyFile",
"description": "A policy file contains one or more filters, where each filter has a unique list of target platforms and a unique list of terms.",
"required": ["filters"],
"properties": {
"filters": {
"type": "array",
"items": { "$ref": "#/$defs/filter" }
}
}
},
"policyIncludeFile": {
"type": "object",
"title": "PolicyIncludeFile",
"description": "A policy include file only defines a list of terms. This file can be inserted into any list of terms.",
"required": ["terms"],
"properties": {
"terms": {
"type": "array",
"items": { "$ref": "#/$defs/term" }
}
}
},
"filter": {
"type": "object",
"required": ["header", "terms"],
"header": {
"type": { "$ref": "#/$defs/filterHeader" }
},
"terms": {
"type": "list",
"items": { "$ref": "#/$defs/term" }
},
"additionalProperties": true
},
"filterHeader": {
"type": "object",
"title": "FilterHeader",
"required": ["targets"],
"targets": {
"type": "object"
}
},
"term": {
"title": "Term",
"oneOf": [
{
"type": "object",
"required": "name",
"properties": {
"name": {
"type": "string"
}
},
"additionalProperties": true
},
{
"type": "object",
"required": "include",
"properties": {
"name": {
"type": "string"
}
},
"additionalProperties": false
}
]
}
}
}