ssh-baseline
ssh-baseline copied to clipboard
ssh_crypto.rb hardcodes the location of the ssh config directory
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.
@weaverslodge nice idea. can you please create a PR for the attrs solution?