Repository navigation
Python: redact DevUI auth tokens from Azure deployment diagnostics - #9118
Conversation
* Python: Redact the generated auth token in the az command log * Python: Redact CLI output before events, errors, and debug logging * Python: Add regression tests for both deployment command branches
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused security fix covers the identified disclosure paths with comprehensive regression tests.
Review effort: Balanced
Findings: None
What changed in this PR
Redacts DevUI Azure deployment tokens from commands and CLI-derived diagnostics without changing Azure CLI authentication.
Changes:
- Adds exact-token redaction for command and CLI output.
- Adds regression coverage for success, failure, environment, and empty-token paths.
| File | Description |
|---|---|
_deployment.py |
Redacts tokens before logging, storing, or propagating CLI output. |
test_deployment.py |
Verifies confidentiality while preserving token delivery. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
I’ve opened #9149 with a focused fix for the original issue: redact I think this keeps the fix narrowly scoped to the confirmed disclosure path. The additional redaction of CLI output, events, exceptions, and FQDN diagnostics in this PR seems broader than the original issue unless we have a demonstrated case where Azure CLI echoes I’d suggest keeping the original fix minimal and handling broader CLI-output redaction separately if we confirm that exposure path. |
Thanks for raising this. I agree that the confirmed disclosure is the INFO command log, and the CLI echo tests do not establish that Azure CLI currently echoes the token. I kept the CLI-output redaction as a small defensive safeguard. It is applied once at the subprocess output boundary, so later debug logs, events, exceptions, and FQDN diagnostics reuse the redacted text without separate mechanisms. The actual Azure CLI arguments and the token returned on successful deployment remain unchanged. I’ll keep this distinction clear: the command log is the reproduced issue, while CLI-output redaction is conditional defense-in-depth. If maintainers prefer the PR to stay strictly limited to the reproduced path, I’m happy to split that safeguard into a follow-up. |
Motivation & Context
DevUI's Azure deployment flow logs the full
az containerapp upcommand at INFO level, including the generatedDEVUI_AUTH_TOKENin plaintext. This exposes the deployment credential on the normal success path in both the existing-environment and new-environment branches.Azure CLI output is also reused in DEBUG logs, deployment events, failure exceptions, and FQDN extraction diagnostics. If the CLI echoes the token, those outputs can expose the same credential.
Description & Review Guide
What are the major changes?
[REDACTED], leaving text unchanged when the token is empty.What is the impact of these changes?
What do you want reviewers to focus on?
Related Issue
Fixes #9116
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.