Skip to content

Instantly share code, notes, and snippets.

@Staggerlee011
Created November 21, 2017 22:03
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Staggerlee011/4f9e407a43f92e12763f481e48f9293c to your computer and use it in GitHub Desktop.
Save Staggerlee011/4f9e407a43f92e12763f481e48f9293c to your computer and use it in GitHub Desktop.
# Create a profile (cookbook)
inspec init profile SQLServerSecurity
# check profile is valid
insec check SQLServerSecurity
# Run single inspec.rb file
inspec exec mytest.rb
# Run a profile
inspec exec SQLServerSecurity
# test remote machine via ssh
inspec exec SQLServerSecurity --key-files /path/keys/ssh.key --target ssh://root@192.168.1.12
inspec exec mytest.rb --key-files /path/keys/ssh.key --target ssh://root@192.168.1.12
# test remote machine via WinRM
insec exec mytest.rb --target winrm://administrator@192.168.1.1 --password SuperSecretPassword
# test remote docker
inspec mytest.rb --target docker://containerid
@Hakkal
Copy link

Hakkal commented May 5, 2019

how can we run sudo and access the server in same command

@paulcalabro
Copy link

how can we run sudo and access the server in same command

Add --sudo to the command.

@mcascone
Copy link

👍

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