Skip to content

DigitalOcean installer puts the admin password in droplet user-data #3799

Closed

Description

@vybe

Problem

scripts/deploy/trinity-do-create.sh writes the operator's admin password into the droplet's user-data script (export ADMIN_PASSWORD='…'). cloud-init keeps user-data on the droplet for the life of the machine, in three places:

  • /var/lib/cloud/instances/<id>/user-data.txt and user-data.txt.i, rewritten on every boot by init.update(), so deleting them lasts only until the next reboot.
  • /var/lib/cloud/instances/<id>/obj.pkl, the pickled datasource, which carries userdata_raw and metadata_full.
  • The DO metadata service, which serves user-data to the droplet for its life. Containers cannot reach it (docker-firewall.sh drops 169.254.0.0/16); host processes can.

Anyone with a root shell later, a disk snapshot, or a backup of the droplet gets the admin password in clear.

Expected

No admin password enters user-data. The installer asks for none; its user-data exports ADMIN_PASSWORD_SOURCE=browser, the path the DO 1-Click and Vultr already run, and the operator creates the admin at /setup when the installer prints the address. The claim window this opens is the accepted risk documented in docs/DEPLOYMENT.md → Security Recommendations.

AWS and Vultr pass no password through user-data and are unchanged. The 1-Click's optional #cloud-config write_files password is tracked separately.

Validation

After a doc-driven DO install, grep -r ADMIN_PASSWORD= /var/lib/cloud finds nothing; the printed address opens the Create your admin account form; after creating the admin, a reboot leaves the instance working.

Activity

  1. added
    priority-p2
    type-bug
    theme-security
    status-ready
    complexity-low
    on Oct 19, 2026
  2. removed
    status-ready
    on Oct 19, 2026
  3. obasilakis commented on Oct 19, 2026

    @obasilakis
    Contributor

    /claim

  4. added
    status-in-progress
    on Oct 19, 2026
  5. github-actions commented on Oct 19, 2026

    @github-actions

    Claimed by @obasilakis. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/3799-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #3799
  6. vybe commented on Oct 19, 2026

    @vybe
    ContributorAuthor

    Verified on a fresh rc4 install: after user-data.txt and the rendered scripts/ are removed, /var/lib/cloud/instances/<id>/obj.pkl (cloud-init's pickled datasource) still contains the full user-data including ADMIN_PASSWORD=. The scrub has to cover obj.pkl too — removing it is safe, per-instance modules do not re-run.

  7. vybe commented on Oct 20, 2026

    @vybe
    ContributorAuthor

    One more finding from the review of the same install: the on-disk scrub is necessary but not sufficient — DigitalOcean serves user-data back to the droplet from the metadata service (169.254.169.254/metadata/v1/user-data) for the droplet's whole life, and nothing on the box can delete that. docker-firewall.sh keeps containers away from it, but root on the host (or a container with host networking) reads it any time. So the password passed at boot should be treated as a boot password and rotated right after first-run setup (an API call once the admin session exists), with the real one stored elsewhere. The script's closing text could say so, or a --rotate step could do it.

  8. changed the title [-]DigitalOcean install leaves the admin password in cloud-init's on-disk user-data copy[/-] [+]DigitalOcean installer puts the admin password in droplet user-data[/+] on Oct 26, 2026
  9. vybe commented on Oct 31, 2026

    @vybe
    ContributorAuthor

    Product ruling, merge-train Gate 1, 2026-10-30. Question: extend the 2026-09-10 claim-window acceptance from marketplace installs to trinity-do-create.sh, accepting first-visitor-becomes-admin there, in place of the obj.pkl and per-boot re-shred fixes asked for on 10-19, rather than an instance-ID-style claim? Answer: yes, extend it and ship the move in #3808. No admin password stays in user-data for the droplet's life.

  10. added
    status-in-dev
    and removed
    status-in-progress
    on Oct 31, 2026
  11. removed
    status-in-dev
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p2theme-securitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions