The problem is the metadata endpoint gives any process on your VM that can make API calls to that address full AWS credentials for that instance’s role. That can turn out to be too simple to use.
iptables -A OUTPUT \
-d 169.254.0.0/16 \
-m owner -j REJECT \
'!' --uid-owner 0Put yourself in AWS's position. Your customer is running a VM which you have only hypervisor level control over. Could be Linux, could be AIX, could be an appliance. How could you possibly implement user/process level security from the outside? How could you know what processes inside the opaque black box are the privileged ones?
> From AWS’s perspective the whole VM is in the same security context.
That's AWS's perspective. But my perspective, as an AWS customer, is important as well. And I might want to run something on a VM that I myself don't necessarily trust - that is the ultimate benefit of an ephemeral, isolated VM.Which could be a problem if intention was to allow it, as your sibling comment points out.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configur...