Skip to content

Commit 120ff02

Browse files
committed
Remove references to WAF aliases. Feature not fullyed developed. Issue identifed by LGTM. Checked with Arshan and he confirmed it should be removed.
1 parent b8c48a9 commit 120ff02

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

configuration/esapi/waf-policy.xsd

-1.07 KB
Binary file not shown.

src/main/java/org/owasp/esapi/waf/configuration/AppGuardianConfiguration.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ public class AppGuardianConfiguration {
7777
public static final String JAVASCRIPT_TARGET_TOKEN = "##1##";
7878
public static final String JAVASCRIPT_REDIRECT = "<html><body><script>document.location='" + JAVASCRIPT_TARGET_TOKEN + "';</script></body></html>";
7979

80-
/*
81-
* The aliases declared in the beginning of the config file.
82-
*/
83-
private HashMap<String,Object> aliases;
84-
8580
/*
8681
* Fail response settings.
8782
*/
@@ -114,8 +109,6 @@ public AppGuardianConfiguration() {
114109
afterBodyRules = new ArrayList<Rule>();
115110
beforeResponseRules = new ArrayList<Rule>();
116111
cookieRules = new ArrayList<Rule>();
117-
118-
aliases = new HashMap<String,Object>();
119112
}
120113

121114
/*
@@ -160,9 +153,6 @@ public void setDefaultResponseCode(int defaultResponseCode) {
160153
this.defaultResponseCode = defaultResponseCode;
161154
}
162155

163-
public void addAlias(String key, Object obj) {
164-
aliases.put(key, obj);
165-
}
166156

167157
public List<Rule> getBeforeBodyRules() {
168158
return beforeBodyRules;

src/main/java/org/owasp/esapi/waf/configuration/ConfigurationParser.java

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public static AppGuardianConfiguration readConfigurationFile(InputStream stream,
9494
doc = parser.build(stream);
9595
root = doc.getRootElement();
9696

97-
Element aliasesRoot = root.getFirstChildElement("aliases");
9897
Element settingsRoot = root.getFirstChildElement("settings");
9998
Element authNRoot = root.getFirstChildElement("authentication-rules");
10099
Element authZRoot = root.getFirstChildElement("authorization-rules");
@@ -106,30 +105,11 @@ public static AppGuardianConfiguration readConfigurationFile(InputStream stream,
106105
Element beanShellRoot = root.getFirstChildElement("bean-shell-rules");
107106

108107

109-
/**
110-
* Parse the 'aliases' section.
111-
*/
112-
if ( aliasesRoot != null ) {
113-
Elements aliases = aliasesRoot.getChildElements("alias");
114-
115-
for(int i=0;i<aliases.size();i++) {
116-
Element e = aliases.get(i);
117-
String name = e.getAttributeValue("name");
118-
String type = e.getAttributeValue("type");
119-
String value = e.getValue();
120-
if ( REGEX.equals(type) ) {
121-
config.addAlias(name, Pattern.compile(value));
122-
} else {
123-
config.addAlias(name, value);
124-
}
125-
}
126-
}
127-
128108
/**
129109
* Parse the 'settings' section.
130110
*/
131111
if ( settingsRoot == null ) {
132-
throw new ConfigurationException("", "The <settings> section is required");
112+
throw new ConfigurationException("", "The <settings> section is required");
133113
} else if ( settingsRoot != null ) {
134114

135115

0 commit comments

Comments
 (0)