Skip to content

Commit

Permalink
fix: EEP RG enforcement (envoyproxy#3475)
Browse files Browse the repository at this point in the history
fix EEP RG enforcement

Signed-off-by: Guy Daich <guy.daich@sap.com>
  • Loading branch information
guydc authored May 26, 2024
1 parent d9a8e54 commit 3f7767f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/gatewayapi/envoyextensionpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ func (t *Translator) buildExtProc(
if err = t.validateExtServiceBackendReference(
&extProc.BackendRefs[i].BackendObjectReference,
policyNamespacedName.Namespace,
egv1a1.KindEnvoyExtensionPolicy,
resources); err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions internal/gatewayapi/securitypolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ func (t *Translator) buildExtAuth(
if err = t.validateExtServiceBackendReference(
backendRef,
policy.Namespace,
KindSecurityPolicy,
resources); err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ referenceGrants:
spec:
from:
- group: gateway.envoyproxy.io
kind: SecurityPolicy
kind: EnvoyExtensionPolicy
namespace: default
to:
- group: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ referenceGrants:
spec:
from:
- group: gateway.envoyproxy.io
kind: SecurityPolicy
kind: EnvoyExtensionPolicy
namespace: default
to:
- group: ''
Expand Down
3 changes: 2 additions & 1 deletion internal/gatewayapi/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ func (t *Translator) validateSecretObjectRef(
func (t *Translator) validateExtServiceBackendReference(
backendRef *gwapiv1.BackendObjectReference,
ownerNamespace string,
policyKind string,
resources *Resources,
) error {
// These are sanity checks, they should never happen because the API server
Expand Down Expand Up @@ -985,7 +986,7 @@ func (t *Translator) validateExtServiceBackendReference(
if !t.validateCrossNamespaceRef(
crossNamespaceFrom{
group: egv1a1.GroupName,
kind: KindSecurityPolicy,
kind: policyKind,
namespace: ownerNamespace,
},
crossNamespaceTo{
Expand Down

0 comments on commit 3f7767f

Please sign in to comment.