Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5546c53
Add fail-closed same-publisher Authenticode verifier
Oleksii-debug Sep 13, 2026
e22cbcf
Report fail-closed update publisher authenticity
Oleksii-debug Sep 13, 2026
ca14bcb
Fail closed when post-signature byte recheck changes
Oleksii-debug Sep 13, 2026
fc63bba
R06: add fail-closed standard-user packaged acceptance
Oleksii-debug Sep 27, 2026
1ab2310
R06: regress no-admin acceptance contract
Oleksii-debug Sep 27, 2026
8454a72
R06: execute packaged acceptance as hosted standard user
Oleksii-debug Sep 27, 2026
449cad4
R06: bind no-admin state path to standard-user profile
Oleksii-debug Sep 27, 2026
a4d879d
R06: fix no-admin workflow contract path
Oleksii-debug Sep 27, 2026
5b98ac6
R06: require full standard-user startup liveness
Oleksii-debug Sep 27, 2026
f059f92
R06: bind no-admin run to exact build artifact
Oleksii-debug Sep 27, 2026
084cf24
R06: regress exact no-admin artifact liveness
Oleksii-debug Sep 27, 2026
6d2f99c
R06: make no-admin contract test overlay-location safe
Oleksii-debug Sep 27, 2026
1339f60
R06: prove ephemeral account is not an administrator
Oleksii-debug Sep 27, 2026
e88d956
R06: persist standard-user identity evidence
Oleksii-debug Sep 27, 2026
48b3d38
R06: bound standard-user acceptance subprocess
Oleksii-debug Sep 27, 2026
1cee268
R06: regress bounded identity-aware no-admin proof
Oleksii-debug Sep 27, 2026
44b2cfa
R06: prove no-admin harness rejects admin runner
Oleksii-debug Sep 27, 2026
94ce1a7
R06: regress admin negative control
Oleksii-debug Sep 27, 2026
4a24eec
R06 late-bind no-admin packaged acceptance to integrated package
Oleksii-debug Sep 27, 2026
97caa0a
R06 no-admin: bind per-user state to current SID profile
Oleksii-debug Sep 27, 2026
d02185c
R06 no-admin: preserve failure evidence in workspace artifact
Oleksii-debug Sep 27, 2026
60a7797
R06 no-admin: regress SID profile and evidence staging
Oleksii-debug Sep 27, 2026
43fdb6b
R06 late-bind no-admin acceptance onto qualified package
Oleksii-debug Sep 27, 2026
6aa524a
R06 no-admin: make child SHA verification module-independent
Oleksii-debug Sep 27, 2026
454d2f2
Converge Authenticode update proof onto current package with regressions
Oleksii-debug Sep 27, 2026
0b57523
Fix dual-OS Authenticode harness portability
Oleksii-debug Sep 27, 2026
d9a4509
Expose exact Authenticode publisher status in update UI
Oleksii-debug Sep 27, 2026
a1f56b6
Regress semantic update authenticity readback
Oleksii-debug Sep 27, 2026
2dfe55d
Harden Authenticode verifier against environment path hijack
Oleksii-debug Sep 27, 2026
3e58894
Regress system-bound Authenticode host resolution
Oleksii-debug Sep 27, 2026
4b5d619
Integrate standard-user packaged acceptance (#224)
Oleksii-debug Sep 27, 2026
158a7db
Repair cross-platform Authenticode path qualification
Oleksii-debug Sep 27, 2026
8040aea
Reconverge Authenticode verification on current packaged authority
Oleksii-debug Sep 27, 2026
d731d10
Fix Authenticode module-qualified PowerShell command
Oleksii-debug Sep 27, 2026
bb6cf48
Exercise real Windows Authenticode verifier path
Oleksii-debug Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 222 additions & 0 deletions .github/workflows/r06-no-admin-acceptance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
name: R06 No-Admin Packaged Acceptance

on:
workflow_dispatch:
push:
branches:
- r06-gospel-no-admin-acceptance-0927-sol
paths:
- 'lanes/dev1/repair_overlay/packaging/run_no_admin_acceptance.ps1'
- 'lanes/dev1/repair_overlay/packaging/probe_packaged_startup.ps1'
- 'lanes/dev1/repair_overlay/tests/test_no_admin_acceptance_contract.py'
- '.github/workflows/r06-no-admin-acceptance.yml'
pull_request:
paths:
- 'lanes/dev1/repair_overlay/packaging/run_no_admin_acceptance.ps1'
- 'lanes/dev1/repair_overlay/packaging/probe_packaged_startup.ps1'
- 'lanes/dev1/repair_overlay/tests/test_no_admin_acceptance_contract.py'
- '.github/workflows/r06-no-admin-acceptance.yml'

env:
DEV01_SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
DEV01_BASE_SOURCE_SHA256: 10fbd546ff4d985465b85b99f4f64bff95d9ec8b1f27132c6d21b4930c344c35
PYTHONUTF8: '1'

jobs:
no-admin-packaged-acceptance:
runs-on: windows-latest
timeout-minutes: 50
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.DEV01_SOURCE_SHA }}

- uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Confirm exact source checkout
shell: pwsh
run: |
$actual = (git rev-parse HEAD).Trim()
if ($actual -ne $env:DEV01_SOURCE_SHA) { throw "Expected $env:DEV01_SOURCE_SHA, got $actual" }

- name: Reconstruct and verify canonical FINALPREP02 source
shell: pwsh
run: |
$parts = Get-ChildItem release_inputs/dev1_finalprep02/part-*.b64 | Sort-Object Name
$b64 = ($parts | ForEach-Object { Get-Content $_.FullName -Raw }) -join ''
[IO.File]::WriteAllBytes('DEV1_R06_PLATFORM_SOURCE.zip', [Convert]::FromBase64String($b64))
python lanes\dev1\verify_source_archive.py DEV1_R06_PLATFORM_SOURCE.zip $env:DEV01_BASE_SOURCE_SHA256
if ($LASTEXITCODE -ne 0) { throw "DEV1 source archive verification failed with exit code $LASTEXITCODE" }
Expand-Archive DEV1_R06_PLATFORM_SOURCE.zip -DestinationPath . -Force
if (-not (Test-Path r06_platform -PathType Container)) { throw "Verified archive did not extract r06_platform" }
Copy-Item -Path lanes\dev1\repair_overlay\* -Destination r06_platform -Recurse -Force

- name: Run no-admin contract regressions
shell: pwsh
run: |
python -m unittest discover -s lanes\dev1\repair_overlay\tests -p test_no_admin_acceptance_contract.py -v
if ($LASTEXITCODE -ne 0) { throw "No-admin contract regressions failed with exit code $LASTEXITCODE" }

- name: Build exact packaged executable
shell: pwsh
run: |
./r06_platform/packaging/build_windows.ps1
if ($LASTEXITCODE -ne 0) { throw "Packaged build failed with exit code $LASTEXITCODE" }
if (-not (Test-Path r06_platform/dist/ScriptureArchive-R06-DEV01.exe -PathType Leaf)) {
throw "Expected packaged executable was not produced"
}

- name: Prove harness fails closed under the admin runner token
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$exe = (Resolve-Path r06_platform/dist/ScriptureArchive-R06-DEV01.exe).Path
$hash = (Get-FileHash -LiteralPath $exe -Algorithm SHA256).Hash.ToLowerInvariant()
$resultPath = (Join-Path (Resolve-Path r06_platform/dist).Path "no_admin_admin_negative.json")
$harness = (Resolve-Path r06_platform/packaging/run_no_admin_acceptance.ps1).Path
$arguments = @(
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy", "Bypass",
"-File", ('"' + $harness + '"'),
"-Executable", ('"' + $exe + '"'),
"-ExpectedSha256", $hash,
"-ProbeSeconds", "1",
"-OutputJson", ('"' + $resultPath + '"')
)
$powershell = Join-Path $env:SystemRoot "System32\WindowsPowerShell\v1.0\powershell.exe"
$negative = Start-Process -FilePath $powershell -ArgumentList $arguments -Wait -PassThru
if ($negative.ExitCode -ne 2) { throw "Admin negative control returned unexpected exit code $($negative.ExitCode)" }
$result = Get-Content -Raw -Encoding utf8 -LiteralPath $resultPath | ConvertFrom-Json
if ($result.status -ne "NO_ADMIN_ACCEPTANCE_FAIL") { throw "Admin negative control did not fail closed" }
if ($result.is_admin -ne $true) { throw "Admin negative control did not record is_admin=true" }
if ($result.failure -notlike "Standard-user token required*") { throw "Admin negative control failed for the wrong reason: $($result.failure)" }
Write-Output "NO_ADMIN_ADMIN_NEGATIVE_CONTROL_PASS"

