feat(system_user): write-only password_wo + password_wo_version #2

Merged
ginjiruu merged 2 commits from lab/user-password-wo into lab/v1.99 2026-11-17 21:04:31 +00:00
Owner

For lab/iac#139: the router's monitoring user gets an ESO-generated, rotated password that must never land in state.

Adds a write-only password_wo and a password_wo_version to routeros_system_user. ResourceCreate/ResourceUpdate get *WithExtra variants that merge the write-only value into the request, on create and whenever the version changes. Provider().InternalValidate() passes.

Tested on a throwaway CHR 7.25.1 with dev_overrides:

  • create, then log in: 200
  • re-plan: empty
  • new password with the same version: plans nothing
  • version bump: in-place update, old password 401, new 200
  • the password appears in neither terraform.tfstate, the saved plan file, nor tofu show -json
  • a read,api group shows no policy drift

Not released yet. After review: lab/release.sh 1.99.1004, then the lab/iac lock moves to it. The change could go upstream as is.

For lab/iac#139: the router's `monitoring` user gets an ESO-generated, rotated password that must never land in state. Adds a write-only `password_wo` and a `password_wo_version` to `routeros_system_user`. `ResourceCreate`/`ResourceUpdate` get `*WithExtra` variants that merge the write-only value into the request, on create and whenever the version changes. `Provider().InternalValidate()` passes. Tested on a throwaway CHR 7.25.1 with dev_overrides: - create, then log in: 200 - re-plan: empty - new password with the same version: plans nothing - version bump: in-place update, old password 401, new 200 - the password appears in neither terraform.tfstate, the saved plan file, nor `tofu show -json` - a `read,api` group shows no policy drift Not released yet. After review: `lab/release.sh 1.99.1004`, then the lab/iac lock moves to it. The change could go upstream as is.
password is Sensitive but stored in state and saved plans. password_wo is
WriteOnly (OpenTofu/Terraform 1.11+): read from the raw config and merged
into the create/update request only (on create, and when
password_wo_version changes), so it never reaches state. ResourceCreate and
ResourceUpdate gain *WithExtra variants for that merge.

Checked on CHR 7.25.1: create + login, empty re-plan, same-version change
plans nothing, version bump rotates (old 401, new 200), password absent
from state, saved plan and show -json.
ginjiruu changed title from WIP: feat(system_user): write-only password_wo + password_wo_version to feat(system_user): write-only password_wo + password_wo_version 2026-11-17 21:04:30 +00:00
ginjiruu merged commit 4f9eb0daa4 into lab/v1.99 2026-11-17 21:04:31 +00:00
ginjiruu deleted branch lab/user-password-wo 2026-11-17 21:04:31 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/terraform-provider-routeros!2
No description provided.