扩展ISDB

功能介绍

扩展ISDB允许您对现有的预定义ISDB中配置的IP和端口范围进行增加,实际上是编辑预定义类型的ISDB条目,并向其添加IP地址和端口范围。

扩展ISDB必须在CLI下配置,创建扩展的ISDB时,必须包含以下参数:

  • IP地址或IP地址范围
  • 协议号
  • 端口号或端口号范围(如果是没有端口号的协议,则不需要填写,如ESP)

删除时必须从GUI的预定义ISDB中删除相关条目。

配置示例

config firewall internet-service-extension
    edit <ID #>
        set comment <comment>
        config entry
            edit <ID #>
                set protocol <number #>
                set dst <object_name>
                config port-range
                    edit <ID #>
                         set start-port <number #>
                         set end-port <number #>
                    next
                end
            next
        end
    end
end

网络需求

  1. 用户想禁止内网访问阿里云相关资源的流量,配置了安全策略阻断去往预定义ISDB“Alibaba-Alibaba.Cloud”的流量。

  2. 但由于阿里云域名对应的IP一直在变化,预定义的ISDB还未来得及更新最新的IP地址和端口号,导致阿里云的个别资源仍然可以正常访问(如www.aliyun.com )。

    image-20230423112106057

    image-20230524093234196

  3. 通过域名解析,找到仍然可以访问的资源为42.59.1.232、42.59.1.234、42.59.1.231、42.59.1.233、42.59.1.229、42.59.1.236、42.59.1.230、42.59.1.235的443端口。

    image-20230423112321159

  4. 查看解析到的IP所属的预定义ISDB,可以看到没有属于任何一个预定义的ISDB。

    FortiGate # diagnose internet-service info root 6 443 42.59.1.235
    Can not find Internet Service ID and name. ret=-1
    
  5. 解决方法是通过在预定义的ISDB上使用扩展ISDB,以扩充预定义的ISDB。

配置步骤

  1. 配置需要在预定义的ISDB上扩展的IP资源的地址和地址组对象。

    config firewall address
        edit "AliCloud_1"
            set subnet 42.59.1.232 255.255.255.255
        next
        edit "AliCloud_2"
            set subnet 42.59.1.234 255.255.255.255
        next
        edit "AliCloud_3"
            set subnet 42.59.1.231 255.255.255.255
        next
        edit "AliCloud_4"
            set subnet 42.59.1.233 255.255.255.255
        next
        edit "AliCloud_5"
            set subnet 42.59.1.229 255.255.255.255
        next
        edit "AliCloud_6"
            set subnet 42.59.1.236 255.255.255.255
        next
        edit "AliCloud_7"
            set subnet 42.59.1.230 255.255.255.255
        next
        edit "AliCloud_8"
            set subnet 42.59.1.235 255.255.255.255
        next
    end
    config firewall addrgrp
        edit "AliCloud_extension"
            set member "AliCloud_1" "AliCloud_2" "AliCloud_3" "AliCloud_4" "AliCloud_5" "AliCloud_6" "AliCloud_7" "AliCloud_8"
        next
    end
    
  2. 配置一条扩展的ISDB,edit的ID填写预定义的ISDB“Alibaba-Alibaba.Cloud”的ID号(该ID号可以在GUI中查询),引用上步配置的地址组,协议为TCP,端口号为443端口。

    config firewall internet-service-extension
        edit 6881402
            set comment ''
            config entry
                edit 1
                    set protocol 6
                    config port-range
                        edit 1
                            set start-port 443
                            set end-port 443
                        next
                    end
                    set dst "AliCloud_extension"
                next
            end
        next
    end
    
  3. 防火墙策略中配置流入接口和源地址,在“目标地址”选项中选择“Internet服务”,在“INTERNET服务”分类中,选择预定义的ISDB“Alibaba-Alibaba.Cloud”,动作选择“拒绝”,开启“记录拒绝流量”。

    image-20230423111730489

    config firewall policy
        edit 9
            set name "Deny_Extension_ISDB"
            set srcintf "lan"
            set dstintf "wan1"
            set srcaddr "all"
            set internet-service enable
            set internet-service-name "Alibaba-Alibaba.Cloud"
            set schedule "always"
            set logtraffic all
        next
    end
    
  4. 将该条策略移动至上网策略之前。

    image-20230423111933758

结果验证

  1. 查询手动扩展的IP和端口所属的ISDB,可以看到已被归类到预定义的ISDB“Alibaba-Alibaba.Cloud”中。

    FortiGate # diagnose internet-service info root 6 443 42.59.1.235
    Internet Service: 6881402(Alibaba-Alibaba.Cloud) country(0 Any) region(0 Any) city(0 Any)
    
  2. 使用内网PC经过FortiGate访问www.aliyun.com ,被阻断。

    image-20230423112707653

  3. 查看防火墙的流量日志,可以看到客户端访问10.10.12.1的HTTPS流量被阻断,目标ISDB识别正确。

    image-20230423112650052

禁用预定义ISDB中的IP/端口

  1. 首先查询某个属于预定义ISDB“Alibaba-Alibaba.Cloud”的IP/端口。

    FortiGate # diagnose internet-service info root 6 443 223.109.11.27
    Internet Service: 6881402(Alibaba-Alibaba.Cloud) country(156 China) region(801 Jiangsu) city(26800 Wuxi)
    
  2. 进入“策略&对象→Internet服务数据库”,编辑要删除内容的预定义ISDB,这里以“Alibaba-Alibaba.Cloud”为例,双击或邮件选择“编辑”。

    image-20230423143731260

  3. 点击页面右侧的“View/Edit Entries”,

    image-20230423143920178

  4. 右键禁用IP/端口所属的条目。

    image-20230423144528218

    image-20230423144553345

  5. 再次查询该IP地址/端口所属的ISDB,可以看到没有属于任何ISDB。

    FortiGate # diagnose internet-service info root 6 443 223.109.11.27
    Can not find Internet Service ID and name. ret=-1
    

Copyright © 2023 Fortinet Inc. All rights reserved. Powered by Fortinet TAC Team.
📲扫描下方二维码分享此页面👇
该页面修订于: 2023-09-12 15:24:08

results matching ""

    No results matching ""