-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support use of SSH agent without requiring a key path to be set #142
Comments
Train is successfully able to use the SSH agent and kitchen-inspec should likely be modified accordingly (if necessary) to not require a path to a key. Sounds like a good enhancement to me. |
I agree, all other kitchen functions work well with the agent, it is just kitchen verify. This is a huge pain in the neck, as we use the ssh-agent for pretty much everything in our organization. |
Hey folks, I just tested this and am no longer able to reproduce this. I fixed this in #140, but unfortunately didn't release it in a gem until 24 days ago. This fix is in Here's my sample .kitchen.yml, without any keys specified: ---
driver:
name: ec2
region: us-west-2
transport:
username: centos
provisioner:
name: chef_zero
always_update_cookbooks: true
verifier:
name: inspec
platforms:
- name: centos
suites:
- name: default
run_list:
- recipe[ssh_agent_test::default]
verifier:
inspec_tests:
- test/smoke/default
attributes: ... and when I run
When I run
So, I do believe this is fixed. If you find that kitchen-inspec 0.20.0 does not fix this for you, please leave us a note with additional repro steps and I'll be happy to reopen this issue. Thanks! |
I'm getting this error in travis testing while switching from kitchen/docker to kitchen/lxd https://travis-ci.org/juju4/puppet-meta-harden-linux/jobs/423403594#L3223
ssh-add at the end does not list any loaded keys and seems failing to reaching ssh-agent even if started at beginning. it seems same for ansible any step that I miss? Thanks |
@juju4 I am not familiar with the kitchen-lxc but it seems that we would need to add special handling to pass in the credentials from lxc to kitchen-inspec similar to what we've done for kitchen ssh plugin https://github.com/inspec/kitchen-inspec/blob/master/lib/kitchen/verifier/inspec.rb#L224-L249 |
Probably need to pass public_key_path argument to whatever value is needed |
@juju4 Should we open a specific issue to support kitchen-lxc because I assume that is different from the pure ssh one? |
Done |
So, I have a setup that can work, but it weirdly requires the transport.ssh_key parameter in the .kitchen.yml file to be defined. I have an SSH agent set up, but without this directive set (and to a correct, alreadly-loaded value) the inspec verification fails, even though it works manually:
chec exec kitchen verify
succeeds if I specify the path to a key I have already loaded. For portability, and separation of access, I don't want to create a shared SSH key, figure out how to distribute it, etc. if the tools can just use an ssh-agent connection instead.Attaching my kitchen.yml file.
kitchen.yml.txt
The text was updated successfully, but these errors were encountered: