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] - user-data security #317

Open
binnsr opened this issue Feb 9, 2023 · 1 comment
Open

[BUG] - user-data security #317

binnsr opened this issue Feb 9, 2023 · 1 comment

Comments

@binnsr
Copy link

binnsr commented Feb 9, 2023

The Vultr API encrypts user_data in the Vultr UI when added to a server, but the vultr_instance terraform provider creates the 'user_data' field in plain text.
If there are sensitive values in the user_data, they then show in the Vultr UI in plain text.

For example, using this command, I have a random-looking string placed into the User Data field in the UI
curl --silent -X PATCH --url "https://api.vultr.com/v2/instances/${INSTANCE_ID}" -H "Authorization: Bearer ${VULTR_API_TOKEN}" -H "Content-Type: application/json" -d '{ "user_data" : "redacted" }'

Running a terraform provisioner with this block, I have the secrets (variables in the code-block below) written to the UI
user_datea = <<EOF
#cloud-config
runcmd:

The Terraform Provisioner should write the data as a hash like the API does, or provide for the ability to redact variables in the field.

@binnsr binnsr added the bug label Feb 9, 2023
@optik-aper
Copy link
Member

Hello @binnsr and thanks for the report.

User data is base64 encoded during transit, but is decoded in the Vultr platform. The Vultr UI will always show it as plain text and if it's showing encoded for you, it might have been doubly encoded and will therefore probably not work in cloud-init. If you want to preserve secure information, perhaps a startup script would be a better solutions? https://www.vultr.com/api/#tag/startup

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

2 participants