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


##########
airflow-ctl/src/airflowctl/ctl/commands/auth_command.py:
##########
@@ -33,6 +33,22 @@
 from airflowctl.ctl.console_formatting import AirflowConsole
 
 
+def _maybe_print_token(token: str, yes: bool) -> None:
+    """Warn the user on stderr, confirm, then print the token to stdout."""
+    if not yes:
+        rich.print(
+            "[yellow]Warning: printing your auth token to stdout exposes it in 
your terminal "
+            "history and to anyone who can see your screen.[/yellow]",
+            file=sys.stderr,
+        )
+        rich.print("Are you sure you want to print the token? [y/N]: ", 
end="", file=sys.stderr)
+        answer = input().strip().lower()
+        if answer not in ("y", "yes"):
+            rich.print("[red]Aborted.[/red]")
+            return
+    print(token)

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)](2) as clear text.
   
   [Show more 
details](https://github.com/apache/airflow/security/code-scanning/588)



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