Skip to content

Commit 776e35c

Browse files
committed
fmting
1 parent a410c68 commit 776e35c

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

geps/gep-3779/index.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ spec:
241241

242242

243243
##### 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.
245245

246246
More on https://docs.cilium.io/en/stable/internals/security-identities/ & https://docs.cilium.io/en/stable/security/network/identity/
247247

@@ -256,29 +256,31 @@ Each `AuthorizationPolicy` resource contains a list of rules. A request matches
256256

257257
A rule may specify:
258258

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.
264265

265266
### **ALLOW Policies**
266267

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.
272274

273275
### **DENY Policies**
274276

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.
277279
* DENY policies enable to define global blocks or exceptions (for example: “block all traffic from Namespace X”).
278280

279281
### **ALLOW vs. DENY Semantics**
280282

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.
282284
* The presence of any authorization policy causes the system to default to **deny-by-default** for matching workloads.
283285
* 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**.
284286

@@ -292,14 +294,14 @@ The `targetRef` can point to a Kubernetes `Service`.
292294

293295
**Benefits:**
294296

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.
296298
* **Simplicity:** Intuitive for users familiar with Kubernetes networking concepts.
297299

298300
**Downsides and Open Questions:**
299301

300302
However, targeting a `Service` introduces several challenges:
301303

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.
303305
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.
304306
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?
305307

@@ -309,8 +311,8 @@ Alternatively, the `targetRef` can specify a set of pods using a `LabelSelector`
309311

310312
**Benefits:**
311313

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.
314316
* Policies can apply to any workload, including pods not exposed via a `Service`, providing a comprehensive authorization solution.
315317

316318
**Downsides and Open Questions:**
@@ -325,7 +327,7 @@ This option depends on enhancements to Gateway API’s policy attachment model t
325327

326328
To mitigate some of the concerns, `LabelSelector` support in policy attachment is designated as an **experimental pattern**.
327329

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).
329331
* 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.
330332

331333
Here is how it is going to look like:
@@ -454,9 +456,9 @@ type AuthorizationSource struct {
454456
// - From IP-to-identity mappings: The implementation might maintain a dynamic
455457
// mapping between source IP addresses (pod IPs) and their associated
456458
// 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
460462
// authorization where identity is often established at the transport layer,
461463
// some implementations might derive identity from authenticated tokens or sources
462464
// within the request itself.
@@ -508,7 +510,7 @@ Note: Existing AuthorizationAPIs recognized the need to support negation fields
508510
#### Feature Names
509511

510512

511-
### Conformance tests
513+
### Conformance tests
512514

513515

514516
## Alternatives

0 commit comments

Comments
 (0)