劫持、注入、镜像、阻断页面、拦截证书内容引用时的处理

This commit is contained in:
wangwei
2019-06-02 16:33:49 +08:00
parent 5355c9ab9c
commit 692d00050c
25 changed files with 4642 additions and 4565 deletions

View File

@@ -20,7 +20,6 @@ public class ProxyFileHijackCfg extends BaseCfg<ProxyFileHijackCfg>{
private String path;//储存路径 private String path;//储存路径
@ExcelField(title="content_name",sort=4) @ExcelField(title="content_name",sort=4)
private String contentName;//内容格式 private String contentName;//内容格式
private String quote;//判断与其他菜单是否关联使用中
public String getContentName() { public String getContentName() {
return contentName; return contentName;
@@ -28,12 +27,6 @@ public class ProxyFileHijackCfg extends BaseCfg<ProxyFileHijackCfg>{
public void setContentName(String contentName) { public void setContentName(String contentName) {
this.contentName = contentName; this.contentName = contentName;
} }
public String getQuote() {
return quote;
}
public void setQuote(String quote) {
this.quote = quote;
}
public String getIndexTable() { public String getIndexTable() {
return indexTable; return indexTable;
} }

View File

@@ -13,7 +13,6 @@ public class ProxyFileInsertScriptCfg extends BaseCfg<ProxyFileInsertScriptCfg>{
private String format;//css/js private String format;//css/js
@ExcelField(title="file_insert_script",sort=2) @ExcelField(title="file_insert_script",sort=2)
private String path;//储存路径 private String path;//储存路径
private String quote;//判断与其他菜单是否关联使用中
public String getIndexTable() { public String getIndexTable() {
return indexTable; return indexTable;
} }
@@ -38,10 +37,4 @@ public class ProxyFileInsertScriptCfg extends BaseCfg<ProxyFileInsertScriptCfg>{
public void setPath(String path) { public void setPath(String path) {
this.path = path; this.path = path;
} }
public String getQuote() {
return quote;
}
public void setQuote(String quote) {
this.quote = quote;
}
} }

View File

@@ -16,15 +16,6 @@ public class ProxyFileResponsePageCfg extends BaseCfg<ProxyFileResponsePageCfg>
private String contentType;//内容类型如text/html取字典表contentType private String contentType;//内容类型如text/html取字典表contentType
private String md5;//文件md5值 private String md5;//文件md5值
private Long contentLength;//文件长度 private Long contentLength;//文件长度
private String quote;//引用状态
public String getQuote() {
return quote;
}
public void setQuote(String quote) {
this.quote = quote;
}
public String getIndexTable() { public String getIndexTable() {
return indexTable; return indexTable;

View File

@@ -3775,15 +3775,8 @@ public class BaseController {
page.setPageNo(1); page.setPageNo(1);
page.setLastPage(false); page.setLastPage(false);
List list = proxyFileHijackService.findPage(page, searchFileHijackCfg).getList(); List list = proxyFileHijackService.findPage(page, searchFileHijackCfg).getList();
List<BaseCfg> result = new ArrayList();
for(int i=0;i<list.size();i++){
ProxyFileHijackCfg temp=(ProxyFileHijackCfg)list.get(i);
if("-1".equals(temp.getQuote()) || temp.getQuote()==null ){
result.add(temp);
}
}
if(!StringUtil.isEmpty(list)){ if(!StringUtil.isEmpty(list)){
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, result, hasData); hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
}else{ }else{
hasData = false; hasData = false;
} }
@@ -3794,15 +3787,8 @@ public class BaseController {
page.setPageNo(1); page.setPageNo(1);
page.setLastPage(false); page.setLastPage(false);
List list = proxyFileInsertScriptService.findPage(page,searchFileInsertScriptCfg).getList(); List list = proxyFileInsertScriptService.findPage(page,searchFileInsertScriptCfg).getList();
List<BaseCfg> result = new ArrayList();
for(int i=0;i<list.size();i++){
ProxyFileInsertScriptCfg temp=(ProxyFileInsertScriptCfg)list.get(i);
if("-1".equals(temp.getQuote()) || temp.getQuote()==null ){
result.add(temp);
}
}
if(!StringUtil.isEmpty(list)){ if(!StringUtil.isEmpty(list)){
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, result, hasData); hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
}else{ }else{
hasData = false; hasData = false;
} }
@@ -3814,15 +3800,8 @@ public class BaseController {
page.setPageNo(1); page.setPageNo(1);
page.setLastPage(false); page.setLastPage(false);
List list = proxyFileTrafficMirrorService.findPage(page,searchFileTrafficMirrorCfg).getList(); List list = proxyFileTrafficMirrorService.findPage(page,searchFileTrafficMirrorCfg).getList();
List<BaseCfg> result = new ArrayList();
for(int i=0;i<list.size();i++){
ProxyFileTrafficMirrorCfg temp=(ProxyFileTrafficMirrorCfg)list.get(i);
if("-1".equals(temp.getUserRegion5()) || temp.getUserRegion5()==null ){
result.add(temp);
}
}
if(!StringUtil.isEmpty(list)){ if(!StringUtil.isEmpty(list)){
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, result, hasData); hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
}else{ }else{
hasData = false; hasData = false;
} }
@@ -3847,15 +3826,8 @@ public class BaseController {
page.setPageNo(1); page.setPageNo(1);
page.setLastPage(false); page.setLastPage(false);
List list = proxyFileResponsePageService.findPage(page,searchFileResponsePageCfg).getList(); List list = proxyFileResponsePageService.findPage(page,searchFileResponsePageCfg).getList();
List<BaseCfg> result = new ArrayList();
for(int i=0;i<list.size();i++){
ProxyFileInsertScriptCfg temp=(ProxyFileInsertScriptCfg)list.get(i);
if("-1".equals(temp.getUserRegion5()) || temp.getUserRegion5()==null ){
result.add(temp);
}
}
if(!StringUtil.isEmpty(list)){ if(!StringUtil.isEmpty(list)){
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, result, hasData); hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
}else{ }else{
hasData = false; hasData = false;
} }
@@ -4164,11 +4136,9 @@ public class BaseController {
cfg.setIsAudit(entity.getIsAudit()); cfg.setIsAudit(entity.getIsAudit());
cfg.setAuditTime(entity.getAuditTime()); cfg.setAuditTime(entity.getAuditTime());
cfg.setAuditorId(entity.getAuditorId()); cfg.setAuditorId(entity.getAuditorId());
if(!cfg.getQuote().equals("1")){
notAuditList.add(cfg); notAuditList.add(cfg);
} }
} }
}
}else if(className.equals("ProxyFileInsertScriptCfg")){ }else if(className.equals("ProxyFileInsertScriptCfg")){
list = proxyFileInsertScriptService.findPage(page, searFileInsertScriptCfg).getList(); list = proxyFileInsertScriptService.findPage(page, searFileInsertScriptCfg).getList();
for(int i=0;i<list.size();i++){ for(int i=0;i<list.size();i++){

View File

@@ -132,10 +132,8 @@ public class InterceptController extends CommonController {
String keyring = request.getParameter("keyring"); String keyring = request.getParameter("keyring");
if(StringUtils.isNotBlank(keyring)) { if(StringUtils.isNotBlank(keyring)) {
entity.getUserRegion().put("keyring", Long.parseLong(keyring)); entity.getUserRegion().put("keyring", Long.parseLong(keyring));
entity.setUserRegion4(keyring);
}else { }else {
entity.getUserRegion().put("keyring", 0); entity.getUserRegion().put("keyring", 0);
entity.setUserRegion4("0");
} }
Map<String,Object> map = new HashMap(); Map<String,Object> map = new HashMap();
//exclusions //exclusions
@@ -237,7 +235,6 @@ public class InterceptController extends CommonController {
if("1".equals(enable)) { if("1".equals(enable)) {
if(StringUtils.isNotBlank(mirror_profile)){ if(StringUtils.isNotBlank(mirror_profile)){
map.put("mirror_profile", mirror_profile.trim()); map.put("mirror_profile", mirror_profile.trim());
entity.setUserRegion5(mirror_profile.trim());
} }
} }
entity.getUserRegion().put("decrypt_mirror", map); entity.getUserRegion().put("decrypt_mirror", map);

View File

@@ -1012,31 +1012,4 @@ public class PxyObjKeyringController extends BaseController {
} }
return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + functionId; return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + functionId;
} }
/**
* 验证Keyring是否有被使用
*
* @param entity
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = { "/ajaxKeyinfIsUsed" })
public boolean ajaxKeyinfIsUsed(String[] compileIds, HttpServletRequest request, HttpServletResponse response) {
for(String compileId:compileIds){
CfgIndexInfo cfg = new CfgIndexInfo();
cfg.setIsAudit(1);
cfg.setIsValid(1);
cfg.setFunctionId(200);//代理拦截策略
cfg.setServiceId(512);
cfg.setUserRegion1(compileId);
List<CfgIndexInfo> list = httpRedirectCfgService.getCfgIndexInfos(cfg);
if (list.size() > 0) {
return false;
}
}
return true;
}
} }

View File

@@ -0,0 +1,99 @@
package com.nis.web.controller.configuration.proxy;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.web.controller.BaseController;
import com.nis.web.service.BaseService;
import com.nis.web.service.configuration.StatusOfUsedService;
@Controller
@RequestMapping("${adminPath}/proxy/statusOfUsed")
public class StatusOfUsedController extends BaseController{
@Autowired
protected StatusOfUsedService statusOfUsedService;
@ResponseBody
@RequestMapping(value = { "/ajaxRequest" })
public boolean statusOfUsed(String[] compileIds, HttpServletRequest request, HttpServletResponse response) {
Integer isValid = Integer.parseInt(request.getParameter("isValid"));
Integer ServiceId = Integer.parseInt(request.getParameter("serviceId"));
Integer functionId = 0;
String key = "";
//拦截证书策略
if(ServiceId==520){
functionId = 200;
ServiceId = 512;
key = "keyring";
}//流量转发目的地址
if(ServiceId==645){
functionId = 200;
ServiceId = 512;
key = "mirror_profile";
}
//劫持文件、注入脚本文件
else if(ServiceId==643 || ServiceId==644){
functionId = 215;
ServiceId = 656;
}//访问阻断页面
else if(ServiceId==646){
functionId = 207;
ServiceId = 576;
}
if(ServiceId == 576 || ServiceId==656){
for(String compileId:compileIds){
CfgIndexInfo cfg = new CfgIndexInfo();
if(ServiceId==656){
cfg.setUserRegion4(compileId);
}else if(ServiceId==576){
cfg.setUserRegion3(compileId);
}
cfg.setIsValid(isValid);
cfg.setFunctionId(functionId);
cfg.setServiceId(ServiceId);
List<CfgIndexInfo> list = statusOfUsedService.getStatusOfUsed(cfg);
if (list.size() > 0) {
return false;
}
}
return true;
}else if(ServiceId==512){
CfgIndexInfo cfg = new CfgIndexInfo();
cfg.setIsValid(isValid);
cfg.setFunctionId(functionId);
cfg.setServiceId(ServiceId);
List<CfgIndexInfo> list = statusOfUsedService.getStatusOfUsed(cfg);
Map<String,Map<String,Object>> tempMap = new HashMap<>();
for(CfgIndexInfo temp:list){
tempMap = BaseService.gsonFromJson(temp.getUserRegion1(), Map.class);
String value = "";
if("keyring".equals(key)){
value = String.valueOf(tempMap.get(key));
}else if("mirror_profile".equals(key)){
value = String.valueOf(tempMap.get("decrypt_mirror").get("mirror_profile"));
}
for(String s: compileIds){
if(s.equals(value))
return false;
}
}
return true;
}
return true;
}
}

View File

@@ -51,14 +51,13 @@
<include refid="ProxyFileHijackCfgColumn" /> <include refid="ProxyFileHijackCfgColumn" />
<trim prefix="," prefixOverrides=","> <trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name , s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,max(i.is_valid) as quote ,ri.request_title as requestName
</trim> </trim>
FROM PXY_PROFILE_HIJACK_FILES a FROM PXY_PROFILE_HIJACK_FILES a
left join sys_user s on a.creator_id=s.id left join sys_user s on a.creator_id=s.id
left join sys_user e on a.editor_id=e.id left join sys_user e on a.editor_id=e.id
left join sys_user u on a.auditor_id=u.id left join sys_user u on a.auditor_id=u.id
left join request_info ri on a.request_id=ri.id left join request_info ri on a.request_id=ri.id
left join cfg_index_info i on a.COMPILE_ID=i.user_region4
<trim prefix="WHERE" prefixOverrides="AND |OR "> <trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''"> <if test="page !=null and page.where != null and page.where != ''">
AND ${page.where} AND ${page.where}
@@ -156,7 +155,6 @@
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${sqlMap.dsf} ${sqlMap.dsf}
</trim> </trim>
group by compile_id
<choose> <choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''"> <when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc

View File

@@ -51,14 +51,13 @@
<include refid="ProxyFileInsertScriptCfgColumn" /> <include refid="ProxyFileInsertScriptCfgColumn" />
<trim prefix="," prefixOverrides=","> <trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name , s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,max(i.is_valid) as quote ,ri.request_title as requestName
</trim> </trim>
FROM PXY_PROFILE_INSERT_SCRIPTS a FROM PXY_PROFILE_INSERT_SCRIPTS a
left join sys_user s on a.creator_id=s.id left join sys_user s on a.creator_id=s.id
left join sys_user e on a.editor_id=e.id left join sys_user e on a.editor_id=e.id
left join sys_user u on a.auditor_id=u.id left join sys_user u on a.auditor_id=u.id
left join request_info ri on a.request_id=ri.id left join request_info ri on a.request_id=ri.id
left join cfg_index_info i on a.COMPILE_ID=i.user_region4
<trim prefix="WHERE" prefixOverrides="AND |OR "> <trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''"> <if test="page !=null and page.where != null and page.where != ''">
AND ${page.where} AND ${page.where}
@@ -155,7 +154,6 @@
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${sqlMap.dsf} ${sqlMap.dsf}
</trim> </trim>
group by compile_id
<choose> <choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''"> <when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc

View File

@@ -53,14 +53,13 @@
<include refid="ProxyFileResponsePageCfgColumn" /> <include refid="ProxyFileResponsePageCfgColumn" />
<trim prefix="," prefixOverrides=","> <trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name , s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,max(i.is_valid) as quote ,ri.request_title as requestName
</trim> </trim>
FROM pxy_profile_response_pages a FROM pxy_profile_response_pages a
left join sys_user s on a.creator_id=s.id left join sys_user s on a.creator_id=s.id
left join sys_user e on a.editor_id=e.id left join sys_user e on a.editor_id=e.id
left join sys_user u on a.auditor_id=u.id left join sys_user u on a.auditor_id=u.id
left join request_info ri on a.request_id=ri.id left join request_info ri on a.request_id=ri.id
left join cfg_index_info i on a.COMPILE_ID=i.user_region3
<trim prefix="WHERE" prefixOverrides="AND |OR "> <trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''"> <if test="page !=null and page.where != null and page.where != ''">
@@ -161,7 +160,6 @@
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${sqlMap.dsf} ${sqlMap.dsf}
</trim> </trim>
group by compile_id
<choose> <choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''"> <when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc

View File

@@ -50,14 +50,13 @@
<include refid="ProxyFileTrafficMirrorCfgColumn" /> <include refid="ProxyFileTrafficMirrorCfgColumn" />
<trim prefix="," prefixOverrides=","> <trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name , s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,max(i.is_valid) as userRegion5 ,ri.request_title as requestName
</trim> </trim>
FROM PXY_PROFILE_TRAFFIC_MIRROR a FROM PXY_PROFILE_TRAFFIC_MIRROR a
left join sys_user s on a.creator_id=s.id left join sys_user s on a.creator_id=s.id
left join sys_user e on a.editor_id=e.id left join sys_user e on a.editor_id=e.id
left join sys_user u on a.auditor_id=u.id left join sys_user u on a.auditor_id=u.id
left join request_info ri on a.request_id=ri.id left join request_info ri on a.request_id=ri.id
left join cfg_index_info i on a.COMPILE_ID=i.user_region5
<trim prefix="WHERE" prefixOverrides="AND |OR "> <trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''"> <if test="page !=null and page.where != null and page.where != ''">
AND ${page.where} AND ${page.where}
@@ -157,7 +156,6 @@
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${sqlMap.dsf} ${sqlMap.dsf}
</trim> </trim>
group by compile_id
<choose> <choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''"> <when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc ORDER BY ${page.orderBy},a.is_audit,a.CFG_ID desc

View File

@@ -142,14 +142,13 @@
<include refid="PxyObjKeyringColumns"/> <include refid="PxyObjKeyringColumns"/>
<trim prefix="," prefixOverrides=","> <trim prefix="," prefixOverrides=",">
,s.name as creator_name,e.name as editor_name,u.name as auditor_name ,s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,max(i.is_valid) as userRegion4 ,ri.request_title as requestName
</trim> </trim>
FROM pxy_obj_keyring r FROM pxy_obj_keyring r
left join sys_user s on r.creator_id=s.id left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id left join request_info ri on r.request_id=ri.id
left join cfg_index_info i on r.COMPILE_ID=i.user_region4
<trim prefix="WHERE" prefixOverrides="AND |OR "> <trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''"> <if test="page !=null and page.where != null and page.where != ''">
AND ${page.where} AND ${page.where}
@@ -230,7 +229,6 @@
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${sqlMap.dsf} ${sqlMap.dsf}
</trim> </trim>
group by compile_id
<choose> <choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''"> <when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy},r.is_audit,r.CFG_ID desc ORDER BY ${page.orderBy},r.is_audit,r.CFG_ID desc

View File

@@ -26,6 +26,7 @@ import com.nis.web.dao.MyBatisDao;
public interface WebsiteCfgDao extends CrudDao<CfgIndexInfo>{ public interface WebsiteCfgDao extends CrudDao<CfgIndexInfo>{
public List<CfgIndexInfo> getCfgIndexInfos(CfgIndexInfo entity); public List<CfgIndexInfo> getCfgIndexInfos(CfgIndexInfo entity);
public List<CfgIndexInfo> getStatusOfUsed(CfgIndexInfo entity);
public CfgIndexInfo getCfgIndexInfo(@Param("cfgId")Long id,@Param("compileId")Integer compileId); public CfgIndexInfo getCfgIndexInfo(@Param("cfgId")Long id,@Param("compileId")Integer compileId);
public List<CfgIndexInfo> getWebsiteList(CfgIndexInfo entity); public List<CfgIndexInfo> getWebsiteList(CfgIndexInfo entity);
public List<IpPortCfg> getIpPortList(CfgIndexInfo entity); public List<IpPortCfg> getIpPortList(CfgIndexInfo entity);

View File

@@ -1177,4 +1177,42 @@
<delete id="deleteDnsDomainCfg"> <delete id="deleteDnsDomainCfg">
delete from dns_domain_cfg where compile_id=#{compileId} and function_id=#{functionId} delete from dns_domain_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete> </delete>
<select id="getStatusOfUsed" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
SELECT
<include refid="ConfigIndex_Column" />
FROM cfg_index_info a
<where>
<if test="cfgId != null">
and cfg_id=#{cfgId}
</if>
<if test="compileId != null">
and compile_id=#{compileId}
</if>
<if test="functionId != null">
and function_id=#{functionId}
</if>
<if test="serviceId != null">
and service_id=#{serviceId}
</if>
<if test="sourceCompileId != null">
and source_compile_id=#{sourceCompileId}
</if>
<if test="isValid != null and isValid != -1">
and is_valid=#{isValid}
</if>
<if test="isValid == -1">
and is_valid &gt; #{isValid}
</if>
<!-- 访问阻断页面 -->
<if test="functionId != null and functionId==207">
and a.user_region3 = #{userRegion3,jdbcType=VARCHAR}
</if>
<!-- 劫持、注入脚本 -->
<if test="functionId != null and functionId==215">
and a.user_region4 = #{userRegion4,jdbcType=VARCHAR}
</if>
</where>
</select>
</mapper> </mapper>

View File

@@ -459,10 +459,8 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
List<ProxyObjKeyring> convertList = Lists.newArrayList(); List<ProxyObjKeyring> convertList = Lists.newArrayList();
for (Object object : auditList) { for (Object object : auditList) {
PxyObjKeyring cfg = (PxyObjKeyring)object; PxyObjKeyring cfg = (PxyObjKeyring)object;
if(!"1".equals(cfg.getUserRegion4())){
convertList.add(BaseService.convertCallBackProxyObjKeyring(cfg)); convertList.add(BaseService.convertCallBackProxyObjKeyring(cfg));
} }
}
if(convertList.size() > 0) { if(convertList.size() > 0) {
auditList = convertList; auditList = convertList;
} }
@@ -484,21 +482,17 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
List<ProxyFileHijackCfgAudit> convertList = Lists.newArrayList(); List<ProxyFileHijackCfgAudit> convertList = Lists.newArrayList();
for (Object object : auditList) { for (Object object : auditList) {
ProxyFileHijackCfg cfg = (ProxyFileHijackCfg)object; ProxyFileHijackCfg cfg = (ProxyFileHijackCfg)object;
if(!"1".equals(cfg.getQuote())){
convertList.add(BaseService.convertCallBackProxyFileHijack(cfg)); convertList.add(BaseService.convertCallBackProxyFileHijack(cfg));
} }
}
if(convertList.size() > 0) { if(convertList.size() > 0) {
auditList = convertList; auditList = convertList;
} }
}else if(entity.getServiceId().equals(644)) { // 脚本注入 }else if(entity.getServiceId().equals(644)) { // 劫持文件
List<ProxyFileInsertScriptCfgAudit> convertList = Lists.newArrayList(); List<ProxyFileInsertScriptCfgAudit> convertList = Lists.newArrayList();
for (Object object : auditList) { for (Object object : auditList) {
ProxyFileInsertScriptCfg cfg = (ProxyFileInsertScriptCfg)object; ProxyFileInsertScriptCfg cfg = (ProxyFileInsertScriptCfg)object;
if(!"1".equals(cfg.getQuote())){
convertList.add(BaseService.convertCallBackProxyFileInsertScript(cfg)); convertList.add(BaseService.convertCallBackProxyFileInsertScript(cfg));
} }
}
if(convertList.size() > 0) { if(convertList.size() > 0) {
auditList = convertList; auditList = convertList;
} }
@@ -506,10 +500,8 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
List<ProxyFileTrafficMirrorCfgAudit> convertList = Lists.newArrayList(); List<ProxyFileTrafficMirrorCfgAudit> convertList = Lists.newArrayList();
for (Object object : auditList) { for (Object object : auditList) {
ProxyFileTrafficMirrorCfg cfg = (ProxyFileTrafficMirrorCfg)object; ProxyFileTrafficMirrorCfg cfg = (ProxyFileTrafficMirrorCfg)object;
if(!"1".equals(cfg.getUserRegion5())){
convertList.add(BaseService.convertCallBackProxyFileTrafficMirror(cfg)); convertList.add(BaseService.convertCallBackProxyFileTrafficMirror(cfg));
} }
}
if(convertList.size() > 0) { if(convertList.size() > 0) {
auditList = convertList; auditList = convertList;
} }
@@ -526,10 +518,8 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
List<ProxyFileResponsePageCfgAudit> convertList = Lists.newArrayList(); List<ProxyFileResponsePageCfgAudit> convertList = Lists.newArrayList();
for (Object object : auditList) { for (Object object : auditList) {
ProxyFileResponsePageCfg cfg = (ProxyFileResponsePageCfg)object; ProxyFileResponsePageCfg cfg = (ProxyFileResponsePageCfg)object;
if(!"1".equals(cfg.getQuote())){
convertList.add(BaseService.convertCallBackProxyFileResponsePage(cfg)); convertList.add(BaseService.convertCallBackProxyFileResponsePage(cfg));
} }
}
if(convertList.size() > 0) { if(convertList.size() > 0) {
auditList = convertList; auditList = convertList;
} }

View File

@@ -0,0 +1,21 @@
package com.nis.web.service.configuration;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.web.dao.configuration.WebsiteCfgDao;
import com.nis.web.service.CrudService;
@Service
public class StatusOfUsedService extends CrudService<WebsiteCfgDao, CfgIndexInfo> {
@Autowired
protected WebsiteCfgDao websiteCfgDao;
public List<CfgIndexInfo> getStatusOfUsed(CfgIndexInfo entity){
return websiteCfgDao.getStatusOfUsed(entity);
}
}

View File

@@ -1581,6 +1581,7 @@ max=Max
decrypt_mirror=Decrypt Mirror decrypt_mirror=Decrypt Mirror
enable=Enable enable=Enable
forward=Forward forward=Forward
file_is_used=file Is Used
decrypt_mirror_enable_on=if the enable option value is '1', the Mirror profile is needed decrypt_mirror_enable_on=if the enable option value is '1', the Mirror profile is needed
ssl_ver_mirror_client_on=if the mirror client option value is '1', the min SSL version and the max SSL version will be ignored ssl_ver_mirror_client_on=if the mirror client option value is '1', the min SSL version and the max SSL version will be ignored
#---------------------------Proxy Manipulate------------------------------------ #---------------------------Proxy Manipulate------------------------------------

View File

@@ -1583,6 +1583,7 @@ max=Max
decrypt_mirror=Decrypt Mirror decrypt_mirror=Decrypt Mirror
enable=Enable enable=Enable
forward=Forward forward=Forward
file_is_used=file Is Used
decrypt_mirror_enable_on=if the enable option value is '1', the Mirror profile is needed decrypt_mirror_enable_on=if the enable option value is '1', the Mirror profile is needed
ssl_ver_mirror_client_on=if the mirror client option value is '1', the min SSL version and the max SSL version will be ignored ssl_ver_mirror_client_on=if the mirror client option value is '1', the min SSL version and the max SSL version will be ignored
#---------------------------Proxy Manipulate------------------------------------ #---------------------------Proxy Manipulate------------------------------------

View File

@@ -1581,6 +1581,7 @@ max=\u6700\u5927
decrypt_mirror=\u89e3\u5bc6\u955c\u50cf decrypt_mirror=\u89e3\u5bc6\u955c\u50cf
enable=\u542f\u7528 enable=\u542f\u7528
forward=Forward forward=Forward
file_is_used=\u6587\u4EF6\u88AB\u4F7F\u7528
decrypt_mirror_enable_on=\u5982\u679c\u542f\u52a8\u9009\u9879\u7684\u503c\u662f1\uff0c\u5219\u955c\u50cf\u6587\u4ef6\u9009\u9879\u9700\u8981\u9009\u62e9 decrypt_mirror_enable_on=\u5982\u679c\u542f\u52a8\u9009\u9879\u7684\u503c\u662f1\uff0c\u5219\u955c\u50cf\u6587\u4ef6\u9009\u9879\u9700\u8981\u9009\u62e9
ssl_ver_mirror_client_on=\u5982\u679c\u955c\u50cf\u5ba2\u6237\u7aef\u9009\u9879\u7684\u503c\u662f1\uff0c\u5219\u6700\u5927\u6700\u5c0fSSL\u7248\u672c\u53f7\u4f1a\u88ab\u5ffd\u7565 ssl_ver_mirror_client_on=\u5982\u679c\u955c\u50cf\u5ba2\u6237\u7aef\u9009\u9879\u7684\u503c\u662f1\uff0c\u5219\u6700\u5927\u6700\u5c0fSSL\u7248\u672c\u53f7\u4f1a\u88ab\u5ffd\u7565
#---------------------------Proxy Manipulate------------------------------------ #---------------------------Proxy Manipulate------------------------------------

View File

@@ -139,7 +139,7 @@ function del(url){
if(validateIsDelete(checkboxes)){ if(validateIsDelete(checkboxes)){
top.$.jBox.tip("<spring:message code='has_prohibit_delete'/>", "<spring:message code='info'/>"); top.$.jBox.tip("<spring:message code='has_prohibit_delete'/>", "<spring:message code='info'/>");
return; return;
}else if(validateIsDeleteOfQuote(checkboxes)){ }else if(!validateIsDeleteOfQuote(checkboxes)){
top.$.jBox.tip("<spring:message code='file_quote_disable_delete'/>", "<spring:message code='info'/>"); top.$.jBox.tip("<spring:message code='file_quote_disable_delete'/>", "<spring:message code='info'/>");
return; return;
}else{ }else{
@@ -347,15 +347,24 @@ function cancelPassOpt(url){
var addrPoolIds = [],canCancel = true; var addrPoolIds = [],canCancel = true;
var compileIds = []; var compileIds = [];
var serviceId = 0;
$(checkboxes).filter(":checked").each(function(){ $(checkboxes).filter(":checked").each(function(){
var addrPoolId = $(this).attr("addressPoolId"); var addrPoolId = $(this).attr("addressPoolId");
var serviceId = $(this).attr("serviceId"); serviceId = $(this).attr("serviceId");
var compileId = $(this).attr("compileId"); var compileId = $(this).attr("compileId");
if(typeof addrPoolId != "undefined"){ if(typeof addrPoolId != "undefined"){
addrPoolIds.push(addrPoolId); addrPoolIds.push(addrPoolId);
} }
//记录代理证书的配置 var serviceIdJudge = false;
if(typeof serviceId != "undefined" && serviceId==520 && typeof compileId != "undefined"){ if(serviceId==520
|| serviceId==643
|| serviceId==644
|| serviceId==645
|| serviceId==646)
{
serviceIdJudge = true;
}
if(typeof serviceId != "undefined" && serviceIdJudge && typeof compileId != "undefined"){
compileIds.push(compileId); compileIds.push(compileId);
} }
}); });
@@ -375,27 +384,22 @@ function cancelPassOpt(url){
}); });
} }
if(canCancel){ if(canCancel){
//查询证书是否被拦截策略引用 //查询是否被引用(劫持、注入、进行、阻断页面、证书策略)
if(compileIds.length > 0){ if(compileIds.length > 0){
$.ajax({ $.ajax({
type:'post', type:'post',
url:'${ctx}/proxy/intercept/strateagy/ajaxKeyinfIsUsed', url:'${ctx}/proxy/statusOfUsed/ajaxRequest',
data:{"compileIds":compileIds.join(',')}, data:{"compileIds":compileIds.join(','),"isValid":1,"serviceId":serviceId},
async:false, async:false,
success:function(data){//处理返回结果 success:function(data){//处理返回结果
if(data == false){ if(data == false){
top.$.jBox.tip('<spring:message code="keyring_is_used"/>'); top.$.jBox.tip('<spring:message code="file_is_used"/>');
canCancel=data; canCancel=data;
} }
} }
}); });
} }
} }
//查询文件是否被引用
if(canCancel && validateIsCancelOfQuote(checkboxes)){
top.$.jBox.tip("<spring:message code='file_is_used'/>", "<spring:message code='info'/>");
canCancel=false;
}
if(canCancel){ if(canCancel){
doAll(checkboxes,url); doAll(checkboxes,url);
} }
@@ -607,25 +611,39 @@ function validateIsDelete(checkboxes){
} }
//验证文件是否其他菜单有引用且非删除状态 //验证文件是否其他菜单有引用且非删除状态
function validateIsDeleteOfQuote(checkboxes){ function validateIsDeleteOfQuote(checkboxes){
var flag = false; var compileIds = [];canCancel = true;
var serviceId = 0;
$(checkboxes).filter(":checked").each(function(){ $(checkboxes).filter(":checked").each(function(){
if($(this).attr("quoteStatus") != -1 && "undefined" != typeof $(this).attr("quoteStatus") && $(this).attr("quoteStatus") != ""){ //可删除的条件 serviceId = $(this).attr("serviceId");
flag = true; var compileId = $(this).attr("compileId");
return; var serviceIdJudge = false;
if(serviceId==520
|| serviceId==643
|| serviceId==644
|| serviceId==645
|| serviceId==646)
{
serviceIdJudge = true;
}
if(typeof serviceId != "undefined" && serviceIdJudge && typeof compileId != "undefined"){
compileIds.push(compileId);
} }
}); });
return flag; if(compileIds.length > 0){
} $.ajax({
//验证文件是否其他菜单引用且生效 type:'post',
function validateIsCancelOfQuote(checkboxes){ url:'${ctx}/proxy/statusOfUsed/ajaxRequest',
var flag = false; data:{"compileIds":compileIds.join(','),"isValid":-1,"serviceId":serviceId},
$(checkboxes).filter(":checked").each(function(){ async:false,
if($(this).attr("quoteStatus") == 1){ //不可取消的配置 success:function(data){//处理返回结果
flag = true; if(data == false){
return; top.$.jBox.tip('<spring:message code="file_is_used"/>');
canCancel=data;
}
} }
}); });
return flag; }
return canCancel;
} }
//验证选择的配置,是否有审核通过的 //验证选择的配置,是否有审核通过的
function validatePass(checkboxes){ function validatePass(checkboxes){

View File

@@ -322,7 +322,7 @@
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1"> <c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr> <tr>
<td> <td>
<input type="checkbox" class="i-checks" serviceId="${cfg.serviceId }" compileId="${cfg.compileId }" id="${cfg.cfgId}" quoteStatus="${cfg.userRegion4}" value="${cfg.isAudit}"> <input type="checkbox" class="i-checks" serviceId="${cfg.serviceId }" compileId="${cfg.compileId }" id="${cfg.cfgId}" value="${cfg.isAudit}">
</td> </td>
<td>${cfg.compileId }</td> <td>${cfg.compileId }</td>
<td>${cfg.cfgDesc }</td> <td>${cfg.cfgDesc }</td>

View File

@@ -314,7 +314,7 @@
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1"> <c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
<tr> <tr>
<td> <td>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" quoteStatus="${indexCfg.quote}" value="${indexCfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" serviceId="${indexCfg.serviceId }" compileId="${indexCfg.compileId }" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td> </td>
<td>${indexCfg.compileId }</td> <td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc}</a></td> <td>${indexCfg.cfgDesc}</a></td>

View File

@@ -313,7 +313,7 @@
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1"> <c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
<tr> <tr>
<td> <td>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" quoteStatus="${indexCfg.quote}" value="${indexCfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" serviceId="${indexCfg.serviceId }" compileId="${indexCfg.compileId }" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td> </td>
<td>${indexCfg.compileId }</td> <td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc}</a></td> <td>${indexCfg.cfgDesc}</a></td>

View File

@@ -302,7 +302,7 @@
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1"> <c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
<tr> <tr>
<td> <td>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" quoteStatus="${indexCfg.quote}" value="${indexCfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" serviceId="${indexCfg.serviceId }" compileId="${indexCfg.compileId }" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td> </td>
<td>${indexCfg.compileId }</td> <td>${indexCfg.compileId }</td>
<td>${indexCfg.fileDesc }</td> <td>${indexCfg.fileDesc }</td>

View File

@@ -320,7 +320,7 @@
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1"> <c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
<tr> <tr>
<td> <td>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" quoteStatus="${cfg.userRegion5}" value="${indexCfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" serviceId="${indexCfg.serviceId }" compileId="${indexCfg.compileId }" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td> </td>
<td>${indexCfg.compileId }</td> <td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc}</a></td> <td>${indexCfg.cfgDesc}</a></td>