forked from awslabs/cedar-access-control-for-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-authorization.cedarschema
156 lines (155 loc) · 4.19 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
150
151
152
153
154
155
namespace k8s {
@doc("ExtraAttribute represents a set of key-value pairs for an identity")
type ExtraAttribute = {
"key": __cedar::String,
"values": Set < __cedar::String >
};
@doc("FieldRequirement represents a requirement on a field")
type FieldRequirement = {
"field": __cedar::String,
"operator": __cedar::String,
"value": __cedar::String
};
@doc("LabelRequirement represents a requirement on a label")
type LabelRequirement = {
"key": __cedar::String,
"operator": __cedar::String,
"values": Set < __cedar::String >
};
@doc("Extra represents a set of key-value pairs for an identity")
entity Extra = {
"key": __cedar::String,
"value"?: __cedar::String
};
@doc("Group represents a Kubernetes group")
entity Group = {
"name": __cedar::String
};
@doc("Node represents a Kubernetes node identity")
entity Node in [Group] = {
"extra"?: Set < ExtraAttribute >,
"name": __cedar::String
};
@doc("NonResourceURL represents a URL that is not associated with a Kubernetes resource")
entity NonResourceURL = {
"path": __cedar::String
};
@doc("PrincipalUID represents an impersonatable identifier for a principal")
entity PrincipalUID;
@doc("Resource represents an authorizable Kubernetes resource")
entity Resource = {
"apiGroup": __cedar::String,
"fieldSelector"?: Set < FieldRequirement >,
"labelSelector"?: Set < LabelRequirement >,
"name"?: __cedar::String,
"namespace"?: __cedar::String,
"resource": __cedar::String,
"subresource"?: __cedar::String
};
@doc("ServiceAccount represents a Kubernetes service account identity")
entity ServiceAccount in [Group] = {
"extra"?: Set < ExtraAttribute >,
"name": __cedar::String,
"namespace": __cedar::String
};
@doc("User represents a Kubernetes user identity")
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" 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" 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 "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" appliesTo {
principal: [Group, Node, ServiceAccount, User],
resource: [Resource],
context: {}
};
}