### Summary
`AuthorizationPolicy` `source.ipBlocks`, `source.notIpBlocks` and the `source.ip` condition on ambient waypoints, and on sidecars receiving HBONE traffic, match the Envoy internal listener address, not the client IP. `DENY` rules on `ipBlocks` fail open, `notIpBlocks` rules match every request. `CUSTOM` rules on `ipBlocks` skip the external authorizer.
### Details
`ipBlocks`, `notIpBlocks` and `source.ip` are translated to the RBAC `direct_remote_ip` principal ([generator.go](https://github.com/istio/istio/blob/1.31.3/pilot/pkg/security/authz/model/generator.go#L151-L157)). Waypoints, and sidecars for HBONE inbound traffic, enforce policy on the `main_internal` internal listener, where the direct remote address is always `envoy://internal`. The `original_dst` listener filter only restores the remote address, so `remoteIpBlocks`/`notRemoteIpBlocks` and `remote.ip` (`remote_ip`) work but `ipBlocks`/`notIpBlocks`/`source.ip` never see the client IP. This applies to `ALLOW`, `DENY` and `CUSTOM` actions. HTTP and TCP traffic are both affected.
Fixes are available in 1.31.4 and 1.30.8.
Workaround: use `remoteIpBlocks`, `notRemoteIpBlocks` and `remote.ip` instead of `ipBlocks`, `notIpBlocks` and `source.ip` in policies that apply to waypoints or to sidecars receiving HBONE traffic.
### Proof of concept
Ambient namespace with a client pod and a waypoint, then a `DENY` on the client pod IP:
```yaml
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metada