Skip to content

Commit 5f0e005

Browse files
Trace hosted fence ACL changes without relaxing security checks
1 parent b15a9c7 commit 5f0e005

7 files changed

Lines changed: 1469 additions & 14 deletions

‎.github/workflows/test.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,21 @@ jobs:
4646
python -m unittest discover -s tests -p "test_paper_pilot_phase_cutover_guarded_v2_trustees.py" -v 2>&1 | tee "$RUNNER_TEMP/windows-fence-trustees.log"
4747
grep -Eq '^Ran 14 tests in ' "$RUNNER_TEMP/windows-fence-trustees.log"
4848
grep -Eq '^OK[[:space:]]*$' "$RUNNER_TEMP/windows-fence-trustees.log"
49-
- name: Run the eight diagnostics-tool sanitization and cleanup cases
49+
- name: Run the ten strict signed-head DACL fence cases (five contract, five native)
50+
if: always()
51+
shell: bash
52+
run: |
53+
set -o pipefail
54+
python -m unittest discover -s tests -p "test_paper_pilot_phase_cutover_guarded_v2_strict_dacl.py" -v 2>&1 | tee "$RUNNER_TEMP/windows-fence-strict-dacl.log"
55+
grep -Eq '^Ran 10 tests in ' "$RUNNER_TEMP/windows-fence-strict-dacl.log"
56+
grep -Eq '^OK[[:space:]]*$' "$RUNNER_TEMP/windows-fence-strict-dacl.log"
57+
- name: Run the sixteen diagnostics-tool sanitization, trace and cleanup cases
5058
if: always()
5159
shell: bash
5260
run: |
5361
set -o pipefail
5462
python -m unittest discover -s tests -p "test_windows_fence_diagnostics.py" -v 2>&1 | tee "$RUNNER_TEMP/windows-fence-diagnostics-tests.log"
55-
grep -Eq '^Ran 8 tests in ' "$RUNNER_TEMP/windows-fence-diagnostics-tests.log"
63+
grep -Eq '^Ran 16 tests in ' "$RUNNER_TEMP/windows-fence-diagnostics-tests.log"
5664
grep -Eq '^OK[[:space:]]*$' "$RUNNER_TEMP/windows-fence-diagnostics-tests.log"
5765
- name: Sanitized Windows trustee serialization diagnostics
5866
if: always()

‎MANIFEST.json‎

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"hash_algorithm": "SHA-256",
44
"manifest_self_excluded": true,
55
"source_only": true,
6-
"file_count": 705,
6+
"file_count": 707,
77
"files": [
88
{
99
"path": ".github/workflows/test.yml",
10-
"bytes": 2602,
11-
"sha256": "366583e5f4821ac69889febc3f1c950c1668d0f02443b936abe759995b2a2c94"
10+
"bytes": 3120,
11+
"sha256": "a0b3ff6080fc9e7212219d25ee9432462ea3057902d5cc786156fb7f85f08c90"
1212
},
1313
{
1414
"path": ".gitignore",
@@ -2632,8 +2632,18 @@
26322632
},
26332633
{
26342634
"path": "tests/test_paper_pilot_phase_cutover_guarded_v2.py",
2635-
"bytes": 12309,
2636-
"sha256": "655b820a4de244c6612bfd2a79854e5f9bda9692ef10ff3903c784a003de4ea5"
2635+
"bytes": 12838,
2636+
"sha256": "a4baf7de9c979aa89ff31c496b9a8e727f94119f823d357e9dfa789ad12cf2f4"
2637+
},
2638+
{
2639+
"path": "tests/test_paper_pilot_phase_cutover_guarded_v2_simulated_acl.py",
2640+
"bytes": 32224,
2641+
"sha256": "bcb5f16b7052094082fa235b74e3950fab2263f53b777f7c9ea8b7b468beb01f"
2642+
},
2643+
{
2644+
"path": "tests/test_paper_pilot_phase_cutover_guarded_v2_strict_dacl.py",
2645+
"bytes": 16130,
2646+
"sha256": "831a973dbb4a10ee4b593ecf66c08bb57fdf0983c5950742b544db078f278c69"
26372647
},
26382648
{
26392649
"path": "tests/test_paper_pilot_phase_cutover_guarded_v2_trustees.py",
@@ -2947,8 +2957,8 @@
29472957
},
29482958
{
29492959
"path": "tests/test_windows_fence_diagnostics.py",
2950-
"bytes": 6916,
2951-
"sha256": "8437f0e838e3832d139d58bb7338a2e7b2bdcf6e217f1640ffab14de1cfbd9fa"
2960+
"bytes": 17143,
2961+
"sha256": "0157f4e5132d2ad64075b214f7b220b3c2841544f7909d5ae3098bdf23c3d5a7"
29522962
},
29532963
{
29542964
"path": "tools/build_schemas.py",
@@ -3027,8 +3037,8 @@
30273037
},
30283038
{
30293039
"path": "tools/windows_fence_diagnostics.py",
3030-
"bytes": 4379,
3031-
"sha256": "d6abd2c30e6336ed73e4e9aa8e679016a29f6bbcc6b3ec106f93606bc2215322"
3040+
"bytes": 19626,
3041+
"sha256": "3b6e5db6ebfa189dd6e4b74b033e6d10dd7fdd552d5002dc306e011252f6b730"
30323042
},
30333043
{
30343044
"path": "tools/windows_image_ocr.ps1",

‎tests/test_paper_pilot_phase_cutover_guarded_v2.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,14 @@ def observe_then_rename(source, destination):
143143
self.assertEqual(result, self.invoke())
144144
self.assertEqual({name: hashlib.sha256((self.archive / name).read_bytes()).hexdigest()
145145
for name in guarded.NAMES}, self.content)
146-
self.assertIn(guarded.DENY_PARENT_ACE.format(sid=self.sid),
147-
guarded.directory_dacl_sddl(self.root))
146+
# The exact parent deny ACE (type D, mask LC, no flags) for this trustee.
147+
# Windows may serialize the numeric SID as an alias (RID 500 -> LA), so
148+
# the trustee is compared by its Windows serialization, not literal text.
149+
parent_dacl = guarded.directory_dacl_sddl(self.root)
150+
self.assertTrue(guarded._has_ace(parent_dacl, guarded.DENY_PARENT_ACE, self.sid))
151+
# A different trustee's deny, or the file-deny mask, is not this ACE.
152+
self.assertFalse(guarded._has_ace(parent_dacl, guarded.DENY_PARENT_ACE, "S-1-5-32-546"))
153+
self.assertFalse(guarded._has_ace(parent_dacl, guarded.DENY_FILE_ACE, self.sid))
148154
self.assertFalse(self.old.exists())
149155

150156
def test_failed_rename_retains_denial_then_same_request_recovers(self):

0 commit comments

Comments
 (0)