-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(shields): keep registered network routes when shields down swaps policy #7963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
harjothkhara
wants to merge
8
commits into
NVIDIA:main
from
harjothkhara:fix/7952-shields-down-network-routes
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ed1115c
fix(shields): keep registered network routes when shields down swaps …
harjothkhara 2dd8c6b
test(shields): compare the inlined provider filter with the canonical…
harjothkhara 8c98627
docs(shields): state the collision assumption in the permissive merge
harjothkhara bfe11fe
Merge branch 'main' into fix/7952-shields-down-network-routes
cv b55ebe3
fix(shields): carry only registry-owned routes and report a degraded …
harjothkhara 8c80c76
fix(shields): name the lost routes and their real recovery command
harjothkhara fbf6ac9
Merge remote-tracking branch 'origin/main' into fix/7952-shields-down…
harjothkhara 8a82528
Merge branch 'main' into fix/7952-shields-down-network-routes
apurvvkumaria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 50372
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 38998
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 50371
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 13677
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 40360
🏁 Script executed:
Repository: NVIDIA/NemoClaw
Length of output: 14941
🌐 Web query:
Official OpenShell documentation network_policies policy key name grammar restrictions toString constructor __proto__💡 Result:
In NVIDIA OpenShell, network_policies are defined as a map of entries where the map key acts as a unique logical identifier for the policy [1][2]. Regarding the specific terms requested: 1. Policy Key Name Grammar Restrictions: The map key (the logical identifier) must be unique within the network_policies block [3]. When the OpenShell system composes policies, it automatically handles key collisions by appending numeric suffixes (e.g., _2, _3) to ensure uniqueness [3]. There are no explicit, strictly documented character-set limitations for these keys beyond being valid YAML/JSON strings, but they serve as identifiers in the policy map [1][3][4]. 2. Name Field: Each entry can include an optional name field [1][5][2]. If provided, this field serves as the display name for the entry in log output [1][5][2]. If omitted, the system defaults the display name to the map key itself [1][2][4]. 3. proto and toString: These terms do not appear as functional elements, reserved keywords, or documented configuration fields in the OpenShell network policy schema [1][5][2]. They are standard JavaScript/prototype properties that are not utilized or addressed by the OpenShell policy definition grammar or constructor logic [6][3]. 4. Constructor: OpenShell policies are declarative and defined via YAML (or JSON) configuration files [7]. Policies are processed by the OpenShell supervisor and gateway components, which parse these declarations [8]; there is no user-facing constructor method or class to instantiate these policies manually [1][4]. The OpenShell documentation emphasizes that network_policies are dynamic and can be reloaded without restarting the sandbox [4]. Each entry defines binaries and endpoints; traffic is permitted only when both match within the same policy block [1][9][4].
Citations:
Use own-property checks when merging network routes.
The policy parser does not reject
toString,constructor, or__proto__.name in baseNetworktherefore treats these live routes as existing baseline routes and drops them. UseObject.hasOwn(baseNetwork, name)and define copied properties safely so__proto__cannot invoke the prototype setter. Add regression tests for these keys.🧰 Tools
🪛 ast-grep (0.45.0)
[error] 160-162: Recursive/iterative merge copies attacker-controllable keys from a source object into a target via a computed property assignment without rejecting dangerous keys, allowing prototype pollution. Skip or block "proto", "constructor", and "prototype" keys (e.g.
if (key === "__proto__" || key === "constructor" || key === "prototype") continue;), use a null-prototype object (Object.create(null)), or use a safe merge utility instead.Context: for (const name of liveNetworkNames) {
if (!(name in baseNetwork)) baseNetwork[name] = liveNetwork[name];
}
Note: [CWE-1321] Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
(prototype-pollution-recursive-merge-typescript)
🤖 Prompt for AI Agents