-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #572 from HXSecurity/develop
Release v1.13.0
- Loading branch information
Showing
34 changed files
with
366 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
dongtai-common/src/main/java/io/dongtai/iast/common/constants/AgentConstant.java
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
54 changes: 54 additions & 0 deletions
54
...main/java/io/dongtai/iast/core/bytecode/enhance/plugin/core/adapter/ValidatorAdapter.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package io.dongtai.iast.core.bytecode.enhance.plugin.core.adapter; | ||
|
||
import io.dongtai.iast.core.bytecode.enhance.MethodContext; | ||
import io.dongtai.iast.core.handler.hookpoint.models.policy.PolicyNode; | ||
import io.dongtai.iast.core.handler.hookpoint.models.policy.ValidatorNode; | ||
import org.objectweb.asm.Label; | ||
import org.objectweb.asm.MethodVisitor; | ||
import org.objectweb.asm.Opcodes; | ||
|
||
import java.util.Set; | ||
|
||
public class ValidatorAdapter extends MethodAdapter { | ||
/** | ||
* @param adapter | ||
* @param mv | ||
* @param context | ||
* @param policyNodes | ||
*/ | ||
@Override | ||
public void onMethodEnter(MethodAdviceAdapter adapter, MethodVisitor mv, MethodContext context, Set<PolicyNode> policyNodes) { | ||
} | ||
|
||
/** | ||
* @param adapter | ||
* @param mv | ||
* @param opcode | ||
* @param context | ||
* @param policyNodes | ||
*/ | ||
@Override | ||
public void onMethodExit(MethodAdviceAdapter adapter, MethodVisitor mv, int opcode, MethodContext context, Set<PolicyNode> policyNodes) { | ||
for (PolicyNode policyNode : policyNodes) { | ||
if (!(policyNode instanceof ValidatorNode)) { | ||
continue; | ||
} | ||
|
||
Label elseLabel = new Label(); | ||
Label endLabel = new Label(); | ||
|
||
isEnterScope(adapter); | ||
mv.visitJumpInsn(Opcodes.IFEQ, elseLabel); | ||
|
||
adapter.trackMethod(opcode, policyNode, true); | ||
|
||
adapter.mark(elseLabel); | ||
adapter.mark(endLabel); | ||
} | ||
} | ||
|
||
private void isEnterScope(MethodAdviceAdapter adapter) { | ||
adapter.invokeStatic(ASM_TYPE_SPY_HANDLER, SPY_HANDLER$getDispatcher); | ||
adapter.invokeInterface(ASM_TYPE_SPY_DISPATCHER, SPY$enterValidator); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.