WDACConfig

0.1.2


This is an advanced PowerShell module for WDAC (Windows Defender Application Control) and automates a lot of tasks.


🟢 Please see the GitHub page for Full details and everything about the module: https://github.com/HotCakeX/Harden-Windows-Security/wiki/WDACConfig


🛡️ Here is the list of parameters the module supports


✔️ New-WDACConfig [-GetBlockRules]

This is an advanced PowerShell module for WDAC (Windows Defender Application Control) and automates a lot of tasks.


🟢 Please see the GitHub page for Full details and everything about the module: https://github.com/HotCakeX/Harden-Windows-Security/wiki/WDACConfig


🛡️ Here is the list of parameters the module supports


✔️ New-WDACConfig [-GetBlockRules]

✔️ New-WDACConfig [-GetDriverBlockRules]

✔️ New-WDACConfig [-MakeAllowMSFTWithBlockRules] [-Deployit] [-TestMode] [-RequireEVSigners]

✔️ New-WDACConfig [-DeployLatestDriverBlockRules]

✔️ New-WDACConfig [-SetAutoUpdateDriverBlockRules]

✔️ New-WDACConfig [-PrepMSFTOnlyAudit] [-LogSize <Int64>]

✔️ New-WDACConfig [-PrepDefaultWindowsAudit] [-LogSize <Int64>]

✔️ New-WDACConfig [-MakePolicyFromAuditLogs] -BasePolicyType <String> [-Deployit] [-TestMode] [-RequireEVSigners] [-Debugmode] [-AllowFileNameFallbacks] [-SpecificFileNameLevel <String>] [-NoDeletedFiles] [-NoUserPEs] [-NoScript] [-Levels <String>] [-Fallbacks <String[]>] [-LogSize <Int64>]

✔️ New-WDACConfig [-MakeLightPolicy] [-Deployit] [-TestMode] [-RequireEVSigners]

✔️ New-WDACConfig [-MakeSupplementalPolicy] -ScanLocation <String> -SuppPolicyName <String> -PolicyPath <String> [-Deployit] [-AllowFileNameFallbacks] [-SpecificFileNameLevel <String>] [-NoUserPEs] [-NoScript] [-Levels <String>] [-Fallbacks <String[]>]

✔️ New-WDACConfig [-MakeDefaultWindowsWithBlockRules] [-Deployit] [-TestMode] [-RequireEVSigners]

✔️ Remove-WDACConfig [-RemoveSignedPolicies] -PolicyPaths <String[]> -CertCN <String> [-SignToolPath <String>]

✔️ Remove-WDACConfig [-RemovePolicies] [-PolicyIDs <String[]>] [-PolicyNames <String[]>]

✔️ Edit-WDACConfig [-AllowNewAppsAuditEvents] -SuppPolicyName <String> -PolicyPaths <String[]> [-Debugmode] [-Levels <String>] [-Fallbacks <String[]>] [-NoScript] [-NoUserPEs] [-AllowFileNameFallbacks] [-SpecificFileNameLevel <String>] [-LogSize <Int64>] [-IncludeDeletedFiles]

✔️ Edit-WDACConfig [-AllowNewApps] -SuppPolicyName <String> -PolicyPaths <String[]> [-Levels <String>] [-Fallbacks <String[]>] [-NoScript] [-NoUserPEs] [-AllowFileNameFallbacks] [-SpecificFileNameLevel <String>]    

✔️ Edit-WDACConfig [-MergeSupplementalPolicies] -SuppPolicyName <String> -PolicyPaths <String[]> -SuppPolicyPaths <String[]>

✔️ Edit-WDACConfig [-UpdateBasePolicy] -CurrentBasePolicyName <String[]> -NewBasePolicyType <String> [-RequireEVSigners]

✔️ Edit-SignedWDACConfig [-AllowNewAppsAuditEvents] -CertPath <String> -SuppPolicyName <String> -PolicyPaths <String[]> -CertCN <String> [-Debugmode] [-LogSize <Int64>] [-NoScript] [-NoUserPEs] [-AllowFileNameFallbacks] [-SpecificFileNameLevel <String>] [-IncludeDeletedFiles] [-SignToolPath <String>] [-Levels <String>] [-Fallbacks <String[]>]

