XUNIA realtime command center: local worker queue and live controls - #74
XUNIA realtime command center: local worker queue and live controls#74sonoxo wants to merge 4 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dea117f67e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| message, | ||
| runtime: 'offline', | ||
| localOnly: true, | ||
| startCommand: 'python xunia_realtime_runtime.py', |
There was a problem hiding this comment.
Ship the runtime referenced by the command center
The offline response directs operators to run python xunia_realtime_runtime.py, but a repository-wide git ls-tree -r search at this commit finds no runtime script or other implementation of /health, /v1/jobs, or /v1/schedules. Consequently, the default 127.0.0.1:8765 configuration always remains offline and every newly added run, cancel, retest, and scheduling control fails unless operators independently obtain an undocumented external service.
Useful? React with 👍 / 👎.
| const body = lastManifest || buildManifest(); | ||
| const response = await apiRequest("POST", "/api/xunia/security/runtime/jobs", body); |
There was a problem hiding this comment.
Rebuild the manifest after changing modes
After building or running a PENTEST plan, changing the visible mode to ASSESS does not clear lastManifest, so Run Now submits the old PENTEST manifest here instead of the current form state. The server correctly validates that stale manifest as PENTEST, allowing safe-active checks to execute while the UI says ASSESS; rebuild the manifest for each run or invalidate it whenever mode changes.
Useful? React with 👍 / 👎.
| } | ||
| }); | ||
|
|
||
| app.post('/api/xunia/security/runtime/jobs', requireAuth, async (req: Request, res: Response) => { |
There was a problem hiding this comment.
Restrict active runtime operations by role
Because this execution endpoint uses only requireAuth, viewer and analyst accounts can submit real PENTEST/SIMULATE jobs and schedules, while the existing pentest execution routes in server/routes.ts restrict equivalent actions to owners and admins. Apply an appropriate requireRole guard to the new job, schedule, cancel, and retest endpoints so read-only users cannot invoke security tools against arbitrary targets.
Useful? React with 👍 / 👎.
| app.get('/api/xunia/security/runtime/jobs', requireAuth, async (_req: Request, res: Response) => { | ||
| try { | ||
| await relayJson(res, await runtimeFetch('/v1/jobs')); |
There was a problem hiding this comment.
Isolate runtime jobs between organizations
In a deployment serving multiple organizations, this endpoint proxies the runtime's entire global job list without passing or filtering by req.user.organizationId; the job payload includes manifests, target values, and authorization references that the new UI renders. The detail, cancel, and retest endpoints likewise accept any discovered job ID, so authenticated users in one tenant can inspect or control another tenant's work; bind jobs to the requesting organization and enforce ownership on every runtime operation.
Useful? React with 👍 / 👎.
Zyra realtime XUNIA control plane
Connects the Zyra Security Command Center to the free local GPT-Doug runtime.
Included
All active testing remains gated by the existing XUNIA engagement authorization model and destructive actions remain disabled.