CDN 用戶操作
CDN 用戶操作
CDN 用戶操作
  • 域名管理
    • 新增域名
    • 批次修改源站
    • 批次移除指定域名
    • 導出站點紀錄
  • 模組管理
    • 證書
    • 時間戳防盜鏈
    • 自定義Header
    • URL轉址
    • CORS設置
    • 回源改寫
  • 站點設置
    • 緩存設置
    • 壓縮
    • 速限
    • DNS接入
    • 添加訪問端口
  • 應用防火牆
    • 白名單設置
    • 黑名單設置
    • 地區設置
    • Header阻擋設置
    • 防CC設置
    • 區域頻率設置
    • 秒級頻率設置
    • User Agent設置
  • 進階防火牆
  • 屏蔽列表
  • 自定義錯誤
  • 站點資訊
  • API文檔
    • API 取得認證方式
    • API 取得Site ID
    • API 域名操作
    • API 證書操作
    • API 黑名單操作
    • API 白名單操作
    • API 應用防火牆操作
    • API 進階防火牆操作
    • API 清除緩存操作
    • API 取得站點資訊
  • 數據分析
    • 統計分析
    • 日誌分析、導出
    • 安全分析
    • 四層攻擊分析
Powered by GitBook
On this page
  • 新增設定集
  • 獲取設定集ID
  • 刪除設定集
  • 設定集內新增規則
  1. API文檔

API 進階防火牆操作

進階防火牆操作

API Token Headers

以下 API 皆需 API Token 相關 Header

  • SKC-RefreshToken

  • SKC-AccessToken


新增設定集

  • POST /api/v1/user/site/{siteID}/module/acls

    • 描述:在進階防火牆頁面新增設定集

    • cURL範例

      curl --request POST \
      --header 'Content-Type: application/json' \
      --header "SKC-RefreshToken: {Your Refresh Token}" \
      --header "SKC-AccessToken: {Your Access Token}" \
      --data '{ 
           "modules": [
              {
                "name": "test123"
              }
          ]
      }' \
      {CDN API Endpoint}/api/v1/user/site/{siteID}/module/acls
  • 詳細內容

    • Payload

      {
        "modules": [
          {
            "name": “test123“
          }
        ]
      }
    • Response

      { "code": 101001 }

獲取設定集ID

  • GET api/v1/user/site/{siteID}/module/acls

    • 描述:取得已建立的設定集ID

    • cURL範例

      curl --request GET \
      --header "SKC-RefreshToken: {Your Refresh Token}" \
      --header "SKC-AccessToken: {Your Access Token}" \
      {CDN API Endpoint}/api/v1/user/site/{siteID}/module/acls
    • 詳細內容

      • response

      {
          "code": 101001,
          "total": 4,
          "data": [
              {
                  "createdAt": "2024-09-12T19:26:40.145+08:00",
                  "updatedAt": "2024-09-12T19:26:40.145+08:00",
                  "id": 11,
                  "name": "test",
                  "inUseCount": 1
              }
          ]
      }

刪除設定集

  • DELETE /api/v1/user/site/{siteID}/module/acls

    • 描述:刪除已創建的設定集

    • cURL範例

      curl --request DELETE \
      --header 'Content-Type: application/json' \
      --header "SKC-RefreshToken: {Your Refresh Token}" \
      --header "SKC-AccessToken: {Your Access Token}" \
      --data '{"ids": [11]}' \
      {CDN API Endpoint}/api/v1/user/site/{siteID}/module/acls
    • 詳細內容

      • response

      {"code": 101001}

設定集內新增規則

  • POST /api/v1/user/site/{siteID}/module/acl/{設定集ID}/rule

    • 描述:在已創建的設定集內新增規則

    • cURL範例

      curl --request POST \
      --header 'Content-Type: application/json' \
      --header "SKC-RefreshToken: {Your Refresh Token}" \
      --header "SKC-AccessToken: {Your Access Token}" \
      --data '{
        "name": "987",
        "priority": 0,
        "enable": false,
        "action": 2,
        "rules": [
          {
            "field": 1,
            "op": 1,
            "value": "1",
            "logic": 0
          }
        ]
      }' \
      {CDN API Endpoint}/api/v1/user/site/{siteID}/module/acl/{設定集ID}/rule

    • 詳細內容

      • response

        {"code": 101001}
      • 新增規則參數一覽

        action:1 = 阻擋
        action:2= allow
        
        運算子
        op1:等於
        op2:不等於
        op3:包含
        op4:不包含
        op5: 在其中
        op6: 不在其中
        op7: >
        op8: <
        op9: >=
        op10: <=
        
        
        enable: true、false = 是否啟用 
        
        符合後處理方式
        DENY = BlockType: 1  
        DROP = BlockType: 2
        DROP+黑名單 = BlockType: 3
        301跳轉 = BlockType: 4
        redirectURL: "{URL}"
        
        field = 欄位
        1 = cookie
        2 = 地理位置
        3 = ip
        4 = 參照域名
        5 = 請求方法,Value: GET、POST、PUT、PATCH、DELETE
        6 = URI路徑
        7 = URI查詢字串
        8 = 使用者代理程式
        9 = 標頭
        10 = 訪問頻率
        11 = AS number
        12 = http狀態碼
        
        and及: logic:2
        or或: logic:1

  • 獲取設定集內個別規則ID

    • GET /api/v1/user/site/{siteID}/module/acl/{設定集ID}/rules

      • 描述:在設定集內獲取規則的ID

      • cURL範例

        curl --request GET \
        --header "SKC-RefreshToken: {Your Refresh Token}" \
        --header "SKC-AccessToken: {Your Access Token}" \
        {CDN API Endpoint}/api/v1/user/site/{siteID}/module/acl/{設定集ID}/rules
    • 詳細內容

      • response

        {
            "code": 101001,
            "total": 1,
            "data": [
                {
                    "createdAt": "2024-10-16T14:50:40.603+08:00",
                    "updatedAt": "2024-10-16T17:46:53.066+08:00",
                    "id": 161,
                    "name": "456",
                    "priority": 0,
                    "action": 1,
                    "blockType": 3,
                    "redirectURL": "",
                    "enable": true,
                    "rules": [
                        {
                            "field": 8,
                            "name": "-",
                            "op": 1,
                            "value": "good",
                            "logic": 0
                        }
                    ]
                }
            ]
        }
PreviousAPI 應用防火牆操作NextAPI 清除緩存操作

Last updated 5 months ago