Skip to content

Commit fd10129

Browse files
committed
[native] Suppress connector values from being logged
The log contains the connector key and value pairs read from the config files. The problem is that certain key-value pairs likely contain secrets that should not be logged as this leaks credentials. We cannot filter the keys to be able to print non-secret information because there is no consistency for naming schemes of these properties and we could miss newly ones added.
1 parent 0d85483 commit fd10129

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

presto-native-execution/presto_cpp/main/PrestoServer.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,14 @@ void enableChecksum() {
109109
});
110110
}
111111

112-
std::string stringifyConnectorConfig(
112+
// Log only the catalog keys that are configured to avoid leaking
113+
// secret information. Some values represent secrets used to access
114+
// storage backends.
115+
std::string logConnectorConfigPropertyKeys(
113116
const std::unordered_map<std::string, std::string>& configs) {
114117
std::stringstream out;
115118
for (auto const& [key, value] : configs) {
116-
out << " " << key << "=" << value << "\n";
119+
out << " " << key << "\n";
117120
}
118121
return out.str();
119122
}
@@ -1220,8 +1223,8 @@ std::vector<std::string> PrestoServer::registerConnectors(
12201223

12211224
auto connectorConf = util::readConfig(entry.path());
12221225
PRESTO_STARTUP_LOG(INFO)
1223-
<< "Registered properties from " << entry.path() << ":\n"
1224-
<< stringifyConnectorConfig(connectorConf);
1226+
<< "Registered catalog property keys from " << entry.path() << ":\n"
1227+
<< logConnectorConfigPropertyKeys(connectorConf);
12251228

12261229
std::shared_ptr<const velox::config::ConfigBase> properties =
12271230
std::make_shared<const velox::config::ConfigBase>(

0 commit comments

Comments
 (0)