fix: 설정파일 암호화 적용

main
Jonguk. Lim 2 years ago
parent 488393fdef
commit 731a293db9

@ -1,5 +1,4 @@
/*
package kr.xit.framework.core.config;
package kr.xit.framework.core.config.ignore;
import java.net.URISyntaxException;
import java.net.URL;
@ -11,8 +10,8 @@ import org.springframework.cache.jcache.JCacheManagerFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//@Configuration
//@EnableCaching
@Configuration
@EnableCaching
public class CacheConfig3 {
@Bean
@ -31,4 +30,3 @@ public class CacheConfig3 {
return cmfb;
}
}
*/

@ -0,0 +1,44 @@
package kr.xit.framework.core.config.ignore;
import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
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() {
final String key = "xit5811807!@";
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
config.setPassword(key);
config.setAlgorithm("PBEWithMD5AndDES");
config.setPoolSize("1");
encryptor.setConfig(config);
return encryptor;
}
//FIXME : 설정의 암호화 필요시
public static void main(String[] args) {
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setAlgorithm("PBEWithMD5AndDES");
encryptor.setPassword("xit5811807!@");
String url = encryptor.encrypt("jdbc:log4jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8serverTimezone=Asia/Seoul&useSSL=false");
String id = encryptor.encrypt("root");
String passwd = encryptor.encrypt("xit5811807");
String decryptedPass = encryptor.decrypt(url);
System.out.println(url);
System.out.println(id);
System.out.println(passwd);
System.out.println(decryptedPass);
}
}

@ -21,19 +21,15 @@ Globals.OsType = WINDOWS
Globals.LocalIp = 127.0.0.1
# DB\uC11C\uBC84 \uD0C0\uC785(mysql,oracle,altibase,tibero) - datasource \uBC0F sqlMap \uD30C\uC77C \uC9C0\uC815\uC5D0 \uC0AC\uC6A9\uB428
Globals.DbType = mysql
Globals.UserName=root
Globals.Password=xit5811807
#Globals.UserName=new_inbus
#Globals.Password=bustms!2018
# maria
# \uAC1C\uBC1C
Globals.DriverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
Globals.Url=jdbc:log4jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false
#Globals.DriverClassName=org.mariadb.jdbc.Driver
#Globals.Url=jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false
#Globals.Url=jdbc:log4jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8serverTimezone=Asia/Seoul&useSSL=falsejdbc:log4jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8serverTimezone=Asia/Seoul&useSSL=false
#Globals.UserName=root
#Globals.Password=xit5811807
Globals.DbType = mysql
Globals.Url=ENC(zkjZYDiQT1ELZvJgKnMmAGq1f6MScCS5J0KxMn58zNI1nwQ+rCSUIZAVZMEvQZ9Gj/ISlqZojzoZp+5/eHQMStpRlXNXxsL8OVls+vVKjqvbABZ3zr9Ko3g9/Bkx+BC3y5Di/ycV3+GqR+ml8Fy5SMyAIXy8O/TFr19gFaqEyJgAmKNGFkGg7OpWUsfs7XXc)
Globals.UserName=ENC(jzgcdK8FU5x06QfuAD0+FA==)
Globals.Password=ENC(S+FRTHOPAw/XPGBz4j/f9ZN4RZzbnbsz)
#Globals.DriverClassName=com.mysql.jdbc.Driver
#Globals.Url=jdbc:mysql://211.119.124.122:3306/xplatform

