{
    "name"  : "请您确认：ip session filter关联ACL是否会导致阻断",
    "problems" : {
        "aclError" : {
            "desc"      : "【原理说明】如果防攻击关联ACL未放行${0}所在的内网网段，会导致${0}无法上网${1}",
            "advice"    : ""
        }
    }
}

---------------------------code-------------------------------
ipCheck = precondition('ipCheck')

reg = /ip\ssession\sfilter\s([\d]+)/i
response = cli('show ip session filter')
result = response.match(reg)
if !result :
    return 'skip'
end

ACL_id = result[1]
if ACL_id != 0 :
    acl_list_str = ''
    cmd = 'show access-lists ' + ACL_id
    response = cli(cmd)
    response = response.split(/\r?\n/)
    i = 1
    length = response.length - 1
    while i < length:
        str = response[i]
        acl_list_str = acl_list_str + '\r\n\t' + str
        i = i + 1
    end
    acl_list_str = acl_list_str + '\r\n\t'
    checkItems = ['{"checkItem": "是", "advice": "【解决方法】请补充配置ip session filter所关联ACL策略，放行该内网网段"}','{"checkItem": "否"}']
    add_problem("aclError", [ipCheck,acl_list_str], [], [], checkItems)
    return 'warn'
end

return 'skip'
