-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vuln-policy.schema.json
168 lines (168 loc) · 5.84 KB
/
vuln-policy.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Policy",
"type": "object",
"properties": {
"apiVersion": {
"description": "API Version.",
"type": "string"
},
"type": {
"description": "Type of the policy.",
"const": "Vulnerability Policy"
},
"name": {
"description": "Name of the policy.",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"description": {
"description": "Short description of the policy.",
"type": "string",
"minLength": 1,
"maxLength": 512
},
"author": {
"description": "Name of the policy author.",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"validFrom": {
"description": "When the policy should take effect (in RFC3339 format).",
"type": "string",
"format": "date-time"
},
"validUntil": {
"description": "Until when the policy should take effect (in RFC3339 format).",
"type": "string",
"format": "date-time"
},
"conditions": {
"description": "1..N conditions as CEL expressions.",
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
},
"analysis": {
"description": "The analysis to apply when all expressions match.",
"type": "object",
"properties": {
"state": {
"description": "State of the analysis.",
"enum": [
"EXPLOITABLE",
"IN_TRIAGE",
"FALSE_POSITIVE",
"NOT_AFFECTED",
"RESOLVED"
]
},
"justification": {
"description": "Justification for the state.",
"enum": [
"CODE_NOT_PRESENT",
"CODE_NOT_REACHABLE",
"REQUIRES_CONFIGURATION",
"REQUIRES_DEPENDENCY",
"REQUIRES_ENVIRONMENT",
"PROTECTED_BY_COMPILER",
"PROTECTED_AT_RUNTIME",
"PROTECTED_AT_PERIMETER",
"PROTECTED_BY_MITIGATING_CONTROL"
]
},
"vendorResponse": {
"description": "What to communicate to consumers for this finding (from a vendor POV).",
"enum": [
"CAN_NOT_FIX",
"WILL_NOT_FIX",
"UPDATE",
"ROLLBACK",
"WORKAROUND_AVAILABLE"
]
},
"details": {
"description": "Additional details about why this analysis was made.",
"type": "string"
},
"suppress": {
"description": "Whether to suppress the finding.",
"type": "boolean"
}
},
"required": [
"state"
]
},
"ratings": {
"description": "0..3 ratings to apply to the finding when all expressions match.",
"type": "array",
"items": {
"$ref": "#/$defs/rating"
},
"minItems": 0,
"maxItems": 3
},
"operationMode": {
"description": "Mode of operation for the vulnerability policy.",
"enum": [
"DISABLED",
"APPLY",
"LOG"
]
}
},
"$defs": {
"rating": {
"type": "object",
"properties": {
"method": {
"description": "Methodology of the rating (e.g. CVSSv2, OWASP).",
"enum": [
"CVSSV2",
"CVSSV3",
"CVSSV31",
"OWASP"
]
},
"severity": {
"description": "Severity (LOW, MEDIUM, etc.).",
"enum": [
"CRITICAL",
"HIGH",
"MEDIUM",
"LOW",
"INFO",
"UNASSIGNED"
]
},
"vector": {
"description": "Vector of the method.",
"type": "string",
"pattern": "(SL:\\d/M:\\d/O:\\d/S:\\d/ED:\\d/EE:\\d/A:\\d/ID:\\d/LC:\\d/LI:\\d/LAV:\\d/LAC:\\d/FD:\\d/RD:\\d/NC:\\d/PV:\\d)|(AV:(N|A|L)\\/AC:(L|M|H)\\/A[Uu]:(N|S|M)\\/C:(N|P|C)\\/I:(N|P|C)\\/A:(N|P|C)|AV:(N|A|L|P)\\/AC:(L|H)\\/PR:(N|L|H)\\/UI:(N|R)\\/S:(U|C)\\/C:(N|L|H)\\/I:(N|L|H)\\/A:(N|L|H))|(AV:(N|A|L|P)\\/AC:(L|H)\\/PR:(N|L|H)\\/UI:(N|R)\\/S:(U|C)\\/C:(N|L|H)\\/I:(N|L|H)\\/A:(N|L|H)\\/E:(F|H|U|P|X)\\/RL:(W|U|T|O|X)\\/RC:(C|R|U|X)\\/CR:(X|L|M|H)\\/IR:(X|L|M|H)\\/AR:(X|L|M|H)\\/MAV:(X|N|A|L|P)\\/MAC:(X|L|H)\\/MPR:(X|N|L|H)\\/MUI:(X|N|R)\\/MS:(X|U|C)\\/MC:(X|N|L|H)\\/MI:(X|N|L|H)\\/MA:(X|N|L|H))"
},
"score": {
"description": "Numeric score for the method.",
"type": "number"
}
},
"required": [
"method",
"severity"
]
}
},
"required": [
"apiVersion",
"type",
"name",
"conditions",
"analysis",
"operationMode"
],
"additionalProperties": false
}