Cloudflare获取防火墙规则(Firewall Rules)的过滤器ID(Filter ID)

发布于 2020-03-02  11 次阅读


原文链接

https://api.cloudflare.com/#firewall-rules-list-of-firewall-rules

翻译转存

List of firewall rules
列出防火墙规则
支持计划FREE PRO BUSINESS ENTERPRISE

curl -X GET "https://api.cloudflare.com/client/v4/zones/023e105f4ecef8ad9ca31a8372d0c353/firewall/rules" \
     -H "X-Auth-Email: [email protected]" \
     -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41" \
     -H "Content-Type: application/json"

返回值

{
  "success": true,
  "errors": [],
  "messages": [],
  "result": [
    {
      "id": "372e67954025e0ba6aaa6d586b9e0b60",
      "filter": {
        "id": "372e67954025e0ba6aaa6d586b9e0b61",
        "expression": "(http.request.uri.path ~ \"*wp-login.php\" or http.request.uri.path ~ \"*xmlrpc.php\") and ip.addr ne 172.16.22.155",
        "paused": false,
        "description": "Restrict access from these browsers on this address range.",
        "ref": "FIL-100"
      },
      "action": "block",
      "products": [
        "waf"
      ],
      "priority": 50,
      "paused": false,
      "description": "Blocks traffic identified during investigation for MIR-31",
      "ref": "MIR-31"
    }
  ]
}

"filter" 下的"id" 即为过滤器ID


信任是利益的武器,捅伤别人,保护自己