Hello all, I need to brainstorm an issue:
Consider the following configs in AWS:
Ingress:
- name: client-port
nodePort: 31213
port: 4242
protocol: TCP
targetPort: 4242
Gateway:
- port:
number: 4242
name: client-port
protocol: TCP
VirtualService:
tcp:
- match:
- port: 4242
route: - destination:
host: myhost
port:
number: 4242
- port: 4242
Traffic is routed 100%, I have no issue. But if I want to apply a DENY for any IP such as follows, it just will not block the traffic:
kind: AuthorizationPolicy
metadata:
name: deny-4242
namespace: app_namespace
spec:
selector:
matchLabels:
application: myapp
action: DENY
rules:
- to:
- operation:
ports: [“4242”]
- operation:
I know that it detects the deny because I see in the logs:
[2023-04-26T14:47:42.204Z] “- - -” 0 - - rbac_access_denied_matched_policy[ns[app_namespace]-policy[deny-4242]-rule[0]] , but I actually still get the data from the server (which is a big no no for us).
I even tried this rule on the istio-system namespace, and still no luck.
Did anyone have this issue, since I only want to restrict one port I cannot use the gateways.istio-ingressgateway.loadBalancerSourceRanges. Also, I have HTTP ports as well and this kind of rule works 100% there.