Secrets, schedules-as-objects, group runs, OIDC UX, installer dialog and GPO polish #2

Merged
gsadmin merged 30 commits from dev into main 2026-08-07 22:45:39 +00:00

30 Commits

Author SHA256 Message Date
gsadmin 73d9f0faee Icon generation degrades to a warning when winget is unavailable
CI / build-test (pull_request) Successful in 3m10s
CI / images (pull_request) Has been skipped
CI / build-test (push) Successful in 4m19s
CI / images (push) Successful in 2m50s
CI service accounts have no winget; the icon is cosmetic and the MSI
compiles without it, so skipping beats failing the whole package step.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 18:13:34 -04:00
gsadmin 69c1b9d01a CI: Node 22 — the nats.js packages refuse Node 20
CI / build-test (push) Failing after 3m56s
CI / images (push) Has been skipped
CI / build-test (pull_request) Successful in 3m4s
CI / images (pull_request) Has been skipped
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 18:05:32 -04:00
gsadmin c1213d913c CI: clone with git directly — actions/checkout cannot handle SHA-256 repos
CI / build-test (push) Failing after 2m44s
CI / images (push) Has been skipped
CI / build-test (pull_request) Failing after 1m22s
CI / images (pull_request) Has been skipped
checkout@v4 inits a SHA-1 repository and then fetches, which a SHA-256
server refuses ("mismatched algorithms"). A plain git clone negotiates
the object format, so the workflows check out with git + the injected
token (branch for pushes/PRs, tag for releases).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 18:00:31 -04:00
gsadmin 78082a1097 CI: check out by ref name — SHA-256 repo defeats checkout's sha detection
CI / build-test (push) Failing after 58s
CI / images (push) Has been skipped
CI / build-test (pull_request) Failing after 50s
CI / images (pull_request) Has been skipped
actions/checkout only recognizes 40-hex SHA-1 ids; this repository uses
the SHA-256 object format, so the 64-hex head sha was fetched as a named
ref ("couldn't find remote ref"). Branch/tag names sidestep it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 17:56:25 -04:00
gsadmin 769d48c881 MSI gains an interactive connection page; registry key DRYed to one define
CI / build-test (push) Failing after 13s
CI / images (push) Has been skipped
CI / build-test (pull_request) Failing after 55s
CI / images (pull_request) Has been skipped
Interactive installs now show Welcome → Connection settings → Verify:
a server URL field and a masked bootstrap token field editing the same
SERVERURL / BOOTSTRAPTOKEN public properties the command line sets, so
CLI values and silent installs behave exactly as before and AppSearch
prefills the URL on upgrades. License and directory pages are skipped.
Service install/start/enroll and the uninstall stop+remove+credential
purge were already wired and are unchanged.

The agent registry key is now a single preprocessor define
($(var.AgentRegKey)) used by all twelve references, so one change moves
everything and nesting appends to it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 16:22:18 -04:00
gsadmin 97e92892df GPMC-quality explain text for every agent policy; GraceSolution removed
CI / build-test (push) Failing after 12s
CI / images (push) Has been skipped
Each ADML help string now reads like proper Group Policy documentation:
what the setting does, Enabled/Disabled/Not Configured behavior, the
default, valid input forms (seconds or hh:mm:ss), operational trade-offs
and security guidance (remote shell stays deliberately opt-in; script
opt-out is enforced on the device), plus the service-restart note since
configuration is read at start. Every stated fact was verified against
the agent's configuration loader and enforcement paths.