✔️ Edit-SignedWDACConfig [-AllowNewApps] -CertPath <String> -SuppPolicyName <String> -PolicyPaths <String[]> -CertCN <String> [-NoScript] [-NoUserPEs] [-AllowFileNameFallbacks] [-SpecificFileNameLevel <String>] [-SignToolPath <String>] [-Levels <String>] [-Fallbacks <String[]>]

✔️ Edit-SignedWDACConfig [-MergeSupplementalPolicies] -CertPath <String> -SuppPolicyName <String> -PolicyPaths <String[]> -CertCN <String> -SuppPolicyPaths <String[]> [-SignToolPath <String>]

✔️ Edit-SignedWDACConfig [-UpdateBasePolicy] -CertPath <String> -CertCN <String> -SignToolPath <String> -CurrentBasePolicyName <String[]> -NewBasePolicyType <String> [-RequireEVSigners]

✔️ Deploy-SignedWDACConfig -CertPath <String> -PolicyPaths <String[]> -CertCN <String> [-SignToolPath <String>]

✔️ Confirm-WDACConfig [-ListActivePolicies] [-OnlyBasePolicies] [-OnlySupplementalPolicies]

✔️ Confirm-WDACConfig [-VerifyWDACStatus]

✔️ Confirm-WDACConfig [-CheckSmartAppControlStatus]



To get help and syntax on PowerShell console, type:
"Get-Command -Module WDACConfig"
"Get-Help New-WDACConfig"
"Get-Help Remove-WDACConfig"
"Get-Help Edit-WDACConfig"
"Get-Help Edit-SignedWDACConfig"
"Get-Help Deploy-SignedWDACConfig"
"Get-Help Confirm-WDACConfig"
Show more

Minimum PowerShell version

7.3.4

There is a newer prerelease version of this module available.
See the version list below for details.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name WDACConfig -RequiredVersion 0.1.2

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name WDACConfig -Version 0.1.2

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2023

Package Details

Author(s)

  • HotCakeX

Tags

WDAC Windows-Defender-Application-Control Windows Security Microsoft Application-Control MDAC Application-Whitelisting

Cmdlets

New-WDACConfig Remove-WDACConfig Deploy-SignedWDACConfig Confirm-WDACConfig Edit-WDACConfig Edit-SignedWDACConfig

Functions

New-WDACConfig Remove-WDACConfig Deploy-SignedWDACConfig Confirm-WDACConfig Edit-WDACConfig Edit-SignedWDACConfig

PSEditions

Core

Dependencies

This module has no dependencies.

Release Notes


## Version 0.1.2
Made the Get-SignTool function more secure.
Added smarter argument completer to Remove-WDACConfig cmdlet.

