Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

chore(security): add ultimate assurance suite

Rahmand9b580627ac6
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000..5d15fb76
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,35 @@
+version: 2
+updates:
+ - package-ecosystem: bun
+ directory: /
+ schedule:
+ interval: weekly
+ day: monday
+ cooldown:
+ default-days: 7
+ open-pull-requests-limit: 5
+ groups:
+ production-minor-patch:
+ dependency-type: production
+ update-types:
+ - minor
+ - patch
+ development-minor-patch:
+ dependency-type: development
+ update-types:
+ - minor
+ - patch
+
+ - package-ecosystem: github-actions
+ directory: /
+ schedule:
+ interval: weekly
+ day: monday
+ cooldown:
+ default-days: 7
+ open-pull-requests-limit: 5
+ groups:
+ actions-minor-patch:
+ update-types:
+ - minor
+ - patch
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6de31c66..a522df24 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,48 +1,44 @@
name: CI
-# MANUAL ONLY — `gh workflow run CI`, or the Actions tab.
-#
-# This ran on every push to main and every PR until 2026-07-30, at roughly 80 s of
-# hosted-runner time per push, duplicating a `pre-push` hook that already runs
-# typecheck + lint + test + check locally and blocks the push when they fail.
-#
-# Three steps here are NOT covered by that hook, and they are the reason this file
-# still exists rather than being deleted:
-# • `bun install --frozen-lockfile` from a clean checkout — the only thing that
-# catches lockfile drift, because the hook runs against an existing node_modules
-# • `bash -n scripts/install.sh`
-# • `bun run build`
-# So run it by hand before cutting a release, or after touching package.json,
-# bun.lock or scripts/install.sh.
-#
-# bun is the INSTALLER only. Node 22 is still set up below and is what actually runs
-# tsc/eslint/vitest/next — they all carry a `#!/usr/bin/env node` shebang and bun
-# honours it — which matches production, where the unit's ExecStart is `npm run start`.
on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
workflow_dispatch:
+permissions:
+ contents: read
+
+concurrency:
+ group: ci-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
verify:
name: Verify
runs-on: ubuntu-latest
- timeout-minutes: 20
+ timeout-minutes: 30
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Setup bun
- uses: oven-sh/setup-bun@v2
+ uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.3.14
- name: Setup Node
- uses: actions/setup-node@v4
+ uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: 22
- name: Install dependencies
run: bun install --frozen-lockfile
+ - name: Validate native dependency
+ run: node -e "require('node-pty')"
+
- name: Validate installer syntax
run: bash -n scripts/install.sh
@@ -52,28 +48,14 @@ jobs:
- name: Lint
run: bun run lint
- # `bun run test`, never `bun test`: the latter is bun's builtin runner, which
- # shadows the script, ignores vitest.config.mts and exits 0 having run nothing.
- - name: Test
- run: bun run test
+ - name: Tests and coverage
+ run: bun run coverage
- - name: Slice checks
+ - name: Repository checks
run: bun run check
- # RAW command, and fail-closed ON PURPOSE — deliberately NOT `bun run audit`.
- # `bun audit` exits 1 both for "found a high" and for "could not reach the
- # registry". scripts/audit.mjs (what `bun run audit` calls) treats the second
- # case as a skip, so a flaky VPS cannot manufacture a fake CVE locally. A
- # release gate must make the opposite trade: never pass an audit it could not
- # actually perform. Added 2026-08-03, when the first run ever caught
- # sharp <0.35.0 (libvips CVEs) sitting transitively under next.
- #
- # If a high ever lands with no upstream fix, do NOT lower this to `critical` —
- # that silently disables the ENTIRE high tier. Add the GHSA id to the IGNORE map
- # in scripts/audit.mjs with a reason and a date, then mirror it here with
- # `--ignore=<id>` so the two halves agree.
- name: Audit dependencies
run: bun audit --audit-level=high
- - name: Build
+ - name: Production build
run: bun run build
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 00000000..19cb46b2
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,38 @@
+name: CodeQL
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+ schedule:
+ - cron: "17 3 * * 2"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ security-events: write
+
+concurrency:
+ group: codeql-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ analyze:
+ name: Analyze JavaScript/TypeScript
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ steps:
+ - name: Checkout
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@4c0873ef8656cb3c50b3f42fb63bc1ade0cfa827 # v4
+ with:
+ languages: javascript-typescript
+ queries: security-extended
+
+ - name: Analyze
+ uses: github/codeql-action/analyze@4c0873ef8656cb3c50b3f42fb63bc1ade0cfa827 # v4
+ with:
+ category: /language:javascript-typescript
diff --git a/.github/workflows/dast.yml b/.github/workflows/dast.yml
new file mode 100644
index 00000000..72e8e1b7
--- /dev/null
+++ b/.github/workflows/dast.yml
@@ -0,0 +1,35 @@
+name: OWASP ZAP Baseline
+
+on:
+ schedule:
+ - cron: "13 5 * * 4"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: zap-production-baseline
+ cancel-in-progress: false
+
+jobs:
+ baseline:
+ name: Passive production baseline
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - name: Checkout reviewed ZAP policy
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+ with:
+ persist-credentials: false
+
+ - name: Run passive ZAP baseline against maintained live instance
+ uses: zaproxy/action-baseline@6c5a007541891231cd9e0ddec25d4f25c59c9874 # v0.15.0
+ with:
+ target: https://mso.rahmanef.com
+ docker_name: ghcr.io/zaproxy/zaproxy@sha256:781a2bdaea47324e7bab583e2263f21d257b0aee61ed51521a5be45f5f5081ef
+ rules_file_name: security/zap-baseline.conf
+ cmd_options: -m 2
+ fail_action: true
+ allow_issue_writing: false
+ artifact_name: zap-baseline-report
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
new file mode 100644
index 00000000..0836d363
--- /dev/null
+++ b/.github/workflows/dependency-review.yml
@@ -0,0 +1,22 @@
+name: Dependency Review
+
+on:
+ pull_request:
+ branches: [main]
+
+permissions:
+ contents: read
+
+jobs:
+ review:
+ name: Review dependency changes
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ steps:
+ - name: Checkout
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+
+ - name: Dependency Review
+ uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
+ with:
+ fail-on-severity: high
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
new file mode 100644
index 00000000..49b49e3b
--- /dev/null
+++ b/.github/workflows/scorecard.yml
@@ -0,0 +1,39 @@
+name: OpenSSF Scorecard
+
+on:
+ branch_protection_rule:
+ push:
+ branches: [main]
+ schedule:
+ - cron: "29 4 * * 3"
+ workflow_dispatch:
+
+permissions: read-all
+
+jobs:
+ analysis:
+ name: Scorecard analysis
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ permissions:
+ security-events: write
+ id-token: write
+ contents: read
+ steps:
+ - name: Checkout
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+ with:
+ persist-credentials: false
+
+ - name: Run OpenSSF Scorecard
+ uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
+ with:
+ results_file: results.sarif
+ results_format: sarif
+ publish_results: true
+
+ - name: Upload Scorecard SARIF
+ uses: github/codeql-action/upload-sarif@4c0873ef8656cb3c50b3f42fb63bc1ade0cfa827 # v4
+ with:
+ sarif_file: results.sarif
+ category: openssf-scorecard
diff --git a/.github/workflows/security-core.yml b/.github/workflows/security-core.yml
new file mode 100644
index 00000000..b3caa3f9
--- /dev/null
+++ b/.github/workflows/security-core.yml
@@ -0,0 +1,128 @@
+name: Security Core
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+ schedule:
+ - cron: "41 2 * * 1"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: security-core-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ gitleaks:
+ name: Gitleaks history
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - name: Checkout full history
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+
+ - name: Scan Git history
+ uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITLEAKS_VERSION: 8.30.1
+
+ trivy:
+ name: Trivy filesystem
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ steps:
+ - name: Checkout
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+ with:
+ persist-credentials: false
+
+ - name: Scan vulnerabilities, misconfigurations and secrets
+ uses: aquasecurity/trivy-action@a9c7b0f06e461e9d4b4d1711f154ee024b8d7ab8 # v0.36.0
+ with:
+ scan-type: fs
+ scan-ref: .
+ scanners: vuln,misconfig,secret
+ severity: HIGH,CRITICAL
+ exit-code: "1"
+ format: table
+
+ - name: Generate CycloneDX SBOM
+ uses: aquasecurity/trivy-action@a9c7b0f06e461e9d4b4d1711f154ee024b8d7ab8 # v0.36.0
+ with:
+ scan-type: fs
+ scan-ref: .
+ scanners: vuln
+ format: cyclonedx
+ output: mso.cdx.json
+ exit-code: "0"
+
+ - name: Upload SBOM
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
+ with:
+ name: mso-cyclonedx-sbom
+ path: mso.cdx.json
+ retention-days: 14
+
+ osv:
+ name: OSV dependency scan
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - name: Checkout
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+ with:
+ persist-credentials: false
+
+ - name: Scan lockfiles with OSV-Scanner 2.5.1
+ run: >-
+ docker run --rm -v "$PWD:/src:ro"
+ ghcr.io/google/osv-scanner@sha256:8108ae94eadea5a02c9bec6e646909d5b790b44bd62d7f5b7f0b1d6d0ffc7734
+ scan source --recursive /src
+
+ semgrep:
+ name: Semgrep OWASP/SAST
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ steps:
+ - name: Checkout
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+ with:
+ persist-credentials: false
+
+ - name: Scan JavaScript/TypeScript and OWASP rules
+ run: >-
+ docker run --rm -v "$PWD:/src:ro"
+ semgrep/semgrep@sha256:f1f7b71861c7b28b6e0f661225a2c4f58a484f5d0f182465c6d6b3b22f972ade
+ semgrep scan --metrics=off
+ --config=p/javascript --config=p/typescript --config=p/owasp-top-ten
+ --error /src
+
+ shellcheck:
+ name: ShellCheck
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ steps:
+ - name: Checkout
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
+ with:
+ persist-credentials: false
+
+ - name: Check tracked shell entrypoints
+ shell: bash
+ run: |
+ set -euo pipefail
+ mapfile -t files < <(git grep -Il '^#!.*sh' -- '*.sh' 'bin/*' 'scripts/*' 'claude-skills/*' || true)
+ args=()
+ for file in "${files[@]}"; do args+=("/src/$file"); done
+ ((${#args[@]} > 0)) || { echo "No shell entrypoints found"; exit 0; }
+ docker run --rm -v "$PWD:/src:ro" \
+ koalaman/shellcheck-alpine@sha256:9955be09ea7f0dbf7ae942ac1f2094355bb30d96fffba0ec09f5432207544002 \
+ shellcheck --severity=warning -e SC1090,SC2034 "${args[@]}"
diff --git a/.gitleaksignore b/.gitleaksignore
new file mode 100644
index 00000000..f0b0a504
--- /dev/null
+++ b/.gitleaksignore
@@ -0,0 +1,6 @@
+71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:generic-api-key:39
+71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:generic-api-key:41
+71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:generic-api-key:42
+71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:generic-api-key:43
+71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:generic-api-key:65
+71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:jwt:50
diff --git a/README.md b/README.md
index 3be257b7..74f65410 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,9 @@
<p align="center">
<a href="https://github.com/rahmanef63/mso/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/rahmanef63/mso/actions/workflows/ci.yml/badge.svg" /></a>
+ <a href="https://github.com/rahmanef63/mso/actions/workflows/codeql.yml"><img alt="CodeQL" src="https://github.com/rahmanef63/mso/actions/workflows/codeql.yml/badge.svg" /></a>
+ <a href="https://github.com/rahmanef63/mso/actions/workflows/security-core.yml"><img alt="Security Core" src="https://github.com/rahmanef63/mso/actions/workflows/security-core.yml/badge.svg" /></a>
+ <a href="https://scorecard.dev/viewer/?uri=github.com/rahmanef63/mso"><img alt="OpenSSF Scorecard" src="https://api.scorecard.dev/projects/github.com/rahmanef63/mso/badge" /></a>
<img alt="Open Source" src="https://img.shields.io/badge/Open%20Source-MIT-green" />
<img alt="Self-hosted" src="https://img.shields.io/badge/Self--hosted-yes-2f7bf6" />
<img alt="Public Alpha" src="https://img.shields.io/badge/Public%20Alpha-Developer%20Preview-f59e0b" />
@@ -37,6 +40,8 @@ MSO is **Public Alpha / Developer Preview** software. It runs on top of Linux as
For a real deployment, put MSO behind **Tailscale, a VPN, or a TLS reverse proxy with tight access control**. Do not expose the raw app port to the public internet.
+**Security assurance:** MSO publishes its [security policy](./SECURITY.md) and [repeatable assurance process](./docs/SECURITY-ASSURANCE.md), with CodeQL, independent SAST/dependency/secret scanners, OpenSSF Scorecard, SBOM generation, passive OWASP ZAP checks, and MSO-specific security regression tests. The evidence is intentionally presented as testing—not as a security certification.
+
## Product screenshot/video
![Manef Shell OS running as a browser workspace on desktop and mobile](./docs/media/mso-hero.webp)
diff --git a/SECURITY.md b/SECURITY.md
index dce56db9..58eec965 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -4,12 +4,15 @@ Manef Shell OS is Public Alpha / Developer Preview software. It has not had a
third-party security audit. Only the latest commit on `main` is supported; there are no
release branches yet.
+The project's repeatable automated and manual verification lanes are documented in
+[`docs/SECURITY-ASSURANCE.md`](./docs/SECURITY-ASSURANCE.md). They are security evidence, not
+a certification or a substitute for an independent third-party audit.
+
## Reporting a vulnerability
-Do not open a public issue containing exploit details or secrets. Use GitHub's private
-vulnerability-reporting flow for this repository. Include the affected commit, reproduction
-steps, impact and sanitized logs. If private reporting is unavailable, open only a minimal
-public issue asking the maintainer to enable private advisory intake.
+Do not open a public issue containing exploit details or secrets. GitHub private
+vulnerability reporting is enabled for this repository; use **Security → Report a vulnerability**.
+Include the affected commit, reproduction steps, impact and sanitized logs.
Never post passwords, session secrets, API keys, bearer tokens, private file contents,
Camoufox profile data or full environment files.
diff --git a/claude-skills/mso-image-editor/image-editor.sh b/claude-skills/mso-image-editor/image-editor.sh
index 9c4e8ba0..6a985793 100755
--- a/claude-skills/mso-image-editor/image-editor.sh
+++ b/claude-skills/mso-image-editor/image-editor.sh
@@ -53,7 +53,7 @@ login() {
code=$(jq -n --arg p "$PASS" --arg d "$DEV" '{password:$p,deviceId:$d,deviceLabel:"os-image-editor cli"}' \
| curl -sS -o /dev/null -w '%{http_code}' -c "$JAR" "${ORIGIN[@]}" -X POST "$B/api/auth/login" \
-H 'content-type: application/json' -d @- || true)
- [ "$code" = "200" ] || { echo "login failed ($code). approve device? → node "$MSO_ROOT/scripts/approve-device.js" "$DEV"" >&2; exit 1; }
+ [ "$code" = "200" ] || { printf 'login failed (%s). approve device? → node "%s" "%s"\n' "$code" "$MSO_ROOT/scripts/approve-device.js" "$DEV" >&2; exit 1; }
}
[ -f "$JAR" ] || login
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index a45b102b..a07cbb09 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -12,6 +12,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Chores**
+- `security` add ultimate assurance suite
- `security` add Codex Security scanning
## 2026-08-24
diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md
index b628e0be..35a6a073 100644
--- a/docs/DEVELOPMENT.md
+++ b/docs/DEVELOPMENT.md
@@ -23,7 +23,8 @@ Every feature is a self-contained **vertical slice** under `frontend/slices/<slu
## Quality gates
```bash
-bun run verify # typecheck + lint + test + check + audit (high/critical only)
+bun run verify # fast/full repository quality gate
+bun run security:ultimate # release security assurance: independent scanners + deep review + DAST
```
The **committed source of truth** for pre-push policy is `scripts/gates.sh`. The
diff --git a/docs/README.md b/docs/README.md
index 425ad6f3..9fbeffec 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -22,6 +22,7 @@ machine-verifiable facts. The repository quality gate runs it automatically.
| [`ARCHITECTURE.md`](./ARCHITECTURE.md) | Current runtime, shell, host, MCP and deployment architecture |
| [`INSTALL.md`](./INSTALL.md) | Owner installation, TLS, updates, backup and uninstall |
| [`DEVELOPMENT.md`](./DEVELOPMENT.md) | Development and release workflow |
+| [`SECURITY-ASSURANCE.md`](./SECURITY-ASSURANCE.md) | Repeatable security verification lanes, public evidence, and claim boundaries |
| [`CLI.md`](./CLI.md) | Generated `mso` CLI contract |
| [`MCP.md`](./MCP.md) | MCP/OAuth internals and full external-tool security model |
| [`CHATGPT-PLUGIN.md`](./CHATGPT-PLUGIN.md) | ChatGPT custom MCP app setup, diagrams, scopes and file bridge |
diff --git a/docs/SECURITY-ASSURANCE.md b/docs/SECURITY-ASSURANCE.md
new file mode 100644
index 00000000..bec54009
--- /dev/null
+++ b/docs/SECURITY-ASSURANCE.md
@@ -0,0 +1,76 @@
+# MSO Security Assurance
+
+MSO is a browser control plane for a Linux server, so security claims need stronger evidence than ordinary UI tests. This document defines the **repeatable security assurance process** used for MSO. It is evidence, not a certification or a guarantee that vulnerabilities do not exist.
+
+The standing baseline is informed by **OWASP ASVS 5.0.0**. MSO does not claim an ASVS certification or complete ASVS level until every applicable requirement has been independently assessed. OWASP Top 10 coverage is treated as awareness coverage, not as a substitute for ASVS verification.
+
+## Public verification lanes
+
+| Lane | Tool / control | What it verifies | Gate |
+|---|---|---|---|
+| Application regression | Vitest + production build | Auth, session, device approval, OAuth/PKCE, MCP scopes, filesystem boundaries, SSRF, proxy/origin, race/revocation and other MSO-specific invariants | Tests/build must pass |
+| SAST | GitHub CodeQL `security-extended` | JavaScript/TypeScript data-flow and security queries | CodeQL analysis must complete; High/Critical alerts block release review |
+| Independent SAST | Semgrep | JavaScript/TypeScript plus OWASP-oriented rules | Findings make the security job fail |
+| Dependency CVEs | Bun audit + Google OSV-Scanner | Known vulnerabilities in resolved dependencies / lockfiles | High/Critical Bun advisories or OSV findings fail |
+| Repository / IaC / secret scan | Trivy | Vulnerabilities, security misconfiguration and secret patterns in tracked source | High/Critical finding or secret match fails |
+| Git history secrets | Gitleaks | Secret patterns across full Git history | Any non-reviewed finding fails |
+| Shell safety | ShellCheck | Warning/error-level shell defects in executable scripts | Warning/error finding fails except two documented non-security false-positive classes |
+| DAST | OWASP ZAP Baseline | Passive browser-facing scan of the live HTTPS surface | Baseline scan must complete; alert policy is reviewed before promotion |
+| AI-assisted code audit | OpenAI Codex Security | Repository-wide security review with a High/Critical release threshold | Full repository scan must pass for an assurance run |
+| Supply chain | OpenSSF Scorecard | Public repository security posture: pinned dependencies, branch protection, review process and related heuristics | Score is published as external evidence, not self-awarded |
+| Dependency changes | GitHub Dependency Review | Vulnerabilities newly introduced by pull requests | High/Critical introduced dependency fails |
+| SBOM | Trivy CycloneDX | Machine-readable component inventory | Generated on Security Core workflow |
+
+All GitHub Actions referenced by the repository are pinned to immutable commit SHAs. Scanner containers used by the reproducible local gate are pinned to image digests.
+
+## GitHub security controls
+
+The public repository enables:
+
+- private vulnerability reporting;
+- Dependabot vulnerability alerts and security updates;
+- GitHub secret scanning;
+- secret scanning push protection;
+- CodeQL code scanning;
+- Dependency Review for pull requests;
+- OpenSSF Scorecard publication.
+
+Controls that GitHub does not make available for the current repository/account are not represented as enabled.
+
+## One-command ultimate gate
+
+From a clean development checkout with Docker and the normal MSO toolchain:
+
+```bash
+bun run security:ultimate
+```
+
+The command creates a `0700` private run directory under `~/.mso/security-assurance`, snapshots **tracked files only**, and runs the repository verification plus Trivy, OSV-Scanner, Gitleaks, Semgrep, ShellCheck, a full-repository Codex Security scan and the passive ZAP baseline. Detailed scanner output stays outside the repository. A failing scanner produces a failing command; the script does not convert scanner outages into security passes.
+
+Codex Security is intentionally not an automatic per-commit hosted gate because it consumes model/API budget. The published assurance gate uses Codex Security's stable full-repository `standard` mode. Deep mode remains available through `MSO_SECURITY_CODEX_MODE=deep`; the wrapper pins OpenAI's conservative deep example (2 discovery workers, 0 nested subagents, stop after 3 no-new runs, at most 10 discovery runs, 1.5-hour discovery ceiling), but a failed deep orchestration is never converted into a pass or advertised as a completed deep review. A maintainer can explicitly skip the Codex lane with `MSO_SECURITY_SKIP_CODEX=1`, but a run with a skipped lane must not be advertised as the full ultimate gate. ZAP is likewise skippable for offline development, but not for a published assurance run.
+
+## Reviewed Gitleaks fixtures
+
+MSO's redaction unit test intentionally contains six realistic-looking **synthetic** credential fixtures so the redactor can prove it removes secrets. Gitleaks correctly detects those patterns in the historical commit that introduced the test. The repository records six exact finding fingerprints in `.gitleaksignore` and marks the current fixture lines with `gitleaks:allow`.
+
+The exception is intentionally finding-specific. The file and rules are **not** globally allowlisted, so a new secret-like value in that test file still fails the scan and requires review.
+
+## Reviewed ZAP informational alerts
+
+The production baseline keeps five known passive signals visible as `INFO`: cache policy on the public manifest, intentionally non-storable private/auth-shell responses, broad HTTPS sources in `img-src`/`frame-src`, a Unix timestamp in a static bundle, and the deliberate absence of COEP. The CSP exception is a product trade-off: MSO permits user-selected remote images and sandboxed HTTPS embeds, while `connect-src` remains restricted and inbound framing is blocked by CSP `frame-ancestors 'none'` plus `X-Frame-Options: DENY`. COEP would break those supported cross-origin resources.
+
+These are rule-specific classifications in `security/zap-baseline.conf`, not a global warning bypass. Any other ZAP baseline alert remains a warning/failure and makes the gate non-zero.
+
+## ASVS-oriented coverage
+
+The automated suite materially exercises ASVS areas including authentication, session management, authorization, OAuth/MCP access control, validation/sanitization, stored-file/path handling, SSRF/network destinations, security headers/browser policy, logging/redaction, dependency integrity and secure configuration. The historical audit in [`AUDIT-2026-08-24.md`](./AUDIT-2026-08-24.md) documents concrete adversarial reproductions and remediations.
+
+Automation cannot establish every ASVS requirement. Deployment architecture, host hardening, operator practices, recovery procedures, threat modeling and some manual design requirements still need human verification. A self-hosted MSO deployment also inherits risk from the Linux host, reverse proxy, installed managed applications and any third-party AI provider selected by the owner.
+
+## What is safe to say publicly
+
+When the latest `main` workflows and the latest full assurance run are green, the project may say:
+
+> MSO is continuously tested with CodeQL, Semgrep, Trivy, OSV-Scanner, Gitleaks, ShellCheck, Dependency Review and OpenSSF Scorecard, with a passive OWASP ZAP production baseline and a separate full-repository Codex Security review. The public repository has private vulnerability reporting, secret scanning/push protection, dependency alerts, an SBOM workflow and MSO-specific security regression tests. The latest published assurance run has no known unresolved High/Critical findings from those gates.
+
+Do **not** shorten this into “certified secure”, “OWASP certified”, “penetration-tested by OWASP”, “100% secure”, or “third-party audited”. Those claims are not established by this process.
diff --git a/lib/managed-apps/redact.test.ts b/lib/managed-apps/redact.test.ts
index 9df3b518..7eaea86a 100644
--- a/lib/managed-apps/redact.test.ts
+++ b/lib/managed-apps/redact.test.ts
@@ -36,18 +36,18 @@ describe("secrets that reached a persisted transcript before this widened", () =
"remote: HTTP Basic: Access denied. The provided token ghp_A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6 is invalid.",
"ghp_A1b2",
],
- ["an npm registry auth line, where the key is a compound", "//registry.npmjs.org/:_authToken=npm_Xy12Ab34Cd56Ef78Gh90Ij12Kl34Mn", "npm_"],
+ ["an npm registry auth line, where the key is a compound", "//registry.npmjs.org/:_authToken=npm_Xy12Ab34Cd56Ef78Gh90Ij12Kl34Mn", "npm_"], // gitleaks:allow — intentionally synthetic redaction fixture
["an env assignment with no word boundary before API", "ANTHROPIC_API_KEY=sk-ant-api03-Zz99Yy88Xx77Ww66Vv55", "sk-ant"],
- ["the same, exported by a shell line the CLI echoed", "export OPENAI_API_KEY=sk-proj-Qq11Ww22Ee33Rr44Tt55Yy66", "sk-proj"],
- ['json with the quote between key and colon', '{"api_key": "sk-live-Aa11Bb22Cc33Dd44Ee55"}', "sk-live"],
- ["the camelCase json spelling openclaw --json prints", '{"apiKey":"sk-live-Ff66Gg77Hh88Ii99Jj00"}', "sk-live"],
+ ["the same, exported by a shell line the CLI echoed", "export OPENAI_API_KEY=sk-proj-Qq11Ww22Ee33Rr44Tt55Yy66", "sk-proj"], // gitleaks:allow — intentionally synthetic redaction fixture
+ ['json with the quote between key and colon', '{"api_key": "sk-live-Aa11Bb22Cc33Dd44Ee55"}', "sk-live"], // gitleaks:allow — intentionally synthetic redaction fixture
+ ["the camelCase json spelling openclaw --json prints", '{"apiKey":"sk-live-Ff66Gg77Hh88Ii99Jj00"}', "sk-live"], // gitleaks:allow — intentionally synthetic redaction fixture
["credentials inside a URL", "fatal: unable to access https://rahman:[email protected]/x/y.git/", "hunter2horse"],
// Assembled rather than written out: as one literal this fixture trips
// GitHub's push protection and the push is rejected. It is a made-up value,
// but a scanner cannot know that, and the test needs the shape, not a string.
["a slack bot token", `posting to ${"xoxb"}-1111111111-2222222222-AbCdEfGhIjKlMnOp`, "xoxb-"],
["an AWS key id", "aws configure: found AKIAIOSFODNN7EXAMPLE in the environment", "AKIA"],
- ["a JWT", "auth failed for eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U", "eyJhbGciOi"],
+ ["a JWT", "auth failed for eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U", "eyJhbGciOi"], // gitleaks:allow — intentionally synthetic redaction fixture
];
for (const [what, line, leaked] of cases) {
@@ -62,7 +62,7 @@ describe("secrets that reached a persisted transcript before this widened", () =
expect(redact("fatal: unable to access https://rahman:[email protected]/x/y.git/")).toBe(
"fatal: unable to access https://rahman:[redacted]@github.com/x/y.git/",
);
- expect(redact('{"apiKey":"sk-live-Ff66Gg77Hh88Ii99Jj00"}')).toBe('{"apiKey":"[redacted]"}');
+ expect(redact('{"apiKey":"sk-live-Ff66Gg77Hh88Ii99Jj00"}')).toBe('{"apiKey":"[redacted]"}'); // gitleaks:allow — intentionally synthetic redaction fixture
// Still a header line, still named — only the credential is gone.
const header = redact("Authorization: Bearer abcdefghijklmnop");
expect(header).toContain("Authorization");
diff --git a/lib/skills/catalog-continuation.test.ts b/lib/skills/catalog-continuation.test.ts
index 7800114c..1f09cfa0 100644
--- a/lib/skills/catalog-continuation.test.ts
+++ b/lib/skills/catalog-continuation.test.ts
@@ -16,6 +16,11 @@ afterEach(async () => { await Promise.all(temps.splice(0).map((d) => rm(d, { rec
const body = (name: string) => `---\nname: ${name}\ndescription: ${name} desc\n---\n\n# ${name}\n`;
+// These two continuation tests intentionally create 300+ real filesystem entries.
+// The production scanner still enforces maxScanMs=4s; this timeout only prevents
+// coverage/loaded-CI overhead from turning correct cursor behavior into a 5s Vitest flake.
+const LARGE_FS_TEST_TIMEOUT_MS = 15_000;
+
async function skillsIn(root: string, count: number, prefix: string) {
await mkdir(root, { recursive: true });
await Promise.all(Array.from({ length: count }, async (_, i) => {
@@ -57,7 +62,7 @@ describe("maxProjectSkills continuation returns the remainder of a partially con
const all = await drain(opts);
// 310 project skills in total, none dropped.
expect([...all].filter((id) => id.includes("/")).length).toBe(310);
- });
+ }, LARGE_FS_TEST_TIMEOUT_MS);
it("records the exact interrupted root rather than marking it complete", async () => {
const workspace = await temp();
@@ -74,7 +79,7 @@ describe("maxProjectSkills continuation returns the remainder of a partially con
const all = await drain(opts);
expect([...all].filter((id) => id.includes("/")).length).toBe(SKILL_SCAN_LIMITS.maxProjectSkills + 20);
- });
+ }, LARGE_FS_TEST_TIMEOUT_MS);
});
describe("a deadline never advances the cursor past an unprocessed entry", () => {
diff --git a/package.json b/package.json
index 39b9a635..0c65d821 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"check": "node scripts/check-cycles.mjs && node scripts/check-docs.mjs && node scripts/check-contrast.mjs && node scripts/check-skill-flows.mjs",
"audit": "node scripts/audit.mjs",
"verify": "bun run typecheck && bun run lint && bun run coverage && bun run check && bun run audit",
+ "security:ultimate": "bash scripts/security-ultimate.sh",
"e2e": "node scripts/e2e/shell.mjs",
"e2e:preview": "node scripts/e2e/preview.mjs",
"changelog": "node scripts/gen-changelog.mjs",
diff --git a/scripts/codex-security-scan.sh b/scripts/codex-security-scan.sh
index 8cff3c56..61e772b6 100755
--- a/scripts/codex-security-scan.sh
+++ b/scripts/codex-security-scan.sh
@@ -35,7 +35,16 @@ args=(
)
if [[ "$MODE" == "deep" ]]; then
- args+=(--max-time-hours "${CODEX_SECURITY_MAX_TIME_HOURS:-1.5}")
+ # Use OpenAI's conservative documented Deep Scan profile by default. Keeping
+ # worker/subagent counts explicit makes the assurance run reproducible across
+ # hosts and avoids silently inheriting more aggressive engine defaults.
+ args+=(
+ --workers "${CODEX_SECURITY_WORKERS:-2}"
+ --subagents "${CODEX_SECURITY_SUBAGENTS:-0}"
+ --stop-after-no-new "${CODEX_SECURITY_STOP_AFTER_NO_NEW:-3}"
+ --max-discovery-runs "${CODEX_SECURITY_MAX_DISCOVERY_RUNS:-10}"
+ --max-time-hours "${CODEX_SECURITY_MAX_TIME_HOURS:-1.5}"
+ )
fi
if [[ "${CODEX_SECURITY_DRY_RUN:-0}" == "1" ]]; then
args+=(--dry-run)
diff --git a/scripts/security-ultimate.sh b/scripts/security-ultimate.sh
new file mode 100755
index 00000000..aec5a21e
--- /dev/null
+++ b/scripts/security-ultimate.sh
@@ -0,0 +1,105 @@
+#!/usr/bin/env bash
+# Reproducible MSO security assurance gate. Scanner details stay private; stdout is a pass/fail summary.
+set -euo pipefail
+umask 077
+
+ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" || exit 1
+cd "$ROOT"
+
+TRIVY_IMAGE='aquasec/trivy@sha256:62b1e65e8869bc4b4c6aa4fa2b21595256c7c2f6018a9d9ad61caf87187c1969' # 0.74.0
+OSV_IMAGE='ghcr.io/google/osv-scanner@sha256:8108ae94eadea5a02c9bec6e646909d5b790b44bd62d7f5b7f0b1d6d0ffc7734' # 2.5.1
+GITLEAKS_IMAGE='zricethezav/gitleaks@sha256:c00b6bd0aeb3071cbcb79009cb16a60dd9e0a7c60e2be9ab65d25e6bc8abbb7f' # 8.30.1
+SEMGREP_IMAGE='semgrep/semgrep@sha256:f1f7b71861c7b28b6e0f661225a2c4f58a484f5d0f182465c6d6b3b22f972ade' # 1.174.0
+SHELLCHECK_IMAGE='koalaman/shellcheck-alpine@sha256:9955be09ea7f0dbf7ae942ac1f2094355bb30d96fffba0ec09f5432207544002' # 0.11.0
+ZAP_IMAGE="${MSO_SECURITY_ZAP_IMAGE:-ghcr.io/zaproxy/zaproxy@sha256:781a2bdaea47324e7bab583e2263f21d257b0aee61ed51521a5be45f5f5081ef}" # 2.17.0
+DAST_URL="${MSO_SECURITY_DAST_URL:-https://mso.rahmanef.com}"
+
+STAMP="$(date -u +%Y%m%dT%H%M%SZ)"
+STATE_BASE="${MSO_SECURITY_STATE_BASE:-$HOME/.mso/security-assurance}"
+RUN_DIR="${MSO_SECURITY_OUTPUT_DIR:-$STATE_BASE/$STAMP}"
+SRC="$RUN_DIR/source"
+LOGS="$RUN_DIR/logs"
+mkdir -p "$SRC" "$LOGS"
+chmod 700 "$RUN_DIR" "$SRC" "$LOGS"
+
+cleanup() {
+ rm -rf "$SRC"
+}
+trap cleanup EXIT INT TERM
+
+need() { command -v "$1" >/dev/null 2>&1 || { echo "security: missing dependency: $1" >&2; exit 2; }; }
+need git; need docker; need bun; need tar
+
+echo "MSO ultimate security gate"
+echo "revision=$(git rev-parse --short=12 HEAD)"
+echo "private_logs=$LOGS"
+
+# Snapshot tracked files only: current tracked edits are included, untracked .env/state files are not.
+git ls-files -z | tar --null -T - -cf - | tar -xf - -C "$SRC"
+
+run_capture() {
+ local name="$1"; shift
+ local safe_name="${name//[^A-Za-z0-9._-]/-}"
+ local log="$LOGS/$safe_name.log"
+ mkdir -p "$LOGS"
+ printf '%-28s ' "$name"
+ if "$@" >"$log" 2>&1; then
+ echo PASS
+ else
+ echo FAIL
+ echo "security: $name failed; private diagnostics: $log" >&2
+ return 1
+ fi
+}
+
+run_capture "repository verify" bun run verify
+run_capture "installer syntax" bash -n scripts/install.sh
+run_capture "Trivy high/critical" docker run --rm -v "$SRC:/src:ro" "$TRIVY_IMAGE" \
+ fs --scanners vuln,misconfig,secret --severity HIGH,CRITICAL --exit-code 1 /src
+run_capture "OSV dependencies" docker run --rm -v "$SRC:/src:ro" "$OSV_IMAGE" \
+ scan source --recursive /src
+run_capture "Gitleaks history" docker run --rm -v "$ROOT:/repo:ro" "$GITLEAKS_IMAGE" \
+ git --no-banner --redact --gitleaks-ignore-path /repo/.gitleaksignore /repo
+run_capture "Semgrep OWASP/SAST" docker run --rm -v "$SRC:/src:ro" "$SEMGREP_IMAGE" \
+ semgrep scan --metrics=off --config=p/javascript --config=p/typescript --config=p/owasp-top-ten --error /src
+
+mapfile -t shell_files < <(git grep -Il '^#!.*sh' -- '*.sh' 'bin/*' 'scripts/*' 'claude-skills/*' || true)
+shell_args=()
+for file in "${shell_files[@]}"; do shell_args+=("/src/$file"); done
+if ((${#shell_args[@]} > 0)); then
+ run_capture "ShellCheck warnings" docker run --rm -v "$SRC:/src:ro" "$SHELLCHECK_IMAGE" \
+ shellcheck --severity=warning -e SC1090,SC2034 "${shell_args[@]}"
+fi
+
+if [[ "${MSO_SECURITY_SKIP_CODEX:-0}" != "1" ]]; then
+ run_capture "Codex Security repository" env CODEX_SECURITY_MODE="${MSO_SECURITY_CODEX_MODE:-standard}" CODEX_SECURITY_FAIL_ON_SEVERITY=high \
+ CODEX_SECURITY_MAX_COST_USD="${CODEX_SECURITY_MAX_COST_USD:-5}" \
+ CODEX_SECURITY_OUTPUT_ROOT="$RUN_DIR/codex-results" \
+ CODEX_SECURITY_STATE_DIR="$RUN_DIR/codex-state" \
+ ./scripts/codex-security-scan.sh
+else
+ printf '%-28s %s\n' "Codex Security repository" SKIPPED
+fi
+
+if [[ "${MSO_SECURITY_SKIP_DAST:-0}" != "1" ]]; then
+ if [[ -z "$ZAP_IMAGE" ]]; then
+ echo "security: MSO_SECURITY_ZAP_IMAGE is required unless MSO_SECURITY_SKIP_DAST=1" >&2
+ exit 2
+ fi
+ ZAP_WORK="$RUN_DIR/zap-work"
+ mkdir -p "$ZAP_WORK"
+ cp "$ROOT/security/zap-baseline.conf" "$ZAP_WORK/zap-baseline.conf"
+ # ZAP 2.17's Automation Framework writes zap.yaml/report state under /zap/wrk.
+ # The parent RUN_DIR is 0700; this child is writable only so the unprivileged
+ # container user can create its ephemeral files. It contains no credentials.
+ chmod 777 "$ZAP_WORK"
+ chmod 644 "$ZAP_WORK/zap-baseline.conf"
+ run_capture "OWASP ZAP baseline" docker run --rm -t \
+ -v "$ZAP_WORK:/zap/wrk:rw" "$ZAP_IMAGE" \
+ zap-baseline.py -t "$DAST_URL" -m 2 -c zap-baseline.conf
+ chmod 700 "$ZAP_WORK"
+else
+ printf '%-28s %s\n' "OWASP ZAP baseline" SKIPPED
+fi
+
+echo "security: ULTIMATE PASS"
diff --git a/scripts/self-update.sh b/scripts/self-update.sh
index a8dc6948..e56e344d 100755
--- a/scripts/self-update.sh
+++ b/scripts/self-update.sh
@@ -14,7 +14,8 @@
# from. That build is unrecoverable in place — there is no old .next to put back.
set -uo pipefail
-cd "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" || exit 1
+cd "$ROOT" || exit 1
LOG="${MSO_UPDATE_LOG:-$HOME/.mso/self-update.log}"
mkdir -p "$(dirname "$LOG")"
diff --git a/security/zap-baseline.conf b/security/zap-baseline.conf
new file mode 100644
index 00000000..8013193d
--- /dev/null
+++ b/security/zap-baseline.conf
@@ -0,0 +1,8 @@
+# MSO ZAP baseline reviewed exceptions.
+# INFO keeps the signal visible without treating the documented design trade-off as a release failure.
+# Any other ZAP baseline rule remains WARN by default and therefore fails the gate (exit 2).
+10015 INFO (Public web manifest intentionally revalidates; no sensitive content)
+10049 INFO (Private/authenticated responses intentionally use no-store; static auth-shell responses inherit it)
+10055 INFO (CSP permits arbitrary HTTPS image/embed sources by product design; connect-src remains tightly restricted)
+10096 INFO (Build/static bundle contains ordinary Unix timestamps; no credential or host-secret exposure)
+90004 INFO (COEP intentionally omitted because cross-origin media/embeds are supported; inbound framing is denied separately)