Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTS-37340 Develop : codeql log injection issue fix for Marriott #1064

Open
wants to merge 45 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b417959
DTS-37340 test log user input sanitize for codeql
Jun 7, 2024
47e7078
DTS-37340 test log user input sanitize for codeql
Jun 7, 2024
a3a2444
DTS-37340 test log user input sanitize for codeql
Jun 7, 2024
9ad16fc
DTS-37340 test for access request class
Jun 7, 2024
ae23ded
Merge pull request #1060 from PublicisSapient/DTS-37340-codeql-logInj…
rapkalya Jun 10, 2024
fbf7e19
DTS-37340 for new code
Jun 10, 2024
5b4ffad
DTS-37340 ProjectToolConfigController
Jun 10, 2024
32cccd5
DTS-37340 AccessRequestsController security fix
Jun 10, 2024
157c5cf
DTS-37340 KPIHelperUtil security fix
Jun 10, 2024
c5110b9
Merge pull request #1061 from PublicisSapient/DTS-37340-codeql-logInj…
hirbabar Jun 10, 2024
f56720d
DTS-37340 SignupRequestsController security fix
Jun 10, 2024
94b64a7
DTS-37340 RolesController security fix
Jun 10, 2024
0090cd5
DTS-37340 ConnectionController security fix
Jun 10, 2024
335eab2
DTS-37340 ForgotPasswordController security fix
Jun 10, 2024
9c53648
DTS-37340 FieldMappingStructureController security fix
Jun 10, 2024
f833b0d
DTS-37340 CommentsServiceImpl logs removed
Jun 10, 2024
408bfa4
DTS-37340 KPIExcelDataController logs removed
Jun 10, 2024
dc2556a
DTS-37340 KpiRequest requestTrackerId sanitize
Jun 10, 2024
5e6fb62
Merge pull request #1066 from PublicisSapient/DTS-37340-codeql-logInj…
hirbabar Jun 10, 2024
d5f9b0d
DTS-37340 SprintTraceLogServiceImp sanitize
Jun 10, 2024
129768b
DTS-37340 SprintTraceLogServiceImp sanitize
Jun 10, 2024
d9b6b57
DTS-37340 BambooController sanitize
Jun 10, 2024
aa3fb71
DTS-37340 log removed
Jun 10, 2024
1fda440
DTS-37340 AzureToolConfigServiceImpl sanitise
Jun 10, 2024
dea16d7
DTS-37340 KPIrequest remove logs
Jun 11, 2024
a17edbc
Merge pull request #1070 from PublicisSapient/DTS-37340-codeql-logInj…
hirbabar Jun 11, 2024
1937b12
DTS-37340 KPI request related remove logs
Jun 11, 2024
9c82f40
DTS-37340 sanitity method apply
Jun 11, 2024
8277c7c
DTS-37340 sanitity method apply
Jun 11, 2024
a5bdb19
Merge pull request #1081 from PublicisSapient/DTS-37340-codeql-logInj…
hirbabar Jun 11, 2024
5f14761
DTS-37340 removed logs
Jun 11, 2024
c3a5cb4
Merge pull request #1084 from PublicisSapient/DTS-37340-codeql-logInj…
hirbabar Jun 11, 2024
cdddccd
DTS-37340 removed logs
Jun 11, 2024
7e7698d
Merge pull request #1087 from PublicisSapient/DTS-37340-codeql-logInj…
gipathak Jun 12, 2024
1b7fa33
fix review comment and added testcase
Jun 13, 2024
a5d2b7f
Merge pull request #1099 from PublicisSapient/DTS-37340-codeql-logInj…
hirbabar Jun 13, 2024
88ad289
Marriot security issues
aksshriv1 Jul 7, 2024
9d5e088
Marriot security issues fix
aksshriv1 Jul 7, 2024
f37445a
issue fix
aksshriv1 Jul 8, 2024
568a80b
SSRF issue fix
aksshriv1 Jul 8, 2024
8abbcf2
SSRF issue fix
aksshriv1 Jul 8, 2024
e1827a0
SSRF issue fix 1
aksshriv1 Jul 8, 2024
29e07ff
SSRF issue fix 1
aksshriv1 Jul 8, 2024
3dbb176
SSRF issue fix 2
aksshriv1 Jul 8, 2024
c61613a
Merge pull request #1186 from PublicisSapient/DTS-38320
aksshriv1 Jul 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public ResponseEntity<Map> runProcessorForProjects(
ExecutionLogContext.set(processorExecutionBasicConfig.getLogContext());
MDC.put("Processor Name", jobExecuter.getProcessor().getProcessorName());
MDC.put("RequestStartTime", String.valueOf(System.currentTimeMillis()));
log.info("Received request to run the processor: {} for projects {}",
jobExecuter.getProcessor().getProcessorName(),
processorExecutionBasicConfig.getProjectBasicConfigIds());

jobExecuter.setProjectsBasicConfigIds(processorExecutionBasicConfig.getProjectBasicConfigIds());
jobExecuter.setExecutionLogContext(ExecutionLogContext.getContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ public class ProcessorExecutionTraceLogServiceImpl implements ProcessorExecution

@Override
public void save(ProcessorExecutionTraceLog processorExecutionTracelog) {
log.info(
"last execution time of {} for project {} is {}. status is {} and lastSuccessfulRun is {} and LastEnableAssigneeToggleState is {} ",
processorExecutionTracelog.getProcessorName(), processorExecutionTracelog.getBasicProjectConfigId(),
processorExecutionTracelog.getExecutionEndedAt(), processorExecutionTracelog.isExecutionSuccess(),
processorExecutionTracelog.getLastSuccessfulRun(),
processorExecutionTracelog.isLastEnableAssigneeToggleState());

Optional<ProcessorExecutionTraceLog> existingTraceLogOptional = processorExecutionTraceLogRepository
.findByProcessorNameAndBasicProjectConfigId(processorExecutionTracelog.getProcessorName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class EditKpiConfigController {
@RequestMapping(value = "/jira/editKpi/{projectBasicConfigId}/{kpiCode}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) // NOSONAR
public ResponseEntity<ServiceResponse> fetchTypeValues(@PathVariable String projectBasicConfigId,
@PathVariable String kpiCode) {
projectBasicConfigId = CommonUtils.handleCrossScriptingTaintedValue(projectBasicConfigId);
projectBasicConfigId = CommonUtils.sanitizeUserInput(projectBasicConfigId);
kpiCode = CommonUtils.handleCrossScriptingTaintedValue(kpiCode);
log.info("Fetching data in KPI edit configuration for :{}", projectBasicConfigId);
Map<String, List<MetadataValue>> data = editKpiConfigService.getDataForType(projectBasicConfigId, kpiCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.net.UnknownHostException;
import java.util.UUID;

import com.publicissapient.kpidashboard.apis.util.CommonUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -95,7 +96,6 @@ public class ForgotPasswordController {
public ResponseEntity<ServiceResponse> processForgotPassword(@RequestBody ForgotPasswordRequest request,
HttpServletRequest httpServletRequest) {
boolean isSuccess = false;
log.info("ForgotPasswordController: requested mail {}", request.getEmail());
Authentication authentication = null;
try {
String serverPath = httpServletRequest.getScheme() + getApiHost() + httpServletRequest.getContextPath();
Expand All @@ -109,7 +109,7 @@ public ResponseEntity<ServiceResponse> processForgotPassword(@RequestBody Forgot
return ResponseEntity.ok().body(new ServiceResponse(isSuccess, "Success", authentication));
} catch (UnknownHostException e) {
log.error("UnknownHostException", e);
log.error("ForgotPasswordController: Mail can not be sent to {}", request.getEmail());
log.error("ForgotPasswordController: Mail can not be sent to {}", CommonUtils.sanitizeUserInput(request.getEmail()));
return ResponseEntity.badRequest().body(new ServiceResponse(isSuccess, "logError", null));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public class ForgotPasswordServiceImpl implements ForgotPasswordService {
*/
@Override
public Authentication processForgotPassword(String email, String url) {
log.info("ForgotPasswordServiceImpl: Requested mail {}", email);
Authentication authentication = getEmailExistsInDB(email);
if (authentication != null) {
String token = createForgetPasswordToken(authentication);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ public ResponseEntity<ServiceResponse> modifyAutoApprovConfigById(@PathVariable(
@Valid @RequestBody AutoApproveAccessConfigDTO autoAcessDTO) {
ModelMapper modelMapper = new ModelMapper();
AutoApproveAccessConfig autoApproveRole = modelMapper.map(autoAcessDTO, AutoApproveAccessConfig.class);

if (!ObjectId.isValid(id)) {
log.info("Id not valid");
return ResponseEntity.status(HttpStatus.OK).body(new ServiceResponse(false,
"access_request@" + id + " does not exist", Arrays.asList(autoAcessDTO)));
}

AutoApproveAccessConfig autoApproveData = autoApproveService.modifyAutoApprovConfigById(id, autoApproveRole);
log.info("Modifying request@{}", id);
return ResponseEntity.status(HttpStatus.OK)
.body(new ServiceResponse(true, "modified access_request@" + id, Arrays.asList(autoApproveData)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;

import com.publicissapient.kpidashboard.apis.util.CommonUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -35,6 +36,7 @@ public class AzureController {
public ResponseEntity<ServiceResponse> getAzurePipelineNameAndDefinitionIdList(@PathVariable String connectionId,
@PathVariable String version) {
ServiceResponse response;
version = CommonUtils.sanitizeUserInput(version);
List<AzurePipelinesResponseDTO> pipelinesResponseList = azureToolConfigService
.getAzurePipelineNameAndDefinitionIdList(connectionId, version);
if (CollectionUtils.isEmpty(pipelinesResponseList)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.publicissapient.kpidashboard.apis.util.CommonUtils;
import org.apache.commons.lang3.StringUtils;
import org.bson.types.ObjectId;
import org.json.simple.JSONArray;
Expand Down Expand Up @@ -73,6 +74,11 @@ public List<AzurePipelinesResponseDTO> getAzurePipelineNameAndDefinitionIdList(S
try {
connectionService.validateConnectionFlag(connection);
HttpEntity<?> httpEntity = new HttpEntity<>(restAPIUtils.getHeaders(username, password));
// Validate the constructed URL
if (!CommonUtils.isValidUrl(finalUrl)) {
log.error("Invalid URL: {}", finalUrl);
return responseList;
}
ResponseEntity<String> response = restTemplate.exchange(finalUrl, HttpMethod.GET, httpEntity,
String.class);

Expand All @@ -88,13 +94,13 @@ public List<AzurePipelinesResponseDTO> getAzurePipelineNameAndDefinitionIdList(S
}
} else {
String statusCode = response.getStatusCode().toString();
log.error("Error while fetching ProjectsAndPlanKeyList from {}. with status {}", finalUrl,
log.error("Error while fetching ProjectsAndPlanKeyList from {}. with status {}", CommonUtils.sanitizeUserInput(finalUrl),
statusCode);
}

} catch (Exception exception) {
isClientException(connection, exception);
log.error("Error while fetching ProjectsAndPlanKeyList from {}: {}", finalUrl, exception.getMessage());
log.error("Error while fetching ProjectsAndPlanKeyList from {}: {}", CommonUtils.sanitizeUserInput(finalUrl), exception.getMessage());
}
}
return responseList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;

import com.publicissapient.kpidashboard.apis.util.CommonUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -56,6 +57,7 @@ public ResponseEntity<ServiceResponse> getBambooProjectsAndPlanKeys(@PathVariabl
public ResponseEntity<ServiceResponse> getBambooBranchesNameAndKeys(@PathVariable String connectionId,
@PathVariable String jobNameKey) {
ServiceResponse response;
jobNameKey = CommonUtils.sanitizeUserInput(jobNameKey);
List<BambooBranchesResponseDTO> projectKeyList = bambooToolConfigService
.getBambooBranchesNameAndKeys(connectionId, jobNameKey);
if (CollectionUtils.isEmpty(projectKeyList)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.publicissapient.kpidashboard.apis.bamboo.model.BambooDeploymentProjectsResponseDTO;
import com.publicissapient.kpidashboard.apis.bamboo.model.BambooPlansResponseDTO;
import com.publicissapient.kpidashboard.apis.connection.service.ConnectionService;
import com.publicissapient.kpidashboard.apis.util.CommonUtils;
import com.publicissapient.kpidashboard.apis.util.RestAPIUtils;
import com.publicissapient.kpidashboard.common.exceptions.ClientErrorMessageEnum;
import com.publicissapient.kpidashboard.common.model.connection.Connection;
Expand Down Expand Up @@ -114,6 +115,12 @@ public List<BambooBranchesResponseDTO> getBambooBranchesNameAndKeys(String conne
String url = String.format(new StringBuilder(baseUrl).append(RESOURCE_BRANCH_ENDPOINT).toString(),
jobNameKey);

// Validate the constructed URL
if (!CommonUtils.isValidUrl(url)) {
log.error("Invalid URL: {}", url);
return responseDTOList;
}

HttpEntity<?> httpEntity = new HttpEntity<>(restAPIUtils.getHeaders(username, password));
try {
connectionService.validateConnectionFlag(connection);
Expand All @@ -133,19 +140,20 @@ public List<BambooBranchesResponseDTO> getBambooBranchesNameAndKeys(String conne

/**
* this method is used to call the api to get branches
*
* @param responseDTOList
* @param url
* @param httpEntity
* @throws ParseException
*/
private void apiCallToGetBranches(List<BambooBranchesResponseDTO> responseDTOList, String url, HttpEntity<?> httpEntity) throws ParseException {
private void apiCallToGetBranches(List<BambooBranchesResponseDTO> responseDTOList, String url,
HttpEntity<?> httpEntity) throws ParseException {
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, String.class);
if (response.getStatusCode() == HttpStatus.OK) {
parseBranchesResponse(responseDTOList, response);
} else {
String statusCode = response.getStatusCode().toString();
log.error("Error while fetching BambooBranchesNameAndKeys from {}. with status {}", url,
statusCode);
log.error("Error while fetching BambooBranchesNameAndKeys from {}. with status {}", url, statusCode);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class BitBucketController {
public ResponseEntity<List<KpiElement>> getBitBucketAggregatedMetrics(@NotNull @RequestBody KpiRequest kpiRequest)
throws Exception { // NOSONAR
MDC.put("BitbucketKpiRequest", kpiRequest.getRequestTrackerId());
log.info("Received BitBucket KPI request {}", kpiRequest);

long bitbucketRequestStartTime = System.currentTimeMillis();
MDC.put("BitbucketRequestStartTime", String.valueOf(bitbucketRequestStartTime));
cacheService.setIntoApplicationCache(Constant.KPI_REQUEST_TRACKER_ID_KEY + KPISource.BITBUCKET.name(),
Expand Down Expand Up @@ -111,7 +111,7 @@ public ResponseEntity<List<KpiElement>> getBitBucketAggregatedMetrics(@NotNull @
public ResponseEntity<List<KpiElement>> getBitBucketKanbanAggregatedMetrics(
@NotNull @RequestBody KpiRequest kpiRequest) throws Exception { // NOSONAR
MDC.put("BitbucketKpiRequest", kpiRequest.getRequestTrackerId());
log.info(" Received BitBucket KPI request {}", kpiRequest);

long bitbucketKanbanRequestStartTime = System.currentTimeMillis();
MDC.put("BitbucketKanbanRequestStartTime", String.valueOf(bitbucketKanbanRequestStartTime));
cacheService.setIntoApplicationCache(Constant.KPI_REQUEST_TRACKER_ID_KEY + KPISource.BITBUCKETKANBAN.name(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ public class BitBucketServiceKanbanR {
@SuppressWarnings("unchecked")
public List<KpiElement> process(KpiRequest kpiRequest) throws EntityNotFoundException {

log.info("[BITBUCKET KANBAN][{}]. Processing KPI calculation for data {}", kpiRequest.getRequestTrackerId(),
kpiRequest.getKpiList());
List<KpiElement> responseList = new ArrayList<>();
String[] kanbanProjectKeyCache = null;
try {
Expand All @@ -111,8 +109,6 @@ public List<KpiElement> process(KpiRequest kpiRequest) throws EntityNotFoundExce
KPISource.BITBUCKETKANBAN.name(), groupId, null);
if (!kpiRequest.getRequestTrackerId().toLowerCase().contains(KPISource.EXCEL.name().toLowerCase())
&& null != cachedData) {
log.info("[BITBUCKET KANBAN][{}]. Fetching value from cache for {}", kpiRequest.getRequestTrackerId(),
kpiRequest.getIds());
return (List<KpiElement>) cachedData;
}

Expand All @@ -126,12 +122,12 @@ public List<KpiElement> process(KpiRequest kpiRequest) throws EntityNotFoundExce

} catch (EntityNotFoundException enfe) {

log.error("[BITBUCKET KANBAN][{}]. Error while KPI calculation for data. No data found {} {}",
kpiRequest.getRequestTrackerId(), kpiRequest.getKpiList(), enfe);
log.error("[BITBUCKET KANBAN][{}]. Error while KPI calculation for data. No data found {}",
kpiRequest.getRequestTrackerId(), enfe);
throw enfe;
} catch (ApplicationException e) {
log.error("[BITBUCKET KANBAN][{}]. Error while KPI calculation for data {} {}",
kpiRequest.getRequestTrackerId(), kpiRequest.getKpiList(), e);
log.error("[BITBUCKET KANBAN][{}]. Error while KPI calculation for data {}",
kpiRequest.getRequestTrackerId(), e);
throw new HttpMessageNotWritableException(e.getMessage(), e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ public class BitBucketServiceR {
@SuppressWarnings("unchecked")
public List<KpiElement> process(KpiRequest kpiRequest) throws EntityNotFoundException {

log.info("[BITBUCKET][{}]. Processing KPI calculation for data {}", kpiRequest.getRequestTrackerId(),
kpiRequest.getKpiList());
List<KpiElement> origRequestedKpis = kpiRequest.getKpiList().stream().map(KpiElement::new)
.collect(Collectors.toList());
List<KpiElement> responseList = new ArrayList<>();
Expand All @@ -99,8 +97,6 @@ public List<KpiElement> process(KpiRequest kpiRequest) throws EntityNotFoundExce
groupId, kpiRequest.getSprintIncluded());
if (!kpiRequest.getRequestTrackerId().toLowerCase().contains(KPISource.EXCEL.name().toLowerCase())
&& null != cachedData) {
log.info("[BITBUCKET][{}]. Fetching value from cache for {}", kpiRequest.getRequestTrackerId(),
kpiRequest.getIds());
return (List<KpiElement>) cachedData;
}

Expand All @@ -125,8 +121,7 @@ public List<KpiElement> process(KpiRequest kpiRequest) throws EntityNotFoundExce
}

} catch (Exception e) {
log.error("[BITBUCKET][{}]. Error while KPI calculation for data {} {}", kpiRequest.getRequestTrackerId(),
kpiRequest.getKpiList(), e);
log.error("[BITBUCKET][{}]. Error while KPI calculation for data {}", kpiRequest.getRequestTrackerId(), e);
throw new HttpMessageNotWritableException(e.getMessage(), e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import javax.validation.Valid;

import com.publicissapient.kpidashboard.apis.util.CommonUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -75,7 +76,7 @@ public ResponseEntity<ServiceResponse> addCapacity(@RequestBody CapacityMaster c
@GetMapping("/{basicProjectConfigId}")
public ResponseEntity<ServiceResponse> getCapacities(@PathVariable String basicProjectConfigId) {
ServiceResponse response = null;

basicProjectConfigId = CommonUtils.sanitizeUserInput(basicProjectConfigId);
List<CapacityMaster> capacities = capacityMasterService.getCapacities(basicProjectConfigId);
if (CollectionUtils.isNotEmpty(capacities)) {
response = new ServiceResponse(true, "Capacity Data", capacities);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public Map<String, Object> findCommentByKPIId(String node, String level, String
mappedCollection.put("kpiId", kpiId);
mappedCollection.put("CommentsInfo", finalCommentsInfo);
}
log.info("Final filter comments of matching kpiId {}", mappedCollection);
return mappedCollection;
}

Expand Down Expand Up @@ -151,8 +150,6 @@ public List<CommentViewResponseDTO> findLatestCommentSummary(List<String> nodes,
*/
@Override
public boolean submitComment(CommentSubmitDTO comment) {

log.debug("CommentSubmitDTO info {}", comment);
List<CommentsInfo> commentsInfo = comment.getCommentsInfo();
if (CollectionUtils.isNotEmpty(commentsInfo)) {
for (CommentsInfo commentInfo : commentsInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public ResponseEntity<KPIExcelValidationDataResponse> getValidationKPIData(HttpS
Boolean isApiAuth = StringUtils.isNotEmpty(
apiKey) && apiKey.equalsIgnoreCase(request.getHeader(Constant.TOKEN_KEY));
String kpiRequestStr = kpiRequest.toString();
kpiID = CommonUtils.handleCrossScriptingTaintedValue(kpiID);
kpiRequestStr = CommonUtils.handleCrossScriptingTaintedValue(kpiRequestStr);
kpiID = CommonUtils.sanitizeUserInput(kpiID);
kpiRequestStr = CommonUtils.sanitizeUserInput(kpiRequestStr);
log.info("[KPI-EXCEL-DATA][]. Received Specific Excel KPI Data request for {} with kpiRequest {}", kpiID,
kpiRequestStr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void clearCache(String cacheName) {
if (cache != null) {
cache.clear();
cache.evict(cacheName);
log.info("Clearing Cache ==>> {}", cacheName);
log.info("Clearing Cache ==>> {}", CommonUtils.sanitizeUserInput(cacheName));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ private Boolean validateOriginWithWhitelist(List<String> originWhiteList, Boolea
throws MalformedURLException {
Boolean result = theResult;
String originHost = new URL(origin).getHost();
log.debug("value of orignHost : {}", originHost);
for (String allowedOrigin : originWhiteList) {
if (StringUtils.equalsIgnoreCase(originHost, allowedOrigin)) {
result = Boolean.TRUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import javax.validation.Valid;

import com.publicissapient.kpidashboard.apis.util.CommonUtils;
import org.apache.commons.lang3.StringUtils;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -71,6 +72,7 @@ public class ConnectionController {
@PreAuthorize("hasPermission(#type,'CONNECTION_ACCESS')")
public ResponseEntity<ServiceResponse> getAllConnection(
@RequestParam(name = "type", required = false) String type) {
type = CommonUtils.sanitizeUserInput(type);
if (StringUtils.isEmpty(type)) {
log.info("Fetching all connection");
return ResponseEntity.status(HttpStatus.OK).body(connectionService.getAllConnection());
Expand Down Expand Up @@ -115,7 +117,6 @@ public ResponseEntity<ServiceResponse> saveConnectionDetails(@RequestBody Connec
@PreAuthorize("hasPermission(#id,'CONNECTION_ACCESS')")
public ResponseEntity<ServiceResponse> modifyConnectionById(@PathVariable String id,
@Valid @RequestBody ConnectionDTO connectionDTO) {
log.info("conn@{} updated", connectionDTO.getId());
final ModelMapper modelMapper = new ModelMapper();
final Connection conn = modelMapper.map(connectionDTO, Connection.class);
return ResponseEntity.status(HttpStatus.OK).body(connectionService.updateConnection(id, conn));
Expand Down
Loading