-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc: handler error while while helm deployment #6082
Conversation
@@ -782,6 +782,10 @@ | |||
// Rollback tx on error. | |||
defer tx.Rollback() | |||
upgradeAppRequest, err = impl.updateInstalledApp(ctx, upgradeAppRequest, tx) | |||
if err != nil { | |||
impl.logger.Errorw("error while performing updateInstalledApp", "upgradeRequest", upgradeAppRequest, "err", err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by an access to Password
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 4 months ago
To fix the problem, we need to ensure that sensitive information is not logged in clear text. The best way to fix this issue without changing existing functionality is to remove the sensitive information from the log message or obfuscate it before logging.
- Identify the logging statement that logs the
upgradeAppRequest
object. - Remove or obfuscate the sensitive information (e.g., passwords) from the
upgradeAppRequest
object before logging it. - Ensure that the fix is applied to all relevant logging statements in the file.
-
Copy modified lines R567-R574 -
Copy modified line R794
@@ -566,2 +566,10 @@ | ||
|
||
func sanitizeUpgradeAppRequest(request *appStoreBean.InstallAppVersionDTO) *appStoreBean.InstallAppVersionDTO { | ||
sanitizedRequest := *request | ||
if sanitizedRequest.InstallAppVersionChartDTO != nil && sanitizedRequest.InstallAppVersionChartDTO.InstallAppVersionChartRepoDTO != nil { | ||
sanitizedRequest.InstallAppVersionChartDTO.InstallAppVersionChartRepoDTO.Password = "****" | ||
} | ||
return &sanitizedRequest | ||
} | ||
|
||
func (impl *AppStoreDeploymentServiceImpl) updateInstalledApp(ctx context.Context, upgradeAppRequest *appStoreBean.InstallAppVersionDTO, tx *pg.Tx) (*appStoreBean.InstallAppVersionDTO, error) { | ||
@@ -785,3 +793,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error while performing updateInstalledApp", "upgradeRequest", upgradeAppRequest, "err", err) | ||
impl.logger.Errorw("error while performing updateInstalledApp", "upgradeRequest", sanitizeUpgradeAppRequest(upgradeAppRequest), "err", err) | ||
return nil, err |
|
Description
Fixes https://github.com/devtron-labs/sprint-tasks/issues/1257
Checklist:
Does this PR introduce a user-facing change?