r/Terraform • u/LevelRelationship732 • 23d ago
Discussion terraform-provider-system (agentless SSH: files, users, packages) has been quiet since May 2024. Who still uses it? I have a changeset I'd like to propose upstream.
neuspaces/terraform-provider-system manages files, folders, users, groups, packages and services on a remote host over SSH, with no agent — the escape hatch for pets in an otherwise immutable setup.
Last commit: 31 May 2024. v0.5.0 is still the latest release. 45 stars, 11 forks, 4 open issues — and the registry reports ~523k downloads, so a fair number of terraform init runs are still pulling it.
I use it for a handful of servers, and I've spent a sprint on a changeset against it. Before I open an issue upstream and send pull requests, I'd like a reality check from people who actually run this thing. I am not publishing a competing provider. The work sits in a plain GitHub fork, on a branch that keeps the module path and the provider address as they are, with no trace of a fork in the tree — it is shaped to be merged upstream, not released beside it.
The change I'm least sure about
Refusing to connect when host_key is not set. Today the provider silently falls back to ssh.InsecureIgnoreHostKey() if you leave host_key out. Every such connection is open to MITM and nothing in the plan says so. My branch makes ConfigureProvider fail unless you set host_key (also proxy.ssh.host_key behind a bastion) or opt out with a new insecure_ignore_host_key = true, which warns on every run and names the block whose key is missing. ssh-keyscan -t ed25519 <host> gets you the value.
That breaks every existing configuration on upgrade, which is why I'm asking instead of just sending it:
- Hard failure with an explicit opt-out, or warn first and fail a release later?
- Does anyone actually set
host_keytoday, or is everyone on the implicit insecure path? - If you go through a bastion, does requiring
proxy.ssh.host_keyhurt?
The rest of the changeset
overwriteforsystem_fileandsystem_folder— adopt an existing path on create instead of failing. This is upstream PR #11 by raynigon (issue #4), rebased and finished: symlinks still fail, even when they point at an entry of the right kind, so nothing is ever written through a link.create_homeforsystem_user— upstream PR #10 by ii1818nn (issue #9). The default keeps passing--no-create-home, so behaviour doesn't depend onCREATE_HOMEin/etc/login.defs.system_file.sourceis no longerForceNew: changed content is rewritten in place instead of destroy + create. Tell me if you relied on the replacement.- Removing
sourcefrom a resource no longer recreates the file empty and throws the remote content away. - Fixed: switching between
content,content_sensitiveandsourcein one apply wrote nothing at all. - Dependencies to Go 1.27 and SDKv2 2.40.1.
govulncheckon v0.5.0 reports 28 reachable vulnerabilities, nine of them in the SSH path; the branch reports none, and the check gates CI. - CI on GitHub-hosted runners: Terraform 1.6 / 1.10 / 1.11 / 1.14 / 1.17 and OpenTofu 1.6 / current, acceptance against Debian, Alpine and Fedora containers built inside the workflow, so a pull request from a fork needs no pre-published images. The README claimed 0.12+; the real floor is 1.6. Protocol stays 5, existing state is unaffected.
- An acceptance test for the thing I care about most: a state file written by the released v0.5.0 binary must produce an empty plan with the new code, on all three target systems, across the whole CLI matrix, with no change to
required_providers.
The full matrix is green — three target systems by seven CLIs, twenty-one acceptance runs, compatibility test included.
One thing the matrix found, and I'd like an opinion on it
The provider offers a password as both the password and the keyboard-interactive method. Against an sshd built without PAM — the Alpine target, for one — the server answers the keyboard-interactive request with USERAUTH_FAILURE and no challenge at all, and current golang.org/x/crypto/ssh aborts the authentication loop with unexpected message type 51 (expected 60) rather than reporting the exhausted method list. It behaves that way since it started to require a challenge before it accepts the result of a method; the version v0.5.0 pins has no such requirement.
The practical effect: on those servers, a mistyped password now produces a protocol error instead of "unable to authenticate". Authentication itself is unaffected — the correct password connects, the wrong one is refused — but the message is useless to a human. Is this worth translating in the provider, or do you read raw x/crypto errors and shrug?
Later, and only if there's interest: moving the file, folder and link resources to the plugin framework behind terraform-plugin-mux, which costs exactly one in-place update of source on the first plan (the framework can't keep etag=… in that attribute), plus content_wo for write-only content on Terraform 1.11+.
What I'm asking
- Do you use this provider? On what, and how many hosts?
- What keeps you on 0.5.0, or what made you drop it?
- Which of the four open issues actually bites you?
- Has anyone reached the maintainers recently? I'd rather contribute than fork, and the repo isn't archived — but eighteen months on a vulnerable SSH stack is why I started.
Branch, if you'd rather read code than prose: https://github.com/metronom72/terraform-provider-system/pull/1
5
u/RoseSec_ If it ain’t broke, I haven’t run terraform apply yet 23d ago
What’s the benefit of using this rather than Ansible, pre-baking the image with Packer, or using user data (startup scripts) to do what I need on the fly?
3
u/KellyShepardRepublic 23d ago
There are a lot of providers so maybe they moved on or maybe they went to opentofu. These providers imo do too much. It would preferably be the core and users handle everything else either through modules which could be go, scripts or mixed with ansible for the final mile.
9
u/ashtonium 23d ago
People dumping Claude output directly into posts…
1
u/MongooseWonderful198 21d ago
I'd prefer the hard failure with an explicit opt-out in a release that clearly announces the breaking change. The migration guide needs one extra step: verify the key you get from
ssh-keyscanagainst a trusted source, such as the server console.ssh-keyscanretrieves a key but doesn't authenticate the server. Pasting its output from an untrusted network can pin an attacker's key. The OpenSSH manual calls this out. The bastion and target each need that initial verification.