• 文档
  • 控制台
  • 登录
  • 立即注册
    目前不支持用户自主注册,如需注册账号,请联系400-080-1100
云防火墙CFW API参考手册
最近更新时间:2023-04-16 17:00:00

1 防火墙

1.1 GetFirewallPolicyList

调用防火墙策略列表,显示防火墙策略信息。

1.1.1 使用说明

路径(GET):https://{endpoint}/cfw/v1.0/policyList

1.1.2 请求参数

image.png

1.1.3 返回数据

image.pngimage.png

表1-1 FirewallPolicyInfo 字段数据结构说明

image.png

image.png

1.1.4 示例

1. 请求示例
GET https://{endpoint}/cfw/v1.0/policyList?VmId=51e8733f-a4ca-4808-a8a8-59fcb1834d64&Uuid=740d15287d4349b18db64dc86ee8f096&PageNumber=1&PageSize=10&Direction=1
2. 正常返回示例
HTTPS:/1.1 200 OK
Content-Type:application/json
{
      "FirewallPolicyInfos": [
    {
          "Id": "40",
          "VmId": "999e79c1-2fea-47d3-aa95-08621ff7391e",
          "PolicyName": "test",
          "SrcIps": "any",
          "DestIps": "10.255.45.75",
          "Services": "any",
          "ProfileGroup": 0,
          "Action": 1,
          "Direction": 0,
          "State": 0,
          "CreateTime": "2022-09-17 16:05:28",
          "UpdateTime": "2022-09-17 16:05:28"
    }
    ],
    "RequestId": "ca5f61fd-9e17-41db-a4a3-73f869720494",
      "TotalCount": 1,
      "PageSize": 10,
      "PageNumber": 1
}

1.2 CreateFirewallPolicy

创建防火墙策略。

1.2.1 使用说明

路径(POST):https://{endpoint}/cfw/v1.0/policy

1.2.2 请求参数

image.png

image.png

1.2.3 返回数据

image.png

1.2.4 示例

1. 请求示例
POST https://{endpoint}/cfw/v1.0/policy
{
      "PolicyName": "test2",
      "SrcAddr": [
          "192.168.1.3"
      ],
      "DestAddr": [
          "10.255.45.75"
      ],
      "Services": [
          "DHCP"
      ],
      "Action": 0,
      "ProfileGroup": 2,
      "VmId": "999e79c1-2fea-47d3-aa95-08621ff7391e",
      "Direction": "0",
      "Uuid":"a070dbd656194a049c4e507a0b8015fa"
}
2. 正常返回示例
HTTPS:/1.1 200 OK
Content-Type: application/json
{
      "RequestId": "559f0eac-d698-4582-b59c-bb85cac0383d",
     "Msg": "处理成功"
}

1.3 EditFirewallPolicy

编辑防火墙策略.

1.3.1 使用说明

路径(PUT):https://{endpoint}/cfw/v1.0/policy

1.3.2 请求参数

image.png

image.png

1.3.3 返回数据

image.png

1.3.4 示例

1. 请求示例
PUT https://{endpoint}/cfw/v1.0/policy
{
      "PolicyName": "test",
      "Services": [
          "DHCP",
          "AH"
      ],
      "Action": 0,
          "ProfileGroup": 2,
  "VmId": "999e79c1-2fea-47d3-aa95-08621ff7391e",
      "Uuid":"a070dbd656194a049c4e507a0b8015fa"
}
2. 正常返回示例
HTTPS:/1.1 200 OK
Content-Type: application/json
{
     "RequestId": "e2887bff-62f4-40f7-89c6-dff608daa667",
     "Msg": "处理成功"
}

1.4 DeleteFirewallPolicy

删除防火墙策略。

1.4.1 使用说明

路径(DELETE):https://{endpoint}/cfw/v1.0/policy

1.4.2 请求参数

image.png

1.4.3 返回数据

image.png

1.4.4 示例

1. 请求示例
DELETE https://{endpoint}/cfw/v1.0/policy
{
      "VmId": "999e79c1-2fea-47d3-aa95-08621ff7391e",
      "PolicyList": [
          "test2"
      ],
      "Uuid":"a070dbd656194a049c4e507a0b8015fa"
}
2. 正常返回示例
HTTPS:/1.1 200 OK
Content-Type: application/json
{
      "RequestId": "84a8b4e3-32ef-450e-9f61-0cfdc17ad201",
      "Msg": "处理成功"
}

1.5 EnableFirewallPolicy

启停防火墙策略。

1.5.1 使用说明

路径(PUT):https://{endpoint}/cfw/v1.0/policy/enable

1.5.2 请求参数

image.png

1.5.3 返回数据

image.png

1.5.4 示例

