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
{ | |
"Statement": [{ | |
"Effect": "Deny", | |
"Action": "ec2:*", | |
"Resource": "*" | |
}] | |
} |
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": ["iam:*"], | |
"Resource": "*", | |
"Condition": { | |
"ArnEquals": { | |
"aws:PrincipalARN": "arn:aws:iam::*:user/guest" | |
} |
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": ["iam:*"], | |
"Resource": "*", | |
"Condition": { | |
"ArnNotEquals": { | |
"aws:PrincipalARN": "arn:aws:iam::*:role/Admin*" | |
} |
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", | |
"Resource": "*", | |
"Condition": { | |
"StringNotEquals": { | |
"aws:RequestedRegion": [ | |
"us-east-1", |
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
import json | |
import boto3 | |
from datetime import datetime, timedelta | |
from botocore import session | |
from awscli.customizations.eks.get_token import STSClientFactory, TokenGenerator, TOKEN_EXPIRATION_MINS | |
def _get_expiration_time(): | |
t_exp = datetime.utcnow() + timedelta(minutes=TOKEN_EXPIRATION_MINS) | |
return t_exp.strftime('%Y-%m-%dT%H:%M:%SZ') |
OlderNewer