Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit ea01466

Browse files
committed
Upgrade a few dependencies in pom.xml. Add some missing header/license
info to the tools/ classes, and 2 other files.
1 parent 6bf88e9 commit ea01466

File tree

8 files changed

+165
-27
lines changed

8 files changed

+165
-27
lines changed

pom.xml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ But it might be needed for Java 10, because I get this error, that I don't get w
831831
<dependency>
832832
<groupId>org.apache.httpcomponents</groupId>
833833
<artifactId>httpcore</artifactId>
834-
<version>4.4.13</version>
834+
<version>4.4.14</version>
835835
</dependency>
836836

837837
<dependency>
@@ -912,7 +912,7 @@ But it might be needed for Java 10, because I get this error, that I don't get w
912912
<dependency>
913913
<groupId>org.json</groupId>
914914
<artifactId>json</artifactId>
915-
<version>20200518</version>
915+
<version>20201115</version>
916916
</dependency>
917917

918918
<dependency>
@@ -924,7 +924,7 @@ But it might be needed for Java 10, because I get this error, that I don't get w
924924
<dependency>
925925
<groupId>org.owasp.esapi</groupId>
926926
<artifactId>esapi</artifactId>
927-
<version>2.2.1.0</version>
927+
<version>2.2.2.0</version>
928928
</dependency>
929929

930930
<dependency>
@@ -1087,7 +1087,7 @@ But it might be needed for Java 10, because I get this error, that I don't get w
10871087
<plugin>
10881088
<groupId>org.apache.maven.plugins</groupId>
10891089
<artifactId>maven-pmd-plugin</artifactId>
1090-
<version>3.13.0</version>
1090+
<version>3.14.0</version>
10911091
<configuration>
10921092
<linkXref>true</linkXref>
10931093
<targetJdk>1.7</targetJdk>
@@ -1097,13 +1097,13 @@ But it might be needed for Java 10, because I get this error, that I don't get w
10971097
<plugin>
10981098
<groupId>org.apache.maven.plugins</groupId>
10991099
<artifactId>maven-project-info-reports-plugin</artifactId>
1100-
<version>3.1.0</version>
1100+
<version>3.1.1</version>
11011101
</plugin>
11021102

11031103
<plugin>
11041104
<groupId>org.apache.maven.plugins</groupId>
11051105
<artifactId>maven-resources-plugin</artifactId>
1106-
<version>3.1.0</version>
1106+
<version>3.2.0</version>
11071107
</plugin>
11081108

11091109
<plugin>
@@ -1130,13 +1130,7 @@ But it might be needed for Java 10, because I get this error, that I don't get w
11301130
<plugin>
11311131
<groupId>org.codehaus.cargo</groupId>
11321132
<artifactId>cargo-maven2-plugin</artifactId>
1133-
<version>1.7.13</version>
1134-
</plugin>
1135-
1136-
<plugin>
1137-
<groupId>org.codehaus.mojo</groupId>
1138-
<artifactId>sonar-maven-plugin</artifactId>
1139-
<version>3.7.1.1746</version>
1133+
<version>1.8.2</version>
11401134
</plugin>
11411135

11421136
<!-- SpotBugs Static Analysis - the successor to FindBugs -->
@@ -1149,6 +1143,15 @@ But it might be needed for Java 10, because I get this error, that I don't get w
11491143
<threshold>Low</threshold>
11501144
<failOnError>true</failOnError>
11511145
</configuration>
1146+
<dependencies>
1147+
<!-- Overwrite dependency on SpotBugs if you want to specify the version of SpotBugs.
1148+
SpotBugs itself is frequently several versions ahead of the spotbugs-maven-plugin -->
1149+
<dependency>
1150+
<groupId>com.github.spotbugs</groupId>
1151+
<artifactId>spotbugs</artifactId>
1152+
<version>${version.spotbugs}</version>
1153+
</dependency>
1154+
</dependencies>
11521155
</plugin>
11531156

11541157
<plugin>
@@ -1220,6 +1223,7 @@ But it might be needed for Java 10, because I get this error, that I don't get w
12201223
<version.jersey>1.19.4</version.jersey>
12211224
<version.slf4j>1.7.30</version.slf4j>
12221225
<version.spotbugs.maven>4.1.4</version.spotbugs.maven>
1226+
<version.spotbugs>4.2.0</version.spotbugs>
12231227
<version.springframework>4.3.29.RELEASE</version.springframework>
12241228
<!-- tomcat 8.5 is last version to support Java 7. Tomcat 9+ requires Java 8. -->
12251229
<tomcat.major.version>8</tomcat.major.version>

src/main/java/org/owasp/benchmark/helpers/LDAPServer.java

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* OWASP Benchmark Project
3+
*
4+
* This file is part of the Open Web Application Security Project (OWASP)
5+
* Benchmark Project For details, please see
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
7+
*
8+
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
9+
* of the GNU General Public License as published by the Free Software Foundation, version 2.
10+
*
11+
* The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
12+
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details
14+
*
15+
* @author Juan GaMa
16+
* @created 2015
17+
*/
18+
119
package org.owasp.benchmark.helpers;
220

