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

[ec2] reset password on Windows VMs #1124

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

pducolin
Copy link
Contributor

@pducolin pducolin commented Sep 25, 2024

What does this PR do?

Reset password and configure it to a random string at init time

Which scenarios this will impact?

EC2 on Windows

Motivation

EC2 configures Windows hosts with a random password. The password is base64 encrypted with the public SSH key, to decrypt it we would need to first decrypt the private SSH key that is passphrase protected on our laptops, then decrypt the key. As this has multiple potential points of failure, and it would require storing the private key password somewhere accessible, it is quicker to reset the password through SSH once we are connected to the VM, at init time.

This allows for any code creating a NewVM on Windows to have a proper, accessible password in the RemoteHost output.

It is safe to print it in our CI logs as the instance is protected behind our network.

Additional Notes

Tested on datadog-agent, the only failure is not related to the change, the test failed on main too

@pducolin pducolin requested a review from a team as a code owner September 25, 2024 16:54
This was breaking as the password can contain special chars
@pducolin
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Sep 30, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 19m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit 85c56b4 into main Sep 30, 2024
9 checks passed
@dd-mergequeue dd-mergequeue bot deleted the pducolin/set-password-ec2-windows branch September 30, 2024 15:56
KevinFairise2 added a commit that referenced this pull request Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants