properties 암호화 적용
parent
5f36826de4
commit
a40e21abfa
|
|
@ -35,6 +35,12 @@ dependencies {
|
|||
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.4'
|
||||
implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16'
|
||||
|
||||
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.4'
|
||||
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.6'
|
||||
testImplementation 'org.springframework.security:spring-security-test:5.5.1'
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
}
|
||||
|
|
@ -6,8 +6,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
@SpringBootApplication
|
||||
public class KcgFileManagerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(KcgFileManagerApplication.class, args);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(KcgFileManagerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.dbnt.kcgfilemanager.config;
|
||||
|
||||
import org.jasypt.encryption.StringEncryptor;
|
||||
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
|
||||
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class JasyptConfig {
|
||||
@Bean(name = "jasyptStringEncryptor")
|
||||
public StringEncryptor stringEncryptor() {
|
||||
|
||||
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
|
||||
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
|
||||
config.setPassword("jasyptKey"); // 암호화할 때 사용하는 키
|
||||
config.setAlgorithm("PBEWithMD5AndDES"); // 암호화 알고리즘
|
||||
config.setKeyObtentionIterations("1000"); // 반복할 해싱 회수
|
||||
config.setPoolSize("1"); // 인스턴스 pool
|
||||
config.setProviderName("SunJCE");
|
||||
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator"); // salt 생성 클래스
|
||||
config.setStringOutputType("base64"); //인코딩 방식
|
||||
encryptor.setConfig(config);
|
||||
return encryptor;
|
||||
}
|
||||
}
|
||||
|
|
@ -14,9 +14,12 @@ spring.thymeleaf.cache=false
|
|||
|
||||
#mariaDB & log4jdbc
|
||||
spring.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
spring.datasource.url=jdbc:log4jdbc:mariadb://localhost:3306/kcgFileManager?characterEncoding=UTF-8&serverTimezone=UTC
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=kcg211228
|
||||
spring.datasource.url=ENC(aqLYKJgbP9cnsnvdR27iHExQ6dhwLVin81SAYNE31Rzfl5HC2PsFSxF5xPTfQypC5jk0TEDpBGIDCTPq6W43KZ+g8wrsw4k3PcwxrAhFVNjLInxh4+Xv4BjcqCiIRfMIx/OnjQK1kwVF9/OZauLFdQ==)
|
||||
spring.datasource.username=ENC(A7iDWZCu8csd0mm0UjqQKA==)
|
||||
spring.datasource.password=ENC(u4iVHinHq1HOrewYzuMUdlqbpagxmR0/)
|
||||
#spring.datasource.url=jdbc:log4jdbc:mariadb://localhost:3306/kcgFileManager?characterEncoding=UTF-8&serverTimezone=UTC
|
||||
#spring.datasource.username=root
|
||||
#spring.datasource.password=kcg211228
|
||||
|
||||
#jpa
|
||||
spring.jpa.show-sql=true
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ spring.thymeleaf.mode=HTML
|
|||
|
||||
#mariaDB
|
||||
spring.datasource.driverClassName=org.mariadb.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mariadb://localhost:3306/kcgFileManager?characterEncoding=UTF-8&serverTimezone=UTC
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=kcg211228
|
||||
spring.datasource.url=ENC(Ej4qsyzlShx9/ybzkraa2sxl9juUnwyTWXpku4w93tG+DlTOuYF4QvAtR53NWXD/zoDbwbAcbkRi7vijqebZJq6559fl31PmiFVR7gJyd5ll7Sg+XQx5UF04RfVWXfHI)
|
||||
spring.datasource.username=ENC(baYt+Dg9T0Vyo0Xght5LNA==)
|
||||
spring.datasource.password=ENC(WE58kbIvn2tl49tHlJEZHgoWoPvoVBbr)
|
||||
|
||||
#jpa
|
||||
spring.jpa.generate-ddl=false
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ spring.thymeleaf.mode=HTML
|
|||
|
||||
#mariaDB
|
||||
spring.datasource.driverClassName=org.mariadb.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mariadb://211.195.183.7:3306/kcgFileManager?characterEncoding=UTF-8&serverTimezone=UTC
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=mariadb#0524
|
||||
spring.datasource.url=ENC(Rtp/g9LgKAG3SKr7SJdCUd0CfWfq5pRsUuV3f2GpIBmK//9hJNESsLCrLb/eeN9OtcX+TNPpti+0V1eKkPt6/JnXqWAmDWobwG3MEV69elSAdSbarEeTGKDF4S754WA/ahFzIofBmMA=)
|
||||
spring.datasource.username=ENC(4pMqX9aMgmo6/K0CWk96SQ==)
|
||||
spring.datasource.password=ENC(Ji9u9zpYJylCp4xh71Un/3S5rNCBJKTr)
|
||||
|
||||
#jpa
|
||||
spring.jpa.generate-ddl=false
|
||||
|
|
|
|||
Loading…
Reference in New Issue