github-advanced-security[bot] commented on code in PR #48791:
URL: https://github.com/apache/airflow/pull/48791#discussion_r2029032695


##########
task-sdk/src/airflow/sdk/execution_time/secrets_masker.py:
##########
@@ -346,12 +356,32 @@
             for k, v in secret.items():
                 self.add_mask(v, k)
         elif isinstance(secret, str):
-            if not secret or (self._test_mode and secret in 
SECRETS_TO_SKIP_MASKING_FOR_TESTS):
+            if not secret:
+                return
+
+            if secret.lower() in SECRETS_TO_SKIP_MASKING:
+                return
+
+            min_length = get_min_secret_length()
+            if len(secret) < min_length:
+                if not SecretsMasker._has_warned_short_secret:
+                    log.warning(
+                        "Skipping masking for a secret as it's too short (<%d 
chars)",
+                        min_length,

Review Comment:
   ## Clear-text logging of sensitive information
   
   This expression logs [sensitive data (secret)](1) as clear text.
   
   [Show more 
details](https://github.com/apache/airflow/security/code-scanning/456)



-- 
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]

Reply via email to