fix(supervisor): quote nft log prefix in bypass rules - #2555
Open
gracesmith6504 wants to merge 1 commit into
Open
fix(supervisor): quote nft log prefix in bypass rules#2555gracesmith6504 wants to merge 1 commit into
gracesmith6504 wants to merge 1 commit into
Conversation
gracesmith6504
requested review from
a team,
derekwaynecarr,
maxamillion and
mrunalp
as code owners
July 30, 2026 09:14
The log prefix value passed to nft contains colons (e.g. openshell:bypass:sandbox-cc817378:) but was not wrapped in double quotes. Since nft concatenates argv entries and parses the result, the bare colons cause a syntax error that silently prevents all bypass-attempt LOG rules from installing. Wrap log prefix values in nft-quoted strings via a new nft_quote() helper that strips embedded double-quotes (nft quoted strings don't support escape sequences). All four log-rule generation sites (TCP and UDP, for both per-sandbox and sidecar rulesets) are updated. Fixes NVIDIA#2470 Signed-off-by: Grace Smith <grasmith@redhat.com>
gracesmith6504
force-pushed
the
fix/2470-nft-log-prefix-quoting
branch
from
July 30, 2026 09:15
567ffba to
34ffe52
Compare
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.
Summary
The nft
log prefixvalue in bypass detection rules contains colons but is not wrapped in double quotes, causing nft to reject the command with a syntax error. This silently disables all bypass-attempt logging. This PR adds annft_quote()helper that wraps prefixes in nft-quoted strings, and applies it to all four log-rule generation sites.Related Issue
Fixes #2470
Changes
nft_quote()helper function that wraps a string in double quotes and strips any embedded double-quotes (nft quoted strings don't support escape sequences)nft_ruleset.rsnft_quote()covering colons, quotes, and backslashesTesting
mise run pre-commitpasses (all checks green: clippy, format, license, markdown, helm)netnsmodule is#[cfg(target_os = "linux")]so unit tests only run in CI, not on macOS. Compilation and clippy verified locally.Checklist