diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 9c4403f..31da221 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -10,4 +10,5 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 833f7d1..9cb4c75 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,5 @@ - + diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs index 04cad8c..5a03dac 100644 --- a/.settings/org.eclipse.wst.validation.prefs +++ b/.settings/org.eclipse.wst.validation.prefs @@ -1,2 +1,22 @@ +DELEGATES_PREFERENCE=delegateValidatorList +USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; +USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; +USER_PREFERENCE=overrideGlobalPreferencesfalse disabled=06target eclipse.preferences.version=1 +override=false +suspend=false +vals/org.eclipse.jst.jsf.facelet.ui.FaceletHTMLValidator/global=TF01 +vals/org.eclipse.jst.jsf.ui.JSFAppConfigValidator/global=TF01 +vals/org.eclipse.jst.jsp.core.JSPBatchValidator/global=TF01 +vals/org.eclipse.jst.jsp.core.JSPContentValidator/global=TF01 +vals/org.eclipse.jst.jsp.core.TLDValidator/global=TF01 +vals/org.eclipse.wst.dtd.core.dtdDTDValidator/global=TF01 +vals/org.eclipse.wst.html.core.HTMLValidator/global=TF01 +vals/org.eclipse.wst.jsdt.core.JsValidator/global=TF01 +vals/org.eclipse.wst.json.core.json/global=TF03 +vals/org.eclipse.wst.wsdl.validation.wsdl/global=TF02158org.eclipse.wst.wsdl.validation.internal.eclipse.Validator +vals/org.eclipse.wst.xml.core.xml/global=TF03 +vals/org.eclipse.wst.xsd.core.xsd/global=TF02162org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator +vals/org.eclipse.wst.xsl.core.xsl/global=TF02 +vf.version=3 diff --git a/pom.xml b/pom.xml index ff5fb3c..81092fe 100644 --- a/pom.xml +++ b/pom.xml @@ -209,7 +209,7 @@ junit junit 4.12 - test + @@ -537,6 +537,10 @@ org.mortbay.jetty jsp-api-2.1 + + jdk.tools + jdk.tools + diff --git a/src/main/java/com/nis/domain/restful/NtcCollectRadiusLog.java b/src/main/java/com/nis/domain/restful/NtcCollectRadiusLog.java index 1c314f8..9496544 100644 --- a/src/main/java/com/nis/domain/restful/NtcCollectRadiusLog.java +++ b/src/main/java/com/nis/domain/restful/NtcCollectRadiusLog.java @@ -1,5 +1,6 @@ package com.nis.domain.restful; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.LogEntity; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -22,6 +23,11 @@ public class NtcCollectRadiusLog extends LogEntity { protected String framedIp; @ApiModelProperty(value="用户名", required=true) protected String account; + + protected String searchNasIp;//ISN接入的IP + protected String searchFramedIp;//服务器下发的用户地址 + protected String searchAccount;//用户名 + public Integer getCode() { return code; } @@ -46,6 +52,27 @@ public class NtcCollectRadiusLog extends LogEntity { public void setAccount(String account) { this.account = account; } + @JsonIgnore + public String getSearchNasIp() { + return searchNasIp; + } + public void setSearchNasIp(String searchNasIp) { + this.searchNasIp = searchNasIp; + } + @JsonIgnore + public String getSearchFramedIp() { + return searchFramedIp; + } + public void setSearchFramedIp(String searchFramedIp) { + this.searchFramedIp = searchFramedIp; + } + @JsonIgnore + public String getSearchAccount() { + return searchAccount; + } + public void setSearchAccount(String searchAccount) { + this.searchAccount = searchAccount; + } } diff --git a/src/main/java/com/nis/web/service/AuditLogThread.java b/src/main/java/com/nis/web/service/AuditLogThread.java index b8db811..e6c5992 100644 --- a/src/main/java/com/nis/web/service/AuditLogThread.java +++ b/src/main/java/com/nis/web/service/AuditLogThread.java @@ -174,9 +174,24 @@ public class AuditLogThread implements Runnable { return sb.toString(); } + + public static String getIpAddr(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + return ip; + } + public static AuditLogThread getNewSaveRequestLogThread(HttpServletRequest request) { AuditLogThread thread = new AuditLogThread(); - thread.setRemoteAddr(request.getRemoteAddr()); + thread.setRemoteAddr(getIpAddr(request)); thread.setRequestURI(request.getRequestURI()); if (request.getMethod().toLowerCase().equals("get")) { thread.setQueryString(request.getQueryString()); diff --git a/src/main/resources/applicationConfig-rule.properties b/src/main/resources/applicationConfig-rule.properties index bfc8515..b885a52 100644 --- a/src/main/resources/applicationConfig-rule.properties +++ b/src/main/resources/applicationConfig-rule.properties @@ -333,7 +333,7 @@ unMaatService=3:32;4:96;25:32;28:32;64;65;261:16;262:16;263:16;264:16;265:16;266 #0x402 APP DOMAIN特征发现 1026:2,5; #0x404 APP IP特征 1028:2,5; ########## -serviceDBIndex=1:2,4,5;2:2,4,5;5:2,5;66:2,4,5;16:2;17:2;18:2;19:2;20:2;21:2;22:2;23:2;24:2;26:2;27:2;30:2;31:2;32:2;33:2,5;34:2;35:2;36:2;37:2;38:2;39:2;40:2;128:2;129:2;130:2;131:2;132:2;133:2;134:2;135:2;136:2;137:2;138:2;139:2;140:2;142:2;143:2;144:2;145:2;146:2;147:2;148:2;149:2;150:2;151:2;152:2;256:2;257:2;258:2;259:2;260:2;267:2;271:2;272:2;273:3;274:5;384:2;385:2;386:2;387:2;388:2;395:2;399:3;512:4,5;513:4,2,5;514:4,5;515:4,2,5;517:4,5;520:4;521:4;528:4;544:4;560:4;576:4;592:4;608:4;624:4;625:4;640:4;641:4;750:4;1024:2;1025:2;1026:2,5;1027:2;1028:2,5;1029:2;1030:2;1040:2;1041:2;1042:2;1056:2;1152:2;3:5;4:5;25:5;28:5;64:2;65:2;261:3;262:3;263:3;264:3;265:3;266:3;268:3;269:3;270:3;389:3;390:3;391:3;392:3;393:3;394:3;396:3;397:3;398:3;834:6;835:6;836:6 +serviceDBIndex=1:2,4,5;2:2,4,5;5:2,5;66:2,4,5;16:2;17:2;18:2;19:2;20:2;21:2;22:2;23:2;24:2;26:2;27:2;30:2;31:2;32:2;33:2,5;34:2;35:2;36:2;37:2;38:2;39:2;40:2;128:2;129:2;130:2;131:2;132:2;133:2;134:2;135:2;136:2;137:2;138:2;139:2;140:2;142:2;143:2;144:2;145:2;146:2;147:2;148:2;149:2;150:2;151:2;152:2;256:2;257:2;258:2;259:2;260:2;267:2;271:2;272:2;273:3;274:5;384:2;385:2;386:2;387:2;388:2;395:2;399:3;512:4,5;513:4,2,5;514:4,5;515:4,2,5;517:4,5;520:4;521:4;528:4;544:4;560:4;576:4;592:4;608:4;624:4;625:4;640:4;641:4;750:4;1024:2;1025:2;1026:2,5;1027:2;1028:2,5;1029:2;1030:2;1040:2,5;1041:2;1042:2;1056:2,5;1152:2;3:5;4:5;25:5;28:5;64:2;65:2;261:3;262:3;263:3;264:3;265:3;266:3;268:3;269:3;270:3;389:3;390:3;391:3;392:3;393:3;394:3;396:3;397:3;398:3;834:6;835:6;836:6 ##阀门配置在redisdb的序号 tapRedisDb=5 @@ -349,7 +349,7 @@ tapRedisDb=5 #0x205 基于PXY IP替换 517 #0x402 APP DOMAIN特征发现 1026 #0x404 APP IP特征 1028 -maat2Valve=33:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;512:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;513:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;514:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;515:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;517:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1026:strRegion|strStrRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1028:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1040:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1056:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;5:ipRegion@COMPILE_ID&USER_REGION&EFFECTIVE_RANGE +maat2Valve=1:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;2:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;33:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;512:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;513:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;514:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;515:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;517:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1026:strRegion|strStrRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1028:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1040:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1056:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;5:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE&COMPILE_ID ##记录哪些service可以被分组复用(只有maat类配置可以被分组复用) #业务ID:域类型1@表名,表名|域类型2@表名;业务ID:域类型1@表名,表名|域类型2@表名 diff --git a/src/main/resources/commonSources/applicationConfig-parser.xml b/src/main/resources/commonSources/applicationConfig-parser.xml index 9fa1bd0..0ee0931 100644 --- a/src/main/resources/commonSources/applicationConfig-parser.xml +++ b/src/main/resources/commonSources/applicationConfig-parser.xml @@ -52,6 +52,7 @@ +