Skip to content

Internal envoy header sanitization  #53402

Closed
@jaellio

Description

@jaellio

(This is used to request new product features, please visit https://github.com/istio/istio/discussions for questions on using Istio)

Describe the feature request

As identified in GHSA-ffhv-fvxq-r6mf, Envoy previously considered all private IPs as internal by default. If an address was "internal", the x-envoy header would not be sanitized on inbound or outbound. This vulnerability unintentionally enabled implicit trust of private IPs allowing external clients to configure envoy headers if the requests passed through an ingress gateway. Internally (sidecar to sidecar requests originating in the mesh), internal envoy headers are stripped as long as the useRemoteAddress is false and the XFF header is unset. However, from Envoy's perspective the set of trusted IP addresses by default is still the set of all private IPs.

To better align with the zero-trust model, Istio should configure Envoy to untrust all IP addresses by default when determining whether internal Envoy headers should be sanitized on inbound/outbound. Users should be able to opt sidecars into trusted mode where internal Envoy headers are not sanitized on outbound. Additionally, Istio should provide a mechanism for users to configure the set of trusted IP address, the internalAddressConfig. Currently, a mechanism via the Istio API does not exist to granularly configure a pod or mesh-wide internalAddressConfig. Through the proxyConfig a user can enable and disable implicit trust of all private IPs.

@jforce

TODO:

  • Add release note for Istio 1.25 explaining the default envoy behavior change and document how to disable explicit_internal_address_config to revert to previous behavior. Link to documentation on how to enable ENABLE_HCM_INTERNAL_NETWORKS to set the internal address config.
    Add documentation on configuring mesh networks with respect to ENABLE_HCM_INTERNAL_NETWORKS

Affected product area (please put an X in all that apply)

[ ] Ambient
[ ] Docs
[ ] Dual Stack
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ ] Extensions and Telemetry
[x] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure

Activity

jaellio

jaellio commented on Oct 21, 2024

@jaellio
ContributorAuthor

In Envoy v1.33, users must explicitly configure the internal_address_config https://github.com/envoyproxy/envoy/releases/tag/v1.32.0. Currently, in v1.32 and all prior versions, the default internal_address_config is the set of all private IPs.

jaellio

jaellio commented on Jan 22, 2025

@jaellio
ContributorAuthor

For Envoy's 1.33 release, explicit_internal_address_config will default to true. To revert to the old behavior of trusting all internal IPs as internal Istio users can set explicit_internal_address_config to false in the mesh or proxy configs. This behavior will impact Istio 1.25.

As of now, I am not planning on adding support to configure the internal address config via an EnvoyFilter or other Istio custom resource. If we receive user requests for adding this capability we will consider adding support in future releases.

ramaraochavali

ramaraochavali commented on Jan 25, 2025

@ramaraochavali
Contributor

It is already supported. You can enable ENABLE_HCM_INTERNAL_NETWORKS to true and create a Mesh Network with the internal IP addresses, it will automatically create an InternalAddressConfig and set it to Envoy.

jaellio

jaellio commented on Jan 27, 2025

@jaellio
ContributorAuthor

@ramaraochavali That's a good point. We're already leveraging that logic to support internal address configuration when PILOT_SIDECAR_USE_REMOTE_ADDRESS is enabled. Is ENABLE_HCM_INTERNAL_NETWORKS experimental and if so, are there plans to promote it? Are there examples for configuring mesh networks with respect to also enabling ENABLE_HCM_INTERNAL_NETWORKS. We should at least add explicit work around steps when we document this envoy behavior change in the next Istio release.

ramaraochavali

ramaraochavali commented on Jan 28, 2025

@ramaraochavali
Contributor

Is ENABLE_HCM_INTERNAL_NETWORKS experimental and if so, are there plans to promote it?

It is off by default because of production usage. If more folks use, we can enable it as true for couple of releases and default it.

Are there examples for configuring mesh networks with respect to also enabling ENABLE_HCM_INTERNAL_NETWORKS.

Unfortunately no.

We should at least add explicit work around steps when we document this envoy behavior change in the next Istio release.

Sure. We can do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Internal envoy header sanitization · Issue #53402 · istio/istio