A simple vulnerable Chess Game developed in Java, using also javascript, jsp pages, css and traditional HttpRequest and HttpReponse. It uses a mysql database with info of the users.
You can find some SQL Injections, Cross Site Scripting, Path Traversal and so on. Some of the most important OWASP TOP 10 vulnerabilities.
gradle clean
gradle buildImage
You have also the option to generate a image with obfuscated source code, it uses proguard for java as obfuscator. To do that, simply run.
gradle buildImageObf
mvn clean install -Dp.type=war
Now that you have your war file generated you can deploy your application with Docker. To do that run:
docker run -d --name chess -p 8087:8080 sebastianrevuelta/chess-game:2.3
docker run -d -p 3306:3306 --name mysql_db -e MYSQL_ROOT_PASSWORD={PASSWORD} --mount src=mysql-db-data,dst=/var/lib/mysql mysql
Note: Credentials, host and port of the database should be configured in resources/config.properties file before war generation
After building the image (gradle buildImage command) then you can deploy with docker-compose as follow:
docker-compose up -d
docker exec -i mysql_db sh -c 'exec mysql -uroot -p{password}' < ./sql/chess_db.sql
You can access to the application through:
localhost:8087/chess
In order to deploy the application in Microsoft Azure Cloud, we need to follow the next steps:
-
Install maven plugin
<plugin> <groupId>com.microsoft.azure</groupId> <artifactId>azure-webapp-maven-plugin</artifactId> <version>1.7.0</version> </plugin> -
Generate azure configuration
mvn azure-webapp:config -
Deploy the application in azure
mvn azure-webapp:deploy
(you should generate the war file as explained above)
First of all, you need to download the Axure CLI client. Then you can check the logs as this:
az webapp log tail --name {appName} --resource-group {groupName}
Note: You can use a MySQL database as a Azure Service, in any case, you need to configure credentials, host and port of the database in resources/config.properties file before deploying app
- Extract chess engine as microservice
- Configuration properties file as environment variables