Skip to content

Commit 8d4fcf9

Browse files
committed
This is a MAJOR change. This commit rips out all the utilities included with Benchmark to score it, run crawlers on it, etc. Those utilities are now in a seperate project called BenchmarkUtils. BenchmarkUtils produces a maven plugin that is now used by all the scoring and crawling scripts updated in this commit. You have to clone BenchmarkUtils, then run: mvn install, to get the plugin (which is built and installed locally).
1 parent aba1a8b commit 8d4fcf9

File tree

129 files changed

+260
-30782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+260
-30782
lines changed

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
.classpath
44
.project
55
.settings/
6+
.idea/
7+
*.iml
8+
9+
data/out.csv
610
reports/
11+
scripts/SonarQubeCredentials.sh
712
target/
813
testfiles/
914
tools/Contrast/contrast.jar
1015
tools/Contrast/contrast.yaml
1116
tools/Contrast/working/
1217

13-
.idea/
14-
*.iml
15-
16-
scripts/SonarQubeCredentials.sh

createAnonScorecards.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
mvn validate -Pscorecard -Dexec.args="-cr anonymousScoringConfig.yaml"
1+
source "scripts/verifyBenchmarkPluginAvailable.sh"
2+
mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard -DconfigFile=data/anonymousScoringConfig.yaml
23

createScorecards.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
call mvn validate -Pscorecard
1+
# source "scripts/verifyBenchmarkPluginAvailable.sh" - Don't have .bat version of this (yet)
2+
#mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard -DconfigFile=config/score_v1.3config.yaml
3+
call mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard
24

createScorecards.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
mvn validate -Pscorecard
1+
source "scripts/verifyBenchmarkPluginAvailable.sh"
2+
#mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard -DconfigFile=config/score_v1.3config.yaml
3+
mvn -Djava.awt.headless=true org.owasp:benchmarkutils-maven-plugin:create-scorecard
24

data/anonymousScoringConfig.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This configuration simply enables anonymous scoring mode
2+
3+
anonymousmode: true # If true, anonymize names of commercial tools
4+

data/benchmark-crawler-http.xml

Lines changed: 1 addition & 2741 deletions
Large diffs are not rendered by default.

pom.xml

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -25,63 +25,6 @@
2525
</licenses>
2626

2727
<profiles>
28-
<profile>
29-
<id>crawler</id>
30-
<build>
31-
<plugins>
32-
<plugin>
33-
<groupId>org.codehaus.mojo</groupId>
34-
<artifactId>exec-maven-plugin</artifactId>
35-
<version>${version.exec.maven}</version>
36-
<executions>
37-
<execution>
38-
<phase>validate</phase>
39-
<goals>
40-
<goal>java</goal>
41-
</goals>
42-
<configuration>
43-
<mainClass>org.owasp.benchmark.tools.BenchmarkCrawler</mainClass>
44-
<arguments>
45-
<argument>${addlArg1}</argument> <!-- -f here -->
46-
<argument>${addlArg2}</argument> <!-- filename here -->
47-
</arguments>
48-
</configuration>
49-
</execution>
50-
</executions>
51-
</plugin>
52-
</plugins>
53-
</build>
54-
</profile>
55-
56-
<profile>
57-
<id>scorecard</id>
58-
<build>
59-
<plugins>
60-
<plugin>
61-
<groupId>org.codehaus.mojo</groupId>
62-
<artifactId>exec-maven-plugin</artifactId>
63-
<version>${version.exec.maven}</version>
64-
<executions>
65-
<execution>
66-
<phase>validate</phase>
67-
<goals>
68-
<goal>java</goal>
69-
</goals>
70-
<configuration>
71-
<mainClass>org.owasp.benchmark.score.BenchmarkScore</mainClass>
72-
<systemProperties>
73-
<systemProperty>
74-
<key>java.awt.headless</key>
75-
<value>true</value>
76-
</systemProperty>
77-
</systemProperties>
78-
</configuration>
79-
</execution>
80-
</executions>
81-
</plugin>
82-
</plugins>
83-
</build>
84-
</profile>
8528

8629
<profile>
8730
<id>findsecbugs</id>
@@ -655,30 +598,6 @@
655598
</build>
656599
</profile>
657600

658-
<profile>
659-
<id>time</id>
660-
<build>
661-
<plugins>
662-
<plugin>
663-
<groupId>org.codehaus.mojo</groupId>
664-
<artifactId>exec-maven-plugin</artifactId>
665-
<version>${version.exec.maven}</version>
666-
<executions>
667-
<execution>
668-
<phase>validate</phase>
669-
<goals>
670-
<goal>java</goal>
671-
</goals>
672-
<configuration>
673-
<mainClass>org.owasp.benchmark.score.WriteTime</mainClass>
674-
</configuration>
675-
</execution>
676-
</executions>
677-
</plugin>
678-
</plugins>
679-
</build>
680-
</profile>
681-
682601
</profiles>
683602

684603
<dependencies>
@@ -709,13 +628,6 @@
709628
<version>1.4</version>
710629
</dependency>
711630

712-
<dependency>
713-
<groupId>commons-io</groupId>
714-
<artifactId>commons-io</artifactId>
715-
<!-- latest is: <version>2.7</version>, but 2.7+ requires Java 8 -->
716-
<version>2.6</version>
717-
</dependency>
718-
719631
<dependency>
720632
<groupId>commons-lang</groupId>
721633
<artifactId>commons-lang</artifactId>
@@ -730,20 +642,6 @@
730642
<version>1.7.32</version>
731643
</dependency>
732644

733-
<dependency>
734-
<groupId>org.apache.commons</groupId>
735-
<artifactId>commons-csv</artifactId>
736-
<!-- Latest is: <version>1.8</version>, but 1.7+ requires Java 8 -->
737-
<version>1.6</version>
738-
</dependency>
739-
740-
<dependency>
741-
<groupId>org.apache.commons</groupId>
742-
<artifactId>commons-lang3</artifactId>
743-
<!-- <version>3.10</version> is latest, but 3.9+ requires Java 8 -->
744-
<version>3.8.1</version>
745-
</dependency>
746-
747645
<dependency>
748646
<groupId>org.apache.directory.server</groupId>
749647
<artifactId>apacheds-core</artifactId>
@@ -902,25 +800,6 @@
902800
<version>2.3.6</version>
903801
</dependency>
904802

905-
<dependency>
906-
<groupId>org.jfree</groupId>
907-
<artifactId>jcommon</artifactId>
908-
<version>1.0.24</version>
909-
</dependency>
910-
911-
<dependency>
912-
<groupId>org.jfree</groupId>
913-
<artifactId>jfreechart</artifactId>
914-
<!-- <version>1.5.1</version> This is latest version, but requires Java 8. 1.5.0 is last version to support Java 7. -->
915-
<version>1.5.0</version>
916-
</dependency>
917-
918-
<dependency>
919-
<groupId>org.json</groupId>
920-
<artifactId>json</artifactId>
921-
<version>20201115</version>
922-
</dependency>
923-
924803
<dependency>
925804
<groupId>org.owasp.esapi</groupId>
926805
<artifactId>esapi</artifactId>
@@ -958,12 +837,6 @@
958837
<version>${version.springframework}</version>
959838
</dependency>
960839

961-
<dependency>
962-
<groupId>org.yaml</groupId>
963-
<artifactId>snakeyaml</artifactId>
964-
<version>1.29</version>
965-
</dependency>
966-
967840
<dependency>
968841
<groupId>xml-apis</groupId>
969842
<artifactId>xml-apis</artifactId>

runCrawler.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
CALL mvn validate -Pcrawler
1+
# source "scripts/verifyBenchmarkPluginAvailable.sh" - Don't have .bat version of this (yet)
2+
CALL mvn org.owasp:benchmarkutils-maven-plugin:run-crawler -DcrawlerFile=data/benchmark-crawler-http.xml
23

runCrawler.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#!/bin/sh
2-
mvn validate -Pcrawler
1+
source "scripts/verifyBenchmarkPluginAvailable.sh"
2+
mvn org.owasp:benchmarkutils-maven-plugin:run-crawler -DcrawlerFile=data/benchmark-crawler-http.xml
33

scripts/runCodeQL.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This script assumes the owasp-benchmark database has already been initialized by running this first:
2+
# ../../Tools/codeql-home/codeql/codeql database create owasp-benchmark --language=java
3+
../../Tools/codeql-home/codeql/codeql database analyze owasp-benchmark java-code-scanning.qls --format=sarifv2.1.0 --output=results/Benchmark_1.2-codeql_java-code-scanning_qls.sarif
4+

0 commit comments

Comments
 (0)