-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Leak of az secrets in file system system calls #28839
Copy link
Copy link
Labels
Accountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Metadata
Metadata
Labels
Accountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
this is a spin off of Azure/login#27
when running
the secret is leaked on the command line as known, it is also leaked through a newfstatat system call.
This is undocumented but it's possible to use instead a "@" so that the password is read from a file, eg in this fashion
which prevents the password leak on the command line (in some cases somewhat addressing #10241 and #27938), however it is still leaked in the newfstatat system call:
performed from
azure-cli/src/azure-cli-core/azure/cli/core/auth/identity.py
Lines 285 to 286 in 246725e
this means the secret is leaked to the file system (if a network file system like NFS it is sent over the network) and relevant auditing tools (auditd, selinux, fapolicyd, etc.)
In addition w.r.t to the previous opened ticket, any documentation that mentions
az login --service-principalwith a password provided on the command line is wrong and should be updated.