Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Created November 20, 2017 13:04
Show Gist options
  • Save kwilczynski/406e30a66a0b2ef8fe0c94f97c481e52 to your computer and use it in GitHub Desktop.
Save kwilczynski/406e30a66a0b2ef8fe0c94f97c481e52 to your computer and use it in GitHub Desktop.
Lock down EC2 meta-data to root (or others) only.
iptables -t filter -I OUTPUT -d 169.254.169.254 -j EC2
iptables -N EC2
iptables -A EC2 -m owner --uid-owner root -d 169.254.169.254 -j ACCEPT
iptables -A EC2 -j REJECT --reject-with icmp-host-unreachable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment