Open
Conversation
CaledoniaProject
requested changes
Jul 1, 2022
| public boolean handleServerInfo(ClassLoader classLoader, ProtectionDomain domain) { | ||
| String version = ""; | ||
| try { | ||
| // if (classLoader == null) { |
| logDetectError("handle inforsuite startup failed", t); | ||
| } | ||
| if (!isJboss(classLoader)) { | ||
| if(version != null){ |
Collaborator
There was a problem hiding this comment.
加个空格,e.g if (version
| Object outputStream = Reflection.getField(output, "outputStream"); | ||
| int flag = (Integer) Reflection.getField(outputStream, "state"); | ||
| isClosed = flag == 1; | ||
| }else if("com/cvicse/inforsuite/grizzly/http/io/OutputBuffer".equals(InforSuiteHttpResponseHook.clazzName)){ |
| @@ -0,0 +1 @@ | |||
| @中创中间件原创代码 | |||
| for (ServerDetector detector : detectors) { | ||
| if (detector.isClassMatched(className) && detector.handleServer(className, classLoader, domain)) { | ||
| HookHandler.LOGGER.info("detect server class: " + className); | ||
| if(className.equals("com/cvicse/loong/enterprise/inforsuite/bootstrap/ASMain")){ |
| if (detector.isClassMatched(className) && detector.handleServer(className, classLoader, domain)) { | ||
| HookHandler.LOGGER.info("detect server class: " + className); | ||
| if(className.equals("com/cvicse/loong/enterprise/inforsuite/bootstrap/ASMain")){ | ||
| detectors.subList(0,13).clear(); |
Collaborator
There was a problem hiding this comment.
这里清理detectors的目的是?
Author
There was a problem hiding this comment.
detect server时,区分中创应用服务器和Tomcat。
具体原因是因为中创应用服务器加载类中存在和Tomcat相同的类,如果不清理,会误判为Tomcat。
Collaborator
There was a problem hiding this comment.
你好,这个代码不能合入,你需要看看是否有其他方式能解决问题
| detectors.subList(0,13).clear(); | ||
| HookHandler.LOGGER.info("detect server class: " + className); | ||
| break; | ||
| }else{ |
| HookHandler.doRealCheckWithoutRequest(CheckParameter.Type.POLICY_SERVER_BES, CheckParameter.EMPTY_MAP); | ||
| } else if ("TongWeb8".equals(serverName)) { | ||
| HookHandler.doRealCheckWithoutRequest(CheckParameter.Type.POLICY_SERVER_TONGWEB8, CheckParameter.EMPTY_MAP); | ||
| }else if ("inforsuite".equals(serverName)){ |
Collaborator
|
关于detector能够清空的问题,我们评估下哈 |
Author
好的,我们技术刚刚提供了另一种解决办法,我也提交一下。这两种解决办法的根本目的在于区分中创和Tomcat的日志输出标识,对于openrasp功能没有影响。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
提交说明:基于openrasp当前1.3.8版本,提交了支持中创InforSuiteAS服务器的代码,新增1个文件夹,1个txt文件,9个java文件,修改5个java文件。
测试结果:针对vulns测试用例,所有测试用例均已测试通过。测试环境:CentOS 7 / 1.8.0_322(64位) / InforSuite ASV10.0/Firefox,rasp以单机模式运行(管理平台未测试)。
遗留说明:RaspInstall.jar 尚不支持在InforSuiteAS上安装rasp,这块代码未进行改造。