iami233
iami233
文章133
标签35
分类4
关于Ten·API防火墙的配置

关于Ten·API防火墙的配置

最近API请求数激增,每天以20w的次数递增,目前已经到了160w…原本打算开发一个管理系统,限制用户调用数,但是计划赶不上变化。(服务器只是1h1g的小鸡,撑不住了日常负载和CPU占用100%)如果你愿意赞助请前往:https://5ime.cn/about/#%E6%8A%95%E9%A3%9F-I-Am-I

现在全站已经迁移到Cloudflare,薅一波资本主义羊毛,但是迁移过去之后服务器直接502(很奇怪),排查了一下,为避免其他用户受影响,现决定开启防火墙。

不得不说cf的防火墙挺不错,目前防火墙规则配置如下,如有误封,请在本页面留言

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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
最后更新时间2022061118:40

屏蔽用户代理:
// 屏蔽的都是不常见的UA,且大批量请求!
包含:Dalvik/2.1.0
包含:Apache-HttpClient
等于:Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1)
等于:Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)

屏蔽IP:
// 通过IPIP查询判定为代理,且大批量请求!
218.206.154.3
61.140.87.45
218.19.214.214
119.85.107.0/24

// 傻逼脚本小子
103.159.64.202
113.81.101.222
81.71.101.188
139.224.11.234
209.126.151.0/24
164.68.102.233
41.77.245.76
20.80.20.97
45.132.238.138
31.171.154.135
194.9.70.148
218.5.41.208
161.35.86.181
103.44.20.186
222.77.111.174
167.71.13.196
193.107.216.227
112.13.96.187
34.226.66.3
45.82.79.15
45.95.147.15
23.224.121.37
193.93.195.179
58.251.121.184
124.160.214.143
134.122.112.12
143.244.41.194
110.86.174.79
45.146.164.37
2404:8c80:0:1001:152:4ae8:5d4e:b9d1
52.188.162.137
194.48.199.121
107.150.108.50
194.48.199.78
45.143.200.54
129.213.134.20
130.61.112.134
148.66.31.138
45.141.84.35
106.53.124.110
103.148.58.148
223.90.4.218
156.251.136.4
180.215.5.133
101.36.172.194
119.29.119.174
178.18.241.45
193.122.157.228
185.202.1.30
193.135.12.33
130.61.131.151
119.90.52.42
132.145.60.63
112.213.97.64
39.68.85.107
171.221.151.93
103.249.106.49
222.186.133.9
111.6.78.243
185.53.89.191
101.80.66.66
2a02:13f0:8100:1:a1f9:d429:94eb:566
154.202.60.47
118.107.44.197
103.206.21.107
171.35.167.36
2002:766b:2cc5::766b:2cc5
156.247.10.42
103.45.158.148
103.146.124.72
132.145.98.193
91.132.58.0/24
45.227.254.31
91.191.209.164
116.202.8.57
118.195.194.32
45.207.55.54
176.113.71.6
125.88.153.227
106.14.208.14
49.234.24.125
47.113.220.205
180.97.118.207
222.186.160.185
45.9.20.78
161.35.188.242
132.145.155.245
45.227.254.6
194.165.16.88
197.248.146.186
91.132.58.62
130.61.178.230
122.114.65.78
59.52.178.202
172.87.27.129
157.245.149.125
43.129.196.60
42.228.160.101
216.224.120.188
113.245.61.25
216.224.120.204
139.9.205.81
216.224.120.205
240e:454:594:78d:cd2e:4fa9:c701:1ff4
240e:398:b3c1:7410:bdf4:abc3:e56e:9ce0
39.109.115.60
106.55.202.118
125.39.132.125
120.70.48.226
172.87.27.130
23.247.108.44
113.96.223.69
58.253.155.242
206.189.49.59
183.221.76.132
39.155.215.213
116.29.247.197
150.109.198.209
141.98.9.21
135.181.165.30
193.56.146.22
91.132.58.81
156.96.47.131
143.198.136.88
193.107.216.49
132.145.52.245
5.188.86.100
45.227.253.141
193.242.145.112
140.238.88.136
130.61.39.91
106.55.57.30
45.134.144.8
185.191.32.158
178.239.21.101
91.132.58.79
140.238.156.169
167.99.133.28
178.239.21.161
5.188.206.18
185.150.189.219
213.5.47.43
45.134.144.43
112.5.37.24
23.247.108.47
112.5.37.79
2408:8420:3da0:5f8:49cf:19e7:58ab:44a5
240e:468:882:2015:9887:5ce0:b3c2:60c1
211.136.253.191
182.148.5.106
202.182.112.76
113.218.129.103
101.34.170.87
171.113.20.32
103.194.185.234
59.55.155.167
156.247.9.41
182.161.38.109
2408:8420:3dd0:554:c818:c838:493f:70e0
167.99.116.148
216.118.235.146
18.193.149.176
240e:314:a29c:8a00:ed4a:fcd1:b28e:91bd
116.77.73.249
2409:8954:8864:28e6:cd23:a61:5120:862
156.247.11.114
110.229.221.92
45.32.102.35
159.223.112.146
39.108.104.53
20.85.224.59
131.255.132.254
83.138.53.128
132.145.109.31
45.61.138.112
178.239.21.162
213.5.47.43
217.165.24.22
185.191.32.210
178.239.21.102
80.82.65.247
45.134.144.42
130.61.227.230
89.248.165.207
91.211.91.104
87.251.64.187
45.146.164.160
218.19.139.32
137.175.7.5
117.44.219.180
2a02:13f0:8100:1:ad0e:df99:f1ea:d0b6
94.102.56.151
134.122.80.186
156.255.2.63
167.71.68.203
132.145.62.87
2409:8944:6640:201d:d956:ec06:7d9e:6d3c
162.33.178.15
156.247.11.1/24
62.210.188.203
14.18.100.250
130.61.227.230
2408:844d:7608:134b:1:1:fa6c:997a
92.205.27.92
117.60.2.32
130.61.233.198
45.155.205.233
120.12.206.108
195.54.160.149
114.217.21.115
119.28.189.182
27.159.92.125
81.30.157.43
19.42.149.170
223.89.116.73
173.212.233.104
101.43.118.245
196.196.150.38
140.246.171.141
218.104.71.166
167.71.175.10
180.129.129.242
45.83.65.197
45.83.65.82
46.105.95.220
125.124.82.198
139.9.76.254
185.220.100.252
221.222.26.163
36.138.125.119
122.228.208.223
27.159.92.85
223.111.134.143
89.248.160.193
175.6.210.66
216.224.121.150
120.24.23.84
27.159.66.46
139.9.190.25
185.191.34.215
103.194.186.194
138.99.216.222
103.231.174.50
27.159.92.84
27.128.174.160
23.101.132.31
45.144.113.252
45.158.22.40
175.6.82.53
45.134.144.108
103.231.174.90
64.225.23.78
178.239.21.103
128.106.139.182
92.255.85.105
86.104.10.77
24.55.159.18
43.248.130.211
112.30.131.54
45.115.243.144
89.248.163.174
89.248.163.177
112.5.37.149
65.190.126.210
116.14.110.40
150.136.181.131
172.87.29.127
27.150.86.28
202.79.171.176
212.243.9.107
113.120.119.125
115.207.62.6
50.117.24.210
113.96.223.239
174.138.6.169
113.96.223.240
117.151.92.48
39.128.126.255
117.136.21.102
189.206.70.33
112.213.97.73
150.107.76.150
58.69.82.84
23.27.76.147
27.150.181.196
154.86.128.221
193.218.118.231
114.236.107.162
187.189.153.219
113.120.37.65
121.233.9.99
185.23.108.23
139.5.177.59
43.132.182.113
103.100.208.119
49.232.201.73
20.124.233.161
222.186.43.126
45.201.198.232
172.105.87.91
98.0.242.10
81.171.9.199
110.240.89.236
178.239.21.16
81.171.9.209
173.255.132.116
113.124.222.150
45.195.52.91
2.56.59.95
178.239.21.104
45.156.84.170
5.188.159.169
103.194.184.42
173.248.241.36
141.164.55.217
45.136.12.217
138.199.55.45
137.116.138.73
194.76.225.97
45.134.144.140
112.5.37.142
45.136.12.208
45.134.144.144
221.228.87.37
101.72.183.9
185.83.144.103
45.134.144.141
138.99.216.224
45.134.144.143
39.144.197.164
167.179.48.56
112.47.58.180
112.5.37.192
180.215.150.13
185.232.52.44
157.245.222.40
185.232.52.38
94.158.80.118
175.178.84.120
216.83.53.42
2002:d853:352a::d853:352a
193.201.8.107
45.120.54.132
38.55.216.222
154.222.228.118
20.127.112.167
179.60.147.11
78.128.113.170
86.106.121.113
142.132.155.16
37.0.8.124
218.2.216.28
45.134.144.155
218.2.216.5
154.6.18.75
182.255.63.157
185.135.73.13
43.248.96.187
47.89.17.189
106.75.28.105
149.56.234.155
136.243.58.229
112.47.61.147
91.191.209.190
141.144.232.84
1.192.56.225
222.186.48.108
45.135.232.80
60.205.179.10
38.55.216.0/24
154.222.232.76
51.103.179.197
216.83.52.14
45.55.52.204
139.60.160.162
45.134.144.159
124.248.67.49
43.250.200.125
103.42.178.235
139.28.235.104
26.190.149.249
12.227.226.96
162.20.200.157
57.254.127.147
20.205.168.121
222.186.43.119
88.214.43.118
31.222.174.143
43.129.74.19
171.217.251.81
44.201.175.121
106.55.161.163
192.151.197.146
103.60.150.10
1.13.16.151
92.205.59.185
203.135.98.51
103.54.124.242
116.63.137.251
54.151.189.202
192.161.161.105
192.151.197.147
47.106.157.11
103.194.184.18
106.75.216.101
216.83.58.97
124.220.163.140
43.248.133.64
45.207.39.102
2408:845c:b900:4eba:79a9:45a4:ca35:f0f6
222.79.61.224
45.207.39.117
203.86.233.200
45.207.39.110
45.207.39.99
203.135.98.102
182.255.63.28
110.40.206.239
45.80.191.58
45.80.191.43
154.222.238.34
20.94.248.189
202.95.13.52
154.222.238.32
143.92.48.2
193.134.208.51
116.225.32.35
154.83.113.10
2a06:98c0:3600::103
134.195.208.171
159.89.190.118
154.204.41.60
45.207.37.24
64.140.131.246
192.64.113.244
185.175.156.40
92.38.133.82
170.130.165.192
172.104.159.48
45.134.144.53
185.162.235.175
179.60.147.21
170.130.55.178
194.165.17.12
1.81.129.47
36.134.86.152
121.140.205.106
154.39.238.150
185.135.73.12
43.138.41.187
118.117.189.88
111.224.144.59
111.225.152.143
111.224.144.196
117.94.223.168
223.198.253.35
223.198.252.122
117.69.24.204
49.70.154.70
58.243.139.172
110.89.122.207
58.243.143.84
103.194.185.162
182.16.17.234
112.213.121.83
111.90.147.124
101.99.93.115
112.213.116.26
52.128.229.50
216.118.226.178
112.206.107.228
117.50.111.6
52.128.229.50
118.107.45.5
223.73.10.85
122.55.53.206
47.98.44.126
185.135.73.232
45.137.20.41
103.106.247.100
20.125.134.75
45.133.193.89
139.5.200.26
116.213.36.10
1.13.18.208
116.213.36.226
121.140.205.137
209.141.55.115
139.162.49.49
112.213.121.41
13.53.194.237
5.45.96.177
185.220.100.243
45.79.93.245
104.244.79.9
138.201.62.183
103.40.113.229
161.35.236.140
193.32.126.152
152.1.66.151
89.248.165.178
92.255.85.38
185.36.81.95
170.130.165.221
92.255.85.112
42.194.241.189
45.72.110.145
193.201.9.69
164.138.103.215
216.131.114.49
185.147.212.114
217.182.199.126
216.131.114.102
37.120.144.231
20.84.241.142
185.174.159.20
216.151.180.100
103.209.253.10
45.134.144.200
147.135.36.162
185.162.235.162
本文作者:iami233
本文链接:https://5ime.cn/apifirewall.html
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可