- name: Execute packaged acceptance as ephemeral standard user
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$user = "ScriptureNoAdmin"
$publicRoot = Join-Path $env:PUBLIC "ScriptureArchive-NoAdmin"
$resultPath = Join-Path $publicRoot "no_admin_acceptance.json"
$childLog = Join-Path $publicRoot "child-output.log"
$childError = Join-Path $publicRoot "child-error.log"
$password = [guid]::NewGuid().ToString("N") + "!Aa7"
$secure = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential(".\$user", $secure)

try {
if (Get-LocalUser -Name $user -ErrorAction SilentlyContinue) {
Remove-LocalUser -Name $user
}
New-LocalUser -Name $user -Password $secure -PasswordNeverExpires -UserMayNotChangePassword | Out-Null
$administrators = Get-LocalGroup -SID "S-1-5-32-544"
$isAdminMember = @(Get-LocalGroupMember -Group $administrators.Name -ErrorAction Stop | Where-Object {
$_.Name -eq "$env:COMPUTERNAME\$user" -or $_.Name -eq ".\$user"
}).Count -gt 0
if ($isAdminMember) {
throw "Standard-user account unexpectedly belongs to the Administrators group"
}

New-Item -ItemType Directory -Force -Path $publicRoot | Out-Null
$acl = Get-Acl -LiteralPath $publicRoot
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
"$env:COMPUTERNAME\$user",
"Modify",
"ContainerInherit,ObjectInherit",
"None",
"Allow"
)
$acl.SetAccessRule($rule)
Set-Acl -LiteralPath $publicRoot -AclObject $acl

$buildExe = (Resolve-Path r06_platform/dist/ScriptureArchive-R06-DEV01.exe).Path
$hash = (Get-FileHash -LiteralPath $buildExe -Algorithm SHA256).Hash.ToLowerInvariant()
$exe = Join-Path $publicRoot "ScriptureArchive-R06-DEV01.exe"
$harness = Join-Path $publicRoot "run_no_admin_acceptance.ps1"
$startupProbe = Join-Path $publicRoot "probe_packaged_startup.ps1"
Copy-Item -LiteralPath $buildExe -Destination $exe -Force
Copy-Item r06_platform/packaging/run_no_admin_acceptance.ps1 $harness -Force
Copy-Item r06_platform/packaging/probe_packaged_startup.ps1 $startupProbe -Force
$publicHash = (Get-FileHash -LiteralPath $exe -Algorithm SHA256).Hash.ToLowerInvariant()
if ($publicHash -ne $hash) { throw "Public staging copy does not match the exact build artifact SHA-256" }

$arguments = @(
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy", "Bypass",
"-File", ('"' + $harness + '"'),
"-Executable", ('"' + $exe + '"'),
"-ExpectedSha256", $hash,
"-ProbeSeconds", "8",
"-OutputJson", ('"' + $resultPath + '"'),
"-StartupProbeScript", ('"' + $startupProbe + '"')
)
$powershell = Join-Path $env:SystemRoot "System32\WindowsPowerShell\v1.0\powershell.exe"
$child = Start-Process -FilePath $powershell -ArgumentList $arguments -Credential $credential -LoadUserProfile -WorkingDirectory $publicRoot -RedirectStandardOutput $childLog -RedirectStandardError $childError -PassThru
if (-not $child.WaitForExit(120000)) {
Stop-Process -Id $child.Id -Force -ErrorAction SilentlyContinue
throw "Standard-user acceptance process exceeded the 120-second bound"
}
$child.Refresh()

if ($child.ExitCode -ne 0) {
if (Test-Path $childLog) { Get-Content $childLog }
if (Test-Path $childError) { Get-Content $childError }
throw "Standard-user acceptance process failed with exit code $($child.ExitCode)"
}
if (-not (Test-Path -LiteralPath $resultPath -PathType Leaf)) {
throw "Standard-user acceptance did not emit result JSON"
}
$result = Get-Content -Raw -Encoding utf8 -LiteralPath $resultPath | ConvertFrom-Json
if ($result.status -ne "NO_ADMIN_ACCEPTANCE_PASS") { throw "No-admin result status was $($result.status)" }
if ($result.is_admin -ne $false) { throw "Child acceptance token was not standard-user" }
if (-not $result.identity_name -or -not $result.user_sid) { throw "Standard-user identity evidence is incomplete" }
if (-not $result.profile_sid_bound) { throw "Per-user state root was not bound to the child SID profile" }
if ($result.local_app_data_source -ne "HKLM_ProfileList_current_sid") { throw "Unexpected per-user state authority: $($result.local_app_data_source)" }
if (-not $result.per_user_state_writable) { throw "Per-user state write/readback was not proven" }
if (-not $result.webview2_detected) { throw "WebView2 was not detected in standard-user context" }
if (-not $result.unicode_spaced_path) { throw "Unicode + spaced per-user launch path was not proven" }
if (-not $result.process_started) { throw "Packaged process did not start under standard-user token" }
if (-not $result.survived_probe_window) { throw "Packaged process did not survive the standard-user probe window" }
if ($result.source_sha256 -ne $hash -or $result.copied_sha256 -ne $hash) { throw "No-admin evidence SHA-256 does not match the exact build artifact" }
Write-Output "NO_ADMIN_ACCEPTANCE_PASS user=$user sha256=$($result.source_sha256)"
}
finally {
if (Get-LocalUser -Name $user -ErrorAction SilentlyContinue) {
Remove-LocalUser -Name $user
}
}

