-
Notifications
You must be signed in to change notification settings - Fork 508
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
K8s client app develop #5889
base: develop
Are you sure you want to change the base?
K8s client app develop #5889
Conversation
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
2763127 | Triggered | Generic High Entropy Secret | 9dbc1fb | scripts/devtron-reference-helm-charts/deployment-chart_1-1-0/secrets-test-values.yaml | View secret |
141558 | Triggered | Generic High Entropy Secret | 9dbc1fb | scripts/devtron-reference-helm-charts/deployment-chart_1-1-0/env-values.yaml | View secret |
10220829 | Triggered | Generic High Entropy Secret | 08d8e82 | charts/devtron/devtron-bom.yaml | View secret |
10220829 | Triggered | Generic High Entropy Secret | 08d8e82 | charts/devtron/values.yaml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
} | ||
err, clusterEntity := impl.convertToEntity(cluster) | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", cluster, "error", err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by an access to PPassword
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 months ago
To fix the problem, we need to ensure that sensitive information such as passwords 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 logging statement. Specifically, we should avoid logging the entire cluster
object and instead log only the non-sensitive fields.
- Identify the logging statement that includes sensitive information.
- Modify the logging statement to exclude sensitive fields such as
PPassword
. - Ensure that the logging statement still provides useful information for debugging without exposing sensitive data.
-
Copy modified line R73
@@ -72,3 +72,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", cluster, "error", err) | ||
impl.logger.Errorw("error occurred while converting model to entity", "clusterId", cluster.Id, "clusterName", cluster.ClusterName, "error", err) | ||
return errors.New("failed to update cluster") |
func (impl *ClusterFileBasedRepository) convertToEntity(model *Cluster) (error, *ClusterEntity) { | ||
configJson, err := json.Marshal(model.Config) | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting to entity", "model", model, "err", err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by an access to Password
Sensitive data returned by an access to PPassword
Sensitive data returned by an access to Password
Sensitive data returned by an access to PPassword
Sensitive data returned by an access to PPassword
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 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 without changing existing functionality is to remove the sensitive information from the log message. Specifically, we should avoid logging the entire model
object and instead log only non-sensitive parts of it.
-
Copy modified line R169
@@ -168,3 +168,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting to entity", "model", model, "err", err) | ||
impl.logger.Errorw("error occurred while converting to entity", "clusterName", model.ClusterName, "err", err) | ||
return errors.New("failed to process cluster data"), nil |
func (impl *ClusterFileBasedRepository) Update(model *Cluster) error { | ||
err, entity := impl.convertToEntity(model) | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by an access to Password
Sensitive data returned by an access to PPassword
Sensitive data returned by an access to PPassword
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 months ago
To fix the problem, we should avoid logging sensitive information directly. Instead, we can log non-sensitive parts of the model
object or obfuscate the sensitive fields before logging. Specifically, we should remove the model
object from the logging statement in the Update
method of ClusterFileBasedRepository.go
.
-
Copy modified line R318 -
Copy modified line R324
@@ -317,3 +317,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while converting model to entity", "error", err) | ||
return errors.New("failed to update cluster") | ||
@@ -323,3 +323,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while updating cluster", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while updating cluster", "error", err) | ||
return errors.New("failed to update cluster") |
result := impl.dbConnection.Model(entity).Updates(entity) | ||
err = result.Error | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while updating cluster", "model", model, "error", err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by an access to Password
Sensitive data returned by an access to PPassword
Sensitive data returned by an access to PPassword
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 months ago
To fix the problem, we need to ensure that sensitive information is not logged in clear text. The best way to achieve this is to obfuscate or omit the sensitive fields from the log messages. Specifically, we should avoid logging the Password
field from the model
object.
- Identify the logging statements that include the
model
object. - Modify these logging statements to exclude sensitive information.
- Ensure that the rest of the logging information remains intact for debugging purposes.
-
Copy modified line R318 -
Copy modified line R324 -
Copy modified line R334 -
Copy modified line R340
@@ -317,3 +317,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", obfuscateSensitiveInfo(model), "error", err) | ||
return errors.New("failed to update cluster") | ||
@@ -323,3 +323,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while updating cluster", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while updating cluster", "model", obfuscateSensitiveInfo(model), "error", err) | ||
return errors.New("failed to update cluster") | ||
@@ -333,3 +333,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", obfuscateSensitiveInfo(model), "error", err) | ||
return errors.New("failed to delete cluster") | ||
@@ -339,3 +339,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while deleting cluster", "model", model, "err", err) | ||
impl.logger.Errorw("error occurred while deleting cluster", "model", obfuscateSensitiveInfo(model), "err", err) | ||
return errors.New("failed to delete cluster") |
func (impl *ClusterFileBasedRepository) Delete(model *Cluster) error { | ||
err, entity := impl.convertToEntity(model) | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by an access to PPassword
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 months ago
To fix the problem, we need to ensure that sensitive information is not logged in clear text. The best way to do this is to avoid logging the model
object directly. Instead, we can log non-sensitive parts of the model
or provide a sanitized version of the model
for logging purposes.
- Identify the logging statements that include the
model
object. - Replace these logging statements with ones that exclude sensitive information.
- Ensure that the sensitive fields such as
PPassword
are not included in the logs.
-
Copy modified line R318 -
Copy modified line R324 -
Copy modified line R334 -
Copy modified line R340
@@ -317,3 +317,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while converting model to entity", "modelId", model.Id, "error", err) | ||
return errors.New("failed to update cluster") | ||
@@ -323,3 +323,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while updating cluster", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while updating cluster", "modelId", model.Id, "error", err) | ||
return errors.New("failed to update cluster") | ||
@@ -333,3 +333,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while converting model to entity", "modelId", model.Id, "error", err) | ||
return errors.New("failed to delete cluster") | ||
@@ -339,3 +339,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while deleting cluster", "model", model, "err", err) | ||
impl.logger.Errorw("error occurred while deleting cluster", "modelId", model.Id, "err", err) | ||
return errors.New("failed to delete cluster") |
result := impl.dbConnection.Delete(entity) | ||
err = result.Error | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while deleting cluster", "model", model, "err", err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Sensitive data returned by an access to PPassword
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 months ago
To fix the problem, we need to ensure that sensitive information such as PPassword
is not logged in clear text. The best way to achieve this is to remove the sensitive fields from the log messages or replace them with obfuscated values.
- Identify the log statements where the
model
is being logged. - Remove the sensitive fields from the log messages or replace them with obfuscated values.
- Ensure that the changes do not affect the existing functionality of the code.
-
Copy modified line R318 -
Copy modified line R324 -
Copy modified line R334 -
Copy modified line R340
@@ -317,3 +317,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while converting model to entity", "modelId", model.Id, "error", err) | ||
return errors.New("failed to update cluster") | ||
@@ -323,3 +323,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while updating cluster", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while updating cluster", "modelId", model.Id, "error", err) | ||
return errors.New("failed to update cluster") | ||
@@ -333,3 +333,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while converting model to entity", "model", model, "error", err) | ||
impl.logger.Errorw("error occurred while converting model to entity", "modelId", model.Id, "error", err) | ||
return errors.New("failed to delete cluster") | ||
@@ -339,3 +339,3 @@ | ||
if err != nil { | ||
impl.logger.Errorw("error occurred while deleting cluster", "model", model, "err", err) | ||
impl.logger.Errorw("error occurred while deleting cluster", "modelId", model.Id, "err", err) | ||
return errors.New("failed to delete cluster") |
|
Description
Fixes #
Checklist:
Does this PR introduce a user-facing change?