321
import java.io.File;
@@ -15,7 +33,6 @@
1533
import org.apache.directory.server.ldap.LdapServer;
1634
import org.apache.directory.server.protocol.shared.transport.TcpTransport;
1735
import org.apache.directory.server.xdbm.Index;
18-
import org.apache.directory.shared.ldap.entry.Entry;
1936
import org.apache.directory.shared.ldap.entry.ServerEntry;
2037
import org.apache.directory.shared.ldap.name.DN;
2138
import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -45,9 +62,10 @@ public LDAPServer() {
4562
}
4663

4764
// Read an entry
48-
Entry result = null;
65+
//Entry result = null;
4966
try {
50-
result = service.getAdminSession().lookup(new DN("dc=apache,dc=org"));
67+
//result =
68+
service.getAdminSession().lookup(new DN("dc=apache,dc=org"));
5169
} catch (Exception e) {
5270
System.out.println("Error creating LDAP Server: " + e.getMessage());
5371
}
@@ -100,6 +118,7 @@ private void initDirectoryService(File workDir){
100118
service = new DefaultDirectoryService();
101119
} catch (Exception e1) {
102120
System.out.println("Error creating DefaultDirectoryService. " + e1.getMessage());
121+
e1.printStackTrace();
103122
}
104123
service.setWorkingDirectory(workDir);
105124

@@ -113,6 +132,7 @@ private void initDirectoryService(File workDir){
113132
systemPartition = addPartition("system", ServerDNConstants.SYSTEM_DN);
114133
} catch (Exception e1) {
115134
System.out.println("Error addPartition system. " + e1.getMessage());
135+
e1.printStackTrace();
116136
}
117137
service.setSystemPartition(systemPartition);
118138

@@ -127,18 +147,23 @@ private void initDirectoryService(File workDir){
127147
fooPartition = addPartition("foo", "dc=foo,dc=com");
128148
} catch (Exception e1) {
129149
System.out.println("Error addPartition foo. " + e1.getMessage());
150+
e1.printStackTrace();
130151
}
152+
131153
Partition barPartition = null;
132154
try {
133155
barPartition = addPartition("bar", "dc=bar,dc=com");
134156
} catch (Exception e1) {
135157
System.out.println("Error addPartition bar. " + e1.getMessage());
158+
e1.printStackTrace();
136159
}
160+
137161
Partition apachePartition = null;
138162
try {
139163
apachePartition = addPartition("apache", "dc=apache,dc=org");
140164
} catch (Exception e1) {
141165
System.out.println("Error addPartition apache. " + e1.getMessage());
166+
e1.printStackTrace();
142167
}
143168

144169
// Index some attributes on the apache partition
@@ -148,7 +173,9 @@ private void initDirectoryService(File workDir){
148173
service.startup();
149174
} catch (Exception e) {
150175
System.out.println("Error at LDAP startup: " + e.getMessage());
176+
e.printStackTrace();
151177
}
178+
152179
// Inject the foo root entry if it does not already exist
153180
try {
154181
service.getAdminSession().lookup(fooPartition.getSuffixDn());
@@ -161,6 +188,7 @@ private void initDirectoryService(File workDir){
161188
service.getAdminSession().add(entryFoo);
162189
} catch (Exception e) {
163190
System.out.println("Error creating new DN.");
191+
e.printStackTrace();
164192
}
165193
}
166194

@@ -176,6 +204,7 @@ private void initDirectoryService(File workDir){
176204
service.getAdminSession().add(entryBar);
177205
} catch (Exception e) {
178206
System.out.println("Error creating new DN.");
207+
e.printStackTrace();
179208
}
180209
}
181210

@@ -190,12 +219,13 @@ private void initDirectoryService(File workDir){
190219
service.getAdminSession().add(entryApache);
191220
} catch (Exception e) {
192221
System.out.println("Error creating new DN.");
222+
e.printStackTrace();
193223
}
194224
}
195225
} catch (Exception e) {
196226
System.out.println("Error when checking if partition exists.");
227+
e.printStackTrace();
197228
}
198-
199229
}
200230

201231
/**
@@ -221,6 +251,8 @@ private void initSchemaPartition() {
221251
extractor.extractOrCopy( true );
222252
//System.out.println("is Extracted: " + extractor.isExtracted());
223253
} catch (Exception e) {
254+
System.out.println("ERROR: parsing LDAP schema");
255+
e.printStackTrace();
224256
}
225257

226258
schemaPartition.setWrappedPartition(ldifPartition);
@@ -233,7 +265,6 @@ private void initSchemaPartition() {
233265
// to initialize the Partitions, as we won't be able to parse
234266
// and normalize their suffix DN
235267
schemaManager.loadAllEnabled();
236-
237268
schemaPartition.setSchemaManager(schemaManager);
238269

239270
List<Throwable> errors = schemaManager.getErrors();
@@ -242,6 +273,8 @@ private void initSchemaPartition() {
242273
throw new Exception("Schema load failed : " + errors);
243274
}
244275
} catch (Exception e) {
276+
System.out.println("ERROR: loading LDAP schema");
277+
e.printStackTrace();
245278
}
246279
}
247280

@@ -296,7 +329,6 @@ public void startServer() throws Exception {
296329
int serverPort = 10389;
297330
server.setTransports(new TcpTransport(serverPort));
298331
server.setDirectoryService(service);
299-
300332
server.start();
301333
}
302334

@@ -312,12 +344,12 @@ public void stopServer() throws Exception {
312344
/**
313345
* Main class.
314346
*
315-
* @param args
316-
* Not used.
347+
* @param args Not used.
317348
* @throws Exception
318349
*/
319350
public static void main(String[] args) throws Exception {
320-
LDAPServer ldap = new LDAPServer();
351+
//LDAPServer ldap =
352+
new LDAPServer();
321353
//ldap.stopServer();
322354
}
323355

