{
    "name"  : "防新建会话攻击配置检查",
    "problems" : {
        "newSession" : {
            "desc"      : "【问题】设备未配置每IP新建会话限制功能，遇新建会话攻击可能导致用户无法上网或丢包。",
            "advice"    : "【建议】参考实施一本通配置每IP防新建会话攻击功能，命令为：ip new-session-limit real-host limit 200，建议值为50-300，具体详情可参考实施一本通。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show run | in new-session-limit real-host limit")
resArr = res.split(/\r?\n/)
if resArr.length == 2 :
    add_problem("newSession")
    return "warn"
end

if resArr.length > 2 :
    resTemp = resArr[1]
    resArr = resTemp.match(/real-host limit (.+)/)
    limitNumber = resArr[1]
    if limitNumber == 0 :
        add_problem("newSession")
        return "warn"    
    end
end

return "success"
