-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c22956
commit 2b27bb5
Showing
29 changed files
with
538 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
.gradle | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
.project | ||
.settings | ||
.classpath | ||
.gradle | ||
target | ||
build | ||
build.xml | ||
/.apt_generated/ | ||
/.apt_generated_tests/ | ||
agent.config | ||
hdivAgentLog.hlg | ||
hdiv-ee-agent.jar | ||
license.hdiv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,40 @@ | ||
FROM gradle:7.3.1-jdk17 AS builder | ||
FROM gradle:7.3.1-jdk17 AS log4j | ||
LABEL maintainer="Hdiv Security" | ||
|
||
COPY --chown=gradle:gradle ./log4j-cve-2021-44228 /home/gradle/src | ||
WORKDIR /home/gradle/src | ||
RUN gradle :malicious-server:bootJar --no-daemon | ||
|
||
FROM openjdk:8u181-jdk-alpine | ||
FROM gradle:8.7-jdk17 AS app | ||
LABEL maintainer="Hdiv Security" | ||
|
||
COPY --chown=gradle:gradle . /home/gradle/src | ||
WORKDIR /home/gradle/src | ||
RUN gradle :bootWar --no-daemon | ||
|
||
RUN mkdir /app | ||
COPY --from=builder /home/gradle/src/malicious-server/build/libs/*.jar /app/malicious-server.jar | ||
FROM openjdk:8u342-jre-slim | ||
|
||
RUN mkdir -p /usr/local/tomcat/ | ||
WORKDIR /app | ||
|
||
WORKDIR /usr/local/tomcat | ||
RUN wget --no-check-certificate http://dlcdn.apache.org/tomcat/tomcat-8/v8.5.73/bin/apache-tomcat-8.5.73.tar.gz | ||
RUN tar xvfz apache*.tar.gz | ||
RUN mv apache-tomcat-8.5.73/* /usr/local/tomcat/. | ||
COPY --from=log4j /home/gradle/src/malicious-server/build/libs/*.jar /app/malicious-server.jar | ||
COPY --from=app /home/gradle/src/build/libs/*.war /app/insecure-bank.war | ||
|
||
ADD start.sh /usr/local/tomcat/ | ||
ADD start.sh /app/start.sh | ||
|
||
# Copy the application to tomcat | ||
ADD target/insecure-bank.war /usr/local/tomcat/webapps | ||
RUN chmod +x /app/start.sh | ||
|
||
# Copy the license file | ||
ADD license.hdiv /usr/local/tomcat/hdiv/ | ||
ADD license.hdiv /app/hdiv/ | ||
|
||
# Copy the agent jar | ||
ADD hdiv-ee-agent.jar /usr/local/tomcat/hdiv/ | ||
ADD hdiv-ee-agent.jar /app/hdiv/ | ||
|
||
ENV JAVA_OPTS="-javaagent:/app/hdiv/hdiv-ee-agent.jar \ | ||
-Dhdiv.config.dir=/app/hdiv/ \ | ||
-Dhdiv.console.url=http://console:8080/hdiv-console-services \ | ||
-Dhdiv.console.token=04db250da579302ca273a958 \ | ||
-Dhdiv.server.name=Testing-Docker \ | ||
-Dhdiv.toolbar.enabled=true" | ||
|
||
# Run Tomcat and enjoy! | ||
CMD export JAVA_OPTS="-javaagent:hdiv/hdiv-ee-agent.jar \ | ||
-Dhdiv.config.dir=hdiv/ \ | ||
-Dhdiv.console.url=http://console:8080/hdiv-console-services \ | ||
-Dhdiv.console.token=04db250da579302ca273a958 \ | ||
-Dhdiv.server.name=Testing-Docker \ | ||
-Dhdiv.toolbar.enabled=true" && ./start.sh | ||
CMD /app/start.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
plugins { | ||
java | ||
war | ||
id("org.springframework.boot") version "2.7.18" | ||
id("io.spring.dependency-management") version "1.0.15.RELEASE" | ||
} | ||
|
||
group = "org.hdivsamples" | ||
version = "0.0.1-SNAPSHOT" | ||
|
||
sourceSets { | ||
main { | ||
resources.srcDir("src/main/webapp") | ||
} | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("org.springframework.boot:spring-boot-starter-jdbc") | ||
implementation("org.springframework.boot:spring-boot-starter-web") | ||
implementation("org.springframework.boot:spring-boot-starter-security") | ||
implementation("org.springframework.boot:spring-boot-starter-validation") | ||
implementation("org.springframework.ldap:spring-ldap-core") | ||
implementation("com.unboundid:unboundid-ldapsdk") | ||
implementation("commons-fileupload:commons-fileupload:1.5") | ||
implementation("commons-io:commons-io:2.13.0") | ||
implementation("com.google.guava:guava:30.0-jre") | ||
|
||
runtimeOnly("javax.servlet:jstl") | ||
runtimeOnly("org.apache.tomcat.embed:tomcat-embed-jasper") | ||
runtimeOnly("org.hsqldb:hsqldb") | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.