Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ scripts/dockerize/dockerfiles
/jdk_21_maven/cs/rest/redis-sample/target/
/jdk_21_maven/em/external/rest/redis-sample/target/
/jdk_21_maven/em/embedded/rest/redis-sample/target/
/jdk_21_maven/cs/rest/arimaa/target/
/jdk_21_maven/em/external/rest/arimaa/target/
/jdk_21_maven/em/embedded/rest/arimaa/target/
/jdk_21_maven/cs/rest/joinus/target/
/jdk_21_maven/em/external/rest/joinus/target/
/jdk_21_maven/em/embedded/rest/joinus/target/
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ How to setup authentication information, based on the current content of the ini
Auth configuration files can found in the [auth](auth) folder.


### REST: Java/Kotlin (40)
### REST: Java/Kotlin (41)

* **Arimaa** (not-known license), [jdk_21_maven/cs/rest/arimaa](jdk_21_maven/cs/rest/arimaa), from [https://github.com/KEAArimaaProject/arimaa-backend](https://github.com/KEAArimaaProject/arimaa-backend)

* **Bibliothek** (MIT), [jdk_17_gradle/cs/rest/bibliothek](jdk_17_gradle/cs/rest/bibliothek), from [https://github.com/PaperMC/bibliothek](https://github.com/PaperMC/bibliothek)

Expand Down
9 changes: 9 additions & 0 deletions auth/arimaa-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
auth:
- name: wfd_admin1
fixedHeaders:
- name: Authorization
value: Basic d2ZkX2FkbWluMTpXZmQtQWRtaW4tUGFzczE=
- name: wfd_admin2
fixedHeaders:
- name: Authorization
value: Basic d2ZkX2FkbWluMjpXZmQtQWRtaW4tUGFzczI=
13 changes: 13 additions & 0 deletions dockerfiles/arimaa.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM amazoncorretto:21-alpine-jdk

COPY ./dist/arimaa-sut.jar .
COPY ./dist/jacocoagent.jar .




ENTRYPOINT \
java \
-javaagent:jacocoagent.jar=output=tcpserver,address=*,port=6300,append=false,dumponexit=false \
-jar arimaa-sut.jar \
--server.port=8080 --spring.datasource.url=jdbc:mysql://db:3306/arimaadockermysqldb --spring.datasource.username=admin --spring.datasource.password=AdminPassword123! --spring.mongodb.uri=mongodb://mongodb:27017/arimaadb --spring.neo4j.uri=bolt://neo4j:7687 --spring.neo4j.authentication.username=neo4j --spring.neo4j.authentication.password=wfdNeo4jPass123
70 changes: 70 additions & 0 deletions dockerfiles/arimaa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
services:
mitmproxy:
image: mitmproxy/mitmproxy:10.2.4
user: "0:0"
environment:
MITM_LOG_DIR: /custom-logs
MITM_LOG_FILE: ${MITM_LOG_FILE:-minlog.csv}
command: >
mitmdump
--mode reverse:http://sut-arimaa:8080
--listen-host 0.0.0.0
--listen-port 8080
--set keep_host_header=true
-s /addons/minlog.py
volumes:
- ${HOST_LOG_DIR:-./mitm-logs}:/custom-logs
- ./addons:/addons:ro
ports:
- "${HOST_PORT:-8080}:8080"
depends_on:
- sut-arimaa
sut-arimaa:
image: webfuzzing/wfd-arimaa:FINAL
# build:
# dockerfile: ./dockerfiles/arimaa.dockerfile
# context: ..
environment:
AUTH_PORT: ${AUTH_PORT:-8081}
ports:
- "${JACOCO_PORT:-6300}:6300"
depends_on:
db:
condition: service_healthy
mongodb:
condition: service_healthy
neo4j:
condition: service_healthy
db:
image: mysql:9.5.0
environment:
MYSQL_DATABASE: arimaadockermysqldb
MYSQL_ROOT_PASSWORD: wfdRootPass123!
volumes:
- ../jdk_21_maven/cs/rest/arimaa/Database/mysql:/docker-entrypoint-initdb.d
healthcheck:
test: mysqladmin ping -h localhost -u root -pwfdRootPass123! --silent
interval: 30s
timeout: 30s
retries: 3
mongodb:
image: mongo:7
volumes:
- ../scripts/dockerize/data/additional_files/arimaa/arimaa-mongo-seed.js:/docker-entrypoint-initdb.d/arimaa-mongo-seed.js
healthcheck:
test: mongosh --quiet --eval "db.adminCommand('ping')"
interval: 30s
timeout: 30s
retries: 3
neo4j:
image: neo4j:5.26
environment:
NEO4J_AUTH: neo4j/wfdNeo4jPass123
volumes:
- ../scripts/dockerize/data/additional_files/arimaa/arimaa-neo4j-seed.cypher:/seed.cypher
healthcheck:
test: cypher-shell -u neo4j -p wfdNeo4jPass123 "MATCH (:WfdSeedComplete) RETURN 1"
interval: 30s
timeout: 30s
retries: 3
command: ["bash", "-c", '/startup/docker-entrypoint.sh neo4j & pid=$!; until cypher-shell -u neo4j -p wfdNeo4jPass123 "RETURN 1" >/dev/null 2>&1; do sleep 2; done; cypher-shell -u neo4j -p wfdNeo4jPass123 -f /seed.cypher; cypher-shell -u neo4j -p wfdNeo4jPass123 "CREATE (:WfdSeedComplete)"; wait $pid']
1 change: 1 addition & 0 deletions experiments/bb-exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def __init__(self, name, auth, sleep, schemaformat, classfiles):

# To ge the SUTs, you need in EMB to run the script "scripts/dist.py"
SUTS = [
Sut("arimaa",True,SLEEP,JSON,["jdk_21_maven/cs/rest/arimaa/target/classes"]),
Sut("bibliothek",False,SLEEP,JSON,["jdk_17_gradle/cs/rest/bibliothek/build/classes"]),
Sut("blogapi",True, SLEEP,JSON,["jdk_8_maven/cs/rest/original/blogapi/target/classes"]),
Sut("catwatch",False,SLEEP,JSON,["jdk_8_maven/cs/rest/original/catwatch/catwatch-backend/target/classes"]),
Expand Down
1 change: 1 addition & 0 deletions experiments/wb-exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def __init__(self, name, platform):

SUTS = [
# REST
Sut("arimaa", JDK_21),
Sut("bibliothek", JDK_17),
Sut("blogapi",JDK_8),
Sut("catwatch", JDK_8),
Expand Down
1 change: 1 addition & 0 deletions jacoco.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ENV CLASS_FILES=/classfiles

### IMPORTANT!!!: must be kept in sync with what declared in run-tools.py, which will need to be updated
### any time in this file we add a new entry to WFD
COPY jdk_21_maven/cs/rest/arimaa/target/classes ${CLASS_FILES}/jdk_21_maven/cs/rest/arimaa/target/classes
COPY jdk_17_gradle/cs/rest/bibliothek/build/classes ${CLASS_FILES}/jdk_17_gradle/cs/rest/bibliothek/build/classes
COPY jdk_8_maven/cs/rest/original/blogapi/target/classes ${CLASS_FILES}/jdk_8_maven/cs/rest/original/blogapi/target/classes
COPY jdk_8_maven/cs/rest/original/catwatch/catwatch-backend/target/classes ${CLASS_FILES}/jdk_8_maven/cs/rest/original/catwatch/catwatch-backend/target/classes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
USE `arimaadockermysqldb`;

INSERT IGNORE INTO `Users` (`username`, `email`, `password`, `role`, `created_at`, `updated_at`)
INSERT IGNORE INTO `Users` (`username`, `email`, `password`, `role`, `created_at`, `updated_at`)
VALUES
('admin1', 'admin1@example.com', '$2a$10$a7Dii8pcWQMclYxLt9Kb1eWpbRNbAPTsMRlJkm7ZT.wYIemq4oiBi', 'ADMIN', NOW(), NOW()),
('user1', 'user1@example.com', '$2a$10$DK1T8LJLPBcPLWhm7i/L1esnux0b7mV0HjMbB02CL794blj0M0lYG', 'USER', NOW(), NOW())
ON DUPLICATE KEY UPDATE
`password` = VALUES(`password`),
`role` = VALUES(`role`),
('user1', 'user1@example.com', '$2a$10$DK1T8LJLPBcPLWhm7i/L1esnux0b7mV0HjMbB02CL794blj0M0lYG', 'USER', NOW(), NOW()),
-- MODIFIED: admin1's password is unknown, and self-registration can never grant ADMIN, so a
-- second known-credential ADMIN account is needed to test broken access control between admins.
('wfd_admin1', 'wfd_admin1@example.com', '$2a$10$3mawxiylgOPZOvvJO24bxeuUcQyQf.n53SzzAX9fBNiT7bfzZn4WO', 'ADMIN', NOW(), NOW()),
('wfd_admin2', 'wfd_admin2@example.com', '$2a$10$8h.Zwu6RHMf0VZsEIZ2rcewbF4CU/nLpzoSSPjE1M1D.nof/9ZQVy', 'ADMIN', NOW(), NOW())
-- MODIFIED
ON DUPLICATE KEY UPDATE
`password` = VALUES(`password`),
`role` = VALUES(`role`),
`updated_at` = NOW();
15 changes: 14 additions & 1 deletion jdk_21_maven/cs/rest/arimaa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,18 @@
<version>3.2.0</version>
<scope>test</scope>
</dependency>
<!-- MODIFIED -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>
<!-- MODIFIED-->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>3.1.0</version>
</dependency>
<!-- MODIFIED-->
</dependencies>
<dependencyManagement/>

Expand All @@ -161,6 +168,12 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.example.arimaabackend.ArimaaBackendApplication</mainClass>
<!-- MODIFIED-->
<!-- WFD expects a single self-contained "arimaa-sut.jar". The classifier keeps
the plain jar as the main artifact, which the external driver depends on. -->
<finalName>arimaa</finalName>
<classifier>sut</classifier>
<!-- MODIFIED-->
</configuration>
</plugin>
<plugin>
Expand Down
1 change: 1 addition & 0 deletions jdk_21_maven/cs/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<module>joinus</module>
<module>person-controller</module>
<module>redis-sample</module>
<module>arimaa</module>
</modules>


Expand Down
59 changes: 59 additions & 0 deletions jdk_21_maven/em/embedded/rest/arimaa/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>evomaster-benchmark-jdk21-em-embedded-rest-arimaa</artifactId>
<packaging>jar</packaging>

<parent>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-benchmark-jdk21-em-embedded-rest</artifactId>
<version>4.3.1-SNAPSHOT</version>
</parent>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>4.0.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- The SUT as a library -->
<dependency>
<groupId>com.example</groupId>
<artifactId>arimaa-backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>5.6.4</version>
</dependency>
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>6.0.3</version>
</dependency>
</dependencies>

</project>
Loading
Loading