Treasury & Bank Transfer Management System — سامانه مدیریت خزانه‌داری و حواله‌های بانکی

1 name: Mayan isolated Windows VM executable probe
2
3 on:
4 workflow_dispatch:
5 inputs:
6 mayan_qa_tag:
7 description: "PRIVATE Release tag containing Mayan-Sanitized-QA.zip"
8 required: true
9 type: string
10 mayan_qa_sha256:
11 description: "SHA-256 of exact sanitized QA asset"
12 required: true
13 type: string
14
15 permissions:
16 contents: read
17
18 jobs:
19 mayan-sandbox:
20 runs-on: windows-latest
21 timeout-minutes: 30
22 steps:
23 - uses: actions/checkout@v4
24 with:
25 persist-credentials: false
26 - name: Fetch pinned private artifact, reject sensitive files
27 shell: pwsh
28 env:
29 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 QA_TAG: ${{ inputs.mayan_qa_tag }}
31 QA_SHA: ${{ inputs.mayan_qa_sha256 }}
32 REPO_NAME: ${{ github.repository }}
33 run: |
34 $ErrorActionPreference='Stop'
35 if($env:QA_SHA -notmatch '^[a-fA-F0-9]{64}$'){throw 'MAYAN_QA_SHA256_REQUIRED'}
36 gh release download $env:QA_TAG --repo $env:REPO_NAME --pattern Mayan-Sanitized-QA.zip --dir $env:RUNNER_TEMP --clobber
37 $zip=Join-Path $env:RUNNER_TEMP 'Mayan-Sanitized-QA.zip'
38 if((Get-FileHash $zip -Algorithm SHA256).Hash -ne $env:QA_SHA.ToUpperInvariant()){throw 'MAYAN_QA_SHA256_MISMATCH'}
39 $destination=Join-Path $env:RUNNER_TEMP 'Mayan-Sanitized-QA'
40 Expand-Archive -LiteralPath $zip -DestinationPath $destination -Force
41 $bad=@(Get-ChildItem $destination -File -Recurse -Force | Where-Object {
42 $_.Name -match '(?i)^license\.key$|^config\.json$|^connectionString\.txt$|\.xlsx$|\.pdb$|\.sqlite$|\.db$|\.pfx$|\.pem$|\.key$|\.ttf$'
43 })
44 if($bad.Count){throw 'QA_ARCHIVE_CONTAINS_SENSITIVE_FILES'}
45 $expected=@(Get-ChildItem $destination -File -Recurse|Where-Object {
46 $_.Extension -notin @('.exe','.dll','.json','.txt')
47 })
48 if($expected.Count){throw 'UNEXPECTED_QA_FILE_TYPE'}
49 "MAYAN_QA_PATH=$destination" >> $env:GITHUB_ENV
50 - name: Start the real WinForms PE with per-program outbound firewall isolation
51 shell: pwsh
52 run: |
53 & ./scripts/windows-vm-mayan-sandbox.ps1 -QaFolder $env:MAYAN_QA_PATH
54 - name: Record Mayan VM run provenance
55 if: always()
56 shell: pwsh
57 run: |
58 $folder=Join-Path $env:RUNNER_TEMP 'mayan-vm-evidence'
59 New-Item -ItemType Directory -Path $folder -Force | Out-Null
60 $proof=[ordered]@{
61 schema='mayan-windows-vm-evidence-v1'
62 run_id=$env:GITHUB_RUN_ID
63 run_attempt=$env:GITHUB_RUN_ATTEMPT
64 head_sha=$env:GITHUB_SHA
65 runner_os=$env:RUNNER_OS
66 runner_name=$env:RUNNER_NAME
67 run_url="$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"
68 gui_business_flow='NOT_VERIFIED'
69 financial_output_parity='NOT_VERIFIED'
70 structure_report_exists=(Test-Path (Join-Path $folder 'mayan-gui.json'))
71 }
72 $proof | ConvertTo-Json -Depth 5 | Set-Content (Join-Path $folder 'verification.json') -Encoding UTF8
73 "Mayan VM provenance: $($proof.run_url) / $env:GITHUB_SHA" >> $env:GITHUB_STEP_SUMMARY
74 - name: Upload sanitized evidence (not real financial data)
75 if: always()
76 uses: actions/upload-artifact@v4
77 with:
78 name: mayan-windows-vm-structural-evidence
79 path: ${{ runner.temp }}/mayan-vm-evidence/*.json
80 retention-days: 7
81 if-no-files-found: warn
82 - name: State honest comparison boundary
83 if: always()
84 shell: pwsh
85 run: |
86 'This probes a real sanitized Mayan EXE only. Real GUI function, licensing and financial output parity remain UNVERIFIED.' >> $env:GITHUB_STEP_SUMMARY
87 'No live bank credentials, live SQL connection, customer records or real payments are used.' >> $env:GITHUB_STEP_SUMMARY