Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

[mysql-persistence] Do not log plain passwords #5665

Merged
merged 2 commits into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -163,9 +163,8 @@ static public boolean sendMail(@ParamDoc(name = "to") String to, @ParamDoc(name
} else {
logger.error(
"Cannot send e-mail because of missing configuration settings. The current settings are: "
+ "Host: '{}', port '{}', from '{}', startTLSEnabled: {}, sslOnConnect: {}, username: '{}', password '{}'",
new Object[] { hostname, String.valueOf(port), from, String.valueOf(startTLSEnabled),
String.valueOf(sslOnConnect), username, password });
+ "Host: '{}', port '{}', from '{}', startTLSEnabled: {}, sslOnConnect: {}, username: '{}'",
hostname, port, from, startTLSEnabled, sslOnConnect, username);
}

return success;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ public void run() {
@Override
public String toString() {
return "Anel connection to '" + state.host + "', send UDP port " + connector.sendPort + ", receive UDP port "
+ connector.receivePort + ", user='" + user + "', password='" + password + "', cache period="
+ cachePeriod + "min.";
+ connector.receivePort + ", user='" + user + "', cache period=" + cachePeriod + "min.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public MyHomeJavaConnector(final String ip, final int port, final String passwd)
this.ip = ip;
this.port = port;
this.passwd = passwd;
logger.debug("Created MyHomeJavaConnector with ip = {}, port = {} and password {}", ip, port, passwd);
logger.debug("Created MyHomeJavaConnector with ip = {}, port = {}", ip, port);
this.commandMutex = new Semaphore(1, true);
this.commandQueue = new PriorityCommandQueue();
this.commandQueueThread = new Thread(new PriorityQueueThread(this, commandQueue), "TailThread");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ public void run() {
send(client, username);
}
receive(client); // password:
logger.trace("TelnetCommandThread password ({})", password);
send(client, password);
receive(client); // welcome text
send(client, cmdString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public boolean sendCommand(APICode apiCode, String... apiData) {
}

if (password == null || password.length() < 1 || password.length() > 6) {
logger.error("sendCommand(): Password is invalid, must be between 1 and 6 chars", password);
logger.error("sendCommand(): Password is invalid, must be between 1 and 6 chars");
break;
}
data = password;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ public void connect() throws IhcExecption {

if (StringUtils.isNotBlank(ip) && StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) {

logger.info("Connecting to IHC / ELKO LS controller [IP='{}' Username='{}' Password='{}'].",
new Object[] { ip, username, "******" });
logger.info("Connecting to IHC / ELKO LS controller [IP='{}' Username='{}'].", ip, username);

ihc = new IhcClient(ip, username, password, timeout);
ihc.setProjectFile(projectFile);
Expand All @@ -163,8 +162,8 @@ public void connect() throws IhcExecption {

} else {
logger.warn(
"Couldn't connect to IHC controller because of missing connection parameters [IP='{}' Username='{}' Password='{}'].",
new Object[] { ip, username, "******" });
"Couldn't connect to IHC controller because of missing connection parameters [IP='{}' Username='{}' Password={}].",
ip, username, StringUtils.isBlank(password) ? "Missing" : "Configured");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public class ISYActiveBindingConfig {
public ISYActiveBindingConfig(Map<Object, Object> config) {

this.logger.info(
"OpenHab Binding Configuration(refresh='{}',upnp='{}',uuid='{}',ip='{}',port='{}',user='{}',password='{}')",
"openHAB Binding Configuration(refresh='{}',upnp='{}',uuid='{}',ip='{}',port='{}',user='{}')",
config.get("refresh"), config.get("upnp"), config.get("uuid"), config.get("ip"), config.get("port"),
config.get("user"), "xxxxxx");
config.get("user"));

if (isNotBlank((String) config.get("refresh"))) {
refreshInterval = Long.parseLong((String) config.get("refresh"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ static class PowerDogLocalApiServerConfig {
public String toString() {
String displayPassword = "[not set]";
if (StringUtils.isNotBlank(password)) {
displayPassword = "[set]*****";
displayPassword = "[set]";
}
return "PowerDogLocalApiServerCache [host=" + host + ", password=" + displayPassword + ", lastUpdate="
+ lastUpdate + ", cache=" + cache + "]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public boolean isValid() {
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("host", host)
.append("username", username).append("password", "*****").append("aliveInterval", aliveInterval)
.append("username", username).append("aliveInterval", aliveInterval)
.append("bindingChangedInterval", bindingChangedInterval).toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public String getSSID() {

@Override
public String toString() {
return String.format("SSID={},password={}", this.name, this.password);
return String.format("SSID=%s,password=********", this.name);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void setCharset(String charset) {

@Override
public String toString() {
return "CalDavConfig [key=" + key + ", username=" + username + ", password=" + password + ", url=" + url
return "CalDavConfig [key=" + key + ", username=" + username + ", url=" + url
+ ", reloadMinutes=" + reloadMinutes + ", preloadMinutes=" + preloadMinutes
+ ", disableCertificateVerification=" + disableCertificateVerification
+ ", lastModifiedFileTimeStampValid=" + lastModifiedFileTimeStampValid + "]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public static Sardine getConnection(CalDavConfig config) {
if (url.startsWith(HTTP_URL_PREFIX)) {
log.error("do not use '{}' if no ssl is used", CalDavLoaderImpl.PROP_DISABLE_CERTIFICATE_VERIFICATION);
}
log.trace("connecting to caldav '{}' with disabled certificate verification (url={}, username={}, password={})",
key, url, userName, password);
log.trace("connecting to caldav '{}' with disabled certificate verification (url={}, username={})",
key, url, userName);
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create().setHostnameVerifier(new AllowAllHostnameVerifier());
try {
httpClientBuilder.setSslcontext(new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
Expand All @@ -146,8 +146,8 @@ public boolean isTrusted(X509Certificate[] arg0, String arg1) throws Certificate
return new SardineImpl(httpClientBuilder, userName, password);
}
} else {
log.trace("connecting to caldav '{}' (url={}, username={}, password={})",
key, url, userName, password);
log.trace("connecting to caldav '{}' (url={}, username={})",
key, url, userName);
if (StringUtils.isEmpty(userName) && StringUtils.isEmpty(password)) {
log.trace("connecting without credentials for '{}'", key);
return new SardineImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ private void connectToDatabase() {
st.close();
} catch (Exception e) {
logger.error(
"mySQL: Failed connecting to the SQL database using: driverClass={}, url={}, user={}, password={}",
driverClass, url, user, password, e);
"mySQL: Failed connecting to the SQL database using: driverClass={}, url={}, user={}",
driverClass, url, user, e);
}
}

Expand Down