Skip to content

Commit adef8fc

Browse files
authored
fix(release): sign all first-party payload binaries (#1182)
* fix(release): enforce first-party binary signing Expand the release policy and verifier to all eight OpenClaw-owned PE files, reject unknown OpenClaw binaries, preserve third-party exclusions, and require the exact OpenClaw Foundation signer subject. Co-authored-by: clawsweeper <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: ea6ca262-e24c-4a46-99c1-1a7b59b24943 * Rename OpenClaw Executables to Binaries in CI fix(release): sign all first-party payload binaries --------- Copilot-Session: ea6ca262-e24c-4a46-99c1-1a7b59b24943
1 parent a76c852 commit adef8fc

4 files changed

Lines changed: 149 additions & 59 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -645,49 +645,73 @@ jobs:
645645
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
646646
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
647647

648-
- name: Stage x64 OpenClaw Executables for Signing
648+
- name: Stage x64 OpenClaw Binaries for Signing
649649
shell: pwsh
650650
run: |
651651
New-Item -ItemType Directory -Path signing-input-x64 -Force | Out-Null
652-
New-Item -ItemType HardLink -Path signing-input-x64\OpenClaw.Tray.WinUI.exe -Target artifacts\tray-win-x64\OpenClaw.Tray.WinUI.exe | Out-Null
652+
$openClawBinaries = @(
653+
"OpenClaw.Tray.WinUI.exe",
654+
"OpenClaw.Tray.WinUI.dll",
655+
"OpenClaw.Chat.dll",
656+
"OpenClaw.Connection.dll",
657+
"OpenClaw.SetupEngine.UI.dll",
658+
"OpenClaw.SetupEngine.dll",
659+
"OpenClaw.Shared.dll",
660+
"OpenClawTray.FunctionalUI.dll"
661+
)
662+
foreach ($binary in $openClawBinaries) {
663+
New-Item -ItemType HardLink -Path "signing-input-x64\$binary" -Target "artifacts\tray-win-x64\$binary" | Out-Null
664+
}
653665
654-
- name: Stage ARM64 OpenClaw Executables for Signing
666+
- name: Stage ARM64 OpenClaw Binaries for Signing
655667
shell: pwsh
656668
run: |
657669
New-Item -ItemType Directory -Path signing-input-arm64 -Force | Out-Null
658-
New-Item -ItemType HardLink -Path signing-input-arm64\OpenClaw.Tray.WinUI.exe -Target artifacts\tray-win-arm64\OpenClaw.Tray.WinUI.exe | Out-Null
670+
$openClawBinaries = @(
671+
"OpenClaw.Tray.WinUI.exe",
672+
"OpenClaw.Tray.WinUI.dll",
673+
"OpenClaw.Chat.dll",
674+
"OpenClaw.Connection.dll",
675+
"OpenClaw.SetupEngine.UI.dll",
676+
"OpenClaw.SetupEngine.dll",
677+
"OpenClaw.Shared.dll",
678+
"OpenClawTray.FunctionalUI.dll"
679+
)
680+
foreach ($binary in $openClawBinaries) {
681+
New-Item -ItemType HardLink -Path "signing-input-arm64\$binary" -Target "artifacts\tray-win-arm64\$binary" | Out-Null
682+
}
659683
660-
- name: Sign x64 OpenClaw Executables
684+
- name: Sign x64 OpenClaw Binaries
661685
uses: azure/artifact-signing-action@v2
662686
with:
663687
endpoint: https://eus.codesigning.azure.net/
664688
signing-account-name: openclaw
665689
certificate-profile-name: openclaw
666690
files-folder: signing-input-x64
667-
files-folder-filter: exe
691+
files-folder-filter: exe,dll
668692
files-folder-depth: 1
669693
file-digest: SHA256
670694
timestamp-rfc3161: http://timestamp.acs.microsoft.com
671695
timestamp-digest: SHA256
672696

673-
- name: Sign ARM64 OpenClaw Executables
697+
- name: Sign ARM64 OpenClaw Binaries
674698
uses: azure/artifact-signing-action@v2
675699
with:
676700
endpoint: https://eus.codesigning.azure.net/
677701
signing-account-name: openclaw
678702
certificate-profile-name: openclaw
679703
files-folder: signing-input-arm64
680-
files-folder-filter: exe
704+
files-folder-filter: exe,dll
681705
files-folder-depth: 1
682706
file-digest: SHA256
683707
timestamp-rfc3161: http://timestamp.acs.microsoft.com
684708
timestamp-digest: SHA256
685709

686-
- name: Verify x64 Release Executable Signing Policy
710+
- name: Verify x64 Release Binary Signing Policy
687711
shell: pwsh
688712
run: .\scripts\Test-ReleaseExecutableSignatures.ps1 -PayloadPath artifacts/tray-win-x64 -RequireSignedOpenClaw
689713

690-
- name: Verify ARM64 Release Executable Signing Policy
714+
- name: Verify ARM64 Release Binary Signing Policy
691715
shell: pwsh
692716
run: .\scripts\Test-ReleaseExecutableSignatures.ps1 -PayloadPath artifacts/tray-win-arm64 -RequireSignedOpenClaw
693717

‎docs/RELEASING.md‎

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ build/sign/publish release artifacts.
2020

2121
```powershell
2222
Select-String .\.github\workflows\ci.yml -Pattern `
23-
"Verify Release Executable Signing Policy", `
23+
"Verify Release Binary Signing Policy", `
2424
"OpenClaw.Tray.WinUI.exe", `
2525
"build-msix:", `
2626
"MSIX distribution is paused"
@@ -89,14 +89,21 @@ installers and signed portable update payloads. This pause is independent of
8989
whether a tag is stable or alpha. Re-enable MSIX only with packaged
9090
camera/microphone consent validation and release coverage.
9191

92-
## Executable signing policy
92+
## Binary signing policy
9393

94-
Only OpenClaw-owned executables should be signed by the OpenClaw release signing
94+
Only OpenClaw-owned binaries should be signed by the OpenClaw release signing
9595
identity.
9696

97-
OpenClaw-owned executables:
97+
OpenClaw-owned binaries:
9898

9999
- `OpenClaw.Tray.WinUI.exe`
100+
- `OpenClaw.Tray.WinUI.dll`
101+
- `OpenClaw.Chat.dll`
102+
- `OpenClaw.Connection.dll`
103+
- `OpenClaw.SetupEngine.UI.dll`
104+
- `OpenClaw.SetupEngine.dll`
105+
- `OpenClaw.Shared.dll`
106+
- `OpenClawTray.FunctionalUI.dll`
100107

101108
Third-party/runtime executables that must not be OpenClaw-signed:
102109

@@ -106,8 +113,11 @@ Third-party/runtime executables that must not be OpenClaw-signed:
106113
- `SetupEngine\RestartAgent.exe`
107114

108115
CI enforces this with `scripts\Test-ReleaseExecutableSignatures.ps1`. The
109-
verifier fails closed on unknown `.exe` files so future payload changes are
110-
reviewed deliberately.
116+
verifier inspects every shipped `.exe` and `.dll`, fails closed on unknown
117+
executables and unknown OpenClaw-named binaries, and rejects an OpenClaw
118+
signature on third-party/runtime binaries. When release signing is required,
119+
every allowlisted OpenClaw binary must have a valid signature from the expected
120+
OpenClaw release signer; a valid signature from another publisher is rejected.
111121

112122
CI also checks native runtime dependencies before release packaging. Both the
113123
x64 and ARM64 portable payloads must ship `vcruntime140.dll` in the payload
@@ -146,13 +156,13 @@ Do not add `AZURE_CLIENT_SECRET` back to the release workflow. The Entra app
146156
registration should have a federated credential for:
147157
`repo:openclaw/openclaw-windows-node:environment:release-signing`.
148158

149-
## How CI signs payload executables
159+
## How CI signs payload binaries
150160

151161
The release workflow does not recursively sign every `.exe`. Instead it creates
152162
temporary signing input directories with hardlinks to only the OpenClaw-owned
153-
executables from the x64 and ARM64 payloads, then runs Azure Artifact Signing on
154-
those allowlists. Because these are NTFS hardlinks, signing the staged file
155-
signs the real payload file.
163+
executables and DLLs from the x64 and ARM64 payloads, then runs Azure Artifact
164+
Signing on those allowlists. Because these are NTFS hardlinks, signing the
165+
staged file signs the real payload file.
156166

157167
After signing, CI verifies the actual payload directory, not the staging folder.
158168
If hardlink signing does not affect the payload, the verifier fails before
@@ -180,8 +190,8 @@ The release job should:
180190

181191
1. Download x64/ARM64 tray payload artifacts.
182192
2. Authenticate to Azure with OIDC in the `release-signing` environment.
183-
3. Sign only the OpenClaw-owned EXEs in both payloads.
184-
4. Verify executable signing policy.
193+
3. Sign only the OpenClaw-owned EXEs and DLLs in both payloads.
194+
4. Verify binary signing policy.
185195
5. Create the portable x64 and ARM64 ZIPs.
186196
6. Build Inno installers.
187197
7. Sign installers.
@@ -206,6 +216,7 @@ Expected:
206216
- Installer EXEs are signed.
207217
- In ZIP payload:
208218
- `OpenClaw.Tray.WinUI.exe` is OpenClaw-signed.
219+
- All listed OpenClaw-owned DLLs are OpenClaw-signed.
209220
- `wxc-exec.exe`, `createdump.exe`, and `RestartAgent.exe` are not
210221
OpenClaw-signed.
211222

Lines changed: 65 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<#
22
.SYNOPSIS
3-
Verifies release payload executable signing policy.
3+
Verifies release payload binary signing policy.
44
55
.DESCRIPTION
6-
Classifies every .exe in a release payload. OpenClaw-owned executables must
7-
be signed when -RequireSignedOpenClaw is passed. Third-party executables,
6+
Classifies every .exe and .dll in a release payload. OpenClaw-owned binaries
7+
must be signed when -RequireSignedOpenClaw is passed. Third-party binaries,
88
including wxc-exec.exe, must not be signed by the OpenClaw release signer.
9-
Unknown executables fail closed.
9+
Unknown executables and unknown OpenClaw-named binaries fail closed.
1010
1111
.PARAMETER PayloadPath
1212
Root directory of the release payload to inspect.
1313
1414
.PARAMETER RequireSignedOpenClaw
15-
Require OpenClaw-owned executables to have valid Authenticode signatures.
15+
Require OpenClaw-owned binaries to have valid Authenticode signatures.
1616
17-
.PARAMETER OpenClawSignerPattern
18-
Regex used to identify the OpenClaw release signer in signer subjects.
17+
.PARAMETER OpenClawSignerSubject
18+
Exact certificate subject required for OpenClaw-owned binaries.
1919
#>
2020
[CmdletBinding()]
2121
param(
@@ -24,7 +24,7 @@ param(
2424

2525
[switch]$RequireSignedOpenClaw,
2626

27-
[string]$OpenClawSignerPattern = "OpenClaw Foundation"
27+
[string]$OpenClawSignerSubject = "CN=OpenClaw Foundation, O=OpenClaw Foundation, L=Mill Valley, S=California, C=US"
2828
)
2929

3030
Set-StrictMode -Version Latest
@@ -41,70 +41,106 @@ function Get-RelativePath {
4141
[System.IO.Path]::GetRelativePath($Root, $Path).Replace('/', '\')
4242
}
4343

44-
function Get-ExecutableClassification {
44+
function Get-BinaryClassification {
4545
param([Parameter(Mandatory = $true)][string]$RelativePath)
4646

4747
switch -Regex ($RelativePath) {
4848
'^OpenClaw\.Tray\.WinUI\.exe$' { return "OpenClawOwned" }
49+
'^OpenClaw\.Tray\.WinUI\.dll$' { return "OpenClawOwned" }
50+
'^OpenClaw\.Chat\.dll$' { return "OpenClawOwned" }
51+
'^OpenClaw\.Connection\.dll$' { return "OpenClawOwned" }
52+
'^OpenClaw\.SetupEngine\.UI\.dll$' { return "OpenClawOwned" }
53+
'^OpenClaw\.SetupEngine\.dll$' { return "OpenClawOwned" }
54+
'^OpenClaw\.Shared\.dll$' { return "OpenClawOwned" }
55+
'^OpenClawTray\.FunctionalUI\.dll$' { return "OpenClawOwned" }
4956
'(^|\\)createdump\.exe$' { return "ThirdPartyExcluded" }
5057
'(^|\\)RestartAgent\.exe$' { return "ThirdPartyExcluded" }
5158
'^tools\\mxc\\[^\\]+\\wxc-exec\.exe$' { return "ThirdPartyExcluded" }
52-
default { return "Unknown" }
59+
'(^|\\)OpenClaw[^\\]*\.(exe|dll)$' { return "UnknownOpenClaw" }
60+
'\.dll$' { return "ThirdPartyExcluded" }
61+
default { return "UnknownExecutable" }
5362
}
5463
}
5564

56-
$executables = @(
57-
Get-ChildItem -LiteralPath $payloadRoot -Recurse -File -Filter *.exe |
65+
$binaries = @(
66+
Get-ChildItem -LiteralPath $payloadRoot -Recurse -File |
67+
Where-Object { $_.Extension -in ".exe", ".dll" } |
5868
Sort-Object FullName |
5969
ForEach-Object {
6070
$relativePath = Get-RelativePath -Root $payloadRoot -Path $_.FullName
6171
$signature = Get-AuthenticodeSignature -LiteralPath $_.FullName
6272
$signerSubject = if ($signature.SignerCertificate) { $signature.SignerCertificate.Subject } else { "" }
6373
[pscustomobject]@{
6474
RelativePath = $relativePath
65-
Classification = Get-ExecutableClassification -RelativePath $relativePath
75+
Classification = Get-BinaryClassification -RelativePath $relativePath
6676
SignatureStatus = $signature.Status.ToString()
6777
SignerSubject = $signerSubject
6878
}
6979
}
7080
)
7181

72-
if ($executables.Count -eq 0) {
73-
throw "No executables found under $payloadRoot."
82+
if ($binaries.Count -eq 0) {
83+
throw "No executable or DLL binaries found under $payloadRoot."
7484
}
7585

76-
$executables | Format-Table -AutoSize
86+
$binaries | Format-Table -AutoSize
7787

7888
$errors = New-Object System.Collections.Generic.List[string]
7989

80-
foreach ($exe in $executables) {
81-
switch ($exe.Classification) {
90+
foreach ($binary in $binaries) {
91+
switch ($binary.Classification) {
8292
"OpenClawOwned" {
83-
if ($RequireSignedOpenClaw -and $exe.SignatureStatus -ne "Valid") {
84-
$errors.Add("OpenClaw executable is not validly signed: $($exe.RelativePath) [$($exe.SignatureStatus)]")
93+
if ($RequireSignedOpenClaw -and $binary.SignatureStatus -ne "Valid") {
94+
$errors.Add("OpenClaw binary is not validly signed: $($binary.RelativePath) [$($binary.SignatureStatus)]")
95+
}
96+
elseif ($RequireSignedOpenClaw -and
97+
-not [string]::Equals(
98+
$binary.SignerSubject,
99+
$OpenClawSignerSubject,
100+
[StringComparison]::OrdinalIgnoreCase)) {
101+
$errors.Add("OpenClaw binary is not signed by the expected OpenClaw signer: $($binary.RelativePath) [$($binary.SignerSubject)]")
85102
}
86103
}
87104
"ThirdPartyExcluded" {
88-
if ($exe.SignatureStatus -eq "Valid" -and $exe.SignerSubject -match $OpenClawSignerPattern) {
89-
$errors.Add("Third-party executable appears to be signed by OpenClaw release signer: $($exe.RelativePath) [$($exe.SignerSubject)]")
105+
if ($binary.SignatureStatus -eq "Valid" -and
106+
[string]::Equals(
107+
$binary.SignerSubject,
108+
$OpenClawSignerSubject,
109+
[StringComparison]::OrdinalIgnoreCase)) {
110+
$errors.Add("Third-party binary appears to be signed by OpenClaw release signer: $($binary.RelativePath) [$($binary.SignerSubject)]")
90111
}
91112
}
113+
"UnknownOpenClaw" {
114+
$errors.Add("Unknown OpenClaw binary in release payload: $($binary.RelativePath)")
115+
}
92116
default {
93-
$errors.Add("Unknown executable in release payload: $($exe.RelativePath)")
117+
$errors.Add("Unknown executable in release payload: $($binary.RelativePath)")
94118
}
95119
}
96120
}
97121

98-
if (-not ($executables | Where-Object RelativePath -eq "OpenClaw.Tray.WinUI.exe")) {
99-
$errors.Add("Missing OpenClaw.Tray.WinUI.exe.")
122+
@(
123+
"OpenClaw.Tray.WinUI.exe",
124+
"OpenClaw.Tray.WinUI.dll",
125+
"OpenClaw.Chat.dll",
126+
"OpenClaw.Connection.dll",
127+
"OpenClaw.SetupEngine.UI.dll",
128+
"OpenClaw.SetupEngine.dll",
129+
"OpenClaw.Shared.dll",
130+
"OpenClawTray.FunctionalUI.dll"
131+
) | ForEach-Object {
132+
$requiredBinary = $_
133+
if (-not ($binaries | Where-Object RelativePath -eq $requiredBinary)) {
134+
$errors.Add("Missing OpenClaw binary: $_.")
135+
}
100136
}
101-
if ($executables | Where-Object RelativePath -eq "SetupEngine\OpenClaw.SetupEngine.UI.exe") {
137+
if ($binaries | Where-Object RelativePath -eq "SetupEngine\OpenClaw.SetupEngine.UI.exe") {
102138
$errors.Add("SetupEngine\OpenClaw.SetupEngine.UI.exe should not be present in the release payload.")
103139
}
104-
if ($executables | Where-Object RelativePath -eq "SetupEngine\OpenClaw.SetupEngine.exe") {
140+
if ($binaries | Where-Object RelativePath -eq "SetupEngine\OpenClaw.SetupEngine.exe") {
105141
$errors.Add("SetupEngine\OpenClaw.SetupEngine.exe should not be present in the release payload.")
106142
}
107-
if (-not ($executables | Where-Object RelativePath -match '^tools\\mxc\\[^\\]+\\wxc-exec\.exe$')) {
143+
if (-not ($binaries | Where-Object RelativePath -match '^tools\\mxc\\[^\\]+\\wxc-exec\.exe$')) {
108144
$errors.Add("Missing tools\mxc\<arch>\wxc-exec.exe third-party executable.")
109145
}
110146

@@ -113,4 +149,4 @@ if ($errors.Count -gt 0) {
113149
exit 1
114150
}
115151

116-
Write-Host "Release executable signing policy passed." -ForegroundColor Green
152+
Write-Host "Release binary signing policy passed." -ForegroundColor Green

0 commit comments

Comments
 (0)