src/main/java/org/owasp/benchmark/score/parsers/TestResults.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This file is part of the Open Web Application Security Project (OWASP)
55
* Benchmark Project For details, please see
6-
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
77
*
88
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
99
* of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -12,7 +12,7 @@
1212
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details
1414
*
15-
* @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a>
15+
* @author Dave Wichers
1616
* @created 2015
1717
*/
1818

@@ -46,6 +46,7 @@ public static enum ToolType {
4646
private static int nextCommercialSAST_ToolNumber = 1;
4747
private static int nextCommercialDAST_ToolNumber = 1;
4848
private static int nextCommercialIAST_ToolNumber = 1;
49+
private static int nextCommercialHybrid_ToolNumber = 1;
4950

5051
// The version of the Benchmark these test results are for
5152
private String benchmarkVersion = "notSet";
@@ -121,6 +122,10 @@ public String getToolNameAndVersion() {
121122
return this.toolName;
122123
}
123124

125+
/**
126+
* Get the version of the tool these results are from.
127+
* @return Version of the tool if determined. Null otherwise.
128+
*/
124129
public String getToolVersion() {
125130
return toolVersion;
126131
}
@@ -151,13 +156,19 @@ public void setAnonymous() {
151156
case DAST : {
152157
if (nextCommercialDAST_ToolNumber < 10) {
153158
this.setTool("DAST-0" + nextCommercialDAST_ToolNumber++);
154-
} else this.setTool("DAST-" + nextCommercialDAST_ToolNumber++);
159+
} else this.setTool("DAST-" + nextCommercialDAST_ToolNumber++);
155160
break;
156161
}
157162
case IAST : {
158163
if (nextCommercialIAST_ToolNumber < 10) {
159164
this.setTool("IAST-0" + nextCommercialIAST_ToolNumber++);
160-
} else this.setTool("IAST-" + nextCommercialIAST_ToolNumber++);
165+
} else this.setTool("IAST-" + nextCommercialIAST_ToolNumber++);
166+
break;
167+
}
168+
case Hybrid : {
169+
if (nextCommercialHybrid_ToolNumber < 10) {
170+
this.setTool("HYBR-0" + nextCommercialHybrid_ToolNumber++);
171+
} else this.setTool("HYBR-" + nextCommercialHybrid_ToolNumber++);
161172
}
162173
}
163174
}

src/main/java/org/owasp/benchmark/tools/AbstractTestCaseRequest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* OWASP Benchmark Project
3+
*
4+
* This file is part of the Open Web Application Security Project (OWASP)
5+
* Benchmark Project For details, please see
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
7+
*
8+
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
9+
* of the GNU General Public License as published by the Free Software Foundation, version 2.
10+
*
11+
* The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
12+
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details
14+
*
15+
* @author Juan Gama
16+
* @created 2017
17+
*/
18+
119
package org.owasp.benchmark.tools;
220

321
import java.util.List;

src/main/java/org/owasp/benchmark/tools/BenchmarkCrawler.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* OWASP Benchmark Project
3+
*
4+
* This file is part of the Open Web Application Security Project (OWASP)
5+
* Benchmark Project For details, please see
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
7+
*
8+
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
9+
* of the GNU General Public License as published by the Free Software Foundation, version 2.
10+
*
11+
* The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
12+
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details
14+
*
15+
* @author Juan Gama
16+
* @created 2017
17+
*/
18+
119
package org.owasp.benchmark.tools;
220

321
import java.io.File;
@@ -156,4 +174,5 @@ public HttpRequestBase getRequestBase() {
156174
public void setRequestBase(HttpRequestBase requestBase) {
157175
this.requestBase = requestBase;
158176
}
159-
}
177+
}
178+

src/main/java/org/owasp/benchmark/tools/NoisyCricket.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* OWASP Benchmark Project
3+
*
4+
* This file is part of the Open Web Application Security Project (OWASP)
5+
* Benchmark Project For details, please see
6+
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
7+
*
8+
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
9+
* of the GNU General Public License as published by the Free Software Foundation, version 2.
10+
*
11+
* The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
12+
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details
14+
*
15+
* @author Juan Gama
16+
* @created 2017
17+
*/
18+
119
package org.owasp.benchmark.tools;
220

321
import java.io.File;

0 commit comments

Comments
 (0)