Skip to content

Read settings from the 64-bit registry only, and keep credential headers where users cannot read them - #59

Merged
rodchristiansen merged 2 commits into
mainfrom
feature/round5-registry-secret
Oct 5, 2026
Merged

rodchristiansen merged 2 commits into
mainfrom
feature/round5-registry-secret

Conversation

@rodchristiansen

Copy link
Copy Markdown
Contributor

64-bit view only

  • The CLI and the GUI read HKLM\SOFTWARE\BootstrapMate\Settings and the policy key from the 64-bit view only. A stale WOW6432Node copy of the settings key used to outrank what the GUI and the MSI write.
  • The MSI removes that copy through a 32-bit component. The CLI also removes it once, logging only the value names.
  • SOFTWARE\Policies is shared between the views. Its "32-bit path" is the live policy key, so it is never removed, and a test guards that.

Credential headers

  • AuthorizationHeader and ReportingHeader live in HKLM\SOFTWARE\BootstrapMate\Secrets. The key's protected ACL admits SYSTEM and Administrators only, and the MSI sets the same ACL.
  • An elevated run moves a header it finds in the policy key (under any alias) or the settings key into the store, then blanks the readable copy. The policy value is emptied rather than deleted, so the setting still shows as managed.
  • The GUI saves headers to the store and no longer passes one on the CLI command line. Command lines are redacted (--headers <redacted>) in the log and session.json.

Tested on a test PC (signed MSI)

  • After install: the stale 32-bit settings key is removed, and policy and 64-bit settings are untouched.
  • An elevated run moved a policy header and a settings header into the store and blanked both copies. Its log shows --headers <redacted>.
  • A test token appeared in no file under ProgramData.
  • As a standard user: the store key is denied, the policy and settings values are empty, and no file holds the token.
  • dotnet test: 122 pass.

…ers where users cannot read them

Settings: the CLI and the GUI read HKLM\SOFTWARE\BootstrapMate\Settings and the
policy key from the 64-bit view only. A stale 32-bit copy of the settings key
(WOW6432Node) used to outrank what the GUI and the MSI write; the MSI removes
it through a 32-bit component, and the CLI removes it once and logs the value
names it removed. The policy key is shared between the two views, so it is
never touched.

Credentials: AuthorizationHeader and ReportingHeader now live in
HKLM\SOFTWARE\BootstrapMate\Secrets, whose ACL admits only SYSTEM and
Administrators. A header found in the policy key (under any alias) or the
settings key is moved there by an elevated run and the readable copy blanked;
the policy value is emptied rather than deleted so it still shows as managed.
The GUI saves headers there and no longer passes one on the command line.
Command lines are redacted before they reach the log or session.json.
@rodchristiansen
rodchristiansen merged commit 9c2637b into main Oct 5, 2026
3 of 4 checks passed
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.

1 participant