-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathexample.html
More file actions
52 lines (46 loc) · 1.36 KB
/
example.html
File metadata and controls
52 lines (46 loc) · 1.36 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>PBAC</title>
</head>
<body>
<p>Policies:</p>
<textarea id="policies" cols="80" rows="20">[
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["iam:CreateUser", "iam:UpdateUser", "iam:DeleteUser"],
"Resource": ["arn:aws:iam:::user/${req:UserName}"],
"Condition": {
"IpAddress": {
"req:IpAddress": "10.0.20.0/24"
}
}
}
]
}
]</textarea>
<p>Action:</p>
<input id="action" type="text" size="80" value="iam:CreateUser">
<p>Resource:</p>
<input id="resource" type="text" size="80" value="arn:aws:iam:::user/testuser">
<p>Context:</p>
<textarea id="context" cols="80" rows="10">{
"req": {
"IpAddress": "10.0.20.51",
"UserName": "testuser"
}
}</textarea>
<p><button type="button" onclick="checkPolicies()">Evaluate</button></p>
<p>Result: <span id="result">?</span></p>
<script src="https://cdn.jsdelivr.net/g/lodash@4(lodash.min.js+lodash.fp.min.js)"></script>
<script src="https://unpkg.com/ipaddr.js@1.6.0/lib/ipaddr.js"></script>
<script src="../dist/pbac.js"></script>
<script src="example.js"></script>
</body>
</html>