diff --git a/.cargo/audit.toml b/.cargo/audit.toml index ec37f42..f7386f5 100644 --- a/.cargo/audit.toml +++ b/.cargo/audit.toml @@ -5,8 +5,15 @@ ignore = [ # RUSTSEC-2026-0459: libsqlite3-sys 0.37.0 (C SQLite CVE-2026-119375), fixed in >= 0.39.0. # https://rustsec.org/advisories/RUSTSEC-2026-0459 - tracked in https://github.com/ilanh/openshell-annotate/issues/76 - # Transitive and not upgradable from this repo: OpenShell v0.1.7 to v0.1.9 openshell-crypto -> sqlx 0.9.0 -> sqlx-sqlite =0.9.0 + # Transitive and not upgradable from this repo: OpenShell v0.1.7 to v0.1.10 openshell-crypto -> sqlx 0.9.0 -> sqlx-sqlite =0.9.0 # (exact pin) -> libsqlite3-sys 0.37.0. openshell-annotate does not use SQLite itself. # Remove this entry once an OpenShell release bumps sqlx/libsqlite3-sys and we move the pin to it. "RUSTSEC-2026-0459", + # RUSTSEC-2026-0600: kube-client 5.0.0 `openssl-tls` also trusts OpenSSL's default CA store, fixed in >= 5.2.0. + # https://rustsec.org/advisories/RUSTSEC-2026-0600 - tracked in https://github.com/ilanh/openshell-annotate/issues/114 + # Transitive and not upgradable from this repo: OpenShell v0.1.10 openshell-crypto requires kube =5.0.0 (exact pin; + # v0.1.9 locked kube 0.99, also affected), and kube 5.2.0 needs Rust 1.95. kube is only in Cargo.lock, not in any + # build of openshell-annotate (`cargo tree -i kube-client --target all` prints nothing), so cargo-deny does not report it. + # Remove this entry once an OpenShell release moves kube to >= 5.2.0 and we move the pin to it. + "RUSTSEC-2026-0600", ] diff --git a/AGENTS.md b/AGENTS.md index 8b8aeb2..ed15506 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,7 +10,7 @@ subprocesses; add directives with reasons; run `scan`, `generate`, `lint`, `drif ## When changing this tool - Build/test: `cargo build && cargo test` (Rust 1.94+). The schema crate is a git dependency pinned to the - OpenShell `v0.1.9` tag (see `Cargo.toml`, `Cargo.lock` pins the commit). Update the tag deliberately and re-run + OpenShell `v0.1.10` tag (see `Cargo.toml`, `Cargo.lock` pins the commit). Update the tag deliberately and re-run the golden tests. `openshell-next` builds against the newest upstream tag, prereleases included, and is moved by `.github/workflows/openshell-next.yml`; fixes that need the newer OpenShell go there, fixes valid on the current pin go to `main` (see `docs/DEVELOPING.md`, "Tracking the next OpenShell release"). diff --git a/CHANGELOG.md b/CHANGELOG.md index a9307b9..18c3e11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ version section and adds the squash-merged PR titles since the previous tag. Ver ## [Unreleased] +- chore(deps): build against OpenShell v0.1.10 (`openshell-policy-schema`, `openshell-policy`, commit 152c59d); docs, generated policy headers and the `diff-logs`/`--image` notes now name v0.1.10. v0.1.10 still declares `rust-version = "1.94"`, so main stays on Rust 1.94 (#113) +- feat(validate): `lint --policy`, `drift` and `generate` run the offline checks of `openshell policy lint` (OpenShell v0.1.10, ai-openshell/openshell#5358): `find_endpoint_ambiguities` and `validate_and_canonicalize_authored_policy` (reserved `_provider_` keys, credential bindings, size limit) next to the gateway validator. Endpoints that match the same requests with different protocols are now an error, since a request is authorized only by endpoints using the selected route's protocol (ai-openshell/openshell#5274) (#113) +- feat(validate): a YAML policy file with `endpoint_settings` (a Cedar-only section, ai-openshell/openshell#5006) is rejected by `lint --policy` and `drift` with OpenShell's message (#113) +- feat(lint): warn about hosts in the NAT64 prefix `64:ff9b::/96` in directives and `--policy` files: OpenShell v0.1.10 checks them as the embedded IPv4 address (ai-openshell/openshell#5793) (#113) +- docs: `--scaffold-profiles` mentions `auth_style: path_subtree` (ai-openshell/openshell#5675); README and DEVELOPING cover the v0.1.10 changes, `openshell policy lint`, and the known v0.1.10 regression on Kubernetes nodes with kernels older than 6.4 (ai-openshell/openshell#6069) (#113) +- test: `diff-logs` reads v0.1.10 records with the real process (`pid`, `created_time`, parent `pid`, ai-openshell/openshell#5251) and skips gateway audit records with `resources[].data` (ai-openshell/openshell#5612) (#113) +- chore(audit): ignore RUSTSEC-2026-0600 (kube-client 5.0.0, exact pin in OpenShell `openshell-crypto`, only in `Cargo.lock`) in `.cargo/audit.toml` until an OpenShell release moves kube to >= 5.2.0 (#114) - chore(deps): build against OpenShell v0.1.9 (`openshell-policy-schema`, `openshell-policy`, commit ce58cf8); docs, generated policy headers and the `diff-logs`/`--image` notes now name v0.1.9 (#107) - feat(lint): warn when a wildcard host in an `egress` directive or a `--policy` endpoint without `allowed_ips` can match a private IP literal (`10.*.*.*`, `**.*.*`): since OpenShell v0.1.9 a wildcard endpoint no longer allows private IP literals on its own (#107) - test: the gateway validator rejects middleware selectors with a port (OpenShell v0.1.9); `diff-logs` skips gateway API Activity denials in both the old (`type_uid` 600399) and the new Create/Update/Delete shape (#107) diff --git a/Cargo.lock b/Cargo.lock index 50b974a..6a7bd87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,6 +45,17 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "annotate-snippets" +version = "0.12.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0258346f92c78dbc5b336b9a5b27c64447aa10643bc64e651db2edb145361564" +dependencies = [ + "anstyle", + "memchr", + "unicode-width 0.2.3", +] + [[package]] name = "anstream" version = "1.0.0" @@ -110,6 +121,12 @@ dependencies = [ "object 0.39.1", ] +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + [[package]] name = "asn1-rs" version = "0.7.2" @@ -428,16 +445,6 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "chrono" -version = "0.4.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" -dependencies = [ - "num-traits", - "serde", -] - [[package]] name = "clap" version = "4.6.7" @@ -525,6 +532,12 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -628,9 +641,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.11" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" dependencies = [ "darling_core", "darling_macro", @@ -638,27 +651,26 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.11" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" dependencies = [ - "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] name = "darling_macro" -version = "0.20.11" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" dependencies = [ "darling_core", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -687,6 +699,27 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e" +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", +] + [[package]] name = "digest" version = "0.10.7" @@ -739,14 +772,14 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "educe" -version = "0.6.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +checksum = "a00371d2607edea062396ef1ce6ade65c8e915ac7a1277daa198208420f682c6" dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -758,6 +791,29 @@ dependencies = [ "serde", ] +[[package]] +name = "encoding_rs" +version = "0.8.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "encoding_rs_io" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba3fe847045ecff794b9c138293a80db914678c453ad63fbf0c6a9eb6e00b22" +dependencies = [ + "encoding_rs", +] + [[package]] name = "enum-ordinalize" version = "4.4.2" @@ -1066,6 +1122,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "granit-parser" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd04d0d9c7079b416b458d2317aea4aa964c81938cb7c20f559758c4f422dc8" +dependencies = [ + "arraydeque", + "smallvec", +] + [[package]] name = "h2" version = "0.4.20" @@ -1091,8 +1157,6 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "allocator-api2", - "equivalent", "foldhash 0.1.5", ] @@ -1122,30 +1186,6 @@ dependencies = [ "hashbrown 0.16.1", ] -[[package]] -name = "headers" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2700e3fe555c3310aa7286cac6167449f2c87e0eb58769c9208a1c58a1d106" -dependencies = [ - "base64 0.22.1", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1 0.10.7", -] - -[[package]] -name = "headers-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.5.0" @@ -1195,15 +1235,6 @@ dependencies = [ "digest 0.11.3", ] -[[package]] -name = "home" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "hostname" version = "0.4.2" @@ -1291,25 +1322,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-http-proxy" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1d471ea2f65ba45eddb1d6ab7d58ac2671d2d4ac14da5c6516ae1d97e1327a" -dependencies = [ - "bytes", - "futures-util", - "headers", - "http", - "hyper", - "hyper-rustls", - "hyper-util", - "pin-project-lite", - "tokio", - "tokio-rustls", - "tower-service", -] - [[package]] name = "hyper-rustls" version = "0.27.10" @@ -1578,6 +1590,41 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "jiff" +version = "0.2.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175dc66334db3b9ab9985bf8b61cfed50dc16d20964bb47f9e479adcae984a7f" +dependencies = [ + "jiff-core", + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e599b80292e597019b8b3e392de3f4bea2959ddfb8c7dff60e035e9e311a2c1b" +dependencies = [ + "log", +] + +[[package]] +name = "jiff-static" +version = "0.2.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7b1af7547d47354bc438d797e3854601bde8f8d185780c5ba4ab27afa54f1ba" +dependencies = [ + "jiff-core", + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "jni" version = "0.22.4" @@ -1662,9 +1709,9 @@ dependencies = [ [[package]] name = "jsonpath-rust" -version = "0.7.5" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c00ae348f9f8fd2d09f82a98ca381c60df9e0820d8d79fce43e649b4dc3128b" +checksum = "c83bc96c838e7a3de9dc89ea291363ac073371959637e3b2207556e9320547b8" dependencies = [ "pest", "pest_derive", @@ -1703,22 +1750,21 @@ dependencies = [ [[package]] name = "k8s-openapi" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c75b990324f09bef15e791606b7b7a296d02fc88a344f6eba9390970a870ad5" +checksum = "ab0d13801242174b1f3966907c3f32039f2d6b36c7ce82c61225d66ed5d1eb70" dependencies = [ "base64 0.22.1", - "chrono", + "jiff", "serde", - "serde-value", "serde_json", ] [[package]] name = "kube" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a4eb20010536b48abe97fec37d23d43069bcbe9686adcf9932202327bc5ca6e" +checksum = "c73b082f549411623a4f8949bd24dcaedacb1511379c461c76d579fde301d021" dependencies = [ "k8s-openapi", "kube-client", @@ -1729,33 +1775,33 @@ dependencies = [ [[package]] name = "kube-client" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc2ed952042df20d15ac2fe9614d0ec14b6118eab89633985d4b36e688dccf1" +checksum = "ae56b223bca490db1f1b115bfc606d411177511d7748d8cc019a7e3b2935430b" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bytes", - "chrono", "either", "futures", - "home", "http", "http-body", "http-body-util", "hyper", - "hyper-http-proxy", "hyper-rustls", "hyper-timeout", "hyper-util", + "jiff", "jsonpath-rust", "k8s-openapi", "kube-core", - "pem 3.0.6", + "pem 4.0.0", + "percent-encoding", "rustls", + "rustls-platform-verifier", "secrecy", "serde", + "serde-saphyr", "serde_json", - "serde_yaml", "thiserror", "tokio", "tokio-util", @@ -1766,13 +1812,14 @@ dependencies = [ [[package]] name = "kube-core" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff0d0793db58e70ca6d689489183816cb3aa481673e7433dc618cf7e8007c675" +checksum = "6de84b47fc1aa35ba0ef9059ef54b47c8b47f0979afd15487e525282f2d73fb9" dependencies = [ - "chrono", + "derive_more", "form_urlencoded", "http", + "jiff", "json-patch", "k8s-openapi", "schemars", @@ -1784,32 +1831,31 @@ dependencies = [ [[package]] name = "kube-derive" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c562f58dc9f7ca5feac8a6ee5850ca221edd6f04ce0dd2ee873202a88cd494c9" +checksum = "de1fb46ac34371491ac0277c13e0e1bb9288000e64c86ca3d91343754818e64e" dependencies = [ "darling", "proc-macro2", "quote", "serde", "serde_json", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] name = "kube-runtime" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f34cfab9b4bd8633062e0e85edb81df23cb09f159f2e31c60b069ae826ffdc" +checksum = "9dea60005024b6ec1819c426209aa29b9eaca64f6b3988ab73c55f43fa484392" dependencies = [ "ahash", "async-broadcast", "async-stream", - "async-trait", "backon", "educe", "futures", - "hashbrown 0.15.5", + "hashbrown 0.16.1", "hostname", "json-patch", "k8s-openapi", @@ -1970,6 +2016,12 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + [[package]] name = "nix" version = "0.29.0" @@ -1982,6 +2034,12 @@ dependencies = [ "libc", ] +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + [[package]] name = "nom" version = "7.1.3" @@ -2111,7 +2169,7 @@ dependencies = [ [[package]] name = "openshell-core" version = "0.0.0" -source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.9#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.10#152c59d3178039e3fbb4a5595f9fff7216a6be92" dependencies = [ "async-trait", "base64 0.22.1", @@ -2123,6 +2181,7 @@ dependencies = [ "openshell-crypto", "openshell-extension-core", "openshell-policy-schema", + "openshell-spiffe", "prost", "prost-types", "protoc-bin-vendored", @@ -2146,7 +2205,7 @@ dependencies = [ [[package]] name = "openshell-crypto" version = "0.0.0" -source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.9#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.10#152c59d3178039e3fbb4a5595f9fff7216a6be92" dependencies = [ "aws-lc-rs", "jsonwebtoken", @@ -2164,7 +2223,7 @@ dependencies = [ [[package]] name = "openshell-extension-core" version = "0.0.0" -source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.9#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.10#152c59d3178039e3fbb4a5595f9fff7216a6be92" dependencies = [ "hyper-util", "serde", @@ -2177,12 +2236,13 @@ dependencies = [ [[package]] name = "openshell-policy" version = "0.0.0" -source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.9#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.10#152c59d3178039e3fbb4a5595f9fff7216a6be92" dependencies = [ "hickory-proto", "miette", "openshell-core", "openshell-policy-schema", + "prost", "prost-types", "serde", "serde_json", @@ -2191,7 +2251,7 @@ dependencies = [ [[package]] name = "openshell-policy-schema" version = "0.0.0" -source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.9#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.10#152c59d3178039e3fbb4a5595f9fff7216a6be92" dependencies = [ "miette", "noyalib", @@ -2201,6 +2261,18 @@ dependencies = [ "thiserror", ] +[[package]] +name = "openshell-spiffe" +version = "0.0.0" +source = "git+https://github.com/ai-openshell/openshell?tag=v0.1.10#152c59d3178039e3fbb4a5595f9fff7216a6be92" +dependencies = [ + "async-trait", + "base64 0.22.1", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "openssl-probe" version = "0.2.2" @@ -2379,6 +2451,15 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" +dependencies = [ + "portable-atomic", +] + [[package]] name = "potential_utf" version = "0.1.6" @@ -2632,6 +2713,26 @@ dependencies = [ "bitflags", ] +[[package]] +name = "ref-cast" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + [[package]] name = "regex" version = "1.13.1" @@ -2754,6 +2855,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" + [[package]] name = "rustls-webpki" version = "0.103.16" @@ -2772,12 +2900,6 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - [[package]] name = "same-file" version = "1.0.6" @@ -2798,11 +2920,12 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.22" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e" dependencies = [ "dyn-clone", + "ref-cast", "schemars_derive", "serde", "serde_json", @@ -2810,14 +2933,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.22" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +checksum = "e1c3a92094fa7d61aa124645844facb6b554dfc797136d0f5fd1f890e2bffc69" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -2874,6 +2997,23 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-saphyr" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "969cde0349344dbbf58b5f9badbfb8f806db13969364eb8007c057ef687007d9" +dependencies = [ + "annotate-snippets", + "base64 0.23.1", + "encoding_rs_io", + "granit-parser", + "nohash-hasher", + "num-traits", + "serde_core", + "smallvec", + "zmij", +] + [[package]] name = "serde-value" version = "0.7.0" @@ -2906,13 +3046,13 @@ dependencies = [ [[package]] name = "serde_derive_internals" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -2950,30 +3090,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - -[[package]] -name = "sha1" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "digest 0.10.7", -] - [[package]] name = "sha1" version = "0.11.0" @@ -3200,7 +3316,7 @@ dependencies = [ "log", "percent-encoding", "serde", - "sha1 0.11.0", + "sha1", "sha2 0.11.1", "sqlx-core", "thiserror", @@ -3693,9 +3809,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.11" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +checksum = "08a05a66a4fdd61cbbe0a1d755ffe0ca6aba159dd4820936a0ff8a8278245b9c" dependencies = [ "base64 0.22.1", "bitflags", @@ -3703,7 +3819,9 @@ dependencies = [ "http", "http-body", "mime", + "percent-encoding", "pin-project-lite", + "tower", "tower-layer", "tower-service", "tracing", @@ -3886,12 +4004,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.7.1" @@ -4038,6 +4150,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "webpki-root-certs" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "293198dcebfb821155b5092ab94b5a82ff180eddd7241df3bd6e66a4ffd1a585" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "1.0.11" diff --git a/Cargo.toml b/Cargo.toml index 35a3e81..2df49a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,10 @@ repository = "https://github.com/ilanh/openshell-annotate" authors = ["Ilan Harel"] [dependencies] -# Pinned to the OpenShell v0.1.9 tag; Cargo.lock records the exact commit. -openshell-policy-schema = { git = "https://github.com/ai-openshell/openshell", tag = "v0.1.9" } +# Pinned to the OpenShell v0.1.10 tag; Cargo.lock records the exact commit. +openshell-policy-schema = { git = "https://github.com/ai-openshell/openshell", tag = "v0.1.10" } # Same tag. Schema parsing accepts policies the gateway later rejects; this crate is that validator. -openshell-policy = { git = "https://github.com/ai-openshell/openshell", tag = "v0.1.9" } +openshell-policy = { git = "https://github.com/ai-openshell/openshell", tag = "v0.1.10" } anyhow = "1" clap = { version = "4", features = ["derive"] } ignore = "0.4" diff --git a/Dockerfile b/Dockerfile index b717113..d024472 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1.7 # Build: scripts/docker-build.sh (or: docker build -t openshell-annotate:dev .) # -# `openshell-policy-schema` is a git dependency on https://github.com/ai-openshell/openshell (tag v0.1.9, commit pinned +# `openshell-policy-schema` is a git dependency on https://github.com/ai-openshell/openshell (tag v0.1.10, commit pinned # in Cargo.lock), fetched by cargo during the build, so no local OpenShell checkout is needed. FROM rust:1.94-bookworm AS build WORKDIR /build diff --git a/README.md b/README.md index be6867e..aa9fbf2 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ un-annotated calls, and gates CI on drift. > **Independent community project.** openshell-annotate is not affiliated with, endorsed by, or sponsored by > NVIDIA. It uses NVIDIA OpenShell's public policy schema crate (Apache-2.0) to validate what it generates. -Early pre-release **v0.1.0-rc.3** (targets OpenShell policy schema v1, `openshell-policy-schema` @ v0.1.9). +Early pre-release **v0.1.0-rc.3** (targets OpenShell policy schema v1, `openshell-policy-schema` @ v0.1.10). Licensed under Apache-2.0. ## Try it in two minutes @@ -136,7 +136,7 @@ stderr. Exit codes and `--deny-warnings` do not depend on the format. ### Files the image keeps outside OpenShell's baseline (`generate --image`) -OpenShell 0.1.9 only lets the sandbox read `/usr /lib /etc /app /var/log /proc /dev/urandom` (plus the workspace when +OpenShell 0.1.10 only lets the sandbox read `/usr /lib /etc /app /var/log /proc /dev/urandom` (plus the workspace when `include_workdir` is on) once a `filesystem_policy` exists, and it does not log filesystem denials ([ai-openshell/openshell#4270](https://github.com/ai-openshell/openshell/issues/4270)), so an application under `/opt/` fails with a bare `EACCES`. `generate --image IMAGE` inspects the image (docker, then podman: WORKDIR, ENTRYPOINT, CMD, and the directory @@ -361,12 +361,32 @@ the rule; a profile bound to other binaries (the bundled `github` profile is for `allowed_ips`. Middleware selectors (`network_middlewares.*.endpoints`) can no longer include a port (ai-openshell/openshell#4359); annotate does not generate middlewares, but `lint --policy`, `drift` and `generate` run the gateway validator on committed policies and report it. +- OpenShell v0.1.10 changes: `lint --policy`, `drift` and `generate` run the same offline checks as the new + `openshell policy lint` (ai-openshell/openshell#5358): the gateway validator plus endpoint ambiguity, reserved + `_provider_` rule keys, credential-binding structure and the encoded size limit (not the configuration of built-in + `openshell/*` middlewares, which annotate does not generate). A request is now authorized only by endpoints that use + the protocol of the route it matched (ai-openshell/openshell#5274), and endpoints that match the same requests with + different protocols are rejected; directive endpoints carry no path selector, so two rules on one host and port with + different `protocol=` fail `generate`: use one protocol per host and port. `endpoint_settings` is a Cedar-only + section (ai-openshell/openshell#5006): a YAML policy file that contains it is rejected. A host in the NAT64 prefix + `64:ff9b::/96` is checked as the IPv4 address it embeds (ai-openshell/openshell#5793), so lint warns about it. Policy + DNS can answer AAAA queries (`policy_dns_ipv6_egress` is a driver setting, not a policy key). Network and HTTP OCSF + events name the real process (`pid`, `created_time`, parent `pid`) instead of pid 0 (ai-openshell/openshell#5251); + `diff-logs` reads only the binary path, so nothing changes. Provider profiles accept `auth_style: path_subtree` + (ai-openshell/openshell#5675), mentioned in `--scaffold-profiles` output. +- Known upstream issue in OpenShell v0.1.10: on Kubernetes nodes with a kernel older than 6.4 (for example RHEL 9 / + RHCOS 9.6, kernel 5.14) every outbound connection from a sandbox fails with `EIO`, allowed or denied, and no `NET:*` + event is logged (ai-openshell/openshell#6069). `diff-logs` then has nothing to read, and the sandbox flow cannot + exercise egress there. The report covers the Kubernetes driver; the same node worked with earlier releases, so keep + such clusters on v0.1.9 until upstream fixes it. - Filesystem/process/landlock are startup-only in OpenShell; drift labels them `startup`. -- `diff-logs` only sees network and L7 events: OpenShell 0.1.9 does not log Landlock/filesystem denials (upstream #4270), log +- `diff-logs` only sees network and L7 events: OpenShell 0.1.10 does not log Landlock/filesystem denials (upstream #4270), log delivery is batched and best-effort (wait a few seconds after the workload; absence of an event is not proof), and `NET:REFUSE` lines carry no binary. A helper spawned by an allowed binary (git -> git-remote-http) is matched through its parent. - Semantic checks mirror `openshell-policy::validate_sandbox_policy` (documented rules) but the authoritative - validation is the gateway (`openshell sandbox create --policy`) and, soon, `openshell policy lint` (#4035). + validation is the gateway (`openshell sandbox create --policy`). Since OpenShell v0.1.10, `openshell policy lint + policy.yaml` checks a file offline with the CLI's own rules; run it on generated policies too when the `openshell` + CLI is installed. ## Develop diff --git a/ROADMAP.md b/ROADMAP.md index e8a6fbd..7a9cc89 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -18,7 +18,7 @@ Order matters: each milestone builds on the previous one. Nothing is published ( ## 2. Docker image (publish) - **Scope:** small runtime image with the binary (tree-sitter grammars compiled in; distroless/cc base, 34.9 MB), entrypoint `openshell-annotate`, workdir `/src`. - **Deliverables:** multi-stage `Dockerfile`, `scripts/docker-build.sh` (local tag `openshell-annotate:dev`, no OpenShell checkout needed), then, after approval, a publish workflow to a registry (ghcr.io) with version tags. -- **Depends on:** a public home for the repo (the `openshell-policy-schema` dependency now resolves from the public OpenShell repo at tag v0.1.9, so the build is portable). Publishing to a registry needs the maintainer's approval. +- **Depends on:** a public home for the repo (the `openshell-policy-schema` dependency now resolves from the public OpenShell repo at tag v0.1.10, so the build is portable). Publishing to a registry needs the maintainer's approval. ## 3. GitHub Action + GitLab CI template - **Scope:** run `lint --deny-warnings` and `drift --policy openshell/policy.yaml` on every pull/merge request; fail with annotations. diff --git a/deny.toml b/deny.toml index 5f12bc2..ee80388 100644 --- a/deny.toml +++ b/deny.toml @@ -12,7 +12,8 @@ unmaintained = "all" # No ignores. RUSTSEC-2026-0459 (libsqlite3-sys 0.37.0, #76), which .cargo/audit.toml ignores, is not reported here: # cargo-deny checks the resolved build graph, and libsqlite3-sys (OpenShell openshell-crypto -> sqlx -> sqlx-sqlite) is # only in Cargo.lock, not in any build of this crate (`cargo tree -i libsqlite3-sys --target all` prints nothing). -# cargo audit reads the whole lockfile, which is why it still needs its ignore. Add an entry here only with a reason. +# cargo audit reads the whole lockfile, which is why it still needs its ignore. The same goes for RUSTSEC-2026-0600 +# (kube-client 5.0.0 through OpenShell openshell-crypto, #114). Add an entry here only with a reason. ignore = [] [licenses] diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md index 727b65b..87f22b9 100644 --- a/docs/DEVELOPING.md +++ b/docs/DEVELOPING.md @@ -8,10 +8,10 @@ build that downloads crates takes longer. | Needed for | What | |---|---| -| everything | Git, a C compiler (`build-essential` / Xcode command line tools: the tree-sitter grammars are C), network access to crates.io and github.com (the OpenShell schema crate is a git dependency pinned to the `v0.1.9` tag) | +| everything | Git, a C compiler (`build-essential` / Xcode command line tools: the tree-sitter grammars are C), network access to crates.io and github.com (the OpenShell schema crate is a git dependency pinned to the `v0.1.10` tag) | | build and test | Rust **1.94** or newer through [rustup](https://rustup.rs). CI pins 1.94 | | Docker image (optional) | Docker with BuildKit | -| sandbox flow (optional) | the `openshell` CLI and `openshell-prover` at 0.1.9, a running OpenShell gateway, and Docker (see section 7) | +| sandbox flow (optional) | the `openshell` CLI and `openshell-prover` at 0.1.10, a running OpenShell gateway, and Docker (see section 7) | ``` rustup toolchain install 1.94 --profile minimal --component rustfmt,clippy @@ -122,7 +122,7 @@ sorts after its own prereleases (`latest`, `latest-stable`, `list`, `pinned`, `n ### Tracking the next OpenShell release (`openshell-next`) `openshell-next` is the one long-lived branch besides `main`. It is `main` plus the OpenShell pin moved to the newest -upstream tag, prereleases included (for example `v0.1.10-pre.3` while `main` is on `v0.1.9`), plus any fix that only +upstream tag, prereleases included (for example `v0.1.11-pre.2` while `main` is on `v0.1.10`), plus any fix that only makes sense on that version. It exists so the next OpenShell is integrated, and its breakage fixed, before it ships as stable. A draft pull request `openshell-next` → `main` and an issue labelled `openshell-next` track it; the issue gets a comment for every new upstream tag. @@ -227,7 +227,7 @@ openshell-annotate diff-logs path/to/sandbox.log --write # inserts directives a # otherwise writes openshell/observed-egress.sh (scanned like any source: review or delete it) ``` -Sample logs for both formats are in `tests/fixtures/logs/`. Filesystem denials are not logged by OpenShell 0.1.9, so +Sample logs for both formats are in `tests/fixtures/logs/`. Filesystem denials are not logged by OpenShell 0.1.10, so `diff-logs` only sees network and L7 events. It reads no sandbox attribution fields, so OpenShell v0.1.8 moving `container.uid`/`container.name` to `device.container.*` (ai-openshell/openshell#5048) needs no change; the OCSF fixture is real v0.1.7 output. @@ -236,6 +236,16 @@ is real v0.1.7 output. skipped, so OpenShell v0.1.9 reporting write-method authorization denials as Create/Update/Delete instead of Other (`type_uid` 600399, ai-openshell/openshell#5606) needs no change; a unit test covers both shapes. +OpenShell v0.1.10 names the real process on network and HTTP records (`actor.process.pid`, `created_time` and +`parent_process.pid`, ai-openshell/openshell#5251) instead of pid 0, and gateway audit records list the resources a +change touched, with `resources[].data` (ai-openshell/openshell#5612). `diff-logs` takes the binary from +`actor.process.file.path` or `actor.process.name` only (never the parent) and skips class 6003, so neither needs a +change; `tests/fixtures/logs/ocsf-0.1.10.jsonl` (hand-written in the v0.1.10 shape) and a unit test cover both. The +Chrono-to-Jiff timestamp change (ai-openshell/openshell#5763) and the `ForwardTcp` OCSF event +(ai-openshell/openshell#5944) are not in v0.1.10. On Kubernetes nodes with a kernel older than 6.4, v0.1.10 sandboxes +cannot open outbound connections at all and log no `NET:*` events (ai-openshell/openshell#6069, open), so a sandbox +flow there produces no logs for `diff-logs`. + ## 6. Docker image ``` @@ -259,7 +269,7 @@ scripts/flow.sh /path/to/project --diff-logs sandbox.log # + diff-logs scripts/flow.sh /path/to/project --image my-image:tag --run-seconds 30 --exercise exercise.js -- sleep 600 ``` -It needs `openshell` and `openshell-prover` 0.1.9 on PATH and a connected gateway (`openshell status` shows `Connected`), and +It needs `openshell` and `openshell-prover` 0.1.10 on PATH and a connected gateway (`openshell status` shows `Connected`), and `OPENSHELL_ANNOTATE=/path/to/binary` if the binary is not on PATH. The image's interpreter paths must be real executables (not symlinks) and match `[languages]` in `openshell-annotate.toml`, because OpenShell matches the resolved binary path. A bare `sleep` workload produces no traffic and so no events: drive the sandbox with `--exercise FILE.js` (run with `node -e`), @@ -305,4 +315,4 @@ public repo or a paid plan). `.github/rulesets/protect-openshell-next.json` bloc | `docs are stale` | run `scripts/gen-docs.sh` and commit `docs/` | | `docs/GITHUB_ACTIONS.md is out of date with actions/*/action.yml` | run `scripts/gen-actions-docs.sh` and commit it; add a `BEGIN/END actions-docs ` section for a new action | | sandbox probes get `403` from `api.github.com` | unauthenticated GitHub API rate limit (60 requests per hour per IP), not a policy decision; wait for the reset or use another host | -| `openshell-prover: not found` in `flow.sh` | install the OpenShell 0.1.9 tools; the static commands (`scan`, `generate`, `lint`, `drift`, `diff-logs`) do not need them | +| `openshell-prover: not found` in `flow.sh` | install the OpenShell 0.1.10 tools; the static commands (`scan`, `generate`, `lint`, `drift`, `diff-logs`) do not need them | diff --git a/examples/polyglot/openshell/policy.yaml b/examples/polyglot/openshell/policy.yaml index 493d836..b33746b 100644 --- a/examples/polyglot/openshell/policy.yaml +++ b/examples/polyglot/openshell/policy.yaml @@ -1,5 +1,5 @@ # Generated by openshell-annotate @VERSION@ - DO NOT EDIT. Change the @openshell directives in source and regenerate. -# Validated against openshell-policy-schema and the OpenShell v0.1.9 gateway validator. Each entry's comment gives the reason and source file:line. +# Validated against openshell-policy-schema and the OpenShell v0.1.10 gateway validator. Each entry's comment gives the reason and source file:line. # Startup-only sections (filesystem_policy, landlock, process) need a sandbox recreate to change; network_policies are live. version: 1 filesystem_policy: diff --git a/src/diff_logs.rs b/src/diff_logs.rs index 4a15918..9484820 100644 --- a/src/diff_logs.rs +++ b/src/diff_logs.rs @@ -3,7 +3,7 @@ //! directives that never matched an event are reported as stale. //! //! Delivery of these logs is best-effort: *absence of a deny or an allow is not proof*. Filesystem denials are not logged by -//! OpenShell 0.1.9 (upstream #4270), so only network and L7 HTTP events are handled. +//! OpenShell 0.1.10 (upstream #4270), so only network and L7 HTTP events are handled. use crate::config::Config; use crate::directive::{Directive, Kind}; @@ -876,7 +876,7 @@ pub fn render_text(rep: &Report) -> String { "diff-logs: {} event(s) ({} denied, {} allowed); {} suggestion(s), {} stale directive(s)\n", rep.events, rep.denied, rep.allowed, rep.suggestions.len(), rep.stale.len() ); - s.push_str("note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.9 (#4270).\n"); + s.push_str("note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.10 (#4270).\n"); for g in &rep.suggestions { let up = g.kind.to_ascii_uppercase(); s.push_str(&format!( @@ -1003,6 +1003,26 @@ garbage line\n"; assert_eq!(e[0].host, "pypi.org"); } + #[test] + fn process_instance_fields_do_not_change_the_binary() { + // OpenShell v0.1.10 (ai-openshell/openshell#5251): real pid, start time and parent pid on the actor. + let t = concat!( + "{\"class_uid\":4001,\"activity_id\":1,\"action_id\":2,\"dst_endpoint\":{\"domain\":\"pypi.org\",\"port\":443},", + "\"actor\":{\"process\":{\"name\":\"/usr/bin/curl\",\"pid\":57,\"created_time\":1795000000101,", + "\"parent_process\":{\"name\":\"/usr/bin/bash\",\"pid\":42}}}}\n", + // no identified binary: `from_bypass` names it `-`, which is not a path + "{\"class_uid\":4001,\"activity_id\":1,\"action_id\":2,\"dst_endpoint\":{\"domain\":\"pypi.org\",\"port\":443},", + "\"actor\":{\"process\":{\"name\":\"-\",\"pid\":0,\"parent_process\":{\"name\":\"/usr/bin/bash\",\"pid\":42}}}}\n", + // gateway audit record naming the resources it changed (#5612): skipped like every class 6003 record + "{\"class_uid\":6003,\"activity_id\":3,\"type_uid\":600303,\"action\":\"Allowed\",\"dst_endpoint\":{\"domain\":\"gw\",\"port\":8080},", + "\"resources\":[{\"name\":\"log_level\",\"type\":\"setting\",\"data\":{\"value\":\"debug\"}}]}\n", + ); + let ev = parse_logs(t, "x"); + assert_eq!(ev.len(), 2); + assert_eq!(ev[0].binary.as_deref(), Some("/usr/bin/curl")); + assert_eq!(ev[1].binary, None); + } + #[test] fn sandbox_attribution_location_does_not_matter() { // OpenShell v0.1.8 (ai-openshell/openshell#5048) moved supervisor sandbox attribution from top-level `container.*` diff --git a/src/generate.rs b/src/generate.rs index 0cd973e..51fb6f7 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -652,7 +652,7 @@ pub fn generate( // Emit let mut y = String::new(); y.push_str(&format!("# Generated by {TOOL} - DO NOT EDIT. Change the @openshell directives in source and regenerate.\n")); - y.push_str("# Validated against openshell-policy-schema and the OpenShell v0.1.9 gateway validator. Each entry's comment gives the reason and source file:line.\n"); + y.push_str("# Validated against openshell-policy-schema and the OpenShell v0.1.10 gateway validator. Each entry's comment gives the reason and source file:line.\n"); y.push_str("# Startup-only sections (filesystem_policy, landlock, process) need a sandbox recreate to change; network_policies are live.\n"); y.push_str("version: 1\n"); if !fs_read.is_empty() || !fs_write.is_empty() { diff --git a/src/image.rs b/src/image.rs index 2520bab..8d288ba 100644 --- a/src/image.rs +++ b/src/image.rs @@ -1,8 +1,8 @@ //! `generate --image IMAGE`: propose `fs read` directives for application paths in a container image. //! //! The OpenShell supervisor only grants read access to a fixed baseline (`/usr /lib /etc /app /var/log /proc -//! /dev/urandom`, plus `/tmp` and `/dev/null` for writing, verified in v0.1.7 to v0.1.9 `PROXY_BASELINE_*`). An app that lives -//! elsewhere (`/opt/context7`) fails at startup with EACCES, and OpenShell 0.1.9 does not log filesystem denials +//! /dev/urandom`, plus `/tmp` and `/dev/null` for writing, verified in v0.1.7 to v0.1.10 `PROXY_BASELINE_*`). An app that lives +//! elsewhere (`/opt/context7`) fails at startup with EACCES, and OpenShell 0.1.10 does not log filesystem denials //! (upstream #4270), so neither the logs nor `diff-logs` can point at it. The image says where the app lives: its //! WORKDIR, ENTRYPOINT and CMD. @@ -260,7 +260,7 @@ pub fn add_dirs(props: &mut Vec, dirs: Vec, declared: &[String /// Renders the stderr note listing the proposals and the `@openshell fs read` lines to add for them. pub fn render_note(image: &str, props: &[Proposal]) -> String { let mut s = format!( - "note: image {image} keeps files outside OpenShell's baseline read set ({}); the sandbox cannot read them, and OpenShell 0.1.9 does not log that denial (#4270):\n", + "note: image {image} keeps files outside OpenShell's baseline read set ({}); the sandbox cannot read them, and OpenShell 0.1.10 does not log that denial (#4270):\n", ["/usr", "/lib", "/etc", "/app", "/var/log", "/proc", "/dev/urandom"].join(" ") ); for p in props { diff --git a/src/lint.rs b/src/lint.rs index 4895c05..49a4c6a 100644 --- a/src/lint.rs +++ b/src/lint.rs @@ -523,6 +523,7 @@ pub fn lint(scan: &Scan, cfg: &Config) -> Vec { if let Kind::Egress { host, .. } = &d.kind { for m in [ validate::host_warning(host), + validate::nat64_warning(host), validate::wildcard_private_ip_warning(host), ] .into_iter() diff --git a/src/render.rs b/src/render.rs index ef5a7e4..239df54 100644 --- a/src/render.rs +++ b/src/render.rs @@ -662,7 +662,7 @@ pub fn diff_logs_human( } out.push_str(&style.paint( "2", - "note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.9 (#4270).\n", + "note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.10 (#4270).\n", )); out } diff --git a/src/scaffold.rs b/src/scaffold.rs index 13c8e4f..3aaa682 100644 --- a/src/scaffold.rs +++ b/src/scaffold.rs @@ -103,7 +103,8 @@ pub fn scaffold(unmapped: &[Unmapped], dirs: &[Directive], cfg: &Config) -> Vec< y.push_str(" # TODO: how does the API take this credential? bearer (authorization header) is the common case.\n"); y.push_str(" # OpenShell v0.1.8+ substitutes it only where declared: another header needs `auth_style: header` and its\n"); y.push_str(" # `header_name` (e.g. x-api-key), a query parameter `auth_style: query` + `query_param`, a URL path slot\n"); - y.push_str(" # `auth_style: path` + `path_template` (with {credential}).\n"); + y.push_str(" # `auth_style: path` + `path_template` (with {credential}; the whole path must match), or since OpenShell\n"); + y.push_str(" # v0.1.10 `auth_style: path_subtree` + the base path (e.g. /bot{credential}) for every path below it.\n"); y.push_str(" auth_style: bearer\n"); y.push_str(" header_name: authorization\n"); y.push_str("discovery:\n"); diff --git a/src/validate.rs b/src/validate.rs index 487c0d8..410226f 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -1,8 +1,9 @@ //! Validation that mirrors OpenShell's authored-policy rules. //! //! Authoritative checks live in `openshell-policy-schema` (parsing, unknown fields) and in -//! [`gateway_violations`], which calls `openshell_policy::validate_and_canonicalize_sandbox_policy` -//! (OpenShell v0.1.9, the same tag as the schema crate). This module also re-implements the +//! [`gateway_violations`], which runs the same offline checks as `openshell policy lint` +//! (`openshell_policy::find_endpoint_ambiguities` and `validate_and_canonicalize_authored_policy`, +//! OpenShell v0.1.10, the same tag as the schema crate). This module also re-implements the //! file-level semantic rules documented in `docs/how-it-works/policies/schema.mdx` so errors carry //! directive locations. `generate` round-trips its output through `parse_policy` and the gateway //! validator. @@ -79,6 +80,21 @@ pub fn host_warning(host: &str) -> Option { Some(format!("`{host}` is an IPv4-mapped IPv6 address; OpenShell v0.1.8+ evaluates these destinations as IPv4, so the rule never matches: use `{v4}`")) } +/// Returns a warning when `host` is an address in the NAT64 well-known prefix `64:ff9b::/96`, such as `64:ff9b::a00:5`. +/// +/// Since OpenShell v0.1.10 (ai-openshell/openshell#5793) the SSRF checks classify such an address as the IPv4 address it +/// embeds (`10.0.0.5`): loopback, link-local and metadata addresses stay blocked, and a private one needs an explicit +/// grant like the IPv4 literal. Network-specific NAT64 prefixes are only known at runtime and are not checked here. +pub fn nat64_warning(host: &str) -> Option { + let h = host.trim_matches(|c| c == '[' || c == ']'); + let o = h.parse::().ok()?.octets(); + if o[..12] != [0, 0x64, 0xff, 0x9b, 0, 0, 0, 0, 0, 0, 0, 0] { + return None; + } + let v4 = std::net::Ipv4Addr::new(o[12], o[13], o[14], o[15]); + Some(format!("`{host}` is in the NAT64 prefix 64:ff9b::/96; OpenShell v0.1.10+ checks it as the IPv4 address it embeds (`{v4}`): loopback, link-local and metadata addresses stay blocked and private ones need their own grant, so prefer `{v4}` (or its host name)")) +} + /// Private and special-use IPv4 ranges a wildcard endpoint no longer admits as IP literals since OpenShell v0.1.9 /// (ai-openshell/openshell#5522): RFC 1918, CGNAT, IETF protocol assignments, the three TEST-NETs, benchmarking and /// broadcast. Loopback, link-local and unspecified are always blocked and rejected by [`check_host`] already. @@ -453,11 +469,8 @@ pub fn check_document(doc: &PolicyDocument) -> (Vec, Vec) { } } for (key, rule) in &doc.network_policies { - if key.starts_with("_provider_") { - errs.push(format!( - "network_policies.{key}: rule keys starting with `_provider_` are reserved" - )); - } + // Rule keys starting with `_provider_` are reported by `gateway_violations` + // (`validate_and_canonicalize_authored_policy`, OpenShell v0.1.10). if rule.binaries.is_empty() { warns.push(format!("network_policies.{key}: empty `binaries` matches no executable, so the rule allows nothing")); } @@ -470,7 +483,10 @@ pub fn check_document(doc: &PolicyDocument) -> (Vec, Vec) { if let Err(m) = check_host(&ep.host) { errs.push(format!("{at}: {m}")); } - if let Some(m) = host_warning(&ep.host) { + for m in [host_warning(&ep.host), nat64_warning(&ep.host)] + .into_iter() + .flatten() + { warns.push(format!("{at}: {m}")); } if ep.allowed_ips.is_empty() { @@ -521,21 +537,32 @@ pub fn miette_str(e: &miette::Report) -> String { .join(": ") } -/// Runs the OpenShell gateway validator on an authored policy. +/// Runs OpenShell's offline checks for an authored policy file, the ones `openshell policy lint` runs (OpenShell v0.1.10, +/// ai-openshell/openshell#5358). /// -/// `Ok(empty)` means `validate_and_canonicalize_sandbox_policy` accepted it. `Ok(messages)` are -/// the violation strings (the same text the gateway reports). `Err` is a parse or conversion -/// failure. +/// That is `parse_sandbox_policy` (which rejects `endpoint_settings`, a Cedar-only section, in a YAML policy file), +/// `find_endpoint_ambiguities` (endpoints that can match the same request but disagree on connection or parsing +/// metadata, such as `protocol`) and `validate_and_canonicalize_authored_policy` (the gateway validator plus reserved +/// `_provider_` rule keys, credential-binding structure and the encoded size limit). `openshell policy lint` also checks +/// the configuration of built-in `openshell/*` middlewares, which needs the supervisor's middleware crate; annotate +/// does not generate middlewares and leaves that to the gateway. +/// +/// `Ok(empty)` means the policy passed. `Ok(messages)` are the violation strings (the same text OpenShell reports). +/// `Err` is a parse or conversion failure. /// /// # Errors /// /// Returns the parse error when the YAML is not a sandbox policy the gateway can load. pub fn gateway_violations(yaml: &str) -> Result, String> { let policy = openshell_policy::parse_sandbox_policy(yaml).map_err(|e| miette_str(&e))?; - match openshell_policy::validate_and_canonicalize_sandbox_policy(policy) { - Ok(_) => Ok(Vec::new()), - Err(e) => Ok(e.violations().iter().map(ToString::to_string).collect()), + let mut out: Vec = openshell_policy::find_endpoint_ambiguities(&policy) + .iter() + .map(ToString::to_string) + .collect(); + if let Err(violations) = openshell_policy::validate_and_canonicalize_authored_policy(policy) { + out.extend(violations); } + Ok(out) } #[cfg(test)] @@ -569,6 +596,76 @@ mod tests { assert!(host_warning("api.example.com").is_none()); } + #[test] + fn nat64_hosts_warn() { + assert!(nat64_warning("64:ff9b::a00:5") + .unwrap() + .contains("embeds (`10.0.0.5`)")); + assert!(nat64_warning("[64:ff9b::7f00:1]") + .unwrap() + .contains("`127.0.0.1`")); + assert!(nat64_warning("64:ff9b::cb00:7107").is_some()); + assert!(nat64_warning("64:ff9b:1::a00:5").is_none()); + assert!(nat64_warning("2001:db8::1").is_none()); + assert!(nat64_warning("10.0.0.5").is_none()); + assert!(nat64_warning("api.example.com").is_none()); + } + + /// OpenShell v0.1.10 (ai-openshell/openshell#5006): `endpoint_settings` is a Cedar-only section. The schema crate + /// parses it (and rejects unknown keys inside it), but a YAML policy file is rejected. + #[test] + fn endpoint_settings_rejected_in_policy_files() { + let base = "version: 1\nnetwork_policies:\n api:\n endpoints:\n - { host: api.example.com, port: 443 }\n binaries:\n - { path: /usr/bin/curl }\n"; + let with = format!( + "{base}endpoint_settings:\n - {{ host: api.example.com, port: 443, tls: skip }}\n" + ); + assert!(openshell_policy_schema::parse_policy(&with).is_ok()); + let e = gateway_violations(&with).unwrap_err(); + assert!( + e.contains("endpoint_settings is not an authored policy section"), + "{e}" + ); + assert_eq!(gateway_violations(base).unwrap(), Vec::::new()); + let unknown = format!( + "{base}endpoint_settings:\n - {{ host: api.example.com, port: 443, bogus: 1 }}\n" + ); + assert!(openshell_policy_schema::parse_policy(&unknown).is_err()); + assert!(gateway_violations(&unknown).is_err()); + } + + /// OpenShell v0.1.10 (ai-openshell/openshell#5274) authorizes a request only with endpoints using the protocol of + /// the selected route, and `openshell policy lint` (#5358) reports endpoints that match the same request with + /// different protocols. Same-protocol overlaps still combine. + #[test] + fn gateway_violations_report_protocol_ambiguity() { + let policy = |second: &str| { + format!("version: 1\nnetwork_policies:\n api:\n endpoints:\n - {{ host: api.example.com, port: 443, protocol: rest, access: read-only }}\n binaries:\n - {{ path: /usr/bin/python3 }}\n rpc:\n endpoints:\n - {{ host: api.example.com, port: 443, {second} }}\n binaries:\n - {{ path: /usr/bin/python3 }}\n") + }; + let vs = gateway_violations(&policy( + "protocol: json-rpc, rules: [{ allow: { method: \"*\" } }]", + )) + .unwrap(); + assert!( + vs.iter() + .any(|v| v.contains("conflicting metadata") && v.contains("json-rpc")), + "{vs:?}" + ); + assert_eq!( + gateway_violations(&policy("protocol: rest, access: read-write")).unwrap(), + Vec::::new() + ); + } + + #[test] + fn gateway_violations_report_reserved_provider_keys() { + let vs = gateway_violations("version: 1\nnetwork_policies:\n _provider_x:\n endpoints:\n - { host: api.example.com, port: 443 }\n binaries:\n - { path: /usr/bin/curl }\n").unwrap(); + assert!( + vs.iter() + .any(|v| v.contains("reserved '_provider_' prefix")), + "{vs:?}" + ); + } + #[test] fn wildcard_hosts_that_match_private_ip_literals_warn() { assert!(wildcard_private_ip_warning("**.*.*") diff --git a/tests/cli.rs b/tests/cli.rs index 0d06443..82e3540 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -1048,6 +1048,48 @@ fn diff_logs_clean_when_everything_is_covered() { assert_eq!(o.status.code(), Some(1)); } +/// OpenShell v0.1.10 (ai-openshell/openshell#5251) names the real process on network and HTTP events (`pid`, +/// `created_time`, the parent's `pid`) instead of pid 0, and gateway audit records (class 6003) list the resources a +/// change touched with `resources[].data` (#5612). diff-logs keys on the binary path only and skips class 6003, so the +/// v0.1.10 shape gives the same result as the older records in `ocsf.jsonl`. +#[test] +fn diff_logs_reads_openshell_0_1_10_process_and_audit_records() { + let t = fixture(); + let (code, v) = diff_json(t.path(), "ocsf-0.1.10.jsonl"); + let (old_code, old) = diff_json(t.path(), "ocsf.jsonl"); + assert_eq!((code, v["events"].as_u64()), (old_code, Some(4))); + let k = kinds(&v); + let kind_host = |k: &[(String, String, String)]| { + let mut x: Vec<(String, String)> = + k.iter().map(|(a, b, _)| (a.clone(), b.clone())).collect(); + x.sort(); + x + }; + assert_eq!(kind_host(&k), kind_host(&kinds(&old))); + // the actor is the process itself, never its parent (the HTTP record now names it too) + assert!( + !k.iter() + .any(|(_, _, b)| b == "/usr/bin/bash" || b == "/usr/bin/sh"), + "{k:?}" + ); + assert!( + k.contains(&( + "missing_egress".into(), + "api.newvendor.io".into(), + "/usr/bin/python3.12".into() + )), + "{k:?}" + ); + assert!( + k.contains(&( + "l7_allow".into(), + "huggingface.co".into(), + "/usr/bin/python3.12".into() + )), + "{k:?}" + ); +} + #[test] fn diff_logs_write_places_directives_and_is_idempotent() { let t = fixture(); @@ -2273,6 +2315,76 @@ fn lint_policy_warns_about_ipv4_mapped_hosts() { ); } +/// OpenShell v0.1.10 (ai-openshell/openshell#5006): `endpoint_settings` belongs to Cedar policies; a YAML policy file is +/// rejected, by `lint --policy` and `drift` alike, with OpenShell's own message. +#[test] +fn endpoint_settings_in_a_policy_file_is_rejected() { + let t = tempfile::tempdir().unwrap(); + std::fs::write( + t.path().join("a.py"), + "# @openshell egress api.example.com:443 reason=\"api\" bin=/usr/bin/python3\nprint(1)\n", + ) + .unwrap(); + let o = run(t.path(), &["generate", "-o", "p.yaml"]); + assert_eq!(o.status.code(), Some(0), "{}", err(&o)); + let mut policy = std::fs::read_to_string(t.path().join("p.yaml")).unwrap(); + let o = run(t.path(), &["drift", "--policy", "p.yaml"]); + assert_eq!(o.status.code(), Some(0), "{}{}", out(&o), err(&o)); + policy.push_str("endpoint_settings:\n - { host: api.example.com, port: 443, tls: skip }\n"); + std::fs::write(t.path().join("p.yaml"), &policy).unwrap(); + let msg = "endpoint_settings is not an authored policy section"; + let o = run( + t.path(), + &["lint", "--format", "compact", "--policy", "p.yaml"], + ); + assert_eq!(o.status.code(), Some(1)); + assert!(out(&o).contains(msg), "{}{}", out(&o), err(&o)); + let o = run(t.path(), &["drift", "--policy", "p.yaml"]); + assert_eq!(o.status.code(), Some(1)); + assert!(err(&o).contains(msg), "{}{}", out(&o), err(&o)); +} + +/// OpenShell v0.1.10 (ai-openshell/openshell#5274) authorizes a request only with endpoints using the protocol of the +/// selected route, and like `openshell policy lint` (#5358) annotate rejects endpoints that match the same requests +/// with different protocols. Directive endpoints have no path selector, so two rules on one host and port tie. +#[test] +fn generate_rejects_one_host_and_port_with_two_protocols() { + let t = tempfile::tempdir().unwrap(); + std::fs::write( + t.path().join("a.py"), + concat!( + "# @openshell egress api.example.com:443 reason=\"REST reads\" protocol=rest access=read-only bin=/usr/bin/python3\n", + "# @openshell egress api.example.com:443 reason=\"JSON-RPC\" protocol=json-rpc allow=\"POST:/rpc\" rule=rpc bin=/usr/bin/python3\n", + "print(1)\n" + ), + ) + .unwrap(); + let o = run(t.path(), &["generate"]); + assert_eq!(o.status.code(), Some(1)); + assert!( + err(&o).contains("conflicting metadata") && err(&o).contains("json-rpc"), + "{}", + err(&o) + ); +} + +/// OpenShell v0.1.10 (ai-openshell/openshell#5793) checks NAT64 addresses (`64:ff9b::/96`) as the IPv4 address they +/// embed. +#[test] +fn lint_warns_about_nat64_hosts() { + let t = tempfile::tempdir().unwrap(); + std::fs::write( + t.path().join("a.js"), + "// @openshell egress [64:ff9b::a00:5]:443 reason=\"db\"\nconsole.log(1)\n", + ) + .unwrap(); + let s = out(&run(t.path(), &["lint", "--format", "compact"])); + assert!( + s.contains("is in the NAT64 prefix 64:ff9b::/96") && s.contains("`10.0.0.5`"), + "{s}" + ); +} + /// OpenShell v0.1.9 (ai-openshell/openshell#5522): a wildcard endpoint no longer allows a private IP literal on its /// own. lint warns about wildcard hosts that match private IPv4 literals, unless the policy endpoint has `allowed_ips`. #[test] diff --git a/tests/fixtures/logs/ocsf-0.1.10.jsonl b/tests/fixtures/logs/ocsf-0.1.10.jsonl new file mode 100644 index 0000000..9e1e46a --- /dev/null +++ b/tests/fixtures/logs/ocsf-0.1.10.jsonl @@ -0,0 +1,6 @@ +{"class_uid":4001,"activity_id":1,"action_id":2,"action":"Denied","status_detail":"transparent_tcp_policy_denied","dst_endpoint":{"domain":"api.newvendor.io","port":443},"actor":{"process":{"name":"/usr/bin/python3.12","pid":57,"created_time":1795000000101,"parent_process":{"name":"/usr/bin/bash","pid":42}}},"firewall_rule":{"name":"-"},"metadata":{"version":"1.8.0","product":{"name":"OpenShell Sandbox Supervisor","vendor_name":"OpenShell","version":"0.1.10"}}} +{"class_uid":4001,"activity_id":1,"action_id":2,"status_detail":"transparent_tcp_policy_denied","dst_endpoint":{"domain":"cdn.other.dev","ip":"1.2.3.4","port":8443},"actor":{"process":{"name":"/usr/local/bin/node","pid":61,"created_time":1795000000202,"parent_process":{"name":"/usr/bin/sh","pid":60}}},"metadata":{"version":"1.8.0","product":{"name":"OpenShell Sandbox Supervisor","vendor_name":"OpenShell","version":"0.1.10"}}} +{"class_uid":4002,"activity_id":6,"action":"Denied","dst_endpoint":{"domain":"huggingface.co","port":443},"http_request":{"http_method":"POST","url":{"hostname":"huggingface.co","path":"/api/upload"}},"actor":{"process":{"name":"/usr/bin/python3.12","pid":57,"created_time":1795000000101,"parent_process":{"name":"/usr/bin/bash","pid":42}}},"status_detail":"L7_REQUEST deny","metadata":{"version":"1.8.0","product":{"name":"OpenShell Sandbox Supervisor","vendor_name":"OpenShell","version":"0.1.10"}}} +{"class_uid":4001,"activity_id":1,"action":"Allowed","dst_endpoint":{"domain":"registry.npmjs.org","port":443},"actor":{"process":{"name":"/usr/local/bin/node","pid":61,"created_time":1795000000202,"parent_process":{"name":"/usr/bin/sh","pid":60}}},"metadata":{"version":"1.8.0","product":{"name":"OpenShell Sandbox Supervisor","vendor_name":"OpenShell","version":"0.1.10"}}} +{"class_uid":6003,"activity_id":3,"type_uid":600303,"action_id":1,"action":"Allowed","status_id":1,"api":{"operation":"/openshell.v1.OpenShell/UpdateConfig"},"resources":[{"name":"default","type":"workspace"},{"uid":"sb-1","type":"sandbox"},{"name":"log_level","type":"setting","data":{"value":"debug"}}],"dst_endpoint":{"domain":"gateway","port":8080},"metadata":{"version":"1.8.0","product":{"name":"OpenShell Gateway","vendor_name":"OpenShell","version":"0.1.10"}}} +{"class_uid":3002,"action":"Allowed","dst_endpoint":{"domain":"ignored.example","port":443}} diff --git a/tests/fixtures/sample/policy.expected.yaml b/tests/fixtures/sample/policy.expected.yaml index 46d1634..16fffec 100644 --- a/tests/fixtures/sample/policy.expected.yaml +++ b/tests/fixtures/sample/policy.expected.yaml @@ -1,5 +1,5 @@ # Generated by openshell-annotate @VERSION@ - DO NOT EDIT. Change the @openshell directives in source and regenerate. -# Validated against openshell-policy-schema and the OpenShell v0.1.9 gateway validator. Each entry's comment gives the reason and source file:line. +# Validated against openshell-policy-schema and the OpenShell v0.1.10 gateway validator. Each entry's comment gives the reason and source file:line. # Startup-only sections (filesystem_policy, landlock, process) need a sandbox recreate to change; network_policies are live. version: 1 filesystem_policy: diff --git a/tests/golden/diff_logs_human_color.txt b/tests/golden/diff_logs_human_color.txt index f8252e0..3c003aa 100644 --- a/tests/golden/diff_logs_human_color.txt +++ b/tests/golden/diff_logs_human_color.txt @@ -59,5 +59,5 @@ ✖ 4 suggestions (1 stale directive · 1 not actionable) 💡 next: `openshell-annotate diff-logs denied.log --write` inserts 3 directives (review, then regenerate the policy) -note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.9 (#4270). +note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.10 (#4270).  \ No newline at end of file diff --git a/tests/golden/diff_logs_human_plain.txt b/tests/golden/diff_logs_human_plain.txt index a7737de..fdf27bd 100644 --- a/tests/golden/diff_logs_human_plain.txt +++ b/tests/golden/diff_logs_human_plain.txt @@ -59,4 +59,4 @@ blocked: 169.254.169.254:80 x1 4 suggestions (1 stale directive, 1 not actionable) next: `openshell-annotate diff-logs denied.log --write` inserts 3 directives (review, then regenerate the policy) -note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.9 (#4270). +note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.10 (#4270). diff --git a/tests/golden/diff_logs_ocsf_1_8_0_plain.txt b/tests/golden/diff_logs_ocsf_1_8_0_plain.txt index b3b1f88..25b6f71 100644 --- a/tests/golden/diff_logs_ocsf_1_8_0_plain.txt +++ b/tests/golden/diff_logs_ocsf_1_8_0_plain.txt @@ -39,4 +39,4 @@ stale: jsonplaceholder.typicode.com:443 /usr/local/bin/python3.12 3 suggestions (1 stale directive) next: `openshell-annotate diff-logs ocsf.jsonl --write` inserts 3 directives (review, then regenerate the policy) -note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.9 (#4270). +note: logs are best-effort and lossy; absence of an event is not proof. Filesystem denials are not logged by OpenShell 0.1.10 (#4270).