-
Notifications
You must be signed in to change notification settings - Fork 682
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
Bastion host #431
Comments
@Fodoj If I get you right, you need some kind of gateway setting right? |
Yep On 8 Feb 2016 19:39 +0100, Christoph Hartmannnotifications@github.com, wrote:
|
InSpec has no native gateway setting yet. At this point, I propose to use ssh to bind the remote ssh port via the gateway ssh to a local port with |
For reference, in Serverspec it can be solved as described: http://pmyjavec.com/code/2014/12/03/serverspec-behind-jump-server.html This feature should be implemented in https://github.com/chef/train/blob/master/lib/train/transports/ssh.rb |
I'm already using the Net::SSH::Proxy::Command gem as mentioned in @chris-rock's link above to get serverspec to test infrastructure on remote non-routable networks via a bastion host. Would really love to see something similar usable with Inspec. My specific use-case here is working in a secure environment with different security domains, we are not allowed to route traffic between two security domains. All connections have to go through some form of jumpbox / proxy server where there is a protocol break and traffic can be "inspected". My secondary use-case is to be able to test infrastructure built on a cloud hosting provider where for good reasons, not all the 'internal' servers are accessible from the internet and have to also be accessed via a jumpbox. |
I would also like to see this added. |
+1 |
I did small patch, but I'm not sure how to get proxy variable from kitchen yml can you guys help? |
+1 |
+1 |
Here's what I've come up with so far:
|
For me Inspec works through jumphost with
And then |
Okay, I used @gordonbondon suggestion and now run the following in a rake task: open("#{Dir.home}/.ssh/config", File::TRUNC) if File.exist?("#{Dir.home}/.ssh/config")
File.open("#{Dir.home}/.ssh/config", 'a+') do |f|
f << "Host bastion\n"
f << "HostName #{bastion_host}\n"
f << " StrictHostKeyChecking no\n"
f << " User ubuntu\n"
f << "Host 10.*\n"
f << " StrictHostKeyChecking no\n"
f << " ProxyCommand ssh -q -W %h:%p bastion\n"
end
cmd = "eval `ssh-agent -s` && ssh-add #{instance_private_key} && " \
"inspec exec spec/*_spec.rb -t ssh://ubuntu@#{server}"
sh cmd |
Is fixing this without the 'goofy' work around still blocked on inspec/train#163 ? |
This was added. |
What is the best way to forward specs through bastion host?
The text was updated successfully, but these errors were encountered: