This commit is contained in:
@@ -276,6 +276,15 @@ public interface MonitoringContext {
|
||||
// 비밀번호 변경 시 SMS 2차 인증 사용 여부 (djb.sms_auth.enabled 와 함께 true 여야 동작)
|
||||
public static final String RMS_PASSWORD_SMS_AUTH_ENABLED = "rms.password.sms_auth.enabled";
|
||||
|
||||
// 비밀번호 최소 길이 (기본 7)
|
||||
public static final String RMS_PASSWORD_LENGTH_CHECK = "rms.password.length.check";
|
||||
|
||||
// 비밀번호 문자 조합 종류 수 (영문/숫자/특수문자 중 N종류 이상, 기본 2)
|
||||
public static final String RMS_PASSWORD_COMBI_CHECK = "rms.password.combi.check";
|
||||
|
||||
// 동일 문자 연속 반복 제한 개수 (기본 3, 2 미만이면 미검사)
|
||||
public static final String RMS_PASSWORD_REPEAT_CHECK = "rms.password.repeat.check";
|
||||
|
||||
// API 상태변화 스윙챗 발송여부
|
||||
public static final String DJB_UMS_MESSENGER_APIMONITOR_ENABLED = "djb.ums.messenger.api-monitor.enabled";
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@ public class MainController implements InterceptorSkipController {
|
||||
private static final String USER_STATUS_LOCKED = "2";
|
||||
private static final int DEFAULT_MAX_LOGIN_FAIL_COUNT = 5;
|
||||
private static final int DEFAULT_PASSWORD_HISTORY_COUNT = 5;
|
||||
private static final int DEFAULT_PASSWORD_LENGTH_CHECK = 7;
|
||||
private static final int DEFAULT_PASSWORD_COMBI_CHECK = 2;
|
||||
private static final int DEFAULT_PASSWORD_REPEAT_CHECK = 3;
|
||||
|
||||
private final LocaleMessage localeMessage;
|
||||
private final MonitoringContext monitoringContext;
|
||||
@@ -469,6 +472,24 @@ public class MainController implements InterceptorSkipController {
|
||||
return monitoringContext.getBooleanProperty(MonitoringContext.RMS_PASSWORD_SMS_AUTH_ENABLED, false);
|
||||
}
|
||||
|
||||
// 비밀번호 최소 길이 조회 (rms.password.length.check)
|
||||
private int getPasswordLengthCheck() {
|
||||
return monitoringContext.getIntProperty(
|
||||
MonitoringContext.RMS_PASSWORD_LENGTH_CHECK, DEFAULT_PASSWORD_LENGTH_CHECK);
|
||||
}
|
||||
|
||||
// 비밀번호 문자 조합 종류 수 조회 (rms.password.combi.check, 영문/숫자/특수문자 중 N종류 이상)
|
||||
private int getPasswordCombiCheck() {
|
||||
return monitoringContext.getIntProperty(
|
||||
MonitoringContext.RMS_PASSWORD_COMBI_CHECK, DEFAULT_PASSWORD_COMBI_CHECK);
|
||||
}
|
||||
|
||||
// 동일 문자 연속 반복 제한 개수 조회 (rms.password.repeat.check, 2 미만이면 미검사)
|
||||
private int getPasswordRepeatCheck() {
|
||||
return monitoringContext.getIntProperty(
|
||||
MonitoringContext.RMS_PASSWORD_REPEAT_CHECK, DEFAULT_PASSWORD_REPEAT_CHECK);
|
||||
}
|
||||
|
||||
// 로그인 실패 횟수 증가, 임계치 도달 시 계정 잠금
|
||||
private int increaseLoginFailCount(UserInfo userInfo) {
|
||||
int failCount = (userInfo.getLoginfailcount() == null ? 0 : userInfo.getLoginfailcount()) + 1;
|
||||
@@ -1018,10 +1039,17 @@ public class MainController implements InterceptorSkipController {
|
||||
|
||||
private boolean isPasswordValid(String password) {
|
||||
|
||||
return password != null && password.getBytes().length == password
|
||||
.length() && password.getBytes().length >= 7
|
||||
&& isCombination(password)
|
||||
&& !isRepeatPassword(password, PASSWORD_PATTERN_CHECK_LENGTH)
|
||||
if (password == null || password.getBytes().length != password.length()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int lengthCheck = getPasswordLengthCheck();
|
||||
int combiCheck = getPasswordCombiCheck();
|
||||
int repeatCheck = getPasswordRepeatCheck();
|
||||
|
||||
return password.getBytes().length >= lengthCheck
|
||||
&& isCombination(password, combiCheck)
|
||||
&& (repeatCheck < 2 || !isRepeatPassword(password, repeatCheck))
|
||||
&& !isSerialPassword(password, PASSWORD_PATTERN_CHECK_LENGTH)
|
||||
&& !isKeyboardSequentialPassword(password, PASSWORD_PATTERN_CHECK_LENGTH);
|
||||
}
|
||||
@@ -1088,7 +1116,7 @@ public class MainController implements InterceptorSkipController {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isCombination(String password) {
|
||||
private boolean isCombination(String password, int minTypes) {
|
||||
int combicount = 0;
|
||||
// 숫자포함여부
|
||||
String pattern = "[0-9]+";
|
||||
@@ -1117,8 +1145,8 @@ public class MainController implements InterceptorSkipController {
|
||||
combicount++;
|
||||
}
|
||||
|
||||
// combicount가 2 이상이면 true, 그렇지 않으면 false 반환
|
||||
return combicount >= 2;
|
||||
// combicount가 minTypes 이상이면 true, 그렇지 않으면 false 반환
|
||||
return combicount >= minTypes;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ public class PortalNoticeManService extends BaseService {
|
||||
private static final String MANUAL_TITLE_KEYWORD = "장애";
|
||||
|
||||
private String decodeString(String value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
if (ContainerUtil.get() == ContainerUtil.TOMCAT) {
|
||||
try {
|
||||
return new String(value.getBytes("euc-kr"), StandardCharsets.UTF_8);
|
||||
@@ -433,7 +436,8 @@ public class PortalNoticeManService extends BaseService {
|
||||
MultipartFile file = portalNoticeUI.getFiles();
|
||||
|
||||
if (file != null && !file.isEmpty()) { // 새로운 파일이 업로드된 경우에만 처리
|
||||
String decodedFileName = decodeString(portalNoticeUI.getFileName());
|
||||
String fileName = StringUtils.defaultIfBlank(portalNoticeUI.getFileName(), file.getOriginalFilename());
|
||||
String decodedFileName = decodeString(fileName);
|
||||
FileTypeContext.setFileType("notice");
|
||||
FileInfo fileInfo = fileService.createOrUpdateSingleFile(portalNotice.getFileId(), file, decodedFileName, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user