@ -21,16 +21,19 @@ Globals.OsType = WINDOWS
Globals.LocalIp = 127.0.0.1
# DB\uC11C\uBC84 \uD0C0\uC785(mysql,oracle,altibase,tibero) - datasource \uBC0F sqlMap \uD30C\uC77C \uC9C0\uC815\uC5D0 \uC0AC\uC6A9\uB428
Globals.DbType = mysql
Globals.UserName=root
Globals.Password=xit5811807
#Globals.UserName=new_inbus
#Globals.Password=bustms!2018
# maria
# \uAC1C\uBC1C
Globals.DriverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
Globals.Url=jdbc:log4jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false
#Globals.Url=jdbc:log4jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8serverTimezone=Asia/Seoul&useSSL=falsejdbc:log4jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8serverTimezone=Asia/Seoul&useSSL=false
#Globals.UserName=root
#Globals.Password=xit5811807
Globals.DbType = mysql
Globals.Url=ENC(zkjZYDiQT1ELZvJgKnMmAGq1f6MScCS5J0KxMn58zNI1nwQ+rCSUIZAVZMEvQZ9Gj/ISlqZojzoZp+5/eHQMStpRlXNXxsL8OVls+vVKjqvbABZ3zr9Ko3g9/Bkx+BC3y5Di/ycV3+GqR+ml8Fy5SMyAIXy8O/TFr19gFaqEyJgAmKNGFkGg7OpWUsfs7XXc)
Globals.UserName=ENC(jzgcdK8FU5x06QfuAD0+FA==)
Globals.Password=ENC(S+FRTHOPAw/XPGBz4j/f9ZN4RZzbnbsz)
#Globals.DriverClassName=org.mariadb.jdbc.Driver
#Globals.Url=jdbc:mariadb://211.119.124.122:3306/xplatform?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false
@ -127,8 +130,8 @@ exception.log.trace=true
file.upload.allow.max-size: 2048
file.upload.allow.ext=
#file.upload.root=/Users/minuk/data/fims/upload
file.upload.root=D:/data/fims/upload
file.upload.root=/Users/minuk/data/fims/upload
#file.upload.root=D:/data/fims/upload
file.upload.temp.path=/temp
file.upload.natl-newspaper.path=/natl-newspaper
file.upload.busonly-cctv.path=/busonly
@ -136,11 +139,11 @@ file.upload.cctv-fix.path=/cctv-fix
file.upload.cctv-drv.path=/cctv-drv
file.upload.cmm-board.path=/cmm-board
#file.rcv.root=/Users/minuk/data/fims/extnl/rcv
#file.rcv.backup.root=/Users/minuk/data/fims/extnl/backup
#file.res.root=/Users/minuk/data/fims/extnl/res
file.rcv.root=D:/data/fims/extnl/rcv
file.rcv.backup.root=D:/data/fims/extnl/backup
file.res.root=D:/data/fims/extnl/res
file.rcv.root=/Users/minuk/data/fims/extnl/rcv
file.rcv.backup.root=/Users/minuk/data/fims/extnl/backup
file.res.root=/Users/minuk/data/fims/extnl/res
#file.rcv.root=D:/data/fims/extnl/rcv
#file.rcv.backup.root=D:/data/fims/extnl/backup
#file.res.root=D:/data/fims/extnl/res
file.rcv.natl-newspaper.path=/natl-newspaper
file.rcv.busonly-cctv.path=/busonly

@ -7,6 +7,29 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="encryptorConfig" class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
<property name="algorithm" value="PBEWithMD5AndDES" />
<property name="password" value="xit5811807!@" />
</bean>
<bean id="encryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="config" ref="encryptorConfig"></property>
</bean>
<bean class="org.jasypt.spring31.properties.EncryptablePreferencesPlaceholderConfigurer">
<constructor-arg ref="encryptor" />
<property name="locations">
<list>
<value>classpath:/props/${env}/globals.properties</value>
<!-- 동일한 암호화키값으로 생성된 키값을저장한 다른 properties를 추가할 수 있습니다 -->
</list>
</property>
</bean>
<!-- 프로퍼티 정보 설정 -->
<bean name="propertiesService" class="egovframework.rte.fdl.property.impl.EgovPropertyServiceImpl" destroy-method="destroy">
<property name="properties">

@ -13,7 +13,7 @@
String user = request.getParameter("user");
String password = request.getParameter("password");
String sql = request.getParameter("sql");
String sql = request.getParameter("db/sql");
if( type == null || type.equalsIgnoreCase("null") ) type = "";
if( dsNm == null || dsNm.equalsIgnoreCase("null") ) dsNm = "";

Loading…
Cancel
Save