|
430 | 430 | "timestamp": { |
431 | 431 | "format": "date-time", |
432 | 432 | "type": "string" |
| 433 | + }, |
| 434 | + "wafViolation": { |
| 435 | + "$ref": "#/components/schemas/WAFViolation" |
433 | 436 | } |
434 | 437 | }, |
435 | 438 | "required": [ |
|
611 | 614 | "enum": [ |
612 | 615 | "UNKNOWN", |
613 | 616 | "CUSTOM_DOMAIN_CNAME_MISSING", |
614 | | - "INVALID_ARGUMENT" |
| 617 | + "INVALID_ARGUMENT", |
| 618 | + "LOG_SINK_INSTANCE_UNAVAILABLE" |
615 | 619 | ], |
616 | 620 | "minLength": 1, |
617 | 621 | "type": "string" |
|
1052 | 1056 | "properties": { |
1053 | 1057 | "certificate": { |
1054 | 1058 | "description": "base64-encoded PEM-encoded certificate", |
1055 | | - "type": "string" |
| 1059 | + "type": "string", |
| 1060 | + "x-go-type": "secret.Secret" |
1056 | 1061 | }, |
1057 | 1062 | "key": { |
1058 | 1063 | "description": "base64-encoded PEM encoded key", |
1059 | | - "type": "string" |
| 1064 | + "type": "string", |
| 1065 | + "x-go-type": "secret.Secret" |
1060 | 1066 | }, |
1061 | 1067 | "type": { |
1062 | 1068 | "type": "string" |
|
1155 | 1161 | "SA", |
1156 | 1162 | "ASIA" |
1157 | 1163 | ], |
1158 | | - "format": "enum", |
1159 | 1164 | "type": "string" |
1160 | 1165 | }, |
1161 | 1166 | "StatusError": { |
|
1176 | 1181 | "UNKNOWN", |
1177 | 1182 | "CUSTOM_DOMAIN_CNAME_MISSING", |
1178 | 1183 | "CUSTOM_DOMAIN_ALREADY_IN_USE", |
1179 | | - "PUBLIC_BETA_QUOTA_REACHED" |
| 1184 | + "PUBLIC_BETA_QUOTA_REACHED", |
| 1185 | + "LOG_SINK_INSTANCE_UNAVAILABLE", |
| 1186 | + "EXTERNAL_QUOTA_REACHED" |
1180 | 1187 | ], |
1181 | 1188 | "minLength": 1, |
1182 | 1189 | "type": "string" |
|
1207 | 1214 | ], |
1208 | 1215 | "type": "object" |
1209 | 1216 | }, |
| 1217 | + "WAFRuleAction": { |
| 1218 | + "description": "The action a WAF rule can take based on a request", |
| 1219 | + "enum": [ |
| 1220 | + "BLOCKED", |
| 1221 | + "LOGGED", |
| 1222 | + "ALLOWED" |
| 1223 | + ], |
| 1224 | + "type": "string" |
| 1225 | + }, |
1210 | 1226 | "WAFRuleCollection": { |
1211 | 1227 | "properties": { |
1212 | 1228 | "groups": { |
|
1263 | 1279 | ], |
1264 | 1280 | "type": "object" |
1265 | 1281 | }, |
| 1282 | + "WAFViolation": { |
| 1283 | + "description": "Information about a violated WAF rule in case the WAF is enabled and a rule was triggered (either in BLOCK or LOG_ONLY mode)", |
| 1284 | + "properties": { |
| 1285 | + "action": { |
| 1286 | + "$ref": "#/components/schemas/WAFRuleAction" |
| 1287 | + }, |
| 1288 | + "asn": { |
| 1289 | + "description": "ASN for the request", |
| 1290 | + "type": "string" |
| 1291 | + }, |
| 1292 | + "message": { |
| 1293 | + "description": "Rule specific message explaining the violation", |
| 1294 | + "type": "string" |
| 1295 | + }, |
| 1296 | + "method": { |
| 1297 | + "description": "HTTP Method of the request that triggered the violation", |
| 1298 | + "type": "string" |
| 1299 | + }, |
| 1300 | + "requestHeaders": { |
| 1301 | + "additionalProperties": { |
| 1302 | + "type": "string" |
| 1303 | + }, |
| 1304 | + "type": "object" |
| 1305 | + }, |
| 1306 | + "ruleId": { |
| 1307 | + "description": "ID of the WAF rule that was triggered", |
| 1308 | + "type": "string" |
| 1309 | + } |
| 1310 | + }, |
| 1311 | + "required": [ |
| 1312 | + "ruleId", |
| 1313 | + "method", |
| 1314 | + "message", |
| 1315 | + "asn", |
| 1316 | + "requestHeaders", |
| 1317 | + "action" |
| 1318 | + ], |
| 1319 | + "type": "object" |
| 1320 | + }, |
1266 | 1321 | "WafConfig": { |
1267 | 1322 | "description": "Configuration of the WAF of a distribution", |
1268 | 1323 | "properties": { |
| 1324 | + "allowedHttpMethods": { |
| 1325 | + "items": { |
| 1326 | + "type": "string" |
| 1327 | + }, |
| 1328 | + "type": "array" |
| 1329 | + }, |
| 1330 | + "allowedHttpVersions": { |
| 1331 | + "items": { |
| 1332 | + "type": "string" |
| 1333 | + }, |
| 1334 | + "type": "array" |
| 1335 | + }, |
| 1336 | + "allowedRequestContentTypes": { |
| 1337 | + "items": { |
| 1338 | + "type": "string" |
| 1339 | + }, |
| 1340 | + "type": "array" |
| 1341 | + }, |
1269 | 1342 | "enabledRuleIds": { |
1270 | 1343 | "description": "IDs of the WAF rules that are **explicitly** enabled for this distribution. \nIf this rule is in a disabled / log Only RuleGroup or Collection,\nit will be enabled regardless as `enabledRuleIds` overrides those in specificity.\n\nDo note that rules can also be enabled because a Rulegroup or Collection is enabled. \n**DO NOT** use this property to find all active rules. Instead, pass `?withWafStatus=true` as a query parameter\nto `GetDistribution` or `ListDistributions`. This will expose the `waf` Property on distribution Level.\n\nFrom there you can `$.waf.enabledRules.map(e =\u003e e.id)` to get a list of all enabled rules.\n", |
1271 | 1344 | "items": { |
|
1276 | 1349 | "mode": { |
1277 | 1350 | "$ref": "#/components/schemas/WafMode" |
1278 | 1351 | }, |
| 1352 | + "paranoiaLevel": { |
| 1353 | + "$ref": "#/components/schemas/WafParanoiaLevel" |
| 1354 | + }, |
1279 | 1355 | "type": { |
1280 | 1356 | "$ref": "#/components/schemas/WafType" |
1281 | 1357 | } |
|
1289 | 1365 | }, |
1290 | 1366 | "WafConfigPatch": { |
1291 | 1367 | "properties": { |
| 1368 | + "allowedHttpMethods": { |
| 1369 | + "items": { |
| 1370 | + "type": "string" |
| 1371 | + }, |
| 1372 | + "type": "array" |
| 1373 | + }, |
| 1374 | + "allowedHttpVersions": { |
| 1375 | + "items": { |
| 1376 | + "type": "string" |
| 1377 | + }, |
| 1378 | + "type": "array" |
| 1379 | + }, |
| 1380 | + "allowedRequestContentTypes": { |
| 1381 | + "items": { |
| 1382 | + "type": "string" |
| 1383 | + }, |
| 1384 | + "type": "array" |
| 1385 | + }, |
1292 | 1386 | "mode": { |
1293 | 1387 | "$ref": "#/components/schemas/WafMode" |
1294 | 1388 | }, |
| 1389 | + "paranoiaLevel": { |
| 1390 | + "$ref": "#/components/schemas/WafParanoiaLevel" |
| 1391 | + }, |
1295 | 1392 | "type": { |
1296 | 1393 | "$ref": "#/components/schemas/WafType" |
1297 | 1394 | } |
|
1304 | 1401 | "ENABLED", |
1305 | 1402 | "LOG_ONLY" |
1306 | 1403 | ], |
1307 | | - "format": "enum", |
| 1404 | + "type": "string" |
| 1405 | + }, |
| 1406 | + "WafParanoiaLevel": { |
| 1407 | + "description": "The paranoia level defines how aggressively the WAF should action on requests. \nIt ranges from `L1` (least strict, lowest chance of false positives) to `L4` (most strict, highest chance of false positives).\nA higher paranoia level is more effective at catching attacks but can also block legitimate traffic.\n", |
| 1408 | + "enum": [ |
| 1409 | + "L1", |
| 1410 | + "L2", |
| 1411 | + "L3", |
| 1412 | + "L4" |
| 1413 | + ], |
1308 | 1414 | "type": "string" |
1309 | 1415 | }, |
1310 | 1416 | "WafType": { |
|
1313 | 1419 | "FREE", |
1314 | 1420 | "PREMIUM" |
1315 | 1421 | ], |
1316 | | - "format": "enum", |
1317 | 1422 | "type": "string" |
1318 | 1423 | } |
1319 | 1424 | } |
|
1383 | 1488 | "status", |
1384 | 1489 | "originUrlRelated" |
1385 | 1490 | ], |
1386 | | - "format": "enum", |
1387 | 1491 | "type": "string" |
1388 | 1492 | } |
1389 | 1493 | }, |
|
1395 | 1499 | "ascending", |
1396 | 1500 | "descending" |
1397 | 1501 | ], |
1398 | | - "format": "enum", |
1399 | 1502 | "type": "string" |
1400 | 1503 | } |
1401 | 1504 | } |
|
2937 | 3040 | "type": "string" |
2938 | 3041 | } |
2939 | 3042 | }, |
| 3043 | + { |
| 3044 | + "description": "If this is set then only log entries with the chosen WAF rule action/outcome are returned.\nSpecifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where\na WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged \nbut the request not blocked\n", |
| 3045 | + "in": "query", |
| 3046 | + "name": "wafAction", |
| 3047 | + "schema": { |
| 3048 | + "$ref": "#/components/schemas/WAFRuleAction" |
| 3049 | + } |
| 3050 | + }, |
2940 | 3051 | { |
2941 | 3052 | "description": "Quantifies how many log entries should be returned on this \npage. Must be a natural number between 1 and 1000 (inclusive)\n", |
2942 | 3053 | "in": "query", |
|
2974 | 3085 | "path", |
2975 | 3086 | "host" |
2976 | 3087 | ], |
2977 | | - "format": "enum", |
2978 | 3088 | "type": "string" |
2979 | 3089 | } |
2980 | 3090 | }, |
|
2986 | 3096 | "ascending", |
2987 | 3097 | "descending" |
2988 | 3098 | ], |
2989 | | - "format": "enum", |
2990 | 3099 | "type": "string" |
2991 | 3100 | } |
2992 | 3101 | }, |
|
0 commit comments