consomme: filter guest network traffic based on destination#3617
Open
damanm24 wants to merge 9 commits into
Open
consomme: filter guest network traffic based on destination#3617damanm24 wants to merge 9 commits into
damanm24 wants to merge 9 commits into
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens Consomme’s NAT behavior by default-dropping guest-originated packets whose destination is “host-local” (loopback/unspecified/link-local), with an opt-in parameter to restore prior behavior for scenarios that need it.
Changes:
- Add destination filtering for IPv4/IPv6 guest TX frames, returning a new
DropReason::DestinationNotAllowedwhen blocked. - Expose a new
ConsommeParamsflag (allow_host_local_access) defaulting tofalseto opt in to allowing these destinations. - Update/add tests to validate the new default filtering and to opt in where existing tests require loopback access.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vm/devices/net/net_consomme/src/lib.rs | Accounts for the new destination-block drop reason in TX drop stats. |
| vm/devices/net/net_consomme/consomme/src/lib.rs | Introduces the new params flag, drop reason, and IPv4/IPv6 destination filtering logic. |
| vm/devices/net/net_consomme/consomme/src/tests.rs | Adds new unit tests covering blocked/allowed destination behavior for IPv4/IPv6. |
| vm/devices/net/net_consomme/consomme/src/tcp/tests.rs | Opts TCP tests into loopback/host-local access as required by the new default. |
| vm/devices/net/net_consomme/consomme/src/udp.rs | Opts UDP tests into loopback/host-local access as required by the new default. |
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.
By default, drop guest-originated packets destined for loopback, unspecified, and link-local addresses in the
consomme NAT layer. A new
allow_host_local_accessparameter on ConsommeParams can be set to opt in to theprevious behavior when needed.