Skip to content

SpringBoot

Spring Boot Installation

Warning

It is recommended that a Spring Boot developer installs the DeepFinder filter application.


Agent Communication Process Installation

1) Download the installation file
Download the DeepFinder Agent installation file from the repository.

[root@localhost ~]# wget download.deepfinder.co.kr/DeepFinder/1.0/DeepFinder.tar.gz

2) Decompress the file
Decompress the downloaded installation file.

[root@localhost ~]# tar xvfz DeepFinder.tar

3) Run the agent script
After confirming the necessary information (Manager Server IP, Company/Domain Group Authentication Info), proceed with the installation.

[root@localhost DeepFinder]# ./agent.sh 1.1.1.1 611dd4300b91412e89xxxxxxxxxxx
************************************************************
SERVER IP : 1.1.1.1
AGENT ID : 611dd4300b91412e89xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SYSTEM KERNEL : 4.4
CHECK OS : Linux
CHECK LINUX : Amazon  Linux
CHECK SELinux : Disabled
CHECK OS BIT : x86_64 (64 bit)
DeepFinder install path : /usr/local/deepfinder
Starting DeepFinder Agent                           [  OK  ]
- Finished DeepFinder WAF Install
************************************************************


Maven

On the server where you will deploy Spring Boot, download the DeepFinder WAS Filter.

Springboot2 http://download.deepfinder.co.kr/DeepFinder/1.0/java/DfFilter.jar

Springboot3 http://download.deepfinder.co.kr/DeepFinder/1.0/java/DfFilter_JaEE.jar


1) Register to Maven Repository

Add the DeepFinder Filter to the Maven Repository.

Insertion Example) \MavenPath>.\mvnw.cmd install:install-file -Dfile=PathToDfFilter.jar -DgroupId="com.df" -DartifactId=DfFilter -Dversion="1.3.0" -Dpackaging=jar


2) Add DfFilter dependency to pom.xml

Add the DfFilter Dependency to the pom.xml file in Maven.

<dependencies>
    ...
        <dependency>
            <groupId>com.df</groupId>
            <artifactId>DfFilter</artifactId>
            <version>1.3.0</version>
        </dependency>
    ...
<dependencies>


3) Insert source code into Application.java
Enter the filter configuration code into the Application.java source.

Springboot2

@Bean
public FilterRegistrationBean<DfFilter> getFilterRegistrationBean(){
FilterRegistrationBean<DfFilter> registrationBean = new FilterRegistrationBean<>();
    registrationBean.setFilter(new DfFilter());
    registrationBean.setOrder(1);
    registrationBean.addUrlPatterns("/*");
    return registrationBean;
    }

Springboot3 Version

 @Bean
public FilterRegistrationBean<DfFilter> getFilterRegistrationBean(){
FilterRegistrationBean<DfFilter> registrationBean = new FilterRegistrationBean<>();
    registrationBean.setFilter(new DfFilter_jakarta_servlet());
    registrationBean.setOrder(1);
    registrationBean.addUrlPatterns("/*");
    return registrationBean;
    }


4) Spring Multipart Configuration

Adjust the spring_multpartresolver value in /usr/local/deepfinder/conf/config.xml according to the Multipart Resolver used by Spring Boot. Set it to 0 if using the Common Multipart Resolver, or 1 if using the Standard Servlet Multipart Resolver.

<Filter
localhost="127.0.0.1"
filter_alive_check_time="90"
policy_update_time="30"
spring_multipartresolver="1"

1) spring_multipartresolver="0" → Common Multipart Resolver (default)
2) spring_multipartresolver="1" → Standard Servlet Multipart Resolver


Gradle

On the server where you will deploy Spring Boot, download the DeepFinder WAS Filter.

Springboot2 http://download.deepfinder.co.kr/DeepFinder/1.0/java/DfFilter.jar

Springboot3 http://download.deepfinder.co.kr/DeepFinder/1.0/java/DfFilter_JaEE.jar


1) Add Gradle Library

Create a libs directory within your Gradle project and add the downloaded jar file.


2) Add Dependency to build.gradle

Add the DfFilter Dependency to the build.gradle file. After adding the dependency, synchronize your gradle build.

Springboot2

 dependencies {
    implementation files('libs/DfFilter.jar')
}

Springboot3

 dependencies {
    implementation files('libs/DfFilter_JaEE.jar')
}


3) Application.java Configuration

Insert the source code into Application.java to reference DfFilter.

Springboot2 Version

@Bean
public FilterRegistrationBean getFilterRegistrationBean() {
    FilterRegistrationBean registrationBean = new FilterRegistrationBean(new DfFilter());
    registrationBean.addUrlPatterns("/*");
    return registrationBean;
}

Springboot3 Version

 @Bean
    public FilterRegistrationBean getFilterRegistrationBean() { 
        FilterRegistrationBean registrationBean = new FilterRegistrationBean(new DfFilter_jakarta_servlet());
        registrationBean.addUrlPatterns("/*");
        return registrationBean;
    }



4) Spring Multipart Configuration

Adjust the spring_multpartresolver value in /usr/local/deepfinder/conf/config.xml according to the Multipart Resolver used by Spring Boot.
Set it to 0 if using the Common Multipart Resolver, or 1 if using the Standard Servlet Multipart Resolver.

<Filter
localhost="127.0.0.1"
filter_alive_check_time="90"
policy_update_time="30"
spring_multipartresolver="1"

1) spring_multipartresolver="0" → Common Multipart Resolver (default)
2) spring_multipartresolver="1" → Standard Servlet Multipart Resolver