GraceSolution is scrubbed everywhere it remained: the ADMX namespace and
GPMC category (ExecuteR Agent is now top-level), MSI manufacturer and
install path (Program Files\ExecuteR Agent, no company folder), the ZIP
bootstrap script, the unused Branding company constants, and docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 16:16:29 -04:00
gsadmin b087c0af78 Device page shows the agent's public IP, masked until revealed
CI / build-test (push) Failing after 12s
CI / images (push) Has been skipped
The backend records the IP each agent is seen from — resolved through
trusted forwarded headers — at enrollment and on every verified
credential refresh, so it stays current as agents roam. The Connectivity
card shows it masked by default with a Reveal toggle; revealed, it is a
click-to-copy chip. The NATS WebSocket terminates at the proxy, so the
HTTP paths are the only faithful source.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 15:00:40 -04:00
gsadmin 22e63e57bd Network tab: MAC joins the aligned rows instead of floating right
CI / build-test (push) Failing after 12s
CI / images (push) Has been skipped
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 14:50:30 -04:00
gsadmin 82229276a1 Storage shows disks with their volumes nested underneath
CI / build-test (push) Failing after 13s
CI / images (push) Has been skipped
The agent walks Win32_DiskDriveToDiskPartition and
Win32_LogicalDiskToPartition so every drive letter maps to its physical
disk. The hardware tab renders each disk (model, bus, size, copyable
serial) with its volumes indented beneath — file system, usage bar and
free-of-total — and volumes without a mapping fall into their own group.
Dev seed grows a two-disk layout so the hierarchy is visible.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 14:04:04 -04:00
gsadmin 18b300f674 Sign-in button shows a friendly provider name
New OIDC_PROVIDER_NAME / Settings field ("Authentik", "Entra ID", …)
feeds the sign-in button subtext; the authority host remains only the
fallback when no name is set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 14:04:04 -04:00
gsadmin 09690fe060 Refresh every screenshot against the current UI
CI / build-test (push) Failing after 13s
CI / images (push) Has been skipped
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 13:39:30 -04:00
gsadmin 23962dae7a Device network tab: per-value copy chips instead of comma-joined text
Each IP, gateway, DNS server and the MAC address is its own click-to-copy
chip (CopyChip is reusable), replacing the joined mono strings that could
not be copied individually.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 13:39:29 -04:00
gsadmin 5d0fa50fe1 Sign-in: green Authenticate using OIDC button with provider subtext
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 13:39:29 -04:00
gsadmin a5ad4c3f35 Hashtable entries typed per entry; expansion runs in the background
Hashtable parameters no longer fix one key/value type for the whole
table: every entry picks its own primitives as it is added, carried as
native JSON and rebuilt by the agent from each element's own kind. That
change surfaced a latent binder bug — the int-downcast ternary widened
numbers back to long before boxing, so hashtable keys never matched
integer lookups — now fixed with explicit branches.

On-device expansion becomes the background default (ExpandEnvironment-
Variables then ExpandString, one pass), replacing the confusing per-mode
"On device" selector with a single Literal opt-out checkbox for values
where the raw text is the point. Stored definitions with removed enum
values degrade to no parameters instead of failing every script read.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 13:39:17 -04:00
gsadmin e97da66800 Groups page: Add trigger is a primary action in the section header
CI / build-test (push) Failing after 36s
CI / images (push) Has been skipped
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 13:10:24 -04:00
gsadmin 14c9753e7c Resolve the public URL centrally: env var wins, trusted headers otherwise
PublicUrl.Resolve backs every displayed URL and generated command:
PUBLIC_SERVER_URL when set, else scheme/host from trusted forwarded
headers. The OIDC redirect URI now honors PUBLIC_SERVER_URL (previously
header-only, wrong when admins browse an internal hostname), and the
Settings install command uses the new /api/settings/server endpoint
instead of trusting the browser origin.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 13:10:24 -04:00
gsadmin 265c5eb037 Secret picker browses the vault; saved providers get a row Test
The script editor navigates folders starting from the provider default
path and picks secrets from a names-only dropdown at the chosen path,
falling back to manual entry whenever listing fails. The driver interface
gains ListFolderPathsAsync (Infisical v1 folders API), and saved provider
rows expose a Test that merges stored credentials server-side so nothing
sensitive is re-entered or returned. Listing failures now surface as 502
instead of leaking a 500 from raw HTTP errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 13:10:11 -04:00
gsadmin 377d4e3221 Schedules become reusable cadence objects honored by scripts
A schedule now defines only when — name, one-shot or recurring cadence,
time zone. Scripts honor it through assignments carrying the target
(device or group) and stored run values, so one "Nightly at 1am" drives
any number of scripts and pausing the cadence pauses everything attached.
Firing prepares each script once per sweep and every assignment records
its own last result; one-shots disable after firing all assignments, and
deleting a script or schedule cascades its assignments.

The Schedules page manages the objects (builder extracted into a shared
cadence editor, cron still behind Advanced with plain-English description
and server-computed next runs) and shows what uses each cadence; the
script editor's panel attaches and detaches them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 13:10:00 -04:00
gsadmin a3b7429cac Fleet-wide Schedules page
CI / build-test (push) Failing after 53s
CI / images (push) Has been skipped
New nav entry listing every schedule sorted by next run: status chip
(Active / Paused / Done), script link, device or group target,
plain-English cadence, next occurrence and last firing result, with
pause/enable and delete in place. The cadence describer moves to a
shared module used by both the overview and the per-script card.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 12:35:03 -04:00
gsadmin dc9b1c2360 README: group fan-out runs and schedule semantics
CI / build-test (push) Failing after 16s
CI / images (push) Has been skipped
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 11:45:06 -04:00
gsadmin f8a9075316 Scheduled runs: friendly cadences first, cron behind Advanced
Scripts can now run on a schedule — once at a set time or recurring —
against a device or a group (members resolved at fire time). The builder
leads with plain selectors (every N minutes/hours, daily/weekly/monthly
at a time, weekday chips) and compiles them to cron internally; a raw
cron field exists only under "Advanced". Whatever is chosen is
auto-described in plain English and grounded by a server-side preview of
the next occurrences, so the description can never drift from reality.

Cronos evaluates expressions in the schedule's time zone with UTC
storage. A 30s worker fires due schedules through the shared JobRunner
(jobs appear as schedule:<name>), advances recurrence from "now" so
downtime causes at most one late firing, disables finished one-shots,
self-disables when the script vanishes, and records a per-firing
LastResult. Stored run values ride along on every firing; a vault
failure is recorded without stalling the cadence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 11:44:40 -04:00
gsadmin 0335694e93 Run scripts on device groups with live per-member fan-out
The target selector now offers groups alongside devices. A group run
creates one job per non-orphaned member (offline members get theirs
durably via JetStream when they reconnect) and the side panel tracks
every job's state live, with click-to-focus output per device. Orphaned
members are reported as skipped rather than silently dropped.

Dispatch logic that was duplicated between the jobs endpoint and the
trigger service now lives in one JobRunner (prelude composition, secret
resolution, durable dispatch, activity broadcast); secrets are resolved
once per run and reused across the whole fan-out, and manual runs fail
fast on vault errors before any job rows exist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 11:28:35 -04:00
gsadmin 3df459c5cf Docs and screenshots for OIDC modes, expansion and secrets; widen settings cards
CI / build-test (push) Failing after 45s
CI / images (push) Has been skipped
README documents UI-configured OIDC with login modes and the fixed
/api/auth/oidc/callback redirect, the three-layer lockout recovery,
on-device value expansion, and the secrets provider flow with $Secrets
usage. Screenshots refreshed for the relocated parameter builder and the
new settings cards.

Fixes a real layout bug the capture surfaced: the settings page's scoped
`wide` class never reached the sections inside child components, so the
Authentication, Secrets providers and S3 cards rendered in narrow grid
columns. Full-width placement now lives on wrapper slots in the page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 11:19:04 -04:00
gsadmin b3bee84b9e Pluggable secrets providers with server-side resolution into $Secrets
Scripts can bind entries of a secrets dictionary to values held in an
external vault. The backend resolves every binding at dispatch time —
manual runs and triggered runs alike — and ships only the values, so
agents and browsers never hold vault credentials. The agent injects them
as a case-insensitive OrderedDictionary session variable (name
configurable per script, default Secrets), giving $Secrets.ApiKey in the
script body with declaration order preserved.

