Skip to content

Require Ed25519-signed payloads when policy sets a signing key - #29

Merged
rodchristiansen merged 3 commits into
mainfrom
feature/script-signing
Oct 9, 2026
Merged

rodchristiansen merged 3 commits into
mainfrom
feature/script-signing

Conversation

@rodchristiansen

Copy link
Copy Markdown
Collaborator

Closes #28.

  • ManifestSigningKey (REG_SZ, base64 raw Ed25519 public key) under HKLM\SOFTWARE\Policies\StartSet turns on required signing. Settings marked [PolicyOnly] resolve from policy alone; machine settings, Config.yaml and command-line values are ignored with a log note, SaveMachineSetting refuses them, and the Prefs tab shows them locked.
  • Signature line # ed25519: <b64> (.ps1) or REM ed25519: <b64> (.cmd/.bat). Signed bytes: the file with those lines removed, split and rejoined on LF, leading UTF-8 BOM kept. Byte-identical to outset for LF PowerShell scripts.
  • Under enforcement, unsigned/tampered scripts, .exe/.msi/.msix, and every payload when the key does not decode are refused: new ExecutionStatus.SignatureRejected, an error log line naming the file and reason, and an Error row in items.json. Refused payloads count as failures in the CLI exit code. Discovery is unchanged (top-level files only).
  • CLI: sign <files> [--key-env VAR | --key-file PATH] (default STARTSET_SIGNING_KEY), verify <files> [--public-key B64] (exit 1 on any failure), generate-keypair. These open no session log, so they run cleanly on build agents.
  • Tests: RFC 8032 TEST 1/2 known answers, round trips (both prefixes, CRLF, BOM, shebang, re-sign), tamper/line-ending/other-key/malformed/binary/bad-key failures, engine enforcement, policy-only resolution. 336 passing.

ManifestSigningKey under HKLM\SOFTWARE\Policies\StartSet turns on script
signing. Only policy can set it; values from machine settings, Config.yaml
or the command line are ignored and logged. While it is set, a script runs
only if its embedded '# ed25519:' (.ps1) or 'REM ed25519:' (.cmd/.bat) line
verifies over the file with that line removed, in outset's format. Anything
else, including executables and packages, and every payload when the key is
invalid, is refused with a SignatureRejected result that the log and
items.json report as an error.

Adds sign, verify and generate-keypair commands, which open no session log,
and RFC 8032 known-answer tests for the format.
…28)

A relative path is made absolute with Path.GetFullPath before it is read,
and a missing file's error names the path that was checked.
@rodchristiansen
rodchristiansen merged commit 62d096e into main Oct 9, 2026
1 check passed
@rodchristiansen
rodchristiansen deleted the feature/script-signing branch October 9, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require Ed25519-signed payloads when policy sets a signing key

1 participant