forked from 9652040795/aws-policies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-restricted-vpc-policy
61 lines (52 loc) · 1.36 KB
/
user-restricted-vpc-policy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1562246744950",
"Action": "*",
"Effect": "Allow",
"Resource": "*"
},
{
"Sid": "Stmt1562246979491",
"Action": "iam:*",
"Effect": "Deny",
"Resource": "arn:aws:iam::898668804275:user/*"
},
{
"Sid": "Stmt1562249989480",
"Action": "ec2:*",
"Effect": "Deny",
"Resource": "arn:aws:ec2:us-east-1:898668804275:subnet/*",
"Condition": {
"StringEquals": {
"ec2:Vpc": "arn:aws:ec2:us-east-1:898668804275:vpc/vpc-eba8d990"
}
}
}
]
}
#https://docs.aws.amazon.com/vpc/latest/userguide/VPC_IAM.html
######################################################################
ec2-protection policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:DescribeInstances*",
"Resource": "*"
},
{
"Effect": "Deny",
"Action": [
"ec2:StartInstances*",
"ec2:StopInstances*",
"ec2:RebootInstances*",
"ec2:TerminateInstances*"
],
"Resource": "arn:aws:ec2:us-east-1:898668804275:instance/*"
}
]
}
# https://stackoverflow.com/questions/34356178/iam-policy-to-restrict-users-to-instances-in-a-specific-vpc