Skip to content

Conversation

@dp001
Copy link

@dp001 dp001 commented Apr 16, 2019

Changes below using CustomUserOrGroupSid variable defined in UnsafePathsToBuildRulesFor.ps1 to allow specify custom SID instead of Everyone's

User case is for allowing specific users' Group executing files from writable directory. Changes allow automating rules creation process instead of manually reviewing/changing them

@msftclas
Copy link

msftclas commented Apr 16, 2019

CLA assistant check
All CLA requirements met.

rmoreas and others added 3 commits April 16, 2019 15:13
Use hashtable output in GetSafePathsToAllow.ps1 supporting "Label" an…
# Get-AppLockerFileInformation -Directory inspects files with these extensions:
# .com, .exe, .dll, .ocx, .msi, .msp, .mst, .bat, .cmd, .js, .ps1, .vbs, .appx
# But this script drops .msi, .msp, .mst, and .appx
[array]$scanFileTypes = @('*.bat','*.com','*.exe','*.dll','*.ocx','*.js','*.ps1','*.pyd','*.vbs','*.xll')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we could specify arbitrary file extensions, but the PowerShell cmdlets don't support them. The problem is that when you pass the Get-AppLockerFileInformation results to New-AppLockerPolicy, it relies on file extension to determine file type based on its own hardcoded list. If you try to manipulate the path name in the file information object to give it a standard extension before passing it to New-AppLockerPolicy, it will still fail because it goes to look for that file and doesn't find it. I considered and quickly discarded an idea to create hard links to the new names and then deleting them after building. For now I'm just running Scan-Directories.ps1 and pulling data out of there for HashRuleData.ps1, or just insisting on good publisher/productname data.

jsuther1974 added a commit that referenced this pull request Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants