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

ad connect password viewable in --debug mode #17

Open
dionrowney opened this issue May 1, 2023 · 1 comment
Open

ad connect password viewable in --debug mode #17

dionrowney opened this issue May 1, 2023 · 1 comment

Comments

@dionrowney
Copy link

We have noticed that the password can be seen when running

puppet agent -t --debug

Debug: /Stage[main]/Adcli::Join/Exec[adcli_join]: '/bin/echo -n 'passwordinplaintext' | /usr/sbin/adcli join   --login-user='adjoin' --domain='example.local' --domain-ou='OU=Linux,OU=Servers,OU=AdminOU,DC=example,DC=local' --stdin-password --verbose    ' won't be executed because of failed check 'unless'

It was expected that the password would be obscured with xxxxxxx possibly by using the Sensative() fucntions

We are calling it using heira vars but also called it this way

class {'::adcli':
ad_join_password => lookup('adcli::ad_join_password')
}

also tried
class {'::adcli':
ad_join_password => Sensitive(lookup('adcli::ad_join_password'))
}

and this errors out as you are using plain text strings I believe

Is there any way to mask the password?

@dionrowney
Copy link
Author

I would like to submit a fix. I changed the code to this:

exec {'adcli_join':
  environment => ["PASSWORD=${ad_join_password}"],
  command   => "/bin/echo -n \"\$PASSWORD\" | /usr/sbin/adcli join ${ad_join_domain_controller_command} \

${ad_join_computer_name_command} --login-user='${ad_join_username}' --domain='${ad_domain}' --domain-ou='${ad_join_ou}'
--stdin-password --verbose ${ad_join_os_command} ${ad_join_os_version_command} ${ad_join_os_service_pack_command}
${ad_join_service_names_command}",
logoutput => true,
unless => "/usr/sbin/adcli testjoin -D ${ad_domain}",
}

this hides the password by storing it in the environment variable. this hides the password. thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant