chore: 添加 ACL 恢复脚本与 AttrInfo 结构差异分析报告

This commit is contained in:
lianjianwei2024
2026-11-04 07:18:11 +08:00
parent e0e09a893b
commit 80bdca043a
7 changed files with 1892 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
{"kind":"invocation","operation":"repair","path":"","status":"started","reason":"Inspect the requested paths, then repair the ACL problems this run can prove, before anything else is attempted.","details":{"recoveryRecord":"","allowRoot":"D:\\PricingReview","paths":["D:\\PricingReview\\CostReview\\data"],"outputDirectory":"D:\\PricingReview\\_acl-recovery"}}
{"kind":"action","operation":"prepare_report","path":"D:\\PricingReview\\_acl-recovery","status":"started","reason":"Create the recovery directory and a new JSONL report that keeps every record, because tool output is truncated to its tail.","details":{"id":1,"effect":"files"}}
{"kind":"action","operation":"prepare_report","path":"D:\\PricingReview\\_acl-recovery","status":"completed","reason":"Create the recovery directory and a new JSONL report that keeps every record, because tool output is truncated to its tail.","details":{"id":1,"effect":"files"}}
{"kind":"action","operation":"initialize","path":"","status":"started","reason":"Load read-only access checks and DACL-only writes before inspecting permissions.","details":{"id":2,"effect":"none"}}
{"kind":"action","operation":"initialize","path":"","status":"completed","reason":"Load read-only access checks and DACL-only writes before inspecting permissions.","details":{"id":2,"effect":"none"}}
{"kind":"observation","operation":"caller","path":"","status":"read","reason":"The caller token determines effective access; unconfined execution does not imply elevation.","details":{"integrity":"S-1-16-8192 (Medium)","sid":"S-1-5-21-1842133535-1407408427-1432962073-1000"}}
{"kind":"observation","operation":"inspect_acl","path":"D:\\PricingReview\\CostReview\\data","status":"read","reason":"Read the ACL and check effective WRITE_DAC and WRITE_OWNER; observed ACEs alone do not identify which rule caused a denial.","details":{"errors":[],"writeOwner":false,"acesOmitted":false,"writeDac":true,"owner":"S-1-5-21-1842133535-1407408427-1432962073-1000","aces":[{"sid":"S-1-5-32-544","type":"Allow","rights":"FullControl","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-544","type":"Allow","rights":"268435456","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-18","type":"Allow","rights":"FullControl","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-18","type":"Allow","rights":"268435456","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-11","type":"Allow","rights":"Modify, Synchronize","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-11","type":"Allow","rights":"-536805376","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-32-545","type":"Allow","rights":"ReadAndExecute, Synchronize","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-545","type":"Allow","rights":"-1610612736","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"}],"lowLabel":null}}
{"kind":"observation","operation":"inspect_acl","path":"D:\\PricingReview\\CostReview","status":"read","reason":"Read the ACL and check effective WRITE_DAC and WRITE_OWNER; observed ACEs alone do not identify which rule caused a denial.","details":{"errors":[],"writeOwner":false,"acesOmitted":false,"writeDac":true,"owner":"S-1-5-21-1842133535-1407408427-1432962073-1000","aces":[{"sid":"S-1-5-32-544","type":"Allow","rights":"FullControl","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-544","type":"Allow","rights":"268435456","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-18","type":"Allow","rights":"FullControl","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-18","type":"Allow","rights":"268435456","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-11","type":"Allow","rights":"Modify, Synchronize","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-11","type":"Allow","rights":"-536805376","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-32-545","type":"Allow","rights":"ReadAndExecute, Synchronize","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-545","type":"Allow","rights":"-1610612736","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"}],"lowLabel":null}}
{"kind":"observation","operation":"inspect_acl","path":"D:\\PricingReview","status":"read","reason":"Read the ACL and check effective WRITE_DAC and WRITE_OWNER; observed ACEs alone do not identify which rule caused a denial.","details":{"errors":[],"writeOwner":true,"acesOmitted":false,"writeDac":true,"owner":"S-1-5-21-1842133535-1407408427-1432962073-1000","aces":[{"sid":"S-1-1-0","type":"Deny","rights":"DeleteSubdirectoriesAndFiles","inherited":false,"inheritance":"ContainerInherit","propagation":"None"},{"sid":"S-1-4-625000727-302857043","type":"Allow","rights":"DeleteSubdirectoriesAndFiles, Write, Delete, Synchronize","inherited":false,"inheritance":"ContainerInherit, ObjectInherit","propagation":"None"},{"sid":"S-1-4-970831040-201677128","type":"Allow","rights":"DeleteSubdirectoriesAndFiles, Write, Delete, Synchronize","inherited":false,"inheritance":"ContainerInherit, ObjectInherit","propagation":"None"},{"sid":"S-1-5-21-1842133535-1407408427-1432962073-1000","type":"Allow","rights":"FullControl","inherited":false,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-544","type":"Allow","rights":"FullControl","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-544","type":"Allow","rights":"268435456","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-18","type":"Allow","rights":"FullControl","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-18","type":"Allow","rights":"268435456","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-11","type":"Allow","rights":"Modify, Synchronize","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-11","type":"Allow","rights":"-536805376","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-32-545","type":"Allow","rights":"ReadAndExecute, Synchronize","inherited":true,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-545","type":"Allow","rights":"-1610612736","inherited":true,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"}],"lowLabel":true}}
{"kind":"observation","operation":"inspect_acl","path":"D:\\","status":"read","reason":"Read the ACL and check effective WRITE_DAC and WRITE_OWNER; observed ACEs alone do not identify which rule caused a denial.","details":{"errors":[],"writeOwner":false,"acesOmitted":false,"writeDac":false,"owner":"S-1-5-18","aces":[{"sid":"S-1-5-11","type":"Allow","rights":"-536805376","inherited":false,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-11","type":"Allow","rights":"Modify, Synchronize","inherited":false,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-18","type":"Allow","rights":"FullControl","inherited":false,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-18","type":"Allow","rights":"268435456","inherited":false,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-32-544","type":"Allow","rights":"268435456","inherited":false,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"},{"sid":"S-1-5-32-544","type":"Allow","rights":"FullControl","inherited":false,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-545","type":"Allow","rights":"ReadAndExecute, Synchronize","inherited":false,"inheritance":"None","propagation":"None"},{"sid":"S-1-5-32-545","type":"Allow","rights":"-1610612736","inherited":false,"inheritance":"ContainerInherit, ObjectInherit","propagation":"InheritOnly"}],"lowLabel":null}}
{"kind":"observation","operation":"subtree_scan","path":"D:\\PricingReview\\CostReview\\data","status":"read","reason":"The caller cannot provision this directory, or it is the authorized root, so explicit package allow ACEs under it were collected in the same run; no reparse point or managed application tree is entered.","details":{"packageSources":[],"truncated":false,"unreadable":0,"visited":8}}
{"kind":"decision","operation":"classify","path":"D:\\PricingReview\\CostReview\\data","status":"PRECONDITION","reason":"The caller cannot open the requested object with both WRITE_DAC and WRITE_OWNER. The reported allow and deny ACEs are evidence, not an attribution to one rule.","details":{"writeOwner":false,"writeDac":true,"packageObjects":[]}}
{"kind":"decision","operation":"grant_targets","path":"D:\\PricingReview\\CostReview\\data","status":"selected","reason":"These directories lack effective WRITE_DAC or WRITE_OWNER; each is backed up, then receives a FullControl allow ACE for the current user.","details":{"paths":["D:\\PricingReview\\CostReview\\data","D:\\PricingReview\\CostReview"]}}
{"kind":"decision","operation":"backup","path":"D:\\PricingReview\\CostReview\\data","status":"selected","reason":"The recovery record and an independent recovery script are written before the ACL change.","details":{"files":["D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json","D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json.ps1"]}}
{"kind":"action","operation":"backup","path":"D:\\PricingReview\\CostReview\\data","status":"started","reason":"Save the original DACL and an independent recovery command before changing permissions.","details":{"id":3,"effect":"files"}}
{"kind":"action","operation":"backup","path":"D:\\PricingReview\\CostReview\\data","status":"completed","reason":"Save the original DACL and an independent recovery command before changing permissions.","details":{"id":3,"effect":"files"}}
{"kind":"observation","operation":"recovery","path":"D:\\PricingReview\\CostReview\\data","status":"available","reason":"These files can restore the saved DACL; no rollback has been executed.","details":{"record":"D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json","command":"pwsh -NoProfile -File 'D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json.ps1' -Path 'D:\\PricingReview\\CostReview\\data' -AllowRoot 'D:\\PricingReview' -Restore 'D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json'","restored":false,"attempted":false,"script":"D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json.ps1","path":"D:\\PricingReview\\CostReview\\data"}}
{"kind":"action","operation":"grant_dacl","path":"D:\\PricingReview\\CostReview\\data","status":"started","reason":"WRITE_DAC or WRITE_OWNER is missing; add a FullControl allow ACE for S-1-5-21-1842133535-1407408427-1432962073-1000 while preserving deny ACEs, owner and SACL.","details":{"id":4,"effect":"acl"}}
{"kind":"action","operation":"grant_dacl","path":"D:\\PricingReview\\CostReview\\data","status":"completed","reason":"WRITE_DAC or WRITE_OWNER is missing; add a FullControl allow ACE for S-1-5-21-1842133535-1407408427-1432962073-1000 while preserving deny ACEs, owner and SACL.","details":{"id":4,"effect":"acl"}}
{"kind":"observation","operation":"inspect_acl","path":"D:\\PricingReview\\CostReview\\data","status":"read","reason":"Read the ACL and check effective WRITE_DAC and WRITE_OWNER; observed ACEs alone do not identify which rule caused a denial.","details":{"errors":[],"writeOwner":true,"acesOmitted":true,"writeDac":true,"owner":"S-1-5-21-1842133535-1407408427-1432962073-1000","aces":null,"lowLabel":null}}
{"kind":"verification","operation":"grant","path":"D:\\PricingReview\\CostReview\\data","status":"verified","reason":"The DACL write completed; recheck effective access before claiming that provisioning can succeed. On failure, restore this invocation and stop.","details":{"before":{"writeOwner":false,"writeDac":true},"after":{"writeOwner":true,"writeDac":true},"recovery":"pwsh -NoProfile -File 'D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json.ps1' -Path 'D:\\PricingReview\\CostReview\\data' -AllowRoot 'D:\\PricingReview' -Restore 'D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json'"}}
{"kind":"decision","operation":"backup","path":"D:\\PricingReview\\CostReview","status":"selected","reason":"The recovery record and an independent recovery script are written before the ACL change.","details":{"files":["D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json","D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json.ps1"]}}
{"kind":"action","operation":"backup","path":"D:\\PricingReview\\CostReview","status":"started","reason":"Save the original DACL and an independent recovery command before changing permissions.","details":{"id":5,"effect":"files"}}
{"kind":"action","operation":"backup","path":"D:\\PricingReview\\CostReview","status":"completed","reason":"Save the original DACL and an independent recovery command before changing permissions.","details":{"id":5,"effect":"files"}}
{"kind":"observation","operation":"recovery","path":"D:\\PricingReview\\CostReview","status":"available","reason":"These files can restore the saved DACL; no rollback has been executed.","details":{"record":"D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json","command":"pwsh -NoProfile -File 'D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json.ps1' -Path 'D:\\PricingReview\\CostReview' -AllowRoot 'D:\\PricingReview' -Restore 'D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json'","restored":false,"attempted":false,"script":"D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json.ps1","path":"D:\\PricingReview\\CostReview"}}
{"kind":"action","operation":"grant_dacl","path":"D:\\PricingReview\\CostReview","status":"started","reason":"WRITE_DAC or WRITE_OWNER is missing; add a FullControl allow ACE for S-1-5-21-1842133535-1407408427-1432962073-1000 while preserving deny ACEs, owner and SACL.","details":{"id":6,"effect":"acl"}}
{"kind":"action","operation":"grant_dacl","path":"D:\\PricingReview\\CostReview","status":"completed","reason":"WRITE_DAC or WRITE_OWNER is missing; add a FullControl allow ACE for S-1-5-21-1842133535-1407408427-1432962073-1000 while preserving deny ACEs, owner and SACL.","details":{"id":6,"effect":"acl"}}
{"kind":"observation","operation":"inspect_acl","path":"D:\\PricingReview\\CostReview","status":"read","reason":"Read the ACL and check effective WRITE_DAC and WRITE_OWNER; observed ACEs alone do not identify which rule caused a denial.","details":{"errors":[],"writeOwner":true,"acesOmitted":true,"writeDac":true,"owner":"S-1-5-21-1842133535-1407408427-1432962073-1000","aces":null,"lowLabel":null}}
{"kind":"verification","operation":"grant","path":"D:\\PricingReview\\CostReview","status":"verified","reason":"The DACL write completed; recheck effective access before claiming that provisioning can succeed. On failure, restore this invocation and stop.","details":{"before":{"writeOwner":false,"writeDac":true},"after":{"writeOwner":true,"writeDac":true},"recovery":"pwsh -NoProfile -File 'D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json.ps1' -Path 'D:\\PricingReview\\CostReview' -AllowRoot 'D:\\PricingReview' -Restore 'D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json'"}}
{"kind":"summary","operation":"repair","path":"D:\\PricingReview\\CostReview\\data","status":"completed","reason":"Operation completion records API execution; verification records the observed result. Only rerunning the original confined operation can confirm its failure is resolved.","details":{"nextAction":"verify_original_confined_operation","operations":[{"id":1,"operation":"prepare_report","path":"D:\\PricingReview\\_acl-recovery","effect":"files","status":"completed"},{"id":2,"operation":"initialize","path":"","effect":"none","status":"completed"},{"id":3,"operation":"backup","path":"D:\\PricingReview\\CostReview\\data","effect":"files","status":"completed"},{"id":4,"operation":"grant_dacl","path":"D:\\PricingReview\\CostReview\\data","effect":"acl","status":"completed"},{"id":5,"operation":"backup","path":"D:\\PricingReview\\CostReview","effect":"files","status":"completed"},{"id":6,"operation":"grant_dacl","path":"D:\\PricingReview\\CostReview","effect":"acl","status":"completed"}],"exitCode":0,"rollbackCommands":["pwsh -NoProfile -File 'D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json.ps1' -Path 'D:\\PricingReview\\CostReview' -AllowRoot 'D:\\PricingReview' -Restore 'D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json'","pwsh -NoProfile -File 'D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json.ps1' -Path 'D:\\PricingReview\\CostReview\\data' -AllowRoot 'D:\\PricingReview' -Restore 'D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json'"],"automaticRollback":true,"restored":0,"observationFailures":0,"report":"D:\\PricingReview\\_acl-recovery\\acl-report-38654d41a493427fb3d9f12eca756ae6.jsonl","refused":0,"scanTruncated":false,"rollback":"not-needed","recoveries":[{"record":"D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json","command":"pwsh -NoProfile -File 'D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json.ps1' -Path 'D:\\PricingReview\\CostReview\\data' -AllowRoot 'D:\\PricingReview' -Restore 'D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json'","restored":false,"attempted":true,"script":"D:\\PricingReview\\_acl-recovery\\acl-backup-1b4df40d57684b42881224c447febb36.json.ps1","path":"D:\\PricingReview\\CostReview\\data"},{"record":"D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json","command":"pwsh -NoProfile -File 'D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json.ps1' -Path 'D:\\PricingReview\\CostReview' -AllowRoot 'D:\\PricingReview' -Restore 'D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json'","restored":false,"attempted":true,"script":"D:\\PricingReview\\_acl-recovery\\acl-backup-47955c9164634109a5215defd0fe7936.json.ps1","path":"D:\\PricingReview\\CostReview"}],"fixed":0,"granted":2}}