## Version 0.1.1
Created a Resources.ps1 file to store repeated functions that are used in all sub-modules, resulting in reduced repeated codes. It is dot-sourced at the beginning of each sub-module and function calls are dot-sourced too.
Started using #Requires -RunAsAdministrator instead of a function to check for Admin privileges, also resulting in reduced repeated codes.
Bumped PowerShell required version to 7.3.4 since it has some fixed for ConfigCI module cmdlets that the WDACConfig module relies on.
Improved the Edit-WDACConfig -AllowNewAppsAuditEvents so that it can now produce a more effective supplemental policy. Also going forward, it won't include deleted files by default, unless the newly introduced -IncludeDeletedFiles switch is used. Deleted files are files that are run and then deleted during a program's installation but event viewer audit logs will have their records.
To improve readability and code validation, added lots of meaningful comments to many commands, functions and script blocks.
Removed "Dekstop" from CompatiblePSEditions in the module manifest since WDACConfig module needs PowerShell and not Windows PowerShell (old).
Removed #requires -version from the top of each sub-module since it's enough for version control to be enforced using module manifest only.
Added extra validation to Edit-SignedWDACConfig cmdlet to prevent user from accidentally using Unsigned policies.
Added extra validation to Edit-WDACConfig cmdlet to prevent user from accidentally using Signed policies.
Changed Valid range for log size parameter from [System.Int64]::MaxValue (9223372036854775807 KB) to 18014398509481983 KB which is the maximum allowed log size by Windows Event viewer
Edit-SignedWDACConfig -AllowNewAppsAuditEvents and Edit-WDACConfig -AllowNewAppsAuditEvents no longer include file rules for deleted file hashes by default, unless -IncludeDeletedFiles optional switch parameter is used.
Edit-SignedWDACConfig -AllowNewAppsAuditEvents and Edit-WDACConfig -AllowNewAppsAuditEvents got smarter. They now can successfully detect and only create extra rules for files that are not in the user-selected paths.
Edit-SignedWDACConfig cmdlet and Edit-WDACConfig got equiped with multiple new optional parameters that were added to New-WDACConfig cmdlet in the previous update. Those parameters include: -NoUserPEs, -NoScript, -AllowFileNameFallbacks and -SpecificFileNameLevel.
Added Validations to parameters to validate folder paths and file paths.
Made multiple argument completers and validate sets more advanced. They no longer suggest the same values that have been selected by user. Thanks to helpful answers by mklement0 on StackOverflow: https://stackoverflow.com/users/45375/mklement0
https://stackoverflow.com/questions/76143006/how-to-prevent-powershell-validateset-argument-completer-from-suggesting-the-sam/76143269
https://stackoverflow.com/questions/76141864/how-to-make-a-powershell-argument-completer-that-only-suggests-files-not-already/76142865
Added 5-way validation for the SignTool executable before it is allowed to be executed.
Substantially improved the security of the script.

## Version 0.1.0
New features: Added new parameter to New-WDACConfig cmdlet, -PrepDefaultWindowsAudit, which as the name suggests, will prepare the system for Default Windows auditing,
it will create audit logs for any file that is run and is not part of the Windows, unlike -PrepMSFTOnlyAudit parameter that creates audit logs for any file that is not signed,
by Microsoft's trusted root certificate. The -PrepDefaultWindowsAudit parameter also scans the WDACConfig module files and PowerShell core files, adds them to the Prep base policy,
so that the final Supplemental policy generated from Event viewer audit logs, won't include those files.
New features: Added more control over the workflow of -MakePolicyFromAuditLogs and -MakeSupplementalPolicy parameters. They now accept multiple new parameters to fine tune the supplemental policy.
Quality improvements: The default level in the module is FilePublisher now, previously it was SignedVersion. The default Fallbacks have also changed from "FilePublisher, Hash" to "Hash" only.
This change contributes to more secure policy creation, although these defaults can be overwritten by user via available parameters.
Quality improvements: Removed the question asked from the user at the end of the -MakePolicyFromAuditLogs parameter about deleting the deployed Prep Audit mode policy.
It will now be automatically deleted when -Deployit switch parameter is used, Otherwise the Prep audit mode policy will stay on the system.
Added -NoDeletedFiles switch parameter to -MakePolicyFromAuditLogs, When used, only event viewer log data will be scanned and used in the final supplemental policy, and no rules will be created for files
that were run but then deleted during program installation.

## Version 0.0.9
Very small update only to change the description of the PowerShell gallery's page and fix the details, nothing code related.

## Version 0.0.8
New features: Added the last base policy type, DefaultWindows, to the available base policy options to be used for the cmdlets of this module.
New features: Added -UpdateBasePolicy parameter for the Edit-SignedWDACConfig cmdlet, so you can seamlessly change the base policy type or update block rules in it without changing or redeploying supplemental policies.
All cmdlets and parameters that create a supplemental policy by scanning now allow optional granular controls over levels and fallback levels, giving user full control over that process.
Removed underscore (_) from parameter names and now using camel case for all of them.
Changed parameter set names from generic Set1,Set2 etc. to proper names that can easily identify which parameter they belong to.
Added [-OnlyBasePolicies] and [-OnlySupplementalPolicies] switches to "Confirm-WDACConfig [-ListActivePolicies]".
The module now has a total of 24 distinct parameters/features to help easily manage advanced WDAC and Application Whitelisting tasks.

