デフォルトの validation.properties ファイルを使用する代わりに、ESAPI にデータベース テーブルから検証プロパティを読み取らせる方法はありますか?
1513 次
1 に答える
2
短い答え:いいえ。
ここでコードをチェックしてください。
関連する答えはドキュメントにあります:
/**
* The SecurityConfiguration manages all the settings used by the ESAPI in a single place. In this reference
* implementation, resources can be put in several locations, which are searched in the following order:
* <p>
* 1) Inside a directory set with a call to SecurityConfiguration.setResourceDirectory( "C:\temp\resources" ).
* <p>
* 2) Inside the System.getProperty( "org.owasp.esapi.resources" ) directory.
* You can set this on the java command line
* as follows (for example): java -Dorg.owasp.esapi.resources="C:\temp\resources". You may have to add this
* to the batch script that starts your web server. For example, in the "catalina" script that
* starts Tomcat, you can set the JAVA_OPTS variable to the -D string above.
* <p>
* 3) Inside the System.getProperty( "user.home" ) + "/.esapi" directory
* <p>
* 4) In an ".esapi" directory on the classpath
* <p>
* Once the Configuration is initialized with a resource directory, you can edit it to set things like master
* keys and passwords, logging locations, error thresholds, and allowed file extensions.
* <p>
* WARNING: Do not forget to update ESAPI.properties to change the master key and other security critical settings.
*
* @author Mike Fauzy (mike.fauzy@aspectsecurity.com)
* @author Jim Manico (jim.manico@aspectsecurity.com)
* @author Jeff Williams (jeff.williams .at. aspectsecurity.com) <a
* href="http://www.aspectsecurity.com">Aspect Security</a>
*/
そのような動作が必要な場合は、esapi ソースを手動で変更する必要があり、(できれば) 特定のデータベースの実装を無視できる方法で変更する必要があります。
また、セキュリティ ライブラリの場合、これらの多くをデータベースで管理するのは少し安全性が低いことも考慮してください。OWASP からの推奨事項は、src/main/resources ディレクトリ内のプロパティ ファイルを使用して、このライブラリを自分で手動でコンパイルすることです。そうすれば、外部のアクターが構成を変更できるようにするには、Java 標準に準拠していると仮定して、マシンに UNIX アカウントを持っている必要があります。(WEB-INF/ は自然に保護されます。)これをデータベースに入れると、理論的には、セキュリティ構成は SQL インジェクションの脅威にさらされます...なぜリスクを冒すのでしょうか?
これらのファイルをライブラリ自体に置くと、クラスパスに直接配置されるため、変更がはるかに難しくなります。これをデータベースに実装する場合は、TOCTOUエラー (チェック時間から使用時間) に十分注意してください。
于 2014-10-15T21:50:41.943 に答える