简体   繁体   English

OWASP ESAPI文件在Maven Project(Web)中的位置

[英]Location of OWASP ESAPI file in Maven Project (Web)

I am trying to use OWASP ESAPI library in my Maven Web Project.The problem i am facing is that the controllers are not able to find the ESAPI properties file. 我试图在我的Maven Web Project中使用OWASP ESAPI库。我面临的问题是控制器无法找到ESAPI属性文件。

I tried putting them in the resources folder ,but it does not work.I can't seem to get it working. 我试图将它们放在资源文件夹中,但它不起作用。我似乎无法使其正常工作。

Can someone help me with the correct location of ESAPI resources in a Maven Project. 有人可以帮助我了解Maven项目中ESAPI资源的正确位置。

The class Javadoc for the implementation class, [DefaultSecurityConfiguration] ( http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/reference/DefaultSecurityConfiguration.html ), describes how the ESAPI.property class is found. 实现类的Javadoc类[DefaultSecurityConfiguration]( http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/reference/DefaultSecurityConfiguration.html )描述了ESAPI的方式。属性类已找到。 It is rather complicated and has been discussed several times on the ESAPI User mailing list so it is not surprising you are confused. 它相当复杂,并且已在ESAPI用户邮件列表中进行了多次讨论,因此毫不奇怪。 (This is the first questions that I feel should be in an ESAPI FAQ if someone ever takes the time to create one.) (如果有人花时间创建一个,我认为这是ESAPI常见问题解答中的第一个问题。)

There also some bugs that we found in Maven such that if the full path to your ESAPI.properties file contains any spaces in it (eg, "C:\\Documents and Settings\\kww\\code\\ESAPI\\configuration\\esapi\\ESAPI.properties"), Maven seems to choke on it and is unable to find it. 我们还在Maven中发现了一些错误,例如,如果ESAPI.properties文件的完整路径中包含任何空格(例如,“ C:\\ Documents and Settings \\ kww \\ code \\ ESAPI \\ configuration \\ esapi \\ ESAPI.properties” ”),Maven似乎对此感到窒息,无法找到它。 (Note, if this were your path, you could tell Maven to look under "C:\\Docume~1\\kww\\code\\ESAPI\\configuration\\esapi\\ESAPI.properties" instead, and that seems to work.) (请注意,如果这是您的路径,则可以告诉Maven转到“ C:\\ Docume〜1 \\ kww \\ code \\ ESAPI \\ configuration \\ esapi \\ ESAPI.properties”下,这似乎可行。)

What I normally suggest to people is to set the system property "org.owasp.esapi.resources" from the java command line to some folder that has no spaces and copy your ESAPI.properties under there. 我通常向人们建议的是,将Java命令行中的系统属性“ org.owasp.esapi.resources”设置为没有空格的某个文件夹,然后在该文件夹下复制ESAPI.properties。 (This is also discussed in the aforementioned Javadoc.) (在上述Javadoc中也对此进行了讨论。)

Lastly, should you get confused, take a look at some of the Bash scripts under "src/examples/scripts", such as "runclass.sh" and hopefully (if you can read Bash), that should show you how this works. 最后,如果您感到困惑,请查看“ src / examples / scripts”下的一些Bash脚本,例如“ runclass.sh”,并希望(如果您能阅读Bash的话)应该会告诉您它是如何工作的。

Hope that helps. 希望能有所帮助。 -kevin -kevin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM