Sha256: b9fa0997945fe5f7ece2285ab0173dc58d21c338be22d4099b4181b535c65fb1

Contents?: true

Size: 461 Bytes

Versions: 2

Compression:

Stored size: 461 Bytes

Contents

Capistrano::Configuration.instance(:must_exist).load do
  namespace :security do
    desc "Setup a firewall with UFW"
    task :setup_firewall, roles: :web do
      run "#{sudo} apt-get -y install ufw"
      run "#{sudo} ufw default deny"
      run "#{sudo} ufw allow 22/tcp"
      run "#{sudo} ufw allow 80/tcp"
      run "#{sudo} ufw allow 443/tcp"
      run "#{sudo} ufw --force enable"
    end
    after "deploy:install", "security:setup_firewall"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cap_bootstrap-0.3.0 lib/cap_bootstrap/recipes/security.rb
cap_bootstrap-0.2 lib/cap_bootstrap/recipes/security.rb