DEVPROD-8409: support host auth using env vars #8680
+72
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DEVPROD-8409
Description
The
localhost:2285/status
agent endpoint that's available to tasks currently leaks the host secret in plaintext because theevergreen agent
process includes the command-line args passed to the agent such as host ID/secret (e.g.evergreen agent --host-id <HOST_ID> --host-secret <HOST_SECRET>
). The/status
endpoint's response returns all commands and their arguments, so the task receives the plaintext host secret.To prevent the
/status
endpoint from returning the host secret in plaintext, I changed the way the agent receives its host ID/secret so that they can be set as environment variables for the process instead of command-line arguments. I can't actually remove the command-ine arguments until this is deployed to prod + I do some post-deploy work to update static hosts (see below).Post-Deploy Steps
As I mentioned under testing, staging has drifted pretty far from prod for distros, so it's not possible to test some provisioning scenarios that will appear in prod. Instead, I'm going to monitor the deploy and manually test SSH provisioning and Docker container pool provisioning once the deploy goes out.
In addition, static hosts will not roll over to the new version automatically (in case you're wondering - no, this is not easily fixable). To roll them over to use env vars for auth, I'm going to reprovision all non-quarantined static hosts manually.
Testing
/status
endpoint.