Repository navigation
Endor: scan all code plugins (report-only) and remove unused Endor code - #4322
Conversation
Endor stays report-only and now covers every code-plugin release, official and community. Skills and bundle plugins remain out of scope. - Remove the unused Endor-to-judge mode, its custom ClawScan profile and the CODEX_SECURITY_SCAN_ENDOR_JUDGE_ENABLED flag. - Replace the CODEX_SECURITY_SCAN_ENDOR_PACKAGES selector with a code-plugin family check behind the existing master switch. - Run the scanner with `docker run --rm` and force-remove it on failure, replacing the create/inspect/label/late-create cleanup protocol. - Drop the local batch script, dry-run mode, unreferenced fixture harness, stale deploy-test branch exception and duplicate report validation. - Rewrite the Endor spec around the remaining behavior.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR enables report-only Endor scans for community code plugins and removes cohort selection, judge integration, and supporting tooling. Example: Scan @acme/community-plugin 1.0.0 with Endor enabled.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this maintainer-authored PR open: current main still limits Production Endor scans to official plugins, and no concrete introduced correctness bug was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe security worker consumes claimed release jobs and verified artifacts, runs isolated dependency analysis, and submits bounded Endor summaries alongside the independent moderation verdict. flowchart TD
A[Claimed release job] --> B[Verified artifact workspace]
B --> C[Code plugin eligibility]
C --> D[Isolated Endor container]
B --> E[ClawScan judge]
D --> F[Release completion]
E --> F
F --> G[Audit report and moderation]
Technical reviewBest possible solution: Use the existing worker and saved-result contract for report-only community scans, with activation held until tenant capacity is confirmed. Do we have a high-confidence way to reproduce the issue? This is an intentional rollout expansion; current-main workflow and eligibility source verify the existing official-only Production boundary. Is this the best way to solve the issue? Best-fix verdict: the existing worker is the right owner, and removing the unused judge branch is reasonable under the maintainer-authored direction; retaining only a wider cohort would be smaller but would preserve the parallel mode this PR intentionally retires. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ec198b182de8. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: Real resolver and network isolation checks support the retained controls, but the expanded credentialed boundary still needs complete final-effect verification. EvidenceWhat I checked:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 3, 2026, 6:14 PM ET / 23:14 UTC (Revision 2). |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Keep the manual fixture harness that proves, in the real scanner image, that npm and Yarn neither leak secrets nor run dependency scripts. Add an unprivileged-user check and a private-network egress probe, accept the 3-argument scan.sh call, and fail instead of hanging if the probe registry dies. Correct the spec on late-created containers: they are never started.
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…code-plugins # Conflicts: # scripts/security/scan-local-plugins.ts
What this PR does
@openclaw/*code plugins. After this PR it runs on community code plugins too. Skills and bundle plugins are still never scanned.The scanner's isolation (firewall, unprivileged user, credential-stripping npm/Yarn, no dependency scripts) is unchanged. This PR adds proof that it holds in the real Production image, because it now sees community code.
Rollout: read before merging
mainand Production already hasCODEX_SECURITY_SCAN_ENDOR_ENABLED=1. Community code-plugin publishes and rescans start running Endor on the next worker run, with no deploy step. To hold it, set that Production variable to0before merging.CODEX_SECURITY_SCAN_ENDOR_PACKAGES(Production) andCODEX_SECURITY_SCAN_ENDOR_JUDGE_ENABLED(Production and Test).Proof
1. Who gets scanned
These are the outputs of calling the old and new eligibility functions with Production's settings:
@openclaw/slack@acme/community-plugin@openclaw/some-bundle@acme/some-bundleWith the switch at
0, a community code plugin is skipped. Skill jobs never reach this check, because only package releases do.2. Isolation holds in the real Production image against hostile dependencies
I ran
scripts/security/endor/fixtures/run.shin the pinned Production imageghcr.io/openclaw/clawhub-endor@sha256:3db43b8b…2b2a. It ran behind the real entrypoint (egress guard, then drop tonode), with the worker's container flags and this PR'sscan.sh. A stand-inendorctlgets synthetic Endor/VirusTotal/unknown secrets and uses the image's real npm and Yarn to install from a local registry that records everyAuthorizationheader:preparescripts that try to record the secrets;.npmrcfiles that try to send the secrets as registry tokens.A separate container on the Docker bridge served as a private listener. Without the egress guard it is reachable:
The full harness:
fixture-okmeans all of the following held:preparescript ran, under npm or Yarn;.npmrcthat tried to use a secret;On macOS the REJECT's ICMP reply doesn't reach the emulated amd64 process, so a block shows as a timeout. The rule's packet counter confirmed the hits.
Negative control: I also ran it with a mutated
scan.shwhose npm/Yarn shims keep the environment (env -iremoved). The harness failed:3. Container cleanup with the real image and the real worker code
I called
runEndorPluginScanagainst the real image for a community release, with no Endor credentials:Both were recorded as Endor failures, and the worker force-removed the container. One edge case showed up: if the timeout lands while Docker is still creating the container, the daemon can finish creating it after the removal. That container stays
Createdand is never started, so nothing runs in it, and the disposable runner discards it. With the 20-minute production timeout this is practically unreachable. The spec documents it.4. Report-only through the real worker path
processJobtests for a community code plugin, with both a completed and a failed Endor scan, check three things:completeCodexScanJob;--config,--context,--scanner-result endor=or anyENDOR_*credential;metadata.jsonholds no storedendorAnalysis.Not proven here
A real Endor scan with real credentials. I don't hold them, and this PR doesn't change how
endorctlis called: the call is the same as the one Production already runs for official plugins. The first community scans after merge are that proof. They show up on the release's security audit page.What changed, file by file
Removed or simplified
clawHubEndorProfile.ts(a custom ClawScan profile with a hand-copied judge prompt),CODEX_SECURITY_SCAN_ENDOR_JUDGE_ENABLED, and the Endor evidence checks in the artifact validator. Production forced this off, and only Test ran it, so Test wasn't checking the same behaviour Production runs.CODEX_SECURITY_SCAN_ENDOR_PACKAGESand the@openclaw/*selector are replaced byfamily === "code-plugin".EndorContainerCleanupError→ stop worker and keep workspace is replaced bydocker run --rm --name <uuid>. On failure or timeout the worker runsdocker rm --force. A real removal failure is added to the recorded error; "No such container" after--rmalready cleaned up is not.scan-local-plugins.tsand theclawscan:pluginsscript;scan.sh's dry-run mode and its duplicate JSON-shape check (the worker validates with zod);assertNoExternalSymlinks(the worker already refuses tarballs with links); thedeploy-test.ymlexception for the deleted branchcodex/endor-plugin-scan-main-20261001.specs/endor-plugin-scans.mdis rewritten around the remaining behavior. Stale Endor-judge text is removed fromspecs/security-consumer-model-policy.md,specs/deploy.mdanddocs/security-audits.md.Kept or added on purpose
.npmrcrejection, the fresh Git snapshot, the reachable-function filter and the bounded summary.scripts/security/endor/fixtures/run.shandprobe_server.py: the real-container isolation proof above. This PR adds the non-root check, the egress probe and a fail-fast for a dead probe registry. The spec says to run it before changing the image, npm, Yarn,scan.shor the egress guard.Known tradeoff, not changed here: ClawScan still waits for Endor (up to 20 minutes) before judging. That order made sense when the judge consumed Endor's result. Running them in parallel is a reasonable follow-up, but it changes how failures and cleanup are ordered.
Local checks
run-endor-plugin-scan,endor/scan,run-codex-scan-worker-clawscan,run-codex-scan-workeranddeploy-test-workflow. 144 passed.bun run ci:static,tsrs --noEmitandbun run buildpassed.ci:unitlocally: only load-related subprocess timeouts. Those files pass when run alone. One of them (clawscan-diagnostic-fixed-registry) fails the same way on unmodifiedmain.maindeploys fine.package.json