Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Service Principal client secret visible in agent log #4883

Open
2 of 4 tasks
KjartanThK opened this issue Jul 5, 2024 · 1 comment
Open
2 of 4 tasks

[BUG]: Service Principal client secret visible in agent log #4883

KjartanThK opened this issue Jul 5, 2024 · 1 comment

Comments

@KjartanThK
Copy link

What happened?

When registering and deregistering an agent with a service principal (--auth SP) the appId, tenantId and clientsecret values are all written to the agent registration log in cleartext. When comparing this with the way that PAT´s are masked in the logs this looks like a bug and I would consider this as a security risk since having all three means a user can act as that SP and do whatever the SP is permitted, not just in Azure DevOps but everywhere in the tenant. In my mind this is as big of a risk as storing AD user passwords in clear text on disk.

Versions

Azure DevOps Agent version: 3.240.1
RuntimeInformation: Microsoft Windows 10.0.20348

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows Server 2022

Version controll system

No response

Relevant log output

Example from agent removal log.
[2024-07-05 13:16:44Z INFO CommandSettings] Remove {
  "Auth": "SP",
  "LaunchBrowser": false,
  "Password": null,
  "Token": null,
  "Unattended": true,
  "UserName": null,
  "ClientId": "<application id>",
  "TenantId": "<tenant id>",
  "ClientSecret": "<client secret>",
  "Help": false,
  "Version": false
}
[2024-07-05 13:16:44Z INFO AgentProcess] Arguments parsed
@ivanduplenskikh
Copy link
Contributor

ivanduplenskikh commented Jul 5, 2024

@KjartanThK, thanks for reporting it! Let us take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants