(1)ipsec协议修改

(2)ipv6掩码范围修改
(3)全部协议放开端口限制
This commit is contained in:
wangxin
2018-10-15 15:26:43 +08:00
parent fd2a4cf28e
commit b6276cdc8c
14 changed files with 107 additions and 50 deletions

View File

@@ -7,6 +7,10 @@ import java.util.Map;
import com.google.gson.GsonBuilder;
public final class Constants {
/**
* IPSEC协议
*/
public static Integer IPSEC_PROTOCOL=Configurations.getIntProperty("ipsec_protocol", 8);
public static final String GROUP_REUSE_SOURCES=Configurations.getStringProperty("groupReuseSources","groupReuseSources");
public static Integer APP_SPEC_SERVICE_CODE_MIN_VAL=Configurations.getIntProperty("app_spec_service_code_min_val", 300001);
public static Integer APP_SPEC_SERVICE_CODE_MAX_VAL=Configurations.getIntProperty("app_spec_service_code_max_val", 268435455);

View File

@@ -24,24 +24,17 @@ import com.nis.domain.FunctionRegionDict;
import com.nis.domain.FunctionServiceDict;
import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.basics.PolicyGroupInfo;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.configuration.template.IpAddrTemplate;
import com.nis.domain.configuration.template.IpAllTemplate;
import com.nis.domain.configuration.template.IpsecTemplate;
import com.nis.domain.configuration.template.TunnelIpTemplate;
import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtil;
import com.nis.util.excel.ExcelField;
import com.nis.util.excel.ExportExcel;
import com.nis.web.controller.BaseController;
import com.nis.web.controller.configuration.CommonController;
import com.nis.web.security.UserUtils;
/**

View File

@@ -205,7 +205,8 @@
,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id
,a.edit_time,a.auditor_id,a.audit_time,a.service_id,a.request_id,
a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable
,a.area_effective_ids,a.function_id,a.cfg_region_code
,a.area_effective_ids,a.function_id,a.cfg_region_code,a.user_region1,a.user_region2,
a.user_region3,a.user_region4,a.user_region5
</sql>
<select id="getById" resultMap="BaseIpMap" parameterType="java.lang.Long" >
SELECT

View File

@@ -136,7 +136,11 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
ipCfgDao.saveCfgIndex(entity);
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(Constants.IPSEC_PROTOCOL.intValue()==cfg.getProtocol().intValue()) {
BeanUtils.copyProperties(entity, cfg,new String[]{"userRegion1","cfgRegionCode","cfgType"});
}else {
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
}
ipCfgDao.saveIpPortCfg(cfg);
}
}
@@ -172,7 +176,11 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
entity.setCreatorId(entity.getCurrentUser().getId());
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(Constants.IPSEC_PROTOCOL.intValue()==cfg.getProtocol().intValue()) {
BeanUtils.copyProperties(entity, cfg,new String[]{"userRegion1","cfgRegionCode","cfgType"});
}else {
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
}
ipCfgDao.saveIpPortCfg(cfg);
}
}
@@ -551,24 +559,23 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
}
}
}
IpPortCfg cfg = new IpPortCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(IpPortCfg.getTablename());
ipCfgDao.auditCfg(cfg);
if(isAudit==1){
for(IpPortCfg cfg:entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
cfg.setTableName(IpPortCfg.getTablename());
ipCfgDao.auditCfg(cfg);
}
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
for(IpPortCfg cfg:entity.getIpPortList()) {
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
cfg.setProtocol(Integer.parseInt(cfg.getUserRegion1()));
}
}
Map<String,List> map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList);
groupRelationList=map.get("groupList");
ipRegionList=map.get("dstList");
if(map.get("numRegionList")!=null){
numRegionList.addAll(map.get("numRegionList"));
}
if(Constants.SERVICE_IP_MULITIPLEX==cfg.getServiceId().intValue()){
String region=Constants.USERREGION_IR_STRATEGY+"="+cfg.getDnsStrategyId()+Constants.USER_REGION_SPLIT
+Constants.USERREGION_IR_TYPE+"="+cfg.getIrType();
maatCfg.setUserRegion(region);
}else if(Constants.SERVICE_IP_RATELIMIT==cfg.getServiceId().intValue()){
maatCfg.setUserRegion(Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit());
}
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
@@ -576,7 +583,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
ipCfgDao.auditCfg(cfg);
if(isAudit==1){
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
@@ -589,7 +596,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
ipCfgDao.auditCfg(cfg);
if(isAudit==1){
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
@@ -600,8 +607,15 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
if(maatType==Constants.CALLBACK_TYPE){
List<InlineIp> ipList=new ArrayList<>();
for(IpPortCfg cfg :entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
Integer ipsecProtocol=null;
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
ipsecProtocol=Integer.parseInt(cfg.getUserRegion1());
}
BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
InlineIp ip=convertCallBackIp(cfg,null);
if(ipsecProtocol!=null) {
ip.setProtocol(ipsecProtocol);
}
ipList.add(ip);
}
//调用服务接口下发配置数据
@@ -660,8 +674,15 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
if(maatType==Constants.CALLBACK_TYPE){
List<InlineIp> ipList=new ArrayList<>();
for(IpPortCfg cfg :entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
Integer ipsecProtocol=null;
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
ipsecProtocol=Integer.parseInt(cfg.getUserRegion1());
}
BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
InlineIp ip=convertCallBackIp(cfg,null);
if(ipsecProtocol!=null) {
ip.setProtocol(ipsecProtocol);
}
ipList.add(ip);
}
//调用服务接口下发配置数据

View File

@@ -1243,4 +1243,5 @@ usual_ddos=Usual DDOS
mail_address=Mail Address
mail_address_whitelist=Mail Address Whitelist
mail_address_monit=Mail Address Monit
mail_address_reject=Mail Address Reject
mail_address_reject=Mail Address Reject
ipsec_protocol=IPSEC Protocol

View File

@@ -1254,4 +1254,5 @@ usual_ddos=Usual DDOS
mail_address=Mail Address
mail_address_whitelist=Mail Address Whitelist
mail_address_monit=Mail Address Monit
mail_address_reject=Mail Address Reject
mail_address_reject=Mail Address Reject
ipsec_protocol=IPSEC Protocol

View File

@@ -1236,4 +1236,5 @@ usual_ddos=\u5E38\u7528DDOS\u653B\u51FB
mail_address=\u90AE\u4EF6\u5730\u5740
mail_address_whitelist=\u90AE\u4EF6\u5730\u5740\u767D\u540D\u5355
mail_address_monit=\u90AE\u4EF6\u5730\u5740\u76D1\u6D4B
mail_address_reject=\u90AE\u4EF6\u5730\u5740\u7BA1\u63A7
mail_address_reject=\u90AE\u4EF6\u5730\u5740\u7BA1\u63A7
ipsec_protocol=IPSEC\u534F\u8BAE

View File

@@ -219,14 +219,14 @@ clusterBStartTime=1503504000725
isCommit=true
############################################################################################################################################
############################################################################################################################################
httpUrl=http://192.168.10.204:7777/galaxy-service/service/cfg/v1/
httpUrl=http://192.168.10.204:9999/galaxy-service/service/cfg/v1/
maatCfg=configSources
fileUploadCfg=fileUploadSources
callbackCfg=commonSources
fileDigestCfg=fileDigestSources
configIdSources=configPzIdSources
#logBaseUrl=http://10.0.6.242:8080/galaxy-service/service/log/v1/
logBaseUrl=http://192.168.10.204:7777/galaxy-service/service/log/v1/
logBaseUrl=http://192.168.10.204:9999/galaxy-service/service/log/v1/
ntcPzReport=ntcPzReport
ntcServiceReport=ntcServiceReport
ntcTagReport=ntcTagReport
@@ -270,7 +270,7 @@ mmLogoDetectionLog=mmLogoDetectionLogs
mmFaceRecognizationLog=mmFaceRecognizationLogs
########################################
#\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3
dashboardUrl=http://192.168.10.204:7777/galaxy-service/service/log/v1/
dashboardUrl=http://192.168.10.204:9999/galaxy-service/service/log/v1/
trafficIpActive=trafficIpActive
trafficProtocol=trafficProtocol
trafficApp=trafficApp
@@ -367,7 +367,7 @@ user_region_placeholder=0
user_region_split=;
#IP\u76f8\u5173\u9a8c\u8bc1\u6b63\u5219
ipv4_ip_subnet_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{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1,4}){0,3}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}))$
ipv4_ip_regexp=^(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(0|1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$
@@ -527,4 +527,5 @@ log_time_end=2018-10-01 00:00:00
area_tag=location
isp_tag=isp
mmFileDigestLog=mmFileDigestLogs
ntcStreamMediaLog=ntcStreamMediaLogs
ntcStreamMediaLog=ntcStreamMediaLogs
ipsec_protocol=8

View File

@@ -64,6 +64,20 @@
</div>
</div>
</c:if>
<div class="col-md-6 ipsecProtocol hidden">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ipsec_protocol"/></label>
<div class="col-md-6">
<select name="${cfgName}.userRegion1" class="selectpicker show-tick form-control required" disabled="disabled">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('IPSEC_PROTOCOL')}" var="ipType">
<option value="${ipType.itemCode}" <c:if test="${_cfg.ipPortList[0].userRegion1==ipType.itemCode}">selected</c:if> ><spring:message code="${ipType.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="${cfgName}.userRegion1"></div>
</div>
</div>
</div>
<div class="row ip">
<div class="col-md-6">

View File

@@ -32,7 +32,12 @@
}else{
hideAction(1,asnRegionCode);
}
$("[name$='protocol']").each(function(){
showHideIPSECProtocol($(this));
});
$("[name$='protocol']").on("change",function(){
showHideIPSECProtocol($(this));
});
if(isAsn==0){
$("[class~='glyphicon-plus'][class~='ipPortList']").click();
$("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click();
@@ -108,6 +113,7 @@
changeIPVal(tabInfo);
}
processAction(isAsn,tabInfo);
$("[name$='protocol']").change();
/* if(tabInfo){
tabInfo.find("[name$='cfgType']").val(cfgType);
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
@@ -372,6 +378,23 @@ var processAction=function(configType,obj){
}
}
var showHideIPSECProtocol=function(obj){
var name=$(obj).attr("name");
var userRegion1=$("select[name='"+name.replace("protocol","userRegion1")+"']");
if($(obj).val()==8){
if(userRegion1){
userRegion1.removeAttr("disabled");
userRegion1.parents(".ipsecProtocol").removeClass("hidden");
userRegion1.selectpicker("refresh");
}
}else{
if(userRegion1){
userRegion1.attr("disabled","disabled");
userRegion1.parents(".ipsecProtocol").addClass("hidden");
userRegion1.selectpicker("refresh");
}
}
}
</script>
</head>
<body>

View File

@@ -237,8 +237,8 @@ jQuery.validator.addMethod("protocolPort",function(value, element) {
var protocolElement=$("[name='"+name.replace("destPort","protocol")+"']");
protocolVal=protocolElement.val();
}
if((protocolVal==0&&srcPortVal>0)||(protocolVal==0&&destPortVal>0)){
$.validator.messages.protocolPort=$.validator.messages.protocolPort;
if(protocolVal==0){
return true;
}else if((protocolVal!=tcp&&protocolVal!=udp&&srcPortVal>0)||(protocolVal!=tcp&&protocolVal!=udp&&destPortVal>0)){
$.validator.messages.protocolPort=$.validator.messages.protocolPort1;
return false;
@@ -250,7 +250,7 @@ jQuery.validator.addMethod("protocolPort",function(value, element) {
//ip地址校验
jQuery.validator.addMethod("ipCheck",function(value, element) {
var ipv4_ip_subnet_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-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\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))$/;
var ipv4_ip_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/;
@@ -370,7 +370,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipPart;
return false;
//}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
}else if(!/^(128)$/.test(ipMaskArr[1])){
}else if(!/^([2-9]|[1-9][0-9]|1[0-2][0-8])$/.test(ipMaskArr[1])){
$.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart;
return false;
} else{
@@ -410,7 +410,6 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}else if(typeInt==46){
var name=$(element).attr("name");
if(name.indexOf("srcIpAddress")>-1){
console.log("client ip must ipv4");
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){
if(ipv4_ip_subnet_regexp.test(value)){
@@ -468,7 +467,6 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}
}
}else if(name.indexOf("destIpAddress")>-1){
console.log("server ip must ipv6");
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true;
@@ -485,7 +483,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipPart;
return false;
//}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
}else if(!/^(128)$/.test(ipMaskArr[1])){
}else if(!/^([2-9]|[1-9][0-9]|1[0-2][0-8])$/.test(ipMaskArr[1])){
$.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart;
return false;
} else{
@@ -526,7 +524,6 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}else if(typeInt==64){
var name=$(element).attr("name");
if(name.indexOf("srcIpAddress")>-1){
console.log("client ip must ipv6");
if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true;
@@ -543,7 +540,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipPart;
return false;
//}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
}else if(!/^(128)$/.test(ipMaskArr[1])){
}else if(!/^([2-9]|[1-9][0-9]|1[0-2][0-8])$/.test(ipMaskArr[1])){
$.validator.messages.ipCheck=$.validator.messages.ipv6MaskPart;
return false;
} else{

View File

@@ -27,7 +27,7 @@
ipMask:"Please enter a correct IP/mask",
ipPart:"Invalid IP part",
//ipv6MaskPart:"Mask must be exponent of 2,not greater than 128",
ipv6MaskPart:"Mask must be 128",
ipv6MaskPart:"Mask must between 2 and 128",
//ipMaskRange:"IP mask must between 0 and 32",
ipMaskRange:"IP mask must between 16 and 32",
srcIpNotEqDestIp:"Client IP ",
@@ -74,6 +74,6 @@
log_1_hour:"Log For The Last Hour",
input:"Please Enter ",
protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0",
protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0"
protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0,ALL protocol has no limit"
});
}(jQuery));

View File

@@ -27,7 +27,7 @@
ipMask:"Введите правильный IP/маску",
ipPart:"Недопустимая часть IP",
//ipv6MaskPart:"Mаска-показатель степени 2, небольше 128",
ipv6MaskPart:"掩码必须为128",
ipv6MaskPart:"掩码介于2到128",
//ipMaskRange:"Маска IP между 0 и 32",
ipMaskRange:"Маска IP должна между 16 и 32",
srcIpNotEqDestIp:"IP Источник",
@@ -74,6 +74,6 @@
log_1_hour:"Log For The Last Hour",
input:"Please Enter ",
protocolPort:"TCP protocol or UDP protocol must be chosen when port is greater than 0",
protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0"
protocolPort1:"Only when TCP protocol or UDP protocol is chosen can port greater than 0,ALL protocol has no limit"
});
}(jQuery));

View File

@@ -27,7 +27,7 @@
ipMask:"请填写正确的IP地址/掩码",
ipPart:"IP部分格式错误",
//ipv6MaskPart:"掩码为不大于128的2的指数幂",
ipv6MaskPart:"掩码必须为128",
ipv6MaskPart:"掩码介于2到128",
//ipMaskRange:"IP掩码介于0到32",
ipMaskRange:"IP掩码介于16到32",
srcIpNotEqDestIp:"源IP ",
@@ -74,6 +74,6 @@
log_1_hour:"1小时日志量",
input:"请输入 ",
protocolPort:"端口大于0时必须选择TCP协议或者UDP协议",
protocolPort1:"只有tcp,udp协议端口号可以不为0"
protocolPort1:"只有tcp,udp协议端口号可以不为0,全部协议无限制"
});
}(jQuery));