Skip to content

Instantly share code, notes, and snippets.

@ericlake
Created September 10, 2018 19:51
Show Gist options
  • Save ericlake/01cec9e57749f2b7a6ac9f03a57f9f28 to your computer and use it in GitHub Desktop.
Save ericlake/01cec9e57749f2b7a6ac9f03a57f9f28 to your computer and use it in GitHub Desktop.
serverspec stuff
require 'serverspec'
set :backend, :exec
describe iptables do
it { should have_rule('-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT') }
it { should have_rule('-A INPUT -s 10.10.10.10/32 -p tcp -m tcp --dport 80 -j ACCEPT') }
it { should have_rule('-A INPUT -p tcp -m tcp --dport 80 -j REJECT') }
end
require "serverspec"
require "pathname"
# Set backend type
set :backend, :exec
RSpec.configure do |c|
c.path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment