Skip to content

Commit 51c5a3a

Browse files
committed
Change log4j.xml to prop value that's obviously ignored.
Also added explanatory comment.
1 parent 6630df5 commit 51c5a3a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/test/java/org/owasp/esapi/waf/WAFTestUtility.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,19 @@ public class WAFTestUtility {
3939
public static void setWAFPolicy( ESAPIWebApplicationFirewallFilter waf, String policyFile ) throws Exception {
4040
Map map = new HashMap();
4141
map.put( "configuration", policyFile );
42-
map.put( "log_settings", "../log4j.xml");
42+
43+
// As of ESAPI 2.5.0.0 (when Log4J 1 dependency was removed), thsi
44+
// init parameter is not ignored. However, it will produce a warning
45+
// log message that looks something like this:
46+
//
47+
// [2022-07-11 00:25:45] [org.owasp.esapi.waf.ESAPIWebApplicationFirewallFilter] [EVENT FAILURE Anonymous:90471@unknown -> 10.1.43.6:80/ExampleApplication/org.owasp.esapi.waf.ESAPIWebApplicationFirewallFilter] >> Since ESAPI 2.5.0.0, ESAPI WAF ignoring parameter 'log_settings; for further details, see https://github.com/ESAPI/esapi-java-legacy/blob/develop/documentation/esapi4java-core-2.5.0.0-release-notes.txt
48+
//
49+
// Without getting really fancy and making this test way more
50+
// complicated than I want though, I am not sure how to test for
51+
// some specicif log output. It's been manually verified (once).
52+
// Hopefully, that is good enough. -kwwall
53+
//
54+
map.put( "log_settings", "parameter-now-ignored!!!");
4355
FilterConfig mfc = new MockWafFilterConfig( map );
4456
waf.init( mfc );
4557
}

0 commit comments

Comments
 (0)