Infisical is the first driver (universal-auth machine identity, v3 raw
API); the ISecretsProviderDriver interface keeps the rest pluggable and
self-describing so the settings form renders from driver metadata.
Provider connection settings are a Data Protection-encrypted blob, secret
config fields never return to the browser, and the script editor's picker
lists secret names only. Resolution failures fail the job with a
value-free message naming the binding and provider.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 11:12:59 -04:00
gsadmin b55608bb52 Expand parameter values with the target device's environment
Each parameter can opt into on-device expansion of its string values:
Environment (%VAR% via ExpandEnvironmentVariables) or PowerShell
($env:VAR and $() via $ExecutionContext.InvokeCommand.ExpandString in
the job's runspace, before the prelude runs). Applies to string scalars,
string array elements and hashtable values — keys stay literal. The
builder gains an "On device" selector and run inputs show a tag so the
operator knows the value resolves remotely.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 10:59:08 -04:00
gsadmin bd56953fbb Roomier parameter builder above the script editor
The schema builder leaves the cramped 360px side column for a full-width
collapsible strip above Monaco: labeled columns (name, type, item types,
description, required), function modules as toggle chips, and a summary
bar when collapsed. The side panel keeps only run-time values next to
Target/Job, and the description field the model always had is finally
editable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 10:54:55 -04:00
gsadmin 3fb72d9289 OIDC callback moves to the spec route /api/auth/oidc/callback
The handler was wired to ASP.NET Core's /signin-oidc convention while
ApiRoutes.AuthOidcCallback already declared the spec route; CallbackPath
now references that constant so they cannot drift. Riding under /api/
lets nginx drop its dedicated callback location, and the compose/.env
surface loses OIDC_CALLBACK_PATH (fixed by design) while gaining the
role-mapping and login-mode variables the backend already reads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 10:51:45 -04:00
gsadmin a9482fc697 OIDC configurable from the UI, login modes, group-to-role mapping, lockout recovery
CI / build-test (push) Failing after 14s
CI / images (push) Has been skipped
Configuration:
- Auth settings persist in AppSettings and override the OIDC_* environment
  bootstrap; the client secret is encrypted at rest and never returned
- OpenIdConnectOptions are rebuilt from a settings cache via an options change
  token, so enabling or repointing the provider needs no restart
- Discovery test validates the authority before saving: endpoint reachable,
  authorization/token/jwks present, PKCE S256 advertised

Login modes: LocalOnly, Both, OidcOnly, OidcAutoRedirect (skips the sign-in
page). The page renders from an anonymous /api/auth/config.

Group to role mapping: admin/operator/viewer claim values map onto application
roles, most privileged wins, with a configurable default and an option to
refuse sign-in when nothing matches.

Callback path is now fixed at /signin-oidc rather than env-tunable. It has to
match the provider registration exactly, so making it drift at runtime only
created a way to break sign-in with no clear error. The exact redirect URI is
shown in the UI to copy into the IdP.

Lockout recovery, three layers, because an IdP outage must never be terminal:
- /login?local=1 always reveals the local form; SSO-only modes hide it but
  never disable it
- `dotnet Backend.dll auth-reset [--admin U --password P]` runs inside the
  container, disables OIDC and restores local sign-in, optionally resetting an
  admin. Works on the database directly so it survives a broken app config
- AUTH_FORCE_LOCAL=1 bypasses stored OIDC at startup; it is environment-only
  and cannot be cleared from the UI
- Saving an SSO-only mode is rejected unless OIDC is actually usable

Fix: the OIDC handler is an IAuthenticationRequestHandler, so the auth
middleware initialises it on every request and options validation threw on a
null ClientId once the scheme was registered unconditionally. Unconfigured
OIDC now gets inert placeholders that are never contacted.

16 new auth tests (35 backend). Verified live: auto-redirect mode, then
auth-reset restoring local sign-in and a recovery admin logging in while the
OIDC environment variables were still set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 10:28:47 -04:00
gsadmin f5f0948552 S3 configurable and testable from the UI; agent installer ships automatically
CI / build-test (push) Failing after 1m6s
CI / images (push) Has been skipped
Agent packaging was manual: nothing put the installer where the backend looks,
so /api/enrollment/agent-package 404'd until someone seeded /data/agent by
hand. It is now automatic.

Automatic agent delivery:
- CI's Windows job packages the agent and uploads it as an artifact; the Linux
  image job stages it into the backend image at /opt/executer/agent before
  docker build, so a stock deployment serves installs immediately
- Resolution order: AGENT_PACKAGE_PATH, then the baked-in image copy, then
  /data/agent for local builds and air-gapped installs
- A warning is emitted (not a failure) if no package was staged
- Settings shows the live source, size, version and SHA-256

S3 configurable and testable from the WebUI:
- Settings are persisted in a new AppSettings table and override the S3_*
  environment defaults; the secret key is encrypted at rest with Data
  Protection and never returned to the browser (blank on save keeps it)
- Test connection performs a real round-trip - bucket, write, read-back,
  presigned download, delete - reporting each step separately so read-only
  credentials or an endpoint unreachable from agents are distinguishable
- Only a fully passing test records lastTestUtc

Optional S3 offload of the installer:
- Requires a passing test; upload is content-addressed by hash so re-uploading
  an unchanged build is skipped
- When enabled, /api/enrollment/agent-package 302s to a presigned URL, keeping
  large downloads off the control plane, and falls back to local streaming if
  presigning fails rather than breaking installs

S3PresignService now resolves settings per call, so UI changes take effect
without restarting the backend. Migrations added for all three providers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 10:03:43 -04:00
gsadmin 6720c472c9 CI: target runner labels that actually exist
CI / build-test (push) Failing after 1m59s
CI / images (push) Has been skipped
Both jobs were unschedulable, not just the Windows one: the registered runners
are labelled windows-host / windows-server-host / powershell-windows and
linux-host / ubuntu-host / powershell-linux, so neither "windows" nor
"ubuntu-latest" matched anything and workflows sat blocked.

- build-test and the release job now run on windows-host (Windows is required
  for the agent: CIM, ConPTY, DPAPI, Windows service, WiX)
- the image build/publish job runs on ubuntu-host

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 22:56:28 -04:00