Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/openshell-next.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: openshell-next

# Keeps the long-lived `openshell-next` branch building against the newest NVIDIA/OpenShell tag, prereleases included,
# Keeps the long-lived `openshell-next` branch building against the newest ai-openshell/openshell tag, prereleases included,
# so the next OpenShell release is integrated (and any breakage fixed) before it ships as stable.
# Twice daily (04:17 and 07:17 UTC): merge main into openshell-next, bump the OpenShell pin when upstream has a newer
# tag, run the tests, push, and report on the tracking issue (label `openshell-next`). The later run is a backup:
Expand Down Expand Up @@ -49,7 +49,7 @@ concurrency:
env:
CARGO_TERM_COLOR: always
BRANCH: openshell-next
UPSTREAM: https://github.com/NVIDIA/OpenShell
UPSTREAM: https://github.com/ai-openshell/openshell

jobs:
track:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Security
# actionlint lint every workflow (with shellcheck on `run:` scripts)
# gitleaks scan the full git history for committed secrets
# cargo-deny advisories, licenses, bans and sources for the Rust dependency tree (deny.toml)
# openshell-pin the NVIDIA/OpenShell git pin: Cargo.toml tag = Cargo.lock commit = upstream tag
# openshell-pin the ai-openshell/openshell git pin: Cargo.toml tag = Cargo.lock commit = upstream tag
# Tools are downloaded by scripts/ci-tools.sh at pinned versions and checked against pinned SHA-256 hashes
# (actionlint also against its GitHub build provenance). Run the same checks locally: scripts/security-local.sh
# The job names are required status checks on main (.github/rulesets/protect-main.json, #103): renaming a job here
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Verify the NVIDIA/OpenShell pin
- name: Verify the ai-openshell/openshell pin
env:
GH_TOKEN: ${{ github.token }}
run: scripts/verify-openshell-pin.sh
4 changes: 2 additions & 2 deletions .github/workflows/upstream-compat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Upstream compatibility

