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
1 change: 1 addition & 0 deletions sample-apps/JavaRestletMySQL/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.log
43 changes: 43 additions & 0 deletions sample-apps/JavaRestletMySQL/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Define variables
GRADLEW = ./gradlew
JAR_FILE = build/libs/demo-0.0.1-SNAPSHOT.jar
JAVA_AGENT = ../../dist/agent.jar

# Default target
.PHONY: all
all: build

# Build the project
.PHONY: build
build:
@echo "Building the project..."
chmod +x $(GRADLEW)
$(GRADLEW) build

# Run the application with the Java agent
.PHONY: run
run: build
@echo "Running JavaRestletMySQL with Zen & ENV (http://localhost:8106)"
AIKIDO_TOKEN="token" \
AIKIDO_REALTIME_ENDPOINT="http://localhost:5000/realtime" \
AIKIDO_ENDPOINT="http://localhost:5000" \
AIKIDO_BLOCK=1 \
AIKIDO_LOG_LEVEL="debug" \
nohup java -javaagent:$(JAVA_AGENT) -jar $(JAR_FILE) --server.port=8106 > output1.log &

# Run the application without Zen
.PHONY: runWithoutZen
runWithoutZen: build
@echo "Running JavaRestletMySQL without Zen & ENV (http://localhost:8107)"
AIKIDO_TOKEN="random-invalid-token" \
nohup java -jar $(JAR_FILE) --server.port=8107 > output2.log &

# Clean the project
.PHONY: clean
clean:
@echo "Cleaning the project..."
$(GRADLEW) clean

.PHONY: kill
kill:
pkill -f java
2 changes: 2 additions & 0 deletions sample-apps/JavaRestletMySQL/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Restlet + MySQL vulnerable sample app
- Inserting a malicious dog : `Malicious Pet", "Gru from the Minions") -- `
25 changes: 25 additions & 0 deletions sample-apps/JavaRestletMySQL/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
plugins {
id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
targetCompatibility = '17'
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.restlet:org.restlet:2.6.0'
//implementation 'org.restlet:org.restlet.ext.json:2.3.12'
//implementation 'org.restlet:org.restlet.ext.servlet:2.3.12'
implementation files('../../dist/agent_api.jar')
//compileOnly 'org.projectlombok:lombok'
implementation 'mysql:mysql-connector-java:8.0.33'
//annotationProcessor 'org.projectlombok:lombok'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#This file is generated by updateDaemonJvm
toolchainVersion=21
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
252 changes: 252 additions & 0 deletions sample-apps/JavaRestletMySQL/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading