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
9 changes: 8 additions & 1 deletion .github/rulesets/protect-main.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": true,
"required_status_checks": [ { "context": "check" }, { "context": "audit" } ]
"required_status_checks": [
{ "context": "check" },
{ "context": "audit" },
{ "context": "actionlint" },
{ "context": "gitleaks" },
{ "context": "cargo-deny" },
{ "context": "openshell-pin" }
]
}
}
],
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ name: Security
# openshell-pin the NVIDIA/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
# These jobs are not (yet) required status checks; see .github/rulesets/protect-main.json.
# The job names are required status checks on main (.github/rulesets/protect-main.json, #103): renaming a job here
# needs the same change in the ruleset, or every pull request waits for a check that never reports.

on:
push:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version section and adds the squash-merged PR titles since the previous tag. Ver

## [Unreleased]

- 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
- chore(deps): build against OpenShell v0.1.8 (`openshell-policy-schema`, `openshell-policy`); docs and generated policy headers now name v0.1.8. The gateway validator now rejects `websocket_credential_rewrite: true` on `protocol: rest` (covered by a test); `--scaffold-profiles` skeletons explain the v0.1.8 credential placement rule (credentials go only where the profile declares them); `diff-logs` needs no change for the OCSF `device.container.*` move; the RUSTSEC-2026-0459 ignore stays (v0.1.8 still pins `sqlx` 0.9.0)
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ goes through a branch and a pull request.
3. Run `scripts/ci-local.sh` before pushing (`TOOLCHAIN=1.94 scripts/ci-local.sh` pins the toolchain CI uses), and
`scripts/security-local.sh` when you touch workflows, dependencies or the OpenShell pin.
4. `git push -u origin <branch>` and open a pull request into `main`.
5. CI must pass (the required `check` and `audit` jobs, and the `Security` workflow's `actionlint`, `gitleaks`,
`cargo-deny` and `openshell-pin` jobs), the branch must be up to date with `main`, and all review
5. CI must pass (the required checks: `check` and `audit` from CI, and `actionlint`, `gitleaks`, `cargo-deny` and
`openshell-pin` from the `Security` workflow), the branch must be up to date with `main`, and all review
conversations must be resolved.
6. Merge with **squash merge** (the only merge method enabled; the PR title becomes the commit message, so use a
conventional title). The head branch is deleted automatically after the merge.

The rules are defined in `.github/rulesets/protect-main.json` and applied with `scripts/protect-main.sh`: pull request
required (0 approvals, conversations resolved), status checks `check` and `audit` required and up to date, linear
required (0 approvals, conversations resolved), status checks `check`, `audit`, `actionlint`, `gitleaks`, `cargo-deny` and `openshell-pin` required and up to date, linear
history, no force pushes, no deletion, and no bypass for admins. GitHub only enforces rulesets on private repositories
with a paid plan; until then the rules are followed by convention.

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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
agree. `cargo audit` runs in CI as well.
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.
- Release archives come with `SHA256SUMS` and GitHub build provenance (`gh attestation verify <file> --repo
Expand Down
5 changes: 3 additions & 2 deletions docs/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ TOOLCHAIN=1.94 scripts/ci-local.sh # pinned like CI; omit TOOLCHAIN to use y

Expected last line: `ci-local: all checks passed`. Optional audit: `cargo install cargo-audit --locked && cargo audit`.

The `Security` workflow (`.github/workflows/security.yml`, #101) adds four jobs. Run them locally with
The `Security` workflow (`.github/workflows/security.yml`, #101) adds four jobs, all required status checks on `main`
next to `check` and `audit` (#103). Run them locally with
`scripts/security-local.sh` (expected last line: `security-local: all checks passed`):

| Job | What it checks | Config |
Expand Down Expand Up @@ -272,7 +273,7 @@ git switch -c feat/short-name # or fix/..., docs/..., chore/...
git commit -s -m "feat: what and why" # -s adds the DCO Signed-off-by line (required)
git push -u origin feat/short-name # CI runs on every push to a pull request
gh pr create --fill # open the PR into main
gh pr checks --watch # wait for `check` and `audit` to pass
gh pr checks --watch # wait for the required checks (CI and Security) to pass
gh pr merge --squash # squash merge; the branch is deleted automatically
```

Expand Down
3 changes: 2 additions & 1 deletion docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ release" note to the tracking issue. To bring it to `main`:
in `src/`), regenerate the goldens (`UPDATE_GOLDEN=1 cargo test`, then review), and add a CHANGELOG line under
`## [Unreleased]`. The workflow only moves the pin, so these strings still name the old version until then.
3. Retitle the tracking PR to `chore(deps): bump OpenShell crates to vX.Y.Z`, put `Closes #<tracking issue>` in it,
mark it ready for review, and squash-merge it once `check` and `audit` pass. Those required checks come from the
mark it ready for review, and squash-merge it once the required checks pass (`check`, `audit` and the `Security` jobs `actionlint`, `gitleaks`,
`cargo-deny`, `openshell-pin`). Those required checks come from the
PR's `pull_request` runs: your push in step 2 starts them; if the head is still a bot commit, select **Approve
workflows to run** on the PR (the `CI (dispatched)` statuses do not count as the required checks). `openshell-next` itself survives the
merge (the `protect-openshell-next` ruleset blocks the automatic branch deletion) and keeps tracking from `main`.
Expand Down
Loading