Skip to content

Commit

Permalink
Dockerization
Browse files Browse the repository at this point in the history
  • Loading branch information
aabashkin committed Nov 21, 2022
1 parent 748e032 commit 1fe75b4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM eclipse-temurin:17-jdk-focal

COPY target/nosql-injection-vulnapp-mongodb-java-*.jar /app/niva.jar

WORKDIR /app

ENTRYPOINT [ "java","-jar", "niva.jar"]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ This edition utilizes MongoDB as the NoSQL database and the official Java driver

# Setup

## Docker
```
docker pull aabashkin/niva
docker run -p 8080:8080 aabashkin/niva
```

## Maven

```
Expand Down Expand Up @@ -59,7 +65,7 @@ The app uses Basic Authentication. Three users are hardcoded:

# Testing
Tests are located in the root of the web application:
`http://localhost:8080/niva/`
`http://localhost:8080/`

The testing page contains a number of links to both secure and insecure endpoints, with options for both regular expected input as well as an example attack vector:

Expand Down
4 changes: 4 additions & 0 deletions build-container-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

mvn clean install
docker build --tag aabashkin/niva .
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>aabashkin</groupId>
<artifactId>nosql-injection-vulnapp-mongodb-java</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<name>nosql-injection-vulnapp-mongodb-java</name>
<description>An app vulnerable to NoSQL injection built with a MongoDB database and the official Java driver</description>
<properties>
Expand Down
12 changes: 12 additions & 0 deletions tag-push-container-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

if [ -z "$1" ]
then
echo "Missing tag version"
exit
fi

docker tag aabashkin/niva aabashkin/niva:$1

docker push aabashkin/niva
docker push aabashkin/niva:$1

0 comments on commit 1fe75b4

Please sign in to comment.