我正在尝试使用 OWASP ESAPI 来验证 spring mvc 项目中的字符串。
到目前为止,我已经做了:
1-
<dependency>
<groupId>org.owasp.esapi</groupId>
<artifactId>esapi</artifactId>
<version>2.1.0.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
2-在资源中添加ESAPI.properties
和validation.properties
作为:
myproject/src/resources/esapi/ESAPI.properties
myproject/src/resources/esapi/validation.properties
3- 将我自己的验证添加到 validation.properties
4-在我的application.properties
我设置org.owasp.esapi.resources
org.owasp.esapi.resources=classpath:esapi/ESAPI.properties
我在一个方法中有以下行
boolean isValid = ESAPI.validator().isValidInput("user id", userID, "USERID", 20, false);
Run Code Online (Sandbox Code Playgroud)
验证有效,但我在标准输出中打印出以下通知:
System property [org.owasp.esapi.opsteam] is not set
System property [org.owasp.esapi.devteam] is not set
我该如何解决?
我也得到几行:
Not found in 'org.owasp.esapi.resources' directory or file not readable: /usr/local/apache-tomcat-8.0.28/bin/ESAPI.properties
Not found in SystemResource Directory/resourceDirectory: .esapi/ESAPI.properties
SUCCESSFULLY LOADED ESAPI.properties via the CLASSPATH from 'esapi/' using current …