From b2d3fb99d210ce13b38f8bf71f7888a70086254a Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 2 Sep 2021 13:27:40 -0400 Subject: Fix sonar security issues in apex-pdp Fixed sonar security issues: - set permissions of temporary files Issue-ID: POLICY-3093 Change-Id: I1dfc87f22975fa950cfcfc47196fad55d6cbf277 Signed-off-by: Jim Hahn --- .../onap/policy/apex/auth/clieditor/tosca/ApexCliToscaEditorMain.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'auth/cli-editor/src/main/java') diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/tosca/ApexCliToscaEditorMain.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/tosca/ApexCliToscaEditorMain.java index 1f2703daa..0926c80e0 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/tosca/ApexCliToscaEditorMain.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/tosca/ApexCliToscaEditorMain.java @@ -20,7 +20,6 @@ package org.onap.policy.apex.auth.clieditor.tosca; -import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -29,6 +28,7 @@ import org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain; import org.onap.policy.apex.auth.clieditor.CommandLineParameters; import org.onap.policy.apex.auth.clieditor.utils.CliUtils; import org.onap.policy.common.utils.coder.CoderException; +import org.onap.policy.common.utils.resources.TextFileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,7 +65,7 @@ public class ApexCliToscaEditorMain { String policyModelFilePath = null; try { - final var tempModelFile = File.createTempFile("policyModel", ".json"); + final var tempModelFile = TextFileUtils.createTempFile("policyModel", ".json"); policyModelFilePath = tempModelFile.getAbsolutePath(); } catch (IOException e) { LOGGER.error("Cannot create the policy model temp file.", e); -- cgit 1.2.3-korg