Repository navigation
feat(diff-logs): report connections that are allowed and then fail as TLS trust problems - #24
Merged
Merged
Conversation
… TLS trust problems Signed-off-by: Ilan Harel <[email protected]>
ilanh
force-pushed
the
fix/diff-logs-tls
branch
from
November 3, 2026 08:06
a601b7e to
7eac5ae
Compare
ilanh
added a commit
that referenced
this pull request
Nov 3, 2026
… scripts out of placement (#26) ## What and why Two `diff-logs` problems found when the probe driver lived inside the repo: - **Wrong root from a subdirectory.** `cd openshell && openshell-annotate diff-logs sandbox-logs.txt` scanned only that directory (0 stale, wrong `place:`). When `--root` is not given, `diff-logs` now walks up to the nearest `openshell-annotate.toml` (like git), prints `note: using repository root ...`, and loads that config. The log paths you pass are still resolved from where you run it. An explicit `--root` other than `.` is never second-guessed. (The other commands take explicit path arguments relative to the working directory, so I left their root handling alone.) - **Probe scripts used as placement targets.** `diff-logs --write` inserted directives into `openshell/exercise.sh` because it mentions the host. New `[diff-logs] exclude` patterns (same literal syntax as `[scan].exclude`) keep files from being picked as the place for a suggestion, while directives inside them still count. The `--observed-file` is always skipped. Docs: README config block, `--root` help (CLI.md regenerated). Tests: `tests/diff_logs_root.rs` (subdirectory run, `--write` from a subdirectory, exclude vs no exclude, observed file never a target). `TOOLCHAIN=1.94 scripts/ci-local.sh` and stable clippy pass. Ordering: edits the `diff-logs` arm of `main.rs` and `find_mention` in `diff_logs.rs`; the TLS PR (#24) edits other parts of `diff_logs.rs`, so a rebase of the second one to merge may be needed. Closes #11 Signed-off-by: Ilan Harel <[email protected]> Co-authored-by: Ilan Harel <[email protected]>
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.
What and why
OpenShell can allow a connection and the client then drops it because it does not trust the sandbox's TLS-termination CA (Rust reqwest with bundled webpki roots, pinned certificates, some Java truststores). The log shows
NET:OPEN ... ALLOWEDimmediately followed byNET:FAIL [LOW] <synthetic ip>:443.diff-logsused to report0 suggestionsfor that.NET:FAILlines (shorthand) and OCSF JSON events withactivity_id4. NewAction::Failed, and afailedcount in the JSON report.tls_failure("Allowed, then failed (TLS)") with the hint: the client most likely does not trust the OpenShell CA; usetls=skip(loses L7 rules) or make the client trust the CA bundle. It points at the existing directive when there is one.tls=skip, the finding is amanualnote saying it is not a certificate problem.--writeleaves files alone for this kind), because the fix is an attribute on an existing line.Tests:
tests/diff_logs_tls.rs(shorthand and OCSF JSON, tls=skip case,--writeno-op). The anthropic-proxy-rs sandbox log kept in the candidates folder no longer contains the NET lines, so I could not replay the real log; the line format follows OpenShell's shorthand formatter (crates/openshell-ocsf/.../shorthand.rs) and the report.TOOLCHAIN=1.94 scripts/ci-local.shand stable clippy pass. Independent of the other PRs (new test file; the diff-logs source edits are away from the lines other PRs touch).Closes #12