aboutsummaryrefslogtreecommitdiffstats
path: root/LogParser
diff options
context:
space:
mode:
authorpa834y <pa834y@att.com>2019-03-26 14:29:38 -0400
committerpa834y <pa834y@att.com>2019-03-31 19:59:20 -0400
commitc1b69dfb1297365d35f2ada8690f13f787d38b4f (patch)
treef7c9780ad4cd84bb24f5d527feac83cb81f50319 /LogParser
parentc683a67fbf4a50e68bf8736517865b43db75ed4b (diff)
Enhancement to use the common CryptoUtils
Change-Id: I06718526382b424eab991f39a7dac1b5cf4f1b74 Issue-ID: POLICY-1422 Signed-off-by: pa834y <pa834y@att.com>
Diffstat (limited to 'LogParser')
-rw-r--r--LogParser/parserlog.properties5
-rw-r--r--LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java15
2 files changed, 12 insertions, 8 deletions
diff --git a/LogParser/parserlog.properties b/LogParser/parserlog.properties
index accf33866..a41fc4cbc 100644
--- a/LogParser/parserlog.properties
+++ b/LogParser/parserlog.properties
@@ -2,7 +2,7 @@
# ============LICENSE_START=======================================================
# LogParser
# ================================================================================
-# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -38,3 +38,6 @@ LOGPATH=C:\\Workspaces\\HealthCheck\\pap-rest.log
PARSERLOGPATH=parserlog.log
node_type=logparser
site_name=site_1
+
+# AES key for password encryption in config files
+#org.onap.policy.encryption.aes.key=12345678901234567890123456789012
diff --git a/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java b/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java
index 54e86d250..f12522af6 100644
--- a/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java
+++ b/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* LogParser
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* Modified Copyright (C) 2018 Samsung Electronics Co., Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -45,12 +45,11 @@ import java.util.Timer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
-
import org.apache.log4j.Logger;
import org.onap.policy.common.im.IntegrityMonitor;
import org.onap.policy.common.im.IntegrityMonitorException;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.utils.CryptoUtils;
+import org.onap.policy.utils.PeCryptoUtils;
import org.onap.xacml.parser.LogEntryObject.LogType;
/**
@@ -62,6 +61,7 @@ public class ParseLog {
// only logging last line of each log file processed to the log4j log file defined by property - PARSERLOGPATH
private static final Logger log4jlogger = Logger.getLogger(ParseLog.class.getName());
+ private static final String PROP_AES_KEY = "org.onap.policy.encryption.aes.key";
// processing logging
private static org.onap.policy.common.logging.flexlogger.Logger logger =
@@ -393,7 +393,7 @@ public class ParseLog {
logger.debug("builder.toString(): " + builder.toString());
if (builder.toString().contains(last + dataFileName + lineRead)) {
final String[] parseString = builder.toString().split(last + dataFileName + lineRead);
- final String returnValue = parseString[1].replace("\r", "");
+ final String returnValue = parseString[1].replace("\r", "");
return returnValue.trim();
}
builder = new StringBuilder();
@@ -886,9 +886,10 @@ public class ParseLog {
jdbcUrl = config.getProperty("JDBC_URL").replace("'", "");
jdbcUser = config.getProperty("JDBC_USER");
jdbcDriver = config.getProperty("JDBC_DRIVER");
- jdbcPassword = CryptoUtils.decryptTxtNoExStr(config.getProperty("JDBC_PASSWORD", ""));
- config.setProperty("javax.persistence.jdbc.password",
- CryptoUtils.decryptTxtNoExStr(config.getProperty("javax.persistence.jdbc.password", "")));
+
+ PeCryptoUtils.initAesKey(config.getProperty(PROP_AES_KEY));
+ jdbcPassword = PeCryptoUtils.decrypt(config.getProperty("JDBC_PASSWORD"));
+ config.setProperty("javax.persistence.jdbc.password", jdbcPassword);
return config;
} catch (final IOException e) {