Skip to content

Commit 97b4488

Browse files
OAS Update
1 parent 132f8d0 commit 97b4488

File tree

1 file changed

+316
-1
lines changed

1 file changed

+316
-1
lines changed

services/cdn/v1beta/cdn.json

Lines changed: 316 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,17 @@
6969
"minItems": 1,
7070
"type": "array",
7171
"uniqueItems": true
72+
},
73+
"waf": {
74+
"$ref": "#/components/schemas/WafConfig"
7275
}
7376
},
7477
"required": [
7578
"regions",
7679
"backend",
7780
"blockedIPs",
78-
"blockedCountries"
81+
"blockedCountries",
82+
"waf"
7983
],
8084
"type": "object"
8185
},
@@ -148,6 +152,9 @@
148152
"minItems": 1,
149153
"type": "array",
150154
"uniqueItems": true
155+
},
156+
"waf": {
157+
"$ref": "#/components/schemas/WafConfigPatch"
151158
}
152159
},
153160
"type": "object"
@@ -234,6 +241,9 @@
234241
"minItems": 1,
235242
"type": "array",
236243
"uniqueItems": true
244+
},
245+
"waf": {
246+
"$ref": "#/components/schemas/WafConfig"
237247
}
238248
},
239249
"required": [
@@ -342,6 +352,35 @@
342352
"description": "RFC3339 string which returns the last time the distribution configuration was modified.\n",
343353
"format": "date-time",
344354
"type": "string"
355+
},
356+
"waf": {
357+
"description": "For this property to be present two pre-conditions must be met: \n- the WAF was enabled at least once\n- the query parameter ?withWafStatus is truthy\n\nThis property contains the waf Status. At this point in time, this contains all resolved rules.\nRules are split into 3 groups: \n- enabledRules\n- logOnlyRules \n- disabledRules\n\n**Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!**\n",
358+
"properties": {
359+
"disabledRules": {
360+
"items": {
361+
"$ref": "#/components/schemas/WAFStatusRuleBlock"
362+
},
363+
"type": "array"
364+
},
365+
"enabledRules": {
366+
"items": {
367+
"$ref": "#/components/schemas/WAFStatusRuleBlock"
368+
},
369+
"type": "array"
370+
},
371+
"logOnlyRules": {
372+
"items": {
373+
"$ref": "#/components/schemas/WAFStatusRuleBlock"
374+
},
375+
"type": "array"
376+
}
377+
},
378+
"required": [
379+
"enabledRules",
380+
"logOnlyRules",
381+
"disabledRules"
382+
],
383+
"type": "object"
345384
}
346385
},
347386
"required": [
@@ -890,6 +929,27 @@
890929
],
891930
"type": "object"
892931
},
932+
"ListWAFCollectionsResponse": {
933+
"properties": {
934+
"collections": {
935+
"items": {
936+
"$ref": "#/components/schemas/WAFRuleCollection"
937+
},
938+
"type": "array"
939+
}
940+
},
941+
"required": [
942+
"collections"
943+
],
944+
"type": "object"
945+
},
946+
"LocalizedString": {
947+
"additionalProperties": {
948+
"type": "string"
949+
},
950+
"description": "LocalizedString is a map from language to string value",
951+
"type": "object"
952+
},
893953
"LokiLogSink": {
894954
"properties": {
895955
"pushUrl": {
@@ -1127,6 +1187,134 @@
11271187
"key"
11281188
],
11291189
"type": "object"
1190+
},
1191+
"WAFRule": {
1192+
"properties": {
1193+
"code": {
1194+
"description": "Optional CoreRuleSet rule ID in case this is a CRS rule",
1195+
"type": "string"
1196+
},
1197+
"description": {
1198+
"$ref": "#/components/schemas/LocalizedString"
1199+
},
1200+
"id": {
1201+
"type": "string"
1202+
}
1203+
},
1204+
"required": [
1205+
"id",
1206+
"description"
1207+
],
1208+
"type": "object"
1209+
},
1210+
"WAFRuleCollection": {
1211+
"properties": {
1212+
"groups": {
1213+
"items": {
1214+
"$ref": "#/components/schemas/WAFRuleGroup"
1215+
},
1216+
"type": "array"
1217+
},
1218+
"id": {
1219+
"type": "string"
1220+
},
1221+
"name": {
1222+
"$ref": "#/components/schemas/LocalizedString"
1223+
}
1224+
},
1225+
"required": [
1226+
"name",
1227+
"id",
1228+
"groups"
1229+
],
1230+
"type": "object"
1231+
},
1232+
"WAFRuleGroup": {
1233+
"properties": {
1234+
"description": {
1235+
"$ref": "#/components/schemas/LocalizedString"
1236+
},
1237+
"name": {
1238+
"$ref": "#/components/schemas/LocalizedString"
1239+
},
1240+
"rules": {
1241+
"items": {
1242+
"$ref": "#/components/schemas/WAFRule"
1243+
},
1244+
"type": "array"
1245+
}
1246+
},
1247+
"required": [
1248+
"name",
1249+
"description",
1250+
"rules"
1251+
],
1252+
"type": "object"
1253+
},
1254+
"WAFStatusRuleBlock": {
1255+
"properties": {
1256+
"id": {
1257+
"description": "Specifies the ID of the Rule.",
1258+
"type": "string"
1259+
}
1260+
},
1261+
"required": [
1262+
"id"
1263+
],
1264+
"type": "object"
1265+
},
1266+
"WafConfig": {
1267+
"description": "Configuration of the WAF of a distribution",
1268+
"properties": {
1269+
"enabledRuleIds": {
1270+
"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+
"items": {
1272+
"type": "string"
1273+
},
1274+
"type": "array"
1275+
},
1276+
"mode": {
1277+
"$ref": "#/components/schemas/WafMode"
1278+
},
1279+
"type": {
1280+
"$ref": "#/components/schemas/WafType"
1281+
}
1282+
},
1283+
"required": [
1284+
"mode",
1285+
"type",
1286+
"enabledRuleIds"
1287+
],
1288+
"type": "object"
1289+
},
1290+
"WafConfigPatch": {
1291+
"properties": {
1292+
"mode": {
1293+
"$ref": "#/components/schemas/WafMode"
1294+
},
1295+
"type": {
1296+
"$ref": "#/components/schemas/WafType"
1297+
}
1298+
},
1299+
"type": "object"
1300+
},
1301+
"WafMode": {
1302+
"enum": [
1303+
"DISABLED",
1304+
"ENABLED",
1305+
"LOG_ONLY"
1306+
],
1307+
"format": "enum",
1308+
"type": "string"
1309+
},
1310+
"WafType": {
1311+
"description": "Enable or disable the Premium WAF. Do note that enabling the Premium WAF will cause additional fees. \n\nSome features are gated behind the Premium WAF, like additional, **premium-only rules** and the ability to create **custom rules** (not yet implemented)\n",
1312+
"enum": [
1313+
"FREE",
1314+
"PREMIUM"
1315+
],
1316+
"format": "enum",
1317+
"type": "string"
11301318
}
11311319
}
11321320
},
@@ -1163,6 +1351,15 @@
11631351
"type": "integer"
11641352
}
11651353
},
1354+
{
1355+
"description": "If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules.",
1356+
"in": "query",
1357+
"name": "withWafStatus",
1358+
"schema": {
1359+
"default": false,
1360+
"type": "boolean"
1361+
}
1362+
},
11661363
{
11671364
"description": "Identifier is returned by the previous response and is used to request the next page.\n\nAs the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result.\nSo a scenario like: \n- Start listing first page\n- Insert new element\n- Start listing second page\nwill *never* result in an element from the first page to get \"pushed\" to the second page, like it could \noccur with basic limit + offset pagination.\n\nThe identifier should be treated as an opaque string and never modified. Only pass values returned by the API.\n",
11681365
"in": "query",
@@ -1656,6 +1853,15 @@
16561853
"format": "uuid",
16571854
"type": "string"
16581855
}
1856+
},
1857+
{
1858+
"description": "If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules.",
1859+
"in": "query",
1860+
"name": "withWafStatus",
1861+
"schema": {
1862+
"default": false,
1863+
"type": "boolean"
1864+
}
16591865
}
16601866
],
16611867
"responses": {
@@ -3221,6 +3427,115 @@
32213427
"resource-type": "project"
32223428
}
32233429
}
3430+
},
3431+
"/v1beta/projects/{projectId}/waf/collections": {
3432+
"get": {
3433+
"description": "Returns all WAF rule collections available to the project",
3434+
"operationId": "ListWAFCollections",
3435+
"parameters": [
3436+
{
3437+
"description": "Your STACKIT Project ID",
3438+
"in": "path",
3439+
"name": "projectId",
3440+
"required": true,
3441+
"schema": {
3442+
"type": "string"
3443+
}
3444+
}
3445+
],
3446+
"responses": {
3447+
"200": {
3448+
"content": {
3449+
"application/json": {
3450+
"examples": {
3451+
"default": {
3452+
"value": {
3453+
"collections": [
3454+
{
3455+
"groups": [
3456+
{
3457+
"description": {},
3458+
"name": {
3459+
"en": "Method Enforcement"
3460+
},
3461+
"rules": [
3462+
{
3463+
"code": "911100",
3464+
"description": {
3465+
"en": "Method is not allowed by policy"
3466+
},
3467+
"id": "@builtin/crs/request/911100"
3468+
}
3469+
]
3470+
}
3471+
],
3472+
"id": "@builtin/crs/request",
3473+
"name": {
3474+
"en": "CRS Request"
3475+
}
3476+
}
3477+
]
3478+
}
3479+
}
3480+
},
3481+
"schema": {
3482+
"$ref": "#/components/schemas/ListWAFCollectionsResponse"
3483+
}
3484+
}
3485+
},
3486+
"description": "OK"
3487+
},
3488+
"401": {
3489+
"content": {
3490+
"text/plain": {
3491+
"schema": {
3492+
"type": "string"
3493+
}
3494+
}
3495+
},
3496+
"description": "unauthorized - please make sure the \"Authorization\" header is set and uses correct credentials"
3497+
},
3498+
"422": {
3499+
"content": {
3500+
"application/json": {
3501+
"schema": {
3502+
"$ref": "#/components/schemas/GenericJSONResponse"
3503+
}
3504+
}
3505+
},
3506+
"description": "unprocessable entity - please make sure the body you provided is constructed according to spec"
3507+
},
3508+
"500": {
3509+
"content": {
3510+
"application/json": {
3511+
"schema": {
3512+
"$ref": "#/components/schemas/GenericJSONResponse"
3513+
}
3514+
}
3515+
},
3516+
"description": "internal error - please try again later or contact support if the issue persists"
3517+
},
3518+
"default": {
3519+
"content": {
3520+
"application/json": {
3521+
"schema": {
3522+
"$ref": "#/components/schemas/GenericJSONResponse"
3523+
}
3524+
}
3525+
},
3526+
"description": "Default error response"
3527+
}
3528+
},
3529+
"summary": "List all WAF rule collections of the project",
3530+
"x-stackit-authorization": {
3531+
"actions": [
3532+
"cdn.distribution.get"
3533+
],
3534+
"resource-id": "projectId",
3535+
"resource-id-type": "dynamic",
3536+
"resource-type": "project"
3537+
}
3538+
}
32243539
}
32253540
},
32263541
"security": [

0 commit comments

Comments
 (0)