Opening EC2 IMDS only to host management processes with nftables socket UIDs and a forward hook Draft
When agents run on an EC2 host, their processes can reach 169.254.169.254 too. Only the host’s management processes should be able to fetch instance role credentials from IMDS. An nftables output hook allows them by socket owner UID. Packets forwarded from another network namespace carry no UID, so a forward hook rejects them by destination alone.