You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: geps/gep-3779/index.md
+25-23Lines changed: 25 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -241,7 +241,7 @@ spec:
241
241
242
242
243
243
##### CiliumIdentity
244
-
Cilium has the concept of CiliumIdentity. Pods are assigned identities derived from their Kubernetes labels (namespace, app labels, etc.). Cilium’s policy matches based on these label-derived identities. The CiliumIdentity implementation maps an integer to a group of IP addresses (the pod IPs associated with a group of pods). This “integer” and its mapping to pod IP addresses represents the core identity primitive in Cilium.
244
+
Cilium has the concept of CiliumIdentity. Pods are assigned identities derived from their Kubernetes labels (namespace, app labels, etc.). Cilium’s policy matches based on these label-derived identities. The CiliumIdentity implementation maps an integer to a group of IP addresses (the pod IPs associated with a group of pods). This “integer” and its mapping to pod IP addresses represents the core identity primitive in Cilium.
245
245
246
246
More on https://docs.cilium.io/en/stable/internals/security-identities/ & https://docs.cilium.io/en/stable/security/network/identity/
247
247
@@ -256,29 +256,31 @@ Each `AuthorizationPolicy` resource contains a list of rules. A request matches
256
256
257
257
A rule may specify:
258
258
259
-
***Sources:** The source identities to which the rule applies. A request’s identity must match one of the listed sources. Supported source kinds are:
260
-
***SPIFFE ID**
261
-
***Kubernetes ServiceAccount**
262
-
***Kubernetes Namespace**
263
-
***Attributes:** Conditions on the target workload, at the time of writing this, only port is supported. If no attributes are specified, the rule applies to all traffic toward the target.
259
+
***Sources:** The source identities to which the rule applies. A request’s identity must match one of the listed sources. Supported source kinds are:
260
+
***SPIFFE ID**
261
+
***Kubernetes ServiceAccount**
262
+
***Kubernetes Namespace**
263
+
264
+
***Attributes:** Conditions on the target workload, at the time of writing this, only port is supported. If no attributes are specified, the rule applies to all traffic toward the target.
264
265
265
266
### **ALLOW Policies**
266
267
267
-
* An **ALLOW** policy is permissive.
268
-
* A request is allowed if:
269
-
* It matches at least one rule in any ALLOW policy targeting the workload **and**
270
-
* It is not explicitly denied by any DENY policy.
271
-
* If no ALLOW policy exists for a workload, traffic is permitted by default, unless any DENY policy applies.
268
+
* An **ALLOW** policy is permissive.
269
+
* A request is allowed if:
270
+
* It matches at least one rule in any ALLOW policy targeting the workload **and**
271
+
* It is not explicitly denied by any DENY policy.
272
+
273
+
* If no ALLOW policy exists for a workload, traffic is permitted by default, unless any DENY policy applies.
272
274
273
275
### **DENY Policies**
274
276
275
-
* A **DENY** policy is restrictive and takes precedence over ALLOW.
276
-
* If a request matches any rule in a DENY policy, it is immediately rejected, regardless of matching ALLOW rules elsewhere.
277
+
* A **DENY** policy is restrictive and takes precedence over ALLOW.
278
+
* If a request matches any rule in a DENY policy, it is immediately rejected, regardless of matching ALLOW rules elsewhere.
277
279
* DENY policies enable to define global blocks or exceptions (for example: “block all traffic from Namespace X”).
278
280
279
281
### **ALLOW vs. DENY Semantics**
280
282
281
-
***DENY always wins.** If both an ALLOW and a DENY policy match a request, the DENY policy blocks it.
283
+
***DENY always wins.** If both an ALLOW and a DENY policy match a request, the DENY policy blocks it.
282
284
* The presence of any authorization policy causes the system to default to **deny-by-default** for matching workloads.
283
285
* Another bullet to re-clarify the one above - the default behavior when no policies select a target workload is to allow all traffic. However, **as soon as at least one `AuthorizationPolicy` targets a workload, the model becomes implicitly deny-if-not-allowed**.
284
286
@@ -292,14 +294,14 @@ The `targetRef` can point to a Kubernetes `Service`.
292
294
293
295
**Benefits:**
294
296
295
-
***No API Extension Required:** Works with the current PolicyAttachment model in Gateway API without modification.
297
+
***No API Extension Required:** Works with the current PolicyAttachment model in Gateway API without modification.
296
298
***Simplicity:** Intuitive for users familiar with Kubernetes networking concepts.
297
299
298
300
**Downsides and Open Questions:**
299
301
300
302
However, targeting a `Service` introduces several challenges:
301
303
302
-
1. Authorization cannot be enforced on workloads not exposed via a `Service` - excluding use cases of pods/jobs without a Service.
304
+
1. Authorization cannot be enforced on workloads not exposed via a `Service` - excluding use cases of pods/jobs without a Service.
303
305
2. If a Pod belongs to multiple Services targeted by different authorization policies, precedence rules, may become unclear, leading to unpredictable or insecure outcomes. Even if such rules are explicitly defined, UX could potentially be confusing for users.
304
306
3. UX and implementation challenges - are implementations expected to enforce the policy only if the traffic arrived through the specific Service? Or just to take the service selectors and enforce the policy regardless of how the traffic got to the destination?
305
307
@@ -309,8 +311,8 @@ Alternatively, the `targetRef` can specify a set of pods using a `LabelSelector`
309
311
310
312
**Benefits:**
311
313
312
-
* Aligns with established practices. Mesh implementations (Istio, Linkerd, Cilium) already use label selectors as the primary mechanism for targeting workloads in their native authorization policies, creating a consistent user experience.
313
-
* Directly applies policy to pods, avoiding ambiguity present when targeting services. Ensures policies are enforced exactly where intended, regardless of how many services a pod might belong to.
314
+
* Aligns with established practices. Mesh implementations (Istio, Linkerd, Cilium) already use label selectors as the primary mechanism for targeting workloads in their native authorization policies, creating a consistent user experience.
315
+
* Directly applies policy to pods, avoiding ambiguity present when targeting services. Ensures policies are enforced exactly where intended, regardless of how many services a pod might belong to.
314
316
* Policies can apply to any workload, including pods not exposed via a `Service`, providing a comprehensive authorization solution.
315
317
316
318
**Downsides and Open Questions:**
@@ -325,7 +327,7 @@ This option depends on enhancements to Gateway API’s policy attachment model t
325
327
326
328
To mitigate some of the concerns, `LabelSelector` support in policy attachment is designated as an **experimental pattern**.
327
329
328
-
***Gateway API Community First:** Allows experimentation within Gateway API policies (like the one in this GEP).
330
+
***Gateway API Community First:** Allows experimentation within Gateway API policies (like the one in this GEP).
329
331
* Implementations **should not** adopt `LabelSelector` targeting in their own custom policies attached to Gateway API resources until the pattern is sufficiently battle-tested and promoted to a standard feature. This staged approach mitigates risks of ecosystem fragmentation.
330
332
331
333
Here is how it is going to look like:
@@ -454,9 +456,9 @@ type AuthorizationSource struct {
454
456
// - From IP-to-identity mappings: The implementation might maintain a dynamic
455
457
// mapping between source IP addresses (pod IPs) and their associated
456
458
// identities (e.g., Service Account, SPIFFE IDs).
457
-
// - From JWTs or other request-level authentication tokens.
458
-
//
459
-
// Note for reviewers: While this GEP primarily focuses on identity-based
459
+
// - From JWTs or other request-level authentication tokens.
460
+
//
461
+
// Note for reviewers: While this GEP primarily focuses on identity-based
460
462
// authorization where identity is often established at the transport layer,
461
463
// some implementations might derive identity from authenticated tokens or sources
462
464
// within the request itself.
@@ -508,7 +510,7 @@ Note: Existing AuthorizationAPIs recognized the need to support negation fields
0 commit comments