Created
August 4, 2021 16:25
-
-
Save crashGoBoom/3efe7084882b82441010dbe31b55c43c to your computer and use it in GitHub Desktop.
Block non root users from accessing ec2 metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This will block users that are not root from accessing ec2 metadata | |
# Prevents users from grabbing the instance credentials | |
iptables -A OUTPUT -m owner ! --uid-owner root -d 169.254.169.254 -j DROP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment