fix(detection): correct ESC15 and SchemaV1 detection boundaries - #91
Merged
Conversation
- update ESC15 conditions in Private/Data/ESCDefinitions.ps1: - remove ManagerApprovalNotRequired (v1 templates do not support it) - require Enabled = $true - keep AuthenticationEKUExist and AuthorizedSignatureNotRequired - replace ESC15 fix/revert with SchemaV1-style supersede guidance - update SchemaV1 conditions to exclude templates with client auth EKU - update SchemaV1 issue text to clarify non-exploitable hygiene finding - update Tests/Public/Find-LS2VulnerableTemplate.Tests.ps1 mocks and cases - remove ManagerApprovalNotRequired from ESC15 tests - add Enabled false negative test for ESC15 - add AuthenticationEKUExist true negative test for SchemaV1
- fix typo "modifieed" -> "upgraded" in ESC15 FixTemplate - switch ESC15 FixTemplate/RevertTemplate to single-quoted literals - remove incorrect "remove Client Authentication EKU" advice from ESC15 issue text - remove leftover ManagerApprovalNotRequired property from ESC15 test helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change separates the concerns of the ESC15 and SchemaV1 findings and fixes an incorrect mitigation recommendation.
Key changes
Private/Data/ESCDefinitions.ps1ManagerApprovalNotRequiredfrom ESC15 conditions. Schema v1 templates do not support manager approval; only permissions can be modified on them.Enabled = $trueto ESC15 conditions.FixTemplate/RevertTemplatewith supersede guidance, matching SchemaV1.AuthenticationEKUExist = $falseto SchemaV1 conditions so ESC15 and SchemaV1 are mutually exclusive.Tests/Public/Find-LS2VulnerableTemplate.Tests.ps1ManagerApprovalNotRequired.Enabled = $false(ESC15) andAuthenticationEKUExist = $true(SchemaV1).Verification
ESCDefinitions.Tests.ps1passes (structure/keys/scoring).Find-LS2VulnerableTemplate.Tests.ps1runs; failures on macOS are due toSystem.DirectoryServices.ActiveDirectorySecuritybeing Windows-only, unrelated to this change.Related context