# Builds and tests main against NVIDIA/OpenShell's newest release, newest prerelease and its main branch (both policy
# Builds and tests main against ai-openshell/openshell's newest release, newest prerelease and its main branch (both policy
# crates repointed to the same upstream commit), so upstream changes show up here before they bite users.
# Informational only: this is NOT a required check (see .github/rulesets/protect-main.json), and only scheduled and
# manual runs can fail. The `openshell-next` branch (.github/workflows/openshell-next.yml) is where a newer pin is
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
gh label create upstream-compat --color D93F0B --description "Broken against a newer OpenShell" 2>/dev/null || true
{
echo "**Target:** \`$TARGET\` (\`${LABEL:-unresolved}\` @ \`${SHA:-unknown}\`)"
echo "**Upstream commit:** https://github.com/NVIDIA/OpenShell/commit/${SHA:-}"
echo "**Upstream commit:** https://github.com/ai-openshell/openshell/commit/${SHA:-}"
echo "**Run / full log:** $RUN_URL"
echo
echo "Last lines of the log:"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ version section and adds the squash-merged PR titles since the previous tag. Ver

## [Unreleased]

- chore(deps): update `url` to 2.5.9 (and `form_urlencoded` to 1.2.3) in `Cargo.lock` for RUSTSEC-2026-0592, a stack overflow in `Url::origin()` on nested `blob:` URLs; `url` comes in through OpenShell's crates (#111)
- chore(deps): OpenShell moved to `ai-openshell/openshell`: the git dependencies, `Cargo.lock` sources (same v0.1.8 commit), `deny.toml` `allow-git`, the pin/tag/compat/openshell-next scripts and workflows, and upstream links in the docs use the new URL instead of the `NVIDIA/OpenShell` redirect (#105)
- ci: the `Security` checks `actionlint`, `gitleaks`, `cargo-deny` and `openshell-pin` are required status checks on `main`, next to `check` and `audit` (`protect-main` ruleset, #103)
- ci: `Security` workflow (#101): actionlint on the workflows, gitleaks over the full git history, `cargo deny check` with a new `deny.toml` (advisories, licenses, bans, sources), and `scripts/verify-openshell-pin.sh`, which checks that the Cargo.toml OpenShell tag, the Cargo.lock commit and the upstream tag agree; tools are installed by `scripts/ci-tools.sh` at pinned versions with pinned SHA-256 hashes (actionlint also by attestation); `scripts/security-local.sh` runs the same checks locally; `ci.yml` pins `actions/checkout` and `actions/cache` by commit SHA
- feat(lint): warn about OpenShell v0.1.8 pitfalls: `ws://`/`wss://` URL literals declared only by a `rest` egress (REST endpoints answer WebSocket upgrades with 403), and IPv4-mapped IPv6 hosts (`::ffff:a.b.c.d`, evaluated as IPv4) in egress directives and policy files; README notes that symlinked filesystem paths (fail launch since v0.1.8) cannot be detected statically
Expand Down
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ authors = ["Ilan Harel"]

[dependencies]
# Pinned to the OpenShell v0.1.8 tag; Cargo.lock records the exact commit.
openshell-policy-schema = { git = "https://github.com/NVIDIA/OpenShell", tag = "v0.1.8" }
openshell-policy-schema = { git = "https://github.com/ai-openshell/openshell", tag = "v0.1.8" }
# Same tag. Schema parsing accepts policies the gateway later rejects; this crate is that validator.
openshell-policy = { git = "https://github.com/NVIDIA/OpenShell", tag = "v0.1.8" }
openshell-policy = { git = "https://github.com/ai-openshell/openshell", tag = "v0.1.8" }
anyhow = "1"
clap = { version = "4", features = ["derive"] }
ignore = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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/NVIDIA/OpenShell (tag v0.1.8, commit pinned
# `openshell-policy-schema` is a git dependency on https://github.com/ai-openshell/openshell (tag v0.1.8, 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
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# openshell-annotate

Policy-as-code for [NVIDIA OpenShell](https://github.com/NVIDIA/OpenShell) sandboxes. Developers write
Policy-as-code for [NVIDIA OpenShell](https://github.com/ai-openshell/openshell) sandboxes. Developers write
structured comments next to the code that needs access; the CLI scans the repo and generates `policy.yaml`
(every entry commented with its reason and `file:line`) plus a separate providers file, lints for
un-annotated calls, and gates CI on drift.
Expand Down Expand Up @@ -138,7 +138,7 @@ stderr. Exit codes and `--deny-warnings` do not depend on the format.

OpenShell 0.1.8 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
([NVIDIA/OpenShell#4270](https://github.com/NVIDIA/OpenShell/issues/4270)), so an application under `/opt/<app>` fails with a bare
([ai-openshell/openshell#4270](https://github.com/ai-openshell/openshell/issues/4270)), so an application under `/opt/<app>` fails with a bare
`EACCES`. `generate --image IMAGE` inspects the image (docker, then podman: WORKDIR, ENTRYPOINT, CMD, and the directory
layout from a throw-away `create` + `export | tar -t`; nothing is started) and prints, on stderr, a proposal such as
`# @openshell fs read /opt/context7 reason="..."` for each directory that is neither in the baseline nor under a declared
Expand Down Expand Up @@ -312,7 +312,7 @@ cloud APIs only. For every credential nothing declares (reported as `unmapped`),
directives in the file that declares it (`tls=skip` endpoints get `allow_uninspected_credentials: true`, which OpenShell
requires). Files that already exist are kept. Review the auth style, then check and import it. The skeleton sends the
credential as a bearer token in `Authorization`; since OpenShell v0.1.8 a credential is substituted only where the profile
declares it ([NVIDIA/OpenShell#4886](https://github.com/NVIDIA/OpenShell/pull/4886)), so an API that takes it in another header
declares it ([ai-openshell/openshell#4886](https://github.com/ai-openshell/openshell/pull/4886)), so an API that takes it in another header
(`x-api-key`), a query parameter or a URL path needs `auth_style: header|query|path` with `header_name`, `query_param` or
`path_template`:

Expand Down Expand Up @@ -350,11 +350,11 @@ the rule; a profile bound to other binaries (the bundled `github` profile is for
listed in `[lint] ignore_hosts`.
- JS regex literals are not parsed; Python docstrings are strings (directives must be `#` comments).
- OpenShell v0.1.8 changes that lint checks: a `ws://`/`wss://` URL literal whose host is declared only by an inspected
`rest` egress is a warning (REST endpoints answer WebSocket upgrades with 403, NVIDIA/OpenShell#5336; use
`rest` egress is a warning (REST endpoints answer WebSocket upgrades with 403, ai-openshell/openshell#5336; use
`protocol=websocket`), and an IPv4-mapped IPv6 host (`::ffff:203.0.113.7`) in a directive or a `--policy` file is a warning
(it is evaluated as IPv4, NVIDIA/OpenShell#5101). A WebSocket client with a computed URL or behind an SDK is not seen.
(it is evaluated as IPv4, ai-openshell/openshell#5101). A WebSocket client with a computed URL or behind an SDK is not seen.
Filesystem policy paths that go through a symlink inside a writable directory now fail sandbox launch
(NVIDIA/OpenShell#5278); the symlink lives in the image, so lint cannot see it: put the symlink's target in `@openshell fs`.
(ai-openshell/openshell#5278); the symlink lives in the image, so lint cannot see it: put the symlink's target in `@openshell fs`.
- Filesystem/process/landlock are startup-only in OpenShell; drift labels them `startup`.
- `diff-logs` only sees network and L7 events: OpenShell 0.1.8 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.
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OpenShell itself should be reported to the OpenShell project (see its `SECURITY.

- Every pull request and push to `main`, plus a weekly run, goes through the `Security` workflow: actionlint on the
workflows, gitleaks over the full git history, `cargo deny check` (RustSec advisories, licenses, sources; see
`deny.toml`) and a check that the pinned `NVIDIA/OpenShell` tag, the commit in `Cargo.lock` and the upstream tag
`deny.toml`) and a check that the pinned `ai-openshell/openshell` tag, the commit in `Cargo.lock` and the upstream tag
agree. `cargo audit` runs in CI as well. All of these are required status checks for merging into `main`.
- Third-party GitHub Actions are pinned by commit SHA. CI tools are downloaded at pinned versions and checked against
pinned SHA-256 hashes.
Expand Down
4 changes: 2 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ allow-wildcard-paths = true
highlight = "simplest-path"

[sources]
# Only crates.io and the pinned NVIDIA/OpenShell git repository. The pin itself (tag -> commit in Cargo.lock) is
# Only crates.io and the pinned ai-openshell/openshell git repository. The pin itself (tag -> commit in Cargo.lock) is
# checked by scripts/verify-openshell-pin.sh.
unknown-registry = "deny"
unknown-git = "deny"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
allow-git = ["https://github.com/NVIDIA/OpenShell"]
allow-git = ["https://github.com/ai-openshell/openshell"]
8 changes: 6 additions & 2 deletions docs/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,15 @@ tool, change its version and hash together. A new license in the dependency tree
reviewed and added to `deny.toml`. Pin every third-party action by full commit SHA with the version in a comment
(`uses: owner/action@<sha> # vX.Y.Z`); actionlint does not enforce this, review does.

CI never downloads OpenShell binaries: it builds the policy crates from the `NVIDIA/OpenShell` git tag. OpenShell's
CI never downloads OpenShell binaries: it builds the policy crates from the `ai-openshell/openshell` git tag. OpenShell's
release attestations cover its built packages, which can be built from another commit than the tag (v0.1.8's .deb came
from 22209de, the tag is f3d9765), so the `openshell-pin` job checks the source pin instead and reports whether GitHub
verified the commit's signature.

OpenShell moved from `NVIDIA/OpenShell` to `ai-openshell/openshell` in November 2026 (upstream #5833). The old
URL redirects, but `Cargo.toml`, `deny.toml` (`allow-git`) and the scripts use the new one, so `cargo deny` rejects a
lock file that still resolves from `NVIDIA/OpenShell` and `scripts/verify-openshell-pin.sh` finds no pin in it.

Clippy gains new lints with every Rust release. If it fails on a newer toolchain but passes on 1.94, fix the lint in a
separate commit (CI will keep using 1.94 until the pin is bumped on purpose in `ci.yml`, `Dockerfile` and `Cargo.toml`).

Expand Down Expand Up @@ -225,7 +229,7 @@ openshell-annotate diff-logs path/to/sandbox.log --write # inserts directives a

Sample logs for both formats are in `tests/fixtures/logs/`. Filesystem denials are not logged by OpenShell 0.1.8, 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.*` (NVIDIA/OpenShell#5048) needs no change; the OCSF fixture
`container.uid`/`container.name` to `device.container.*` (ai-openshell/openshell#5048) needs no change; the OCSF fixture
is real v0.1.7 output.

## 6. Docker image
Expand Down
2 changes: 1 addition & 1 deletion scripts/openshell-next.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Maintain the `openshell-next` integration branch, which builds against the newest NVIDIA/OpenShell tag
# Maintain the `openshell-next` integration branch, which builds against the newest ai-openshell/openshell tag
# (prereleases included). Used by .github/workflows/openshell-next.yml; safe to run by hand on a local checkout.
#
# scripts/openshell-next.sh bump <tag> # pin both OpenShell crates to <tag> in Cargo.toml and re-resolve Cargo.lock
Expand Down
6 changes: 3 additions & 3 deletions scripts/openshell-tags.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# List and compare NVIDIA/OpenShell release tags in release order (a stable vX.Y.Z sorts after its vX.Y.Z-pre.N).
# List and compare ai-openshell/openshell release tags in release order (a stable vX.Y.Z sorts after its vX.Y.Z-pre.N).
#
# scripts/openshell-tags.sh latest # newest tag, prereleases included (what `openshell-next` tracks)
# scripts/openshell-tags.sh latest-stable # newest vX.Y.Z
Expand All @@ -9,14 +9,14 @@
# scripts/openshell-tags.sh is-stable A # exit 0 when A is vX.Y.Z (no prerelease suffix)
#
# Only vX.Y.Z and vX.Y.Z-pre.N tags count; anything else upstream (`dev`, `vm-runtime`, ...) is ignored.
# Env: UPSTREAM_REPO (default https://github.com/NVIDIA/OpenShell); OPENSHELL_TAGS (newline-separated tag list to use
# Env: UPSTREAM_REPO (default https://github.com/ai-openshell/openshell); OPENSHELL_TAGS (newline-separated tag list to use
# instead of asking the remote, for tests and offline runs); OPENSHELL_ANNOTATE_ROOT (checkout whose Cargo.toml
# `pinned` reads; default: the checkout this script lives in).
# Exit: 0 ok / true, 1 false, 2 usage or no tags found.
set -euo pipefail
cd "${OPENSHELL_ANNOTATE_ROOT:-$(dirname "$0")/..}"

REPO="${UPSTREAM_REPO:-https://github.com/NVIDIA/OpenShell}"
REPO="${UPSTREAM_REPO:-https://github.com/ai-openshell/openshell}"
RE='^v[0-9]+\.[0-9]+\.[0-9]+(-pre\.[0-9]+)?$'

usage() { sed -n '2,13p' "$0" | sed 's/^# \{0,1\}//' >&2; exit 2; }
Expand Down
6 changes: 3 additions & 3 deletions scripts/upstream-compat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# (openshell-policy-schema and openshell-policy, both repointed to the same upstream commit),
# WITHOUT touching this working tree (Cargo.toml / Cargo.lock stay pinned). Works on a temporary copy.
#
# scripts/upstream-compat.sh latest-release # newest stable vX.Y.Z tag of NVIDIA/OpenShell
# scripts/upstream-compat.sh latest-release # newest stable vX.Y.Z tag of ai-openshell/openshell
# scripts/upstream-compat.sh latest-prerelease # newest tag incl. vX.Y.Z-pre.N (what openshell-next tracks; = latest-release when no newer prerelease)
# scripts/upstream-compat.sh main # OpenShell HEAD
# scripts/upstream-compat.sh v0.1.7-pre.3 # any tag, branch or commit SHA
#
# Env: UPSTREAM_REPO (default https://github.com/NVIDIA/OpenShell), UPSTREAM_COMPAT_LOG (also write the log there),
# Env: UPSTREAM_REPO (default https://github.com/ai-openshell/openshell), UPSTREAM_COMPAT_LOG (also write the log there),
# CARGO_TARGET_DIR (reuse a build cache), GITHUB_STEP_SUMMARY / GITHUB_OUTPUT (set automatically in Actions).
# Exit: 0 compatible, 1 build/test failure, 2 usage / could not resolve the ref.
set -euo pipefail
cd "$(dirname "$0")/.."

REPO="${UPSTREAM_REPO:-https://github.com/NVIDIA/OpenShell}"
REPO="${UPSTREAM_REPO:-https://github.com/ai-openshell/openshell}"
TARGET="${1:-}"
[ -n "$TARGET" ] || { echo "usage: $0 <latest-release|latest-prerelease|main|tag|branch|sha>" >&2; exit 2; }

Expand Down
Loading
Loading