Created
March 27, 2023 18:51
-
-
Save spasam/f1b0810c54c2bf32531a5a7ef6e944c1 to your computer and use it in GitHub Desktop.
Prevent temporary credentials issued to EC2 instances from being used elsewhere
This file contains hidden or 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
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Deny", | |
| "Action": "*", | |
| "Resource": "*", | |
| "Condition": { | |
| "StringNotEquals": { | |
| "aws:ec2InstanceSourceVPC": "${aws:SourceVpc}" | |
| }, | |
| "Null": { | |
| "ec2:SourceInstanceARN": "false" | |
| }, | |
| "BoolIfExists": { | |
| "aws:ViaAWSService": "false" | |
| } | |
| } | |
| }, | |
| { | |
| "Effect": "Deny", | |
| "Action": "*", | |
| "Resource": "*", | |
| "Condition": { | |
| "StringNotEquals": { | |
| "aws:ec2InstanceSourcePrivateIPv4": "${aws:VpcSourceIp}" | |
| }, | |
| "Null": { | |
| "ec2:SourceInstanceARN": "false" | |
| }, | |
| "BoolIfExists": { | |
| "aws:ViaAWSService": "false" | |
| } | |
| } | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment