github-advanced-security[bot] commented on code in PR #34599:
URL: https://github.com/apache/superset/pull/34599#discussion_r2392168648


##########
superset/commands/database/update.py:
##########
@@ -65,6 +65,23 @@
         if not self._model:
             raise DatabaseNotFoundError()
 
+        # Log the operation without sensitive data (keys only)
+        sensitive_keys = {
+            "password",
+            "api_key",
+            "encrypted_extra",
+            "masked_encrypted_extra",
+            "sqlalchemy_uri",
+            "ssh_tunnel",
+        }
+        safe_field_names = [
+            k for k in self._properties.keys() if k not in sensitive_keys
+        ]
+        logger.info(
+            "Updating database %s with fields: %s",
+            self._model_id,
+            safe_field_names,

Review Comment:
   ## Clear-text logging of sensitive information
   
   This expression logs [sensitive data (password)](1) as clear text.
   This expression logs [sensitive data (password)](2) as clear text.
   This expression logs [sensitive data (password)](3) as clear text.
   This expression logs [sensitive data (password)](4) as clear text.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2058)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to