Repository navigation
Conversation
|
🌿 Preview your docs: https://nvidia-preview-pr-5006.docs.buildwithfern.com/openshell |
vishwa-raman
left a comment
There was a problem hiding this comment.
Drew, I went through #5006 against vishwa/cedar-openshell and the goals we set for bringing Cedar in. The direction looks right to me: the runtime interface, the separate adapter and runtime crates, and composing the backend in the supervisor are cleaner than what we had. One issue blocks the merge and a few others need answers.
What I verified
- Parity is intact. All 147 parity tests moved to
tests/policy-conformanceunder the same names. On macOS they pass on both branches (149 passed, the same 3 Linux-only symlink tests ignored).expected.jsonrecords the same 7 YAML/Cedar differences the old harness documented, with no new ones. I like that each backend is now checked against its own expected outcome. - The stable dependency graph is clean.
cargo tree -e normal -i cedar-policyfinds nothing foropenshell-gateway,-supervisor,-cli,-sandboxor-tuiwith default features. With--features experimental, the gateway and supervisor resolve theai-openshell/cedarfork. - Supervisor negotiation is right.
POLICY_CEDAR_V1is only advertised undercfg!(feature = "experimental").
Blocker
The stable RPM build fails offline resolution. 3a4a04506 deletes deploy/rpm/create-vendor-archive.sh and returns .packit.yaml and openshell.spec to main's versions. But Cargo.lock lists the ai-openshell/cedar git source in every build, with or without experimental. %cargo_prep only redirects crates.io to the vendored copy, so offline resolution fails on the git source even when nothing compiles Cedar:
cargo vendor --locked vendor > /dev/null
CARGO_HOME=$(mktemp -d) cargo tree --offline --locked -e normal -p openshell-gateway \
--config 'source.crates-io.replace-with="vendored-sources"' \
--config 'source.vendored-sources.directory="vendor"'
# error: can't checkout from 'https://github.com/ai-openshell/cedar.git': you are in the offline mode(If mise shims cargo, use the toolchain's cargo binary directly. Overriding CARGO_HOME breaks the shim.)
openshell-cli and openshell-supervisor fail the same way. With the [source."git+…"] mapping the old script wrote, resolution succeeds. The vendoring script, or something equivalent, needs to stay as long as the lockfile carries a git source.
Needs an answer before merge
driver_enforces_policyremoval. The field and its admission check are gone fromcompute_driver.protoand all six drivers. Does MXC on thewindowsbranch rely on it to keep out policies it can't enforce? If so, the removal needs a replacement there.- Older gateways silently dropping Cedar. Without the health flag and the client-side check, a gateway that predates
CedarPolicydrops tag 7 and accepts the request as an empty YAML policy (which passes validation on main). The docs cover it, but I couldn't establish what an empty policy enforces on the filesystem. Could we confirm it fails closed, ideally with an e2e against a current stable gateway? - Policy warnings.
policy_warningsandPolicyWarningare removed entirely, so load-time analysis (for example, audit-only rules next to enforced rules on the same endpoint) is computed but never shown to the author. Was dropping them intended, or should a small additive field come back later?
Follow-ups (fine after merge)
- A CI check that stable builds exclude Cedar. The boundary is clean today, but with
verify-cedar-off.shgone nothing would catch a regression. Acargo tree -i cedar-policycheck that must fail, following the webpki/telemetry pattern intasks/rust.toml, would cover it. - Configuring Cedar sandboxes through the CLI. With
--middlewaregone, the CLI can't set middleware,endpoint_settingsor process identity on a Cedar policy. That matches the plan, but it should have a tracking issue. - Rollout paragraph in the RFC (#4564): Cedar is opt-in and dev-only, with criteria for promoting it.
- Commit messages and review size. The 21 refactor commits have no message bodies, and the API changes (
cedar_policyas a message, capability strings, the warning and driver-field removals) are mixed into a 222-file diff. Short bodies on3a4a04506,73419b00cand7e66b3491would help other reviewers.
Describe the implementation as it stands after the refactor: middleware, endpoint settings, and process are policy-message fields set through the API instead of a --middleware file; a CedarPolicy message selects Cedar; supervisor networking depends on engine-neutral runtime contracts with one composition point; parity lives in tests/policy-conformance with recorded expectations; and Cedar is gated by the experimental feature bundle, built only in Release Dev. Record the implementation as the #5005, #5006, and #4991 stack, and update verification and rollout to match. Older gateways that ignore the cedar_policy field, load-time warnings, and a CI check for stable builds follow #5006 as it is today and are listed under Open questions pending review. Refs #4474 Signed-off-by: Vishwanath Raman <vishwanathr@nvidia.com>
|
On Without it, if an experimental gateway sends a Cedar policy to MXC, MXC's policy mapper sees empty YAML fields (no filesystem grants and default-deny network), so it fails closed. That's fine for now. If MXC wants an explicit rejection later, its mapper can reject |
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
82d6ec4 to
90b71d5
Compare
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. rust-sdk — No explicit risk acceptance foundSandboxPolicy gains cedar_policy, provider_credential_rules, and endpoint_settings, while GetSandboxConfigRequest and SupervisorHello gain supported_capabilities, changing their exhaustive Rust message shapes.
Review details
Advisory review; publication gates are unchanged. |
Summary
Support Cedar-authored sandbox policies in development builds. The gateway and supervisor enable Cedar through the single
experimentalfeature; crate boundaries forward that bundle without separatecedarswitches. Default, prerelease, and stable product builds exclude Cedar.Cedar parsing and evaluation stay in dedicated engine/schema crates. A Cedar message adapter owns analysis shared by gateway and runtime composition, and a separate runtime adapter implements neutral policy contracts. Supervisor composition selects the backend; networking enforces baseline destination restrictions before consulting opaque policy authorizers.
Related Issue
Stacked on #5005. Closes #4411. Builds on #4565. Cedar example policies and demos are reviewed separately in #4991.
Behavior
CedarPolicyat protobuf tag 7 selects Cedar, including empty source. Existing YAML fields retain their meanings.--policyoption for Cedar source and adds no middleware flag. Middleware, endpoint settings, and custom process identity are not configurable through the CLI for Cedar policies; existing YAML middleware is unchanged.Validation
experimental, 283 default policy tests, and 18 default gateway/supervisor Cedar rejection tests. Gateway/supervisor compile and dependency-graph checks passed with the bundle enabled and disabled.libgcc_s; production image defaults are unchanged.Release Notes
Development builds can create and enforce sandboxes with Cedar policies. YAML policies keep their existing behavior.