Skip to content

Instantly share code, notes, and snippets.

@ProTip
Created November 19, 2014 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ProTip/e817c3dfc7de850f2a88 to your computer and use it in GitHub Desktop.
Save ProTip/e817c3dfc7de850f2a88 to your computer and use it in GitHub Desktop.
powershell_script 'firewall_metadata' do
guard_interpreter :powershell_script
code "New-NetFirewallRule -DisplayName 'Block AWS Metadata' -Direction 'outbound' -RemoteAddress '169.254.169.254' -RemotePort '80' -Protocol 'tcp' | Get-NetFirewallSecurityFilter | Set-NetFirewallSecurityFilter -LocalUser 'O:LSD:(D;;CC;;;SY)'"
not_if "Get-NetFirewallRule -DisplayName 'Block AWS Metadata'"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment