From b37f010c8fbc07ce47abc13a09da73115386fe8b Mon Sep 17 00:00:00 2001 From: tomaszkrosnowski Date: Thu, 24 Jun 2021 20:43:56 +0200 Subject: [PATCH] [EGD-6995] Remove sensitive data from logs Sensitive data like phone numbers, sms text etc were removed from logs. --- module-apps/application-messages/windows/NewMessage.cpp | 6 +++--- .../application-messages/windows/SMSTemplatesWindow.cpp | 2 +- .../application-messages/windows/SMSThreadViewWindow.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module-apps/application-messages/windows/NewMessage.cpp b/module-apps/application-messages/windows/NewMessage.cpp index 7afbf65ca24550ad3f456da475d975e19e6b2b5e..5f98417519fb3abf1ae311953abbc38a2a211d36 100644 --- a/module-apps/application-messages/windows/NewMessage.cpp +++ b/module-apps/application-messages/windows/NewMessage.cpp @@ -75,7 +75,7 @@ namespace gui } else if (auto textData = dynamic_cast(data); textData != nullptr) { const auto &text = textData->text; - LOG_INFO("Received sms text data \"%s\"", text.c_str()); + LOG_INFO("Received sms text data"); if (textData->concatenate == SMSTextData::Concatenate::True) { message->addText(text); } @@ -86,10 +86,10 @@ namespace gui } else if (auto sendRequest = dynamic_cast(data); sendRequest != nullptr) { phoneNumber = sendRequest->getPhoneNumber(); - LOG_INFO("Received sms send request to number: %s", phoneNumber.getFormatted().c_str()); + LOG_INFO("Received sms send request"); auto retContact = DBServiceAPI::MatchContactByPhoneNumber(application, phoneNumber); if (!retContact) { - LOG_WARN("Not valid contact for number %s", phoneNumber.getEntered().c_str()); + LOG_WARN("No valid contact for given number"); recipient->setText(phoneNumber.getFormatted()); message->setText(sendRequest->textData); return; diff --git a/module-apps/application-messages/windows/SMSTemplatesWindow.cpp b/module-apps/application-messages/windows/SMSTemplatesWindow.cpp index 70bcafdbf8077ed9227b3df8e266e7552a55c3eb..83b174bc03d4cb4d8a5f17741fefe16c3dc44475 100644 --- a/module-apps/application-messages/windows/SMSTemplatesWindow.cpp +++ b/module-apps/application-messages/windows/SMSTemplatesWindow.cpp @@ -79,7 +79,7 @@ namespace gui auto phoneNumber = switchData->getPhoneNumber(); app->templatesCallback = [=](std::shared_ptr templ) { - LOG_DEBUG("SMS template id = %" PRIu32 "sent to %s", templ->ID, phoneNumber.getFormatted().c_str()); + LOG_DEBUG("SMS template id = %" PRIu32 "sent", templ->ID); app->sendSms(phoneNumber, templ->text); app::manager::Controller::switchBack(app, std::make_unique( diff --git a/module-apps/application-messages/windows/SMSThreadViewWindow.cpp b/module-apps/application-messages/windows/SMSThreadViewWindow.cpp index ed9f5f85f0f93ecd5e44e90e84a9fa54588d0045..464b4377854587d484aa54f6a1eafd284fcafbb6 100644 --- a/module-apps/application-messages/windows/SMSThreadViewWindow.cpp +++ b/module-apps/application-messages/windows/SMSThreadViewWindow.cpp @@ -85,7 +85,7 @@ namespace gui } if (auto pdata = dynamic_cast(data)) { auto txt = pdata->text; - LOG_INFO("received sms templates data \"%s\"", txt.c_str()); + LOG_INFO("received sms templates data"); pdata->concatenate == SMSTextData::Concatenate::True ? smsModel->smsInput->inputText->addText(txt) : smsModel->smsInput->inputText->setText(txt); }