1. 请求示例
PUT https://{endpoint}/cfw/v1.0/policy/enable
{
      "VmId": "999e79c1-2fea-47d3-aa95-08621ff7391e",
      "PolicyList": [
          "test"
      ],
      "OperateType": 0,
      "Uuid":"a070dbd656194a049c4e507a0b8015fa"
}
2. 正常返回示例
HTTPS:/1.1 200 OK
Content-Type: application/json
{
      "RequestId": "8c863147-e27b-4808-b611-4468b9a5705a",
     "Msg": "处理成功"
}

1.6 GetFirewallServerList

防火墙服务列表查询。

1.6.1 使用说明

路径(GET):https://{endpoint}/cfw/v1.0/service

1.6.2 请求参数

image.png

1.6.3 返回数据

image.png

表1-2 List 字段数据结构说明

image.png

1.6.4 示例

1. 请求示例
GET https://{endpoint}/cfw/v1.0/service?VmId=999e79c1-2fea-47d3-aa95-08621ff7391e&Uuid=a070dbd656194a049c4e507a0b8015fa
2. 正常返回示例
HTTPS:/1.1 200 OK
Content-Type: application/json
{
      "List": [
      {
          "Text": "any",
          "Type": "predef",
          "Value": "any"
      },
      {
          "Text": "AH",
          "Type": "predef",
          "Value": "AH"
      },
      {
          "Text": "DHCP",
          "Type": "predef",
          "Value": "DHCP"
      },
      {
          "Text": "DHCPv6",
          "Type": "predef",
          "Value": "DHCPv6"
      },
      {
          "Text": "DNS",
          "Type": "predef",
          "Value": "DNS"
      },
      {
          "Text": "ESP",
          "Type": "predef",
          "Value": "ESP"
      },
      {
          "Text": "FTP",
          "Type": "predef",
          "Value": "FTP"
      },
      {
          "Text": "GRE",
          "Type": "predef",
          "Value": "GRE"
      },
      {
          "Text": "HTTP",
          "Type": "predef",
          "Value": "HTTP"
      },
      {
          "Text": "HTTPS",
          "Type": "predef",
          "Value": "HTTPS"
      },
      {
          "Text": "ICMP",
          "Type": "predef",
          "Value": "ICMP"
      },
      {
          "Text": "ICMPv6",
          "Type": "predef",
          "Value": "ICMPv6"
      },
      {
          "Text": "IGMP",
          "Type": "predef",
          "Value": "IGMP"
      },
      {
          "Text": "IKE",
          "Type": "predef",
          "Value": "IKE"
      },
      {
          "Text": "IKE-NAT",
          "Type": "predef",
          "Value": "IKE-NAT"
      },
      {
          "Text": "L2TP",
          "Type": "predef",
          "Value": "L2TP"
      },
      {
          "Text": "LOTUSNOTE",
          "Type": "predef",
          "Value": "LOTUSNOTE"
      },
      {
          "Text": "NETBIOS",
          "Type": "predef",
          "Value": "NETBIOS"
      },
      {
          "Text": "NTP",
          "Type": "predef",
          "Value": "NTP"
      },
      {
          "Text": "OICQC",
          "Type": "predef",
          "Value": "OICQC"
      },
      {
          "Text": "OICQS",
          "Type": "predef",
          "Value": "OICQS"
      },
      {
          "Text": "OSPF",
          "Type": "predef",
          "Value": "OSPF"
      },
      {
          "Text": "PCANYWHERE",
          "Type": "predef",
          "Value": "PCANYWHERE"
      },
      {
          "Text": "POP3",
          "Type": "predef",
          "Value": "POP3"
      },
      {
          "Text": "PPTP",
          "Type": "predef",
          "Value": "PPTP"
      },
      {
          "Text": "RIP",
          "Type": "predef",
          "Value": "RIP"
      },
      {
          "Text": "SMTP",
          "Type": "predef",
          "Value": "SMTP"
      },
      {
          "Text": "IMAP",
          "Type": "predef",
          "Value": "IMAP"
      },
      {
          "Text": "SNMP",
          "Type": "predef",
          "Value": "SNMP"
      },
      {
          "Text": "SNMPTRAP",
          "Type": "predef",
          "Value": "SNMPTRAP"
      },
      {
          "Text": "SSH",
          "Type": "predef",
          "Value": "SSH"
      },
      {
          "Text": "SSLVPN",
          "Type": "predef",
          "Value": "SSLVPN"
      },
      {
          "Text": "SYSLOG",
          "Type": "predef",
          "Value": "SYSLOG"
      },
      {
          "Text": "TCP",
          "Type": "predef",
          "Value": "TCP"
      },
      {
          "Text": "TELNET",
          "Type": "predef",
          "Value": "TELNET"
      },
      {
          "Text": "TFTP",
          "Type": "predef",
          "Value": "TFTP"
      },
      {
          "Text": "UDP",
          "Type": "predef",
          "Value": "UDP"
      },
      {
          "Text": "VIRUS_BLASTER",
          "Type": "predef",
          "Value": "VIRUS_BLASTER"
      },
      {
          "Text": "VIRUS_SASSER",
          "Type": "predef",
          "Value": "VIRUS_SASSER"
      },
      {
          "Text": "VIRUS_SQLWORM",
          "Type": "predef",
          "Value": "VIRUS_SQLWORM"
      },
      {
          "Text": "VRRP",
          "Type": "predef",
          "Value": "VRRP"
      },
      {
          "Text": "POP3S",
          "Type": "predef",
          "Value": "POP3S"
      },
      {
          "Text": "SMTPS",
          "Type": "predef",
          "Value": "SMTPS"
      },
      {
          "Text": "IMAPS",
          "Type": "predef",
          "Value": "IMAPS"
      },
      {
          "Text": "SIP",
          "Type": "predef",
          "Value": "SIP"
      },
      {
          "Text": "SQLNET",
          "Type": "predef",
          "Value": "SQLNET"
      },
      {
          "Text": "RAS",
          "Type": "predef",
          "Value": "RAS"
      },
      {
          "Text": "Q.931",
          "Type": "predef",
          "Value": "Q.931"
      },
      {
          "Text": "MMS",
          "Type": "predef",
          "Value": "MMS"
      },
      {
          "Text": "RTSP",
          "Type": "predef",
          "Value": "RTSP"
      },
      {
          "Text": "MSRPC",
          "Type": "predef",
          "Value": "MSRPC"
      },
      {
          "Text": "XDMCP",
          "Type": "predef",
          "Value": "XDMCP"
      },
      {
          "Text": "H.323",
          "Type": "predef",
          "Value": "H.323"
      },
      {
          "Text": "SECGATE_GLOBAL",
          "Type": "predef",
          "Value": "SECGATE_GLOBAL"
      },
      {
          "Text": "SECGATE_HTTPS",
          "Type": "predef",
      "Value": "SECGATE_HTTPS"
      }
      ],
      "RequestId": "bc4540cc-3f06-4bdc-988d-d2d2ea686419"
}