## Version 0.0.7
New feature: Edit-WDACConfig -UpdateBasePolicy It can rebootlessly change the type of the deployed base policy. It can update the recommended block rules and/or change policy rule options in the deployed base policy.
Used Begin and Process blocks in module functions to organize everything properly. Added a lot of parameter validations.

## Version 0.0.6
New feature: Confirm-WDACConfig -CheckSmartAppControlStatus.
Checks the status of Smart App Control and reports the results on the console.
Improved Confirm-WDACConfig -ListActivePolicies by showing the number of deployed non-system WDAC policies and base policies on the console.

## Version 0.0.5
New feature: Edit-SignedWDACConfig -Merge_SupplementalPolicies. It can merge multiple deployed Signed supplemental policies into 1 and deploy it, remove the individual ones, all happening automatically.
Very useful to keep Supplemental policies below 32 since that's the limit.

## Version 0.0.4
New feature: Merge multiple deployed Supplemental policies into 1 and deploy it, remove the individual ones, all happening automatically. Very useful to keep Supplemental policies below 32 since that's the limit.

## Version 0.0.3
Completed self-updating feature. Changed icon, added syntaxes.

## Version 0.0.2
Testing self updating procedure with the new PowerShell gallery repo

## Version 0.0.1
Renamed the previous repository in order to comply with proper nested modules and improve the readability and mangement of the module.
Added 2 new features too, rebootlessly add new apps to non-signed deployed WDAC policies. You could do it with Signed policies, now you can do the same with non-signed policies.

FileList

Version History

Version Downloads Last updated
0.4.9 1,148 11/16/2024
0.4.8.2 1,774 11/4/2024
0.4.8.1 331 11/2/2024
0.4.7 947 10/27/2024
0.4.6 1,841 10/12/2024
0.4.5 4,152 9/7/2024
0.4.4 1,783 8/20/2024
0.4.3 1,516 8/5/2024
0.4.2 1,372 7/9/2024
0.4.1 160 7/1/2024
0.4.0 427 6/7/2024
0.3.9 75 6/4/2024
0.3.8 478 4/28/2024
0.3.7 95 4/21/2024
0.3.6 61 4/16/2024
0.3.5 354 3/16/2024
0.3.4 171 3/2/2024
0.3.4-Beta1 8 3/2/2024
0.3.3 123 2/21/2024
0.3.2 103 2/10/2024
0.3.1 190 1/22/2024
0.3.0 142 1/9/2024
0.2.9 66 1/2/2024
0.2.8 41 12/27/2023
0.2.8-Beta3 10 12/27/2023
0.2.8-Beta2 7 12/27/2023
0.2.8-Beta1 9 12/26/2023
0.2.7 190 12/12/2023
0.2.6 222 10/10/2023
0.2.5 26 10/6/2023
0.2.4 42 9/25/2023
0.2.3 34 9/19/2023
0.2.2 66 9/5/2023
0.2.1 121 8/13/2023
0.2.0 83 7/18/2023
0.1.9 47 7/9/2023
0.1.8 97 6/2/2023
0.1.7 15 5/28/2023
0.1.6 12 5/25/2023
0.1.5 38 5/18/2023
0.1.4 12 5/14/2023
0.1.3 12 5/13/2023
0.1.2 (current version) 27 5/3/2023
0.1.1 8 5/1/2023
0.1.0 25 4/22/2023
0.0.9 15 4/15/2023
0.0.8 7 4/14/2023
0.0.7 18 4/10/2023
0.0.6 19 4/5/2023
0.0.5 15 4/4/2023
0.0.4 14 4/3/2023
0.0.3 8 4/2/2023
0.0.2 22 4/2/2023
0.0.1 8 4/2/2023
Show less