upstream: add opt-in validation of bind config network namespaces#45976
Open
bpalermo wants to merge 3 commits into
Open
upstream: add opt-in validation of bind config network namespaces#45976bpalermo wants to merge 3 commits into
bpalermo wants to merge 3 commits into
Conversation
A bind config source address referencing a Linux network namespace that cannot be opened previously failed only when upstream connections were created. This adds a BindConfig.validate_network_namespaces bool: when set, the network_namespace_filepath of every source address in the bind config is validated at configuration load time and the configuration is rejected if a namespace cannot be opened. This is opt-in rather than default/runtime-guarded because upstream binds only enter the namespace at connection-establishment time, so a namespace may legitimately not exist yet when the configuration is loaded. Signed-off-by: Bruno Palermo <b@palermo.dev>
Signed-off-by: Bruno Palermo <b@palermo.dev>
|
Hi @bpalermo, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
This was referenced Jul 4, 2026
Signed-off-by: Bruno Palermo <b@palermo.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message
upstream: add opt-in validation of bind config network namespaces
Additional Description
Split out of #45721 (validation half), as requested in review.
A cluster (or the bootstrap cluster manager) whose bind config references a Linux network
namespace that cannot be opened previously failed only when creating upstream connections
(historically with a crash; #45975 makes it a graceful connection failure). This PR adds a new
BindConfig.validate_network_namespacesbool. When set, theSocketAddress.network_namespace_filepathof every source address in the bind config isvalidated at configuration load time, and the configuration is rejected if a namespace cannot be
opened.
Per review feedback on #45721, this is an opt-in API field rather than a runtime guard: a
namespace may legitimately not exist yet when the configuration is loaded (upstream binds only
enter the namespace at connection-establishment time), so eager validation must not be the
unconditional default, and a temporary runtime guard would eventually make it unconditional.
Risk Level
Low — new behavior is opt-in via a new API field; default behavior is unchanged.
Testing
Unit tests added:
Network::Utility::validateNetworkNamespace(success/open-failure), andcluster config rejection with
validate_network_namespacesset, plus acceptance of the sameconfig when unset.
Docs Changes
API proto docs for the new field.
Release Notes
Added a new-feature changelog fragment.
Platform Specific Features
Network namespaces are Linux-only; on other platforms
network_namespace_filepathhas no effectand the new validation is a no-op.