- name: Collect no-admin evidence inside workspace
if: always()
shell: pwsh
run: |
$destination = Join-Path $PWD "no_admin_evidence"
New-Item -ItemType Directory -Force -Path $destination | Out-Null
$sources = @(
@{ Path = "C:\Users\Public\ScriptureArchive-NoAdmin\no_admin_acceptance.json"; Name = "no_admin_acceptance.json" },
@{ Path = "C:\Users\Public\ScriptureArchive-NoAdmin\child-output.log"; Name = "child-output.log" },
@{ Path = "C:\Users\Public\ScriptureArchive-NoAdmin\child-error.log"; Name = "child-error.log" },
@{ Path = (Join-Path $PWD "r06_platform\dist\no_admin_admin_negative.json"); Name = "no_admin_admin_negative.json" }
)
foreach ($source in $sources) {
if (Test-Path -LiteralPath $source.Path -PathType Leaf) {
Copy-Item -LiteralPath $source.Path -Destination (Join-Path $destination $source.Name) -Force
}
}
Get-ChildItem -LiteralPath $destination -File -ErrorAction SilentlyContinue | ForEach-Object {
Write-Output ("NO_ADMIN_EVIDENCE_STAGED " + $_.Name)
}

- uses: actions/upload-artifact@v4
if: always()
with:
name: R06-no-admin-packaged-acceptance
path: no_admin_evidence
if-no-files-found: warn
17 changes: 15 additions & 2 deletions lanes/dev1/repair_overlay/frontend/application-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ function clearDetails(){
$('application-update-details')?.replaceChildren();
}

function authenticityLabel(status){
if(status==='same_publisher_authenticode_verified'){
return 'Підтверджено: чинний Authenticode; сертифікат видавця збігається з поточною програмою';
}
if(status==='not_proven_by_local_hash_verification'){
return 'Не підтверджено: локальний SHA-256 не доводить автентичність підпису або походження';
}
return 'Не підтверджено: невідомий статус автентичності';
}

function renderDetails(data){
const host=$('application-update-details');
if(!host)return;
Expand All @@ -44,7 +54,7 @@ function renderDetails(data){
['Файл пакета',data.artifact_name],
['Розмір',Number.isFinite(Number(data.artifact_size))?`${data.artifact_size} байт`:'—'],
['SHA-256',data.artifact_sha256],
['Автентичність',data.authenticity==='not_proven_by_local_hash_verification'?'Локальний hash не доводить автентичність підпису/джерела':'—'],
['Автентичність',authenticityLabel(data.authenticity)],
];
for(const [label,value] of rows){
const dt=document.createElement('dt');dt.textContent=label;
Expand Down Expand Up @@ -75,7 +85,10 @@ async function selectAndVerify(){
const data=await invokeNativeVerification();
if(data.verified===true&&data.status==='verified'){
renderDetails(data);
announce(`Локальний пакет перевірено: ${data.artifact_name??'пакет'} → ${data.target_version??'цільова версія'}. Нічого не встановлено.`);
const publisherStatus=data.authenticity==='same_publisher_authenticode_verified'
?' Видавець підтверджений чинним Authenticode і збігається з поточною програмою.'
:' Автентичність видавця не підтверджена.';
announce(`Локальний пакет перевірено: ${data.artifact_name??'пакет'} → ${data.target_version??'цільова версія'}.${publisherStatus} Нічого не встановлено.`);
}else if(data.status==='cancelled'){
announce(data.message||'Вибір локального оновлення скасовано.');
}else{
Expand Down
Loading
Loading