如何通过 API 检索硬件防火墙日志



我想知道是否有办法检索Fortigate防火墙日志,也可以在 https://control.softlayer.com/devices/details//vlanFirewall 中找到"报告"或任何其他日志。

我可以检索 updateRequests,因此我可以获取链接到执行该操作的用户的防火墙规则集的更改历史记录。

问候伊利亚斯

请按照以下步骤操作:

  1. 查找防火墙关联的Vlan_Id

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Vlan_Firewall/[Vlan_Firewall_Id]/getNetworkVlans
    Method: GET
    

响应应该是这样的:

[
  {
    "accountId": 207800,
    "id": 204000,
    "modifyDate": "2012-06-18T14:11:22-05:00",
    "primarySubnetId": 420900,
    "vlanNumber": 1600
  }
]

哪里:"id":204000"是我们需要的

引用:

SoftLayer_Network_Vlan_Firewall::getNetworkVlan

SoftLayer_Network_Vlan_Firewall::getNetworkVlans

  1. 要获取与上述Vlan_Id关联的Ip address列表,请执行:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Vlan/204000/getFirewallProtectableIpAddresses?objectMask=mask[ id,ipAddress]
    Method: GET
    

引用:SoftLayer_Network_Vlan::getFirewallProtectableIpAddresses(英语:getFirewallProtectableIpAddresses)

  1. 最后,如Control Portal,选择IP Address(在我的情况下Ip_Address_Id = 54846700)以获取Firewall Report。我们将执行以下操作:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Subnet_IpAddress/54846700/getSyslogEventsOneDay
    Method: GET
    

引用:

SoftLayer_Network_Subnet_IpAddress::getSyslogEventsOneDay

SoftLayer_Network_Subnet_IpAddress::getSyslogEventsSevenDays

我希望这些信息对您有所帮助。

最新更新