1.7 GetFireWallProtectIpList

获取已防护 IP 列表。

1.7.1 使用说明

路径(GET):https://{endpoint}/cfw/v1.0/protectIp

1.7.2 请求参数

image.png

1.7.3 返回数据

image.png

表1-3 EipInfoList 字段数据结构说明

image.png

1.7.4 示例

1. 请求示例
GET https://{endpoint}/cfw/v1.0/protectIp?VmId=999e79c1-2fea-47d3-aa95-08621ff7391e&Uuid=a070dbd656194a049c4e507a0b8015fa
2. 正常返回示例
HTTPS:/1.1 200 OK
Content-Type: application/json
{
     "EipInfoList": [
     {
         "Eip": "10.255.45.113",
         "FloatingIp": "10.255.45.113"
     }
     ],
     "RequestId": "ecf48e83-f622-4f6b-b6b8-8b2124ff532b"
}

1.8 GetProtectInfoList

防护信息查询。

1.8.1 使用说明

路径(GET):https://{endpoint}/cfw/v1.0/protect

1.8.2 请求参数

image.png

image.png


1.8.3 返回数据

image.png

表1-4 SafeKitCFWProtectList 字段数据结构说明

image.png

image.png

1.8.4 示例

1. 请求示例
GET
https:///{endpoint}/cfw/v1.0/protect?PageSize=10&PageNumber=1&Uuid=a070dbd656194a049c4e507a0b8015fa&Eip=10.255.45.75&Status=0
2. 正常返回示例
HTTPS:/1.1 200 OK
Content-Type: application/json
{
      "SafeKitCFWProtectList": [
      {
          "FloatingId": "eip-mlosgmmx1nux",
          "Eip": "10.255.45.75",
          "Name": "eip-84850368",
          "InstanceType": "云堡垒机",
          "InstanceCode": 3,
          "InstanceUid": "ecs-havgxt3bnfhw5q",
          "InstanceName": "cecloud-cbh-48713",
          "BandWidth": 1,
          "Status": 0
      }
      ],
      "RequestId": "dd297399-bf72-4b6f-a393-84bcfe197c8a",
      "TotalCount": 1,
      "PageSize": 10,
      "PageNumber": 1
}

1.9 SettingFireWallProtectIp

防火墙防护 IP 或者取消防护。

1.9.1 使用说明

 路径(POST):https://{endpoint}/cfw/v1.0/protect

1.9.2 请求参数

image.png

1.9.3 返回数据

image.png

1.9.4 示例

 1. 请求示例
 POST https://{endpoint}/cfw/v1.0/protect
 {
      "Uuid": "a070dbd656194a049c4e507a0b8015fa",
      "EipList": ["10.255.45.75"],
      "Action": 1
 }
 2. 正常返回示例
 HTTPS:/1.1 200 OK
 Content-Type: application/json
 {
      "RequestId": "52f68559-17c7-4d89-8d0f-c797d48558cc",
     "Msg": "处理成功"
 }

1.10 GetInstanceList

获取防火墙实例列表。

1.10.1 使用说明

 路径(GET):https://{endpoint}/cfw/v1.0/instance

1.10.2 请求参数

image.png

1.10.3 返回数据

image.png

 表1-5 SafeKitInfoList 字段数据结构说明

image.png

image.png

image.png

image.png

1.10.4 示例

 1. 请求示例
 GET https://{endpoint}/cfw/v1.0/instance?PageNumber=1&PageSize=10
 2. 正常返回示例
 HTTPS:/1.1 200 OK
 Content-Type: application/json
 {
      "SafeKitInfoList": [
      {
          "Uuid": "740d15287d4349b18db64dc86ee8f096",
          "VmId": "51e8733f-a4ca-4808-a8a8-59fcb1834d64",
          "Name": "cecloud-cfw-25160",
          "AvailableArea": "可用区 01",
          "Bandwidth": 50,
          "BandwidthType": "Mbps",
          "ProtectIPNum": "1",
          "ProtectIPList": [
              "10.255.45.75"
          ],
          "PayModel": 2,
          "RunStatus": 2,
          "CreateDate": "2022-09-20 09:39",
          "ExpireDays": 424,
          "ExpireDate": "2023-11-20 23:59",
          "FrozenDays": null,
          "FrozenDate": null,
          "ReleaseDays": null,
          "Hour": null,
          "Min": null,
          "ReleaseDate": null,
          "Url": "https://security.sec.console.hanmei01.jz1.cecloudsec.com/backend/sso/sso?instanceId=51e8733f-a4ca-4808-a8a8-59fcb1834d64&product=CFW",
          "BootFlag": 1
      },
      {
          "Uuid": "a070dbd656194a049c4e507a0b8015fa",
          "VmId": "999e79c1-2fea-47d3-aa95-08621ff7391e",
          "Name": "cecloud-waf-52894",
          "AvailableArea": "可用区 01",
          "Bandwidth": 50,
          "BandwidthType": "Mbps",
          "ProtectIPNum": "1",
          "ProtectIPList": [
              "10.255.45.113"
          ],
          "PayModel": 1,
          "RunStatus": 2,
          "CreateDate": "2022-09-16 14:04",
          "ExpireDays": 24,
          "ExpireDate": "2022-10-16 23:59",
          "FrozenDays": null,
          "FrozenDate": null,
          "ReleaseDays": null,
          "Hour": null,
          "Min": null,
          "ReleaseDate": null,
          "Url": "https:s://security.sec.console.hanmei01.jz1.cecloudsec.com/backend/sso/sso?instanceId=999e79c1-2fea-47d3-aa95-08621ff7391e&product=CFW",
          "BootFlag": 1
      },
      {
          "Uuid": "92182dff080c41fa85358e75adadff70",
          "VmId": "a0bee91c-8f59-4a01-a595-8effbe3d1d73",
          "Name": "cecloud-cfw-69395",
          "AvailableArea": "可用区 01",
          "Bandwidth": 50,
          "BandwidthType": "Mbps",
          "ProtectIPNum": "1",
          "ProtectIPList": [
              "10.255.45.95"
          ],
          "PayModel": 1,
          "RunStatus": 2,
          "CreateDate": "2022-09-16 10:11",
          "ExpireDays": 85,
          "ExpireDate": "2022-12-16 23:59",
          "FrozenDays": null,
          "FrozenDate": null,
          "ReleaseDays": null,
          "Hour": null,
          "Min": null,
          "ReleaseDate": null,
          "Url": "https:s://security.sec.console.hanmei01.jz1.cecloudsec.com/backend/sso/sso?instanceId=a0bee91c-8f59-4a01-a595-8effbe3d1d73&product=CFW",
          "BootFlag": 1
      }
      ],
      "RequestId": "278e19be-e545-4454-9d60-d3ebbc7b9477",
      "TotalCount": 3,
      "PageSize": 10,
      "PageNumber": 1
 }

意见反馈

文档内容是否对您有帮助?

如您有其他疑问,您也可以通过在线客服来与我们联系探讨 在线客服

联系我们
回到顶部