| 1 |
{ |
| 2 |
"nftables": [ |
| 3 |
{ |
| 4 |
"metainfo": { |
| 5 |
"version": "VERSION", |
| 6 |
"release_name": "RELEASE_NAME", |
| 7 |
"json_schema_version": 1 |
| 8 |
} |
| 9 |
}, |
| 10 |
{ |
| 11 |
"table": { |
| 12 |
"family": "inet", |
| 13 |
"name": "filter", |
| 14 |
"handle": 0 |
| 15 |
} |
| 16 |
}, |
| 17 |
{ |
| 18 |
"chain": { |
| 19 |
"family": "inet", |
| 20 |
"table": "filter", |
| 21 |
"name": "input", |
| 22 |
"handle": 0, |
| 23 |
"type": "filter", |
| 24 |
"hook": "input", |
| 25 |
"prio": 0, |
| 26 |
"policy": "accept" |
| 27 |
} |
| 28 |
}, |
| 29 |
{ |
| 30 |
"limit": { |
| 31 |
"family": "inet", |
| 32 |
"name": "tarpit-pps", |
| 33 |
"table": "filter", |
| 34 |
"handle": 0, |
| 35 |
"rate": 1, |
| 36 |
"per": "second", |
| 37 |
"burst": 5 |
| 38 |
} |
| 39 |
}, |
| 40 |
{ |
| 41 |
"limit": { |
| 42 |
"family": "inet", |
| 43 |
"name": "tarpit-bps", |
| 44 |
"table": "filter", |
| 45 |
"handle": 0, |
| 46 |
"rate": 1, |
| 47 |
"per": "second", |
| 48 |
"rate_unit": "kbytes" |
| 49 |
} |
| 50 |
}, |
| 51 |
{ |
| 52 |
"limit": { |
| 53 |
"family": "inet", |
| 54 |
"name": "http-bulk-rl-1m", |
| 55 |
"table": "filter", |
| 56 |
"handle": 0, |
| 57 |
"rate": 1, |
| 58 |
"per": "second", |
| 59 |
"rate_unit": "mbytes" |
| 60 |
} |
| 61 |
}, |
| 62 |
{ |
| 63 |
"limit": { |
| 64 |
"family": "inet", |
| 65 |
"name": "http-bulk-rl-10m", |
| 66 |
"table": "filter", |
| 67 |
"handle": 0, |
| 68 |
"rate": 10, |
| 69 |
"per": "second", |
| 70 |
"rate_unit": "mbytes" |
| 71 |
} |
| 72 |
}, |
| 73 |
{ |
| 74 |
"set": { |
| 75 |
"family": "inet", |
| 76 |
"name": "tarpit4", |
| 77 |
"table": "filter", |
| 78 |
"type": { |
| 79 |
"typeof": { |
| 80 |
"payload": { |
| 81 |
"protocol": "ip", |
| 82 |
"field": "saddr" |
| 83 |
} |
| 84 |
} |
| 85 |
}, |
| 86 |
"handle": 0, |
| 87 |
"size": 10000, |
| 88 |
"flags": [ |
| 89 |
"timeout", |
| 90 |
"dynamic" |
| 91 |
], |
| 92 |
"timeout": 60 |
| 93 |
} |
| 94 |
}, |
| 95 |
{ |
| 96 |
"set": { |
| 97 |
"family": "inet", |
| 98 |
"name": "tarpit6", |
| 99 |
"table": "filter", |
| 100 |
"type": { |
| 101 |
"typeof": { |
| 102 |
"payload": { |
| 103 |
"protocol": "ip6", |
| 104 |
"field": "saddr" |
| 105 |
} |
| 106 |
} |
| 107 |
}, |
| 108 |
"handle": 0, |
| 109 |
"size": 10000, |
| 110 |
"flags": [ |
| 111 |
"timeout", |
| 112 |
"dynamic" |
| 113 |
], |
| 114 |
"timeout": 60 |
| 115 |
} |
| 116 |
}, |
| 117 |
{ |
| 118 |
"map": { |
| 119 |
"family": "inet", |
| 120 |
"name": "addr4limit", |
| 121 |
"table": "filter", |
| 122 |
"type": { |
| 123 |
"typeof": { |
| 124 |
"concat": [ |
| 125 |
{ |
| 126 |
"meta": { |
| 127 |
"key": "l4proto" |
| 128 |
} |
| 129 |
}, |
| 130 |
{ |
| 131 |
"payload": { |
| 132 |
"protocol": "ip", |
| 133 |
"field": "saddr" |
| 134 |
} |
| 135 |
}, |
| 136 |
{ |
| 137 |
"payload": { |
| 138 |
"protocol": "tcp", |
| 139 |
"field": "sport" |
| 140 |
} |
| 141 |
} |
| 142 |
] |
| 143 |
} |
| 144 |
}, |
| 145 |
"handle": 0, |
| 146 |
"map": "limit", |
| 147 |
"flags": [ |
| 148 |
"interval" |
| 149 |
], |
| 150 |
"elem": [ |
| 151 |
[ |
| 152 |
{ |
| 153 |
"concat": [ |
| 154 |
"tcp", |
| 155 |
{ |
| 156 |
"prefix": { |
| 157 |
"addr": "192.168.0.0", |
| 158 |
"len": 16 |
| 159 |
} |
| 160 |
}, |
| 161 |
{ |
| 162 |
"range": [ |
| 163 |
1, |
| 164 |
65535 |
| 165 |
] |
| 166 |
} |
| 167 |
] |
| 168 |
}, |
| 169 |
"tarpit-bps" |
| 170 |
], |
| 171 |
[ |
| 172 |
{ |
| 173 |
"concat": [ |
| 174 |
"udp", |
| 175 |
{ |
| 176 |
"prefix": { |
| 177 |
"addr": "192.168.0.0", |
| 178 |
"len": 16 |
| 179 |
} |
| 180 |
}, |
| 181 |
{ |
| 182 |
"range": [ |
| 183 |
1, |
| 184 |
65535 |
| 185 |
] |
| 186 |
} |
| 187 |
] |
| 188 |
}, |
| 189 |
"tarpit-pps" |
| 190 |
], |
| 191 |
[ |
| 192 |
{ |
| 193 |
"concat": [ |
| 194 |
"tcp", |
| 195 |
{ |
| 196 |
"range": [ |
| 197 |
"127.0.0.1", |
| 198 |
"127.1.2.3" |
| 199 |
] |
| 200 |
}, |
| 201 |
{ |
| 202 |
"range": [ |
| 203 |
1, |
| 204 |
1024 |
| 205 |
] |
| 206 |
} |
| 207 |
] |
| 208 |
}, |
| 209 |
"tarpit-pps" |
| 210 |
], |
| 211 |
[ |
| 212 |
{ |
| 213 |
"concat": [ |
| 214 |
"tcp", |
| 215 |
{ |
| 216 |
"range": [ |
| 217 |
"10.0.0.1", |
| 218 |
"10.0.0.255" |
| 219 |
] |
| 220 |
}, |
| 221 |
80 |
| 222 |
] |
| 223 |
}, |
| 224 |
"http-bulk-rl-1m" |
| 225 |
], |
| 226 |
[ |
| 227 |
{ |
| 228 |
"concat": [ |
| 229 |
"tcp", |
| 230 |
{ |
| 231 |
"range": [ |
| 232 |
"10.0.0.1", |
| 233 |
"10.0.0.255" |
| 234 |
] |
| 235 |
}, |
| 236 |
443 |
| 237 |
] |
| 238 |
}, |
| 239 |
"http-bulk-rl-1m" |
| 240 |
], |
| 241 |
[ |
| 242 |
{ |
| 243 |
"concat": [ |
| 244 |
"tcp", |
| 245 |
{ |
| 246 |
"prefix": { |
| 247 |
"addr": "10.0.1.0", |
| 248 |
"len": 24 |
| 249 |
} |
| 250 |
}, |
| 251 |
{ |
| 252 |
"range": [ |
| 253 |
1024, |
| 254 |
65535 |
| 255 |
] |
| 256 |
} |
| 257 |
] |
| 258 |
}, |
| 259 |
"http-bulk-rl-10m" |
| 260 |
], |
| 261 |
[ |
| 262 |
{ |
| 263 |
"concat": [ |
| 264 |
"tcp", |
| 265 |
"10.0.2.1", |
| 266 |
22 |
| 267 |
] |
| 268 |
}, |
| 269 |
"http-bulk-rl-10m" |
| 270 |
] |
| 271 |
] |
| 272 |
} |
| 273 |
}, |
| 274 |
{ |
| 275 |
"map": { |
| 276 |
"family": "inet", |
| 277 |
"name": "saddr6limit", |
| 278 |
"table": "filter", |
| 279 |
"type": { |
| 280 |
"typeof": { |
| 281 |
"payload": { |
| 282 |
"protocol": "ip6", |
| 283 |
"field": "saddr" |
| 284 |
} |
| 285 |
} |
| 286 |
}, |
| 287 |
"handle": 0, |
| 288 |
"map": "limit", |
| 289 |
"flags": [ |
| 290 |
"interval" |
| 291 |
], |
| 292 |
"elem": [ |
| 293 |
[ |
| 294 |
{ |
| 295 |
"range": [ |
| 296 |
"dead::beef", |
| 297 |
"dead::1:aced" |
| 298 |
] |
| 299 |
}, |
| 300 |
"tarpit-pps" |
| 301 |
] |
| 302 |
] |
| 303 |
} |
| 304 |
}, |
| 305 |
{ |
| 306 |
"rule": { |
| 307 |
"family": "inet", |
| 308 |
"table": "filter", |
| 309 |
"chain": "input", |
| 310 |
"handle": 0, |
| 311 |
"expr": [ |
| 312 |
{ |
| 313 |
"limit": { |
| 314 |
"map": { |
| 315 |
"key": { |
| 316 |
"concat": [ |
| 317 |
{ |
| 318 |
"meta": { |
| 319 |
"key": "l4proto" |
| 320 |
} |
| 321 |
}, |
| 322 |
{ |
| 323 |
"payload": { |
| 324 |
"protocol": "ip", |
| 325 |
"field": "saddr" |
| 326 |
} |
| 327 |
}, |
| 328 |
{ |
| 329 |
"payload": { |
| 330 |
"protocol": "th", |
| 331 |
"field": "sport" |
| 332 |
} |
| 333 |
} |
| 334 |
] |
| 335 |
}, |
| 336 |
"data": "@addr4limit" |
| 337 |
} |
| 338 |
} |
| 339 |
} |
| 340 |
] |
| 341 |
} |
| 342 |
}, |
| 343 |
{ |
| 344 |
"rule": { |
| 345 |
"family": "inet", |
| 346 |
"table": "filter", |
| 347 |
"chain": "input", |
| 348 |
"handle": 0, |
| 349 |
"expr": [ |
| 350 |
{ |
| 351 |
"limit": { |
| 352 |
"map": { |
| 353 |
"key": { |
| 354 |
"payload": { |
| 355 |
"protocol": "ip6", |
| 356 |
"field": "saddr" |
| 357 |
} |
| 358 |
}, |
| 359 |
"data": "@saddr6limit" |
| 360 |
} |
| 361 |
} |
| 362 |
} |
| 363 |
] |
| 364 |
} |
| 365 |
} |
| 366 |
] |
| 367 |
} |