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

ssh_crypto.rb hardcodes the location of the ssh config directory #105

Open
weaverslodge opened this issue Jun 25, 2018 · 1 comment
Open

Comments

@weaverslodge
Copy link

weaverslodge commented Jun 25, 2018

Although you can specify a path for the ssh config it seems to assume that the host keys are always assumed to be in /etc/ssh

here's the bit of code

# returns the hostkeys value based on valid_algorithms
def valid_hostkeys
  hostkeys = valid_algorithms.map { |alg| "/etc/ssh/sshhost#{alg}_key" }
  # its('HostKey') provides a string for a single-element value.
  # we have to return a string if we have a single-element
  # https://github.com/chef/inspec/issues/1434
  return hostkeys[0] if hostkeys.length == 1
  hostkeys
end

So we use BoKS which has it's ssh in an alternate directory and I can cope with that with both the ssh_config and the sshd_config resources because I can specify a path to the config but this doesn't look at it unfortunately.
What might be better is if you can provide a default path for the ssh directory, environment variable maybe that can be set or something that you can pass with --attrs perhaps.

@atomic111
Copy link
Member

@weaverslodge nice idea. can you please create a PR for the attrs solution?

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

2 participants