-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathk8s-authorization.cedarschema
150 lines (149 loc) · 3.67 KB
/
k8s-authorization.cedarschema
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
namespace k8s {
type ExtraAttribute = {
"key": __cedar::String,
"values": Set < __cedar::String >
};
type FieldRequirement = {
"field": __cedar::String,
"operator": __cedar::String,
"value": __cedar::String
};
type LabelRequirement = {
"key": __cedar::String,
"operator": __cedar::String,
"values": Set < __cedar::String >
};
entity Extra = {
"key": __cedar::String,
"value"?: __cedar::String
};
entity Group = {
"name": __cedar::String
};
entity Node in [Group] = {
"extra"?: Set < ExtraAttribute >,
"name": __cedar::String
};
entity NonResourceURL = {
"path": __cedar::String
};
entity PrincipalUID;
entity Resource = {
"apiGroup": __cedar::String,
"fieldSelector"?: Set < FieldRequirement >,
"labelSelector"?: Set < LabelRequirement >,
"name"?: __cedar::String,
"namespace"?: __cedar::String,
"resource": __cedar::String,
"subresource"?: __cedar::String
};
entity ServiceAccount in [Group] = {
"extra"?: Set < ExtraAttribute >,
"name": __cedar::String,
"namespace": __cedar::String
};
entity User in [Group] = {
"extra"?: Set < ExtraAttribute >,
"name": __cedar::String
};
action "approve" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "attest" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "bind" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "create" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "delete" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [NonResourceURL, Resource],
context: {}
};
action "deletecollection" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "escalate" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "get" in [Action::"readOnly"] appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [NonResourceURL, Resource],
context: {}
};
action "head" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [NonResourceURL],
context: {}
};
action "impersonate" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Extra, Group, Node, PrincipalUID, ServiceAccount, User],
context: {}
};
action "list" in [Action::"readOnly"] appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "options" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [NonResourceURL],
context: {}
};
action "patch" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [NonResourceURL, Resource],
context: {}
};
action "post" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [NonResourceURL],
context: {}
};
action "put" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [NonResourceURL],
context: {}
};
action "readOnly" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "sign" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "update" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "use" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
action "watch" in [Action::"readOnly"] appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
}