Repository navigation
test: reproduce incorrect host-path attribution through container aliases - #2131
Draft
robbycochran wants to merge 5 commits into
Draft
robbycochran wants to merge 5 commits into
robbycochran wants to merge 5 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2131 +/- ##
=======================================
Coverage 33.45% 33.45%
=======================================
Files 22 22
Lines 3623 3623
Branches 3623 3623
=======================================
Hits 1212 1212
Misses 2402 2402
Partials 9 9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
robbycochran
marked this pull request as draft
October 14, 2026 17:32
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.
Goal: reproduce incorrect host-path attribution caused by aliasing
The main purpose of this PR is to capture an aliasing layout in which Fact reports a nonempty
host_paththat identifies the wrong backing file, then add a regression that fails until that attribution is corrected. Related: #2130.Status: incomplete. The current 16 tests pass on main; they do not yet reproduce the incorrect attribution. This PR must not be considered complete until the failing case and its raw event evidence are included.
Real-world example: a container's
/etcis backed by scratch storageAn OpenShift node has a file-monitoring policy for host
/etc. A workload bind-mounts a scratch directory into its container at/etc, for example:The application updates
/etc/app.confinside the container. The backing file is/var/tmp/workload-config/app.confon the node; the node's/etc/app.confwas not changed.The regression must reject this incorrect Fact event:
The expected output preserves the observed container path and either reports the correctly established backing path or leaves it unresolved:
This example explains the intended failure, not an already reproduced result. The simple scratch-to-watched-path layout in the current tests correctly emits an empty
host_path. We still need to identify and preserve the directory-aliasing conditions that cause the erroneous nonempty value.Positive controls must also remain: host
/etcmounted at either container/etcor/host-configmust retain its genuine host attribution. This guards against hiding the bug by dropping events or clearing all host paths. Tests use disposable directories as stand-ins; they never modify the real host/etc.Completion criteria
host_pathon an unfixed revision and retain the exact mount/alias setup plus raw event.The primary regression belongs at Fact's emitted-path boundary. Sensor policy matching is a separate follow-up; it must not substitute for demonstrating the incorrect Fact
host_path.Related ROX work
The Atlassian connector is disabled by administrator policy in this session, so these relationships are verified from GitHub references, not a direct Jira search. Jira status and full issue scope have not been verified.
host_pathtargeted here./root -> var/roothome; currently documented as a missing-event timeout.FACT_HOST_MOUNT; issue explicitly describes the possibility of selecting a file inside Fact's container instead of the host. No ROX reference was found in that issue body.None of these has been established as a duplicate of the incorrect-attribution regression. ROX-36834 and #1595 are useful starting points for reproducing the precise aliasing failure.
Existing supporting coverage
A temporary watched directory models host
/etc; no real host/etcfiles are modified. Four mount layouts are tested:Each layout exercises existing-file writable OPEN and new-file CREATE through both gRPC and OTEL: 16 cases. Existing files are seeded before Fact's initial scan, so OPEN coverage cannot accidentally depend on a preceding creation event. The assertions check container identity, operation, observed path, and host path. Unwatched sources may remain unresolved or report their correct backing path; they may never claim the unrelated watched directory. Writer mount inspection is saved beside the existing Fact logs.
This is a test-only PR on main and does not depend on either runtime-metadata PR. These 16 cases already pass on main and are supporting controls, not the required failing reproducer. The primary regression remains to be implemented. #2130 tracks the wider solution building blocks.
Checklist
Automated testing
host_pathattribution; current tests are passing controlsTesting Performed
Live run on a privileged Podman Fedora CoreOS arm64 VM, kernel
6.11.3-200.fc40.aarch64, with BPF LSM enabled:661acec004, repeated successfully after the final assertion update (72.39 seconds).sha256:955550e7587a936d3488162404cd90bb2d9b026a18f18c1b7ff4df4c1e6f06fd.git diff --checkpassed.Summary by CodeRabbit