简体   繁体   English

尝试使用 ESAPI 但出现 ConfigurationException 错误

[英]Trying to Use ESAPI but getting Error as ConfigurationException

ESAPI: WARNING: System property org.owasp.esapi.opsteam is not set ESAPI: WARNING: System property org.owasp.esapi.devteam is not set ESAPI: Attempting to load ESAPI.properties via file I/O. ESAPI: WARNING: System property org.owasp.esapi.opsteam is not set ESAPI: WARNING: System property org.owasp.esapi.devteam is not set ESAPI: Attempting to load ESAPI.properties via file I/O. ESAPI: Attempting to load ESAPI.properties as resource file via file I/O. ESAPI: Not found in org.owasp.esapi.resources directory or file not readable: ESAPI.properties ESAPI: Not found in org.owasp.esapi.resources directory or file not readable: ESAPI.properties

ESAPI: Loading validation.properties via file I/O failed. ESAPI:通过文件 I/O 加载 validation.properties 失败。 ESAPI: Attempting to load validation.properties via the classpath. ESAPI:尝试通过类路径加载 validation.properties。 ESAPI: validation.properties could not be loaded by any means. ESAPI:无法以任何方式加载 validation.properties。 fail.. Caught java.lang.IllegalArgumentException;失败.. 捕获 java.lang.IllegalArgumentException; exception message was: java.lang.IllegalArgumentException: Failed to load ESAPI.properties as a classloader resource.异常消息是:java.lang.IllegalArgumentException:无法将 ESAPI.properties 作为类加载器资源加载。 ESAPI: SecurityConfiguration for ESAPI.printProperties not found in ESAPI.properties. ESAPI:在 ESAPI.properties 中找不到 ESAPI.printProperties 的安全配置。 Using default: false使用默认值:false

ESAPI: SecurityConfiguration for Encoder.DefaultCodecList not found in ESAPI.properties. ESAPI:在 ESAPI.properties 中找不到 Encoder.DefaultCodecList 的安全配置。 Using default: [org.owasp.esapi.codecs.HTMLEntityCodec, org.owasp.esapi.codecs.PercentCodec, org.owasp.esapi.codecs.JavaScriptCodec]使用默认值:[org.owasp.esapi.codecs.HTMLEntityCodec, org.owasp.esapi.codecs.PercentCodec, org.owasp.esapi.codecs.JavaScriptCodec]

org.owasp.esapi.errors.ConfigurationException: java.lang.reflect.InvocationTargetException Encoder class (org.owasp.esapi.reference.DefaultEncoder) CTOR threw exception org.owasp.esapi.errors.ConfigurationException: java.lang.reflect.InvocationTargetException 编码器 class (org.owasp.esapi.reference.DefaultEncoder) CTOR 抛出异常

You can safely ignore those warning messages .您可以安全地忽略这些警告消息 It's a red herring.这是一条红鲱鱼。 That's referring to a more secure configuration option that you can use (although most people don't) when deploying an application that uses ESAPI.这是指在部署使用 ESAPI 的应用程序时可以使用(尽管大多数人不使用)的更安全的配置选项。

[ Aside : The idea is that it allows you to split the ESAPI.properties file into two files, one controlled by the dev team and the other controlled by the operations (ops) team. [旁白:这个想法是它允许您将 ESAPI.properties文件拆分为两个文件,一个由开发团队控制,另一个由运营 (ops) 团队控制。 Any property found in the one controlled by the ops team overrides and identical property in the dev version.在由 ops 团队控制的版本中找到的任何属性都会覆盖开发版本中的相同属性。

This feature was developed in the days before DevOps became as prevalent as it is today (and long before things like HashiCorp Vault), so perhaps it doesn't make as much sense now, but the intent was to allow the devs to have there own ESAPI.properties file with properties like Encryptor.MasterKey that all the developers can safely share, but that the operations team can set a separate version for QA and production deployments.这个功能是在 DevOps 像今天这样流行之前的日子里开发的(并且早在 HashiCorp Vault 之类的东西之前),所以现在它可能没有多大意义,但目的是让开发人员拥有自己的ESAPI.properties文件具有Encryptor.MasterKey等所有开发人员可以安全共享的属性,但运营团队可以为 QA 和生产部署设置单独的版本。 (It of course applied to other properties as well, but I think that was the properties that drove it.) (它当然也适用于其他属性,但我认为是驱动它的属性。)

So that explains the warnings part.]这样就解释了警告部分。]

But your actual problem is that ESAPI cannot find your ESAPI.properties file anywhere.但是您的实际问题是 ESAPI 无法在任何地方找到您的ESAPI.properties文件。 Looks at this for an explanation of how ESAPI tries to locate your configuration files: https://www.javadoc.io/static/org.owasp.esapi/esapi/2.5.1.0/org/owasp/esapi/reference/DefaultSecurityConfiguration.html查看此内容以了解 ESAPI 如何尝试定位您的配置文件: https://www.javadoc.io/static/org.owasp.esapi/esapi/2.5.1.0/org/owasp/esapi/reference/DefaultSecurityConfiguration。 html

If you are still having trouble, what I generally recommend is setting the system property ' org.owasp.esapi.resources ' on the 'java' command line.如果您仍然遇到问题,我通常建议在“java”命令行上设置系统属性“ org.owasp.esapi.resources ”。

If for some reason that you don't want to do that, you will have to provide us with more details, like ALL the messages, including the complete exception stack trace.如果出于某种原因您不想这样做,则必须向我们提供更多详细信息,例如所有消息,包括完整的异常堆栈跟踪。

Hope that helps.希望有所帮助。

暂无
暂无

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

相关问题 尝试使用 ESAPI 但出现错误 - Trying to Use ESAPI But getting Error 尝试使用ESAPI getValidInput但出现错误 - Trying to use ESAPI getValidInput but getting error ESAPI尝试记录警告时抛出org.owasp.esapi.errors.ConfigurationException - ESAPI throwing org.owasp.esapi.errors.ConfigurationException when trying to log a warning 尝试使用OWASP ESAPI库时,获取antisamy-esapi.xml找不到异常 - Getting antisamy-esapi.xml not found exception while trying to use OWASP ESAPI library org.owasp.esapi.errors.ConfigurationException: java.lang.reflect.InvocationTargetException 调用 ESAPI.encoder() 时出错 - org.owasp.esapi.errors.ConfigurationException: java.lang.reflect.InvocationTargetException Error while invoking ESAPI.encoder() 尝试使用OWASP ESAPI时找不到antisamy-esapi.xml - antisamy-esapi.xml not found when trying to use OWASP ESAPI ESAPI错误,即时通讯试图在数据库中保存内容 - ESAPI Error im trying to save content in database ESAPI 记录器抛出 org.owasp.esapi.errors.ConfigurationException:HttpUtilities.MaxHeaderNameSize 的 SecurityConfiguration 类型不正确 - ESAPI Logger throwing org.owasp.esapi.errors.ConfigurationException: SecurityConfiguration for HttpUtilities.MaxHeaderNameSize has incorrect type ESAPI - 使用 ESAPI 2.2.3.1 获取 ClassNotFoundException - ESAPI - Getting ClassNotFoundException with ESAPI 2.2.3.1 线程“main”org.owasp.esapi.errors.ConfigurationException 中的异常: - Exception in thread "main" org.owasp.esapi.errors.ConfigurationException:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM