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

Check, if keytool exists, before trying to execute it #445

Open
cocker-cc opened this issue Oct 12, 2023 · 4 comments
Open

Check, if keytool exists, before trying to execute it #445

cocker-cc opened this issue Oct 12, 2023 · 4 comments

Comments

@cocker-cc
Copy link
Contributor

Use Case

If keytool does not exist, sensitive Password is not “redacted” in Error-Message:

Error: /Stage[main]/Myprofilemodule/Java_ks[myRootCA]/ensure: change from 'absent' to 'latest' failed:  
Execution of 'keytool -importcert -noprompt -alias myrootca -file /etc/pki/tls/certs/myCA_root.pem -keystore /path/to/mykeystore -srcstorepass MyPassword -deststorepass MyPassword' returned 1:  
Error: Could not execute posix command: No such file or directory - keytool

Describe the Solution You Would Like

  • check, if keytool exists, before trying to execute it
  • prevent Password-Leak in other Error-Situations
@danifr
Copy link

danifr commented Nov 10, 2023

@david22swan (apologies for tagging you, you seem to be the last one who contributed to the latest version of this module)

I have a similar issue, I have installed 2 different version of java on the same machine and java_ks does not find the keytool one I'd like to use.

It there a way to implement a way to provide the PATH where keytool is installed? Thanks

@danifr
Copy link

danifr commented Nov 13, 2023

I worked around it creating a link:

  file { '/usr/local/bin/keytool':
    ensure  => link,
    target  => "${java_binaries_path}/keytool",
    require => Class['java'],
  }

@cocker-cc
Copy link
Contributor Author

@danifr: But you know, that this is not the Point of this Issue, right? This Issue is about leaking Secrets.

@danifr
Copy link

danifr commented Nov 13, 2023

Yes yes sorry for hijacking your ticket :)

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

No branches or pull requests

3 participants