Skip to content

Commit 70338b3

Browse files
drewvishwa-ramanjohnnygreco
committed
feat(policy): support Cedar in development builds
Add Cedar-authored sandbox policy support behind the `experimental` Cargo feature flag on `openshell-gateway` and `openshell-supervisor`. Default, prerelease, and stable builds exclude Cedar. - Add `CedarPolicy` (tag 7), `provider_credential_rules` (tag 8), and `endpoint_settings` (tag 9) to `SandboxPolicy`, plus `supported_capabilities` on `SupervisorHello` and `GetSandboxConfigRequest`. - Keep Cedar parsing, analysis, and evaluation in dedicated crates behind `openshell-policy-runtime-interface`, `openshell-policy-cedar-adapter`, and `openshell-policy-cedar-runtime`. - Move cross-backend conformance tests to `tests/policy-conformance`. - Capture vendored git source replacements for offline RPM builds. Co-authored-by: Vishwanath Raman <vishwanathr@nvidia.com> Co-authored-by: Johnny Greco <jogreco@nvidia.com> Signed-off-by: Drew Newberry <anewberry@nvidia.com> Signed-off-by: Vishwanath Raman <vishwanathr@nvidia.com> Signed-off-by: Johnny Greco <jogreco@nvidia.com>
1 parent 0d495be commit 70338b3

193 files changed

Lines changed: 51093 additions & 5317 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.packit.yaml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ actions:
2828
# reflects any patching that Packit may have done (e.g. version bumps).
2929
- 'bash -c "VERSION=${PACKIT_PROJECT_VERSION} && TMPDIR=$(mktemp -d) && DIR=openshell-${VERSION} && mkdir -p ${TMPDIR}/${DIR} && git ls-files -z | xargs -0 tar cf - | tar xf - -C ${TMPDIR}/${DIR}/ && tar -czf openshell-${VERSION}.tar.gz -C ${TMPDIR} ${DIR} && rm -rf ${TMPDIR}"'
3030
# Step 2: Create vendored Cargo dependencies tarball for offline RPM build.
31-
- 'bash -c "VERSION=${PACKIT_PROJECT_VERSION} && CARGO_HTTP_TIMEOUT=600 CARGO_NET_RETRY=5 cargo vendor --locked --quiet && tar -cJf openshell-${VERSION}-vendor.tar.xz vendor/ && rm -rf vendor/"'
31+
# The script also captures the [source."git+..."] replacement tables that
32+
# cargo vendor prints, so git dependencies resolve offline in %prep.
33+
- 'bash deploy/rpm/create-vendor-archive.sh'
3234
# Step 3: Return the primary archive name. Packit expects create-archive
3335
# to print one path for Source0; Source1 is patched explicitly below.
3436
- 'bash -c "echo openshell-${PACKIT_PROJECT_VERSION}.tar.gz"'

‎AGENTS.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Do not rely on this file for a full inventory. The detailed public and contribut
3232
| `crates/openshell-sandbox-backend/` | OpenShell sandbox backend | Concrete Isolation Backend RPC client and authenticated Sandbox Protocol shared with `openshell-sandbox` |
3333
| `crates/openshell-policy/` | Policy engine | Filesystem, network, and process constraints |
3434
| `crates/openshell-policy-schema/` | Authored policy schema | Dependency-light YAML/JSON representation, bounded parsing, and pure authored-language semantics |
35+
| `crates/openshell-policy-runtime-interface/` | Policy runtime interface | Engine-neutral decisions, request metadata, snapshots, and staged reload contracts |
36+
| `crates/openshell-policy-cedar/` | Cedar policy engine | Validation, Landlock/L7/DNS derivation, and evaluation for Cedar-authored sandbox policies; linked only with the gateway and supervisor `experimental` feature |
37+
| `crates/openshell-policy-cedar-schema/` | Cedar policy schema | Canonical Cedar schema and entity, action, and context names; linked only with the `experimental` feature |
38+
| `crates/openshell-policy-cedar-adapter/` | Cedar message adapter | Cedar analysis, filesystem grants, and endpoint inventory shared by gateway and runtime composition |
39+
| `crates/openshell-policy-cedar-runtime/` | Cedar runtime adapter | Implements the policy runtime contracts; selected by supervisor composition with the `experimental` feature |
3540
| `crates/openshell-bootstrap/` | Gateway metadata | Gateway registration metadata, auth token storage, mTLS bundle storage |
3641
| `crates/openshell-gateway-interceptors/` | Gateway interceptors | Intercepts and transforms configured gRPC requests at the gateway routing boundary |
3742
| `crates/openshell-ocsf/` | OCSF logging | OCSF v1.8.0 event types, builders, shorthand/JSONL formatters, tracing layers |

‎CONTRIBUTING.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ The workspace build, check, lint, and test tasks (`build:rust:workspace`,
352352
and direct Cargo builds leave it off unless you pass `--features experimental`;
353353
prerelease and stable builds leave it off as well.
354354

355+
Workspace builds select the Cedar runtime member and unify its shared policy
356+
features, so use per-package checks to verify that Cedar is excluded.
357+
358+
The `experimental` build flag includes Cedar. Build the gateway and supervisor
359+
with `--features experimental`, or use published Release Dev artifacts.
360+
355361
## Building the `openshell` CLI
356362

357363
Inside this repository, `openshell` is a local shortcut script at `scripts/bin/openshell`. The script will
@@ -431,12 +437,18 @@ The TypeScript SDK moved to [ai-openshell/sdk-typescript](https://github.com/ai-
431437
| --------------- | --------------------------------------------- |
432438
| `crates/` | Rust crates |
433439
| `crates/openshell-policy-schema/` | Canonical authored policy DTOs and bounded YAML/JSON parser |
440+
| `crates/openshell-policy-cedar/` | Validation and evaluation for Cedar-authored sandbox policies, enabled by the development `experimental` feature |
441+
| `crates/openshell-policy-cedar-schema/` | Canonical Cedar schema and entity, action, and context names, linked only with the `experimental` feature |
442+
| `crates/openshell-policy-cedar-adapter/` | Cedar analysis adapted to policy messages for gateway and runtime composition |
443+
| `crates/openshell-policy-cedar-runtime/` | Cedar implementation of the shared runtime contracts, selected by supervisor composition |
444+
| `crates/openshell-policy-runtime-interface/` | Shared policy decisions, request metadata, snapshots, and staged reload contracts; no engine implementations |
434445
| `crates/openshell-prover-cli/` | Standalone local policy boundary checker |
435446
| `python/` | Python SDK (frozen, moved to ai-openshell/sdk-python) |
436447
| `sdk/typescript/` | Deprecated `@nvidia/openshell-sdk` stub re-exporting `@ai-openshell/sdk` (moved to ai-openshell/sdk-typescript) |
437448
| `proto/` | Protocol buffer definitions and [public API conventions](proto/README.md) |
438449
| `tasks/` | `mise` task definitions and build scripts |
439450
| `tests/testkit/` | Support library for SDK-driven end-to-end suites |
451+
| `tests/policy-conformance/` | Policy backend conformance through production networking paths |
440452
| `tests/suites/` | End-to-end suites, grouped by test family |
441453
| `tests/tmachine/` | QEMU test machines provisioned with Ansible, and the `Session` API that drives them |
442454
| `tests/runner/` | `openshell-test-runner`: builds a test family for tmachine guests, runs it in a tmachine environment and checks the results |

0 commit comments

Comments
 (0)