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

remove secret crypted by terraform on junos_system_tacplus_server #688

Closed
lotusnoir opened this issue Jul 31, 2024 · 1 comment · Fixed by #699
Closed

remove secret crypted by terraform on junos_system_tacplus_server #688

lotusnoir opened this issue Jul 31, 2024 · 1 comment · Fixed by #699
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lotusnoir
Copy link

hello,

on resource "junos_system_tacplus_server" there is the variable "secret (Optional, String, Sensitive)" that has to be plain text password in order to be crypted by terraform. Because i dont wanna have the clear password in the configuration code but directly the crypted one, is it possible to add an option to choose it we want it converted by terraform or not ?

like you do for resource "junos_system_root_authentication with

encrypted_password
plain_text_password

Thanks in advance

@lotusnoir lotusnoir added the bug Something isn't working label Jul 31, 2024
@jeremmfr
Copy link
Owner

Hi 👋

The provider doesn't encrypt plain text secrets, but Junos device encrypts plain text secrets with an obfuscation algorithm, which is easily reversible.
The provider sets secrets without any modification on the value from Terraform config, but when reading secrets on Junos device to refresh the resource state, it decodes it to avoid drift between the secret in the config and the secret in the state.

With the current version of the provider, if you add an encrypted secret to the attribute in the config, it will be correctly added. Still, a refresh of the resource will detect a drift between the attribute in the config and the attribute in the state.

Passwords of system users (root and other user) are encrypted with a different algorithm which is not reversible, so there is two options on the corresponding resources (junos_system_root_authentication, junos_system_login_user, junos_snmp_v3_usm_user) in the provider.

So for your needs, I'll take care of adding an option to the provider to disable automatic decoding of secrets. So you will be able to add encrypted secrets without causing an attribute drift.

@jeremmfr jeremmfr added enhancement New feature or request and removed bug Something isn't working labels Aug 29, 2024
@jeremmfr jeremmfr added this to the v2.9.0 milestone Aug 29, 2024
@jeremmfr jeremmfr self-assigned this Aug 29, 2024
jeremmfr added a commit that referenced this issue Aug 29, 2024
to disable decoding secret hashes by Junos device
when reading resource data
Fix #688
jeremmfr added a commit that referenced this issue Aug 29, 2024
to disable decoding secret hashes by Junos device
when reading resource data
Fix #688
jeremmfr added a commit that referenced this issue Aug 29, 2024
to disable decoding secret hashes by Junos device
when reading resource data
Fix #688
jeremmfr added a commit that referenced this issue Sep 2, 2024
to disable decoding secret $9$ hashes by Junos device
when reading resource data
Fix #688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants