WSUS and more fun stuff!
Windows Server Update Services can be deployed many ways. Also included as a part of SCCM. Either as a single server standalone, or a replicated server farm. Secondary (downstream) servers pull their updates from upstream (master) WSUS server; master-servers download updates from Microsoft Update over the internet.
Computer groups will help deploying and testing patches and hotfixes easier. You can have a group a “test servers” as a part of the production enviroment, but with nothing important on to see what implications a patch bring along. Summing up the benefits of WSUS:
This TechNet-guide is great for getting started, and goes into the technical stuff that I don’t hit on.
You can either use Windows Interal database (WID) or Microsoft SQL server (on server 2016) To install the tools, use the following cmdlet:
Install-WindowsFeature -Name UpdateServices, UpdateServices-WiDB, UpdateServices-Services, UpdateServices-API, UpdatesServices-UI
Open the Windows Server Update Services console from the server manager, this starts the Complete WSUS Installation Wizard
Post installation tasks take a few minutes, after which you’re taken into a second wizard where there’s a verification step that asks you if WSUS servers firewall rules are configured and you’re logged in with proper credentials. Then we’re presented with the following choices that needs to be made (in some cases ignored):
After initial sync completes, you’re ready to define computer groups, apply approval policies and configure automatic update. All of this can be done via the Update Services MMC console
By default WSUS creates (but doesn’t populate) a single computer group called Unassigned Computers. Let’s create a new group for our infrastructure servers:
Adding computers to the group is a bit hard, we must use a GPO to point our client servers and desktop computers to a given WSUS server. Once that has been done, however, you can reassign the host by clicking the host and selecting change membership.
To point clients and servers to the right WSUS server, go to this GPO:
Computer Config\Policies\Administrative Templates\Windows Components\Windows Update
And to the following:
In the same GPO path, open the Configure Automatic Updates policy. Here you control how often the targeted hosts query the WSUS server.
In Windows Server 16 defender behavior is configurable from the Update and Security pane in Settings.
You can control real-time protection (runs defender in the background constantly), cloud-based protection (sends results to windows to help make defender better and faster at detecting), automatic sample submission (submits samples of detected malware to microsoft), exclusions (don’t scan certain files / folders if you’re sure they’re safe), windows defender offline (you can scan the system from an alternative startup volume, but you have to install windows defender offline to do this, version info (how recent is the defitions and signature files.
Start-MpScan #to start a normal scan
Start-MpWDOScan #to start offline scan (if you've created an offline boot media).
Please refer to the article on running and reviewing offline scans with Windows Defender for more details. There’s also an overview over different defender cmdlets that might prove useful!
Configure WSUS to automatically approve windows defender updates automatically.
Your server should now automatically approve and download Windows Defender definition updates. You can control defender from GPO:
Comp Conf\Policies\Adm Temp\Windows Components\Windows Defender.
Here you can do stuff like enable headless UI mode for users, allow users to pause scans and set time of day to run scans. Headless UI mode refers to update running in background, without bothering the users with pop-ups or information they don’t need.
AppLocker is basically whitelisting. Make sure that AppIDSvc is running on all protected servers, you can use GPOs to force-enable this service. You can have five types of rules:
For each rule we have a choice of three conditions:
To get more into the nitty-gritty and understand AppLocker rules and policies, check out this guide.
We will try to create an automatically generated rule to whitelist the standard applications and block the firefox browser executable.
First we need to sure AppIDSvc is running, then in GPO editor, navigate to:
Comp Conf\Policies\Windows Settings\Security Settings\Application Control Policies\AppLocker
Right click the Executable Rules node and select Automatically Generate Rules. This allows the following:
Right click executeable rules and click Create New Rule and change the User or Group scope to Authenticated User:
Then we can use PowerShell to force domain wide gpo-update
invoke-gpupdate -computer $_.name -Force
Log on to a computer and try to run calc.exe, doesn’t work. You can also view this in eventviewer, where you will have four different applocker logs:
For a reference guide with links to each individual step, check this TechNet-article out!
Control Flow Guard is a developer focused feature. To enable it the creators of .NET software need to enable it in Visual Studio and recompile the program.
In most cases, there is no need to change source code. All you have to do is add an option to your Visual Studio 2015 project, and the compiler and linker will enable CFG. The simplest method is to navigate to Project | Properties | Configuration Properties | C/C++ | Code Generation and choose Yes (/guard:cf) for Control Flow Guard.
How does it work? Well, when a CFG check fails at runtime, Windows immediately terminates the program, thus breaking any exploit that attempts to indirectly call an invalid address.
Run the dumpbin tool (included in the Visual Studio 2015 installation) from the Visual Studio command prompt with the /headers and /loadconfig options: dumpbin /headers /loadconfig test.exe. The output for a binary under CFG should show that the header values include “Guard”, and that the load config values include “CF Instrumented” and “FID table present”.
Device Guard isn’t a single product, it’s a collection of security-related hardware and software features that fully protects the servers executable environment. This article on demystifying Device Guard and Credential Guard on TechNet explains a lot!
To summarize briefly, device guard consist of three primary components:
So, to make it clear, device guard isn’t a single thing, it’s these three components working together to guard your device.
You can manage device guard with:
This gives us the ability to choose from preference, and also automate a great deal. For more information on how to configure this, see the article above.
Define the actual application whitelist that is enforced on the target node. Create a “golden” server and workstation images that contain all the signed software and components that are allowed by the policy.
Each server/computer can only have one CI-policy at the time. It’s located at:
C:\Windows\System32\CodeIntegrity\SIPolicy.p7b
Code integrity file rules specify the level at which applications are ided and trusted by Device Guard. Run levels are almost the same as in AppLocker, being Hash, FileName, SignedVersion, Publisher, FilePublisher, WHQL (used to trust windows kernel bins) and WHQLFilePublisher (specifies that bin code must be certifiedby Windows Hardware Quality Labs).
High level steps to deploy a new CI-policy:
Update 12.02.2019
High level steps to deploy CI:
End update
Also important to note, as Microsoft likes to change things up, Code Integrity is now known as Windows Defender Application Control or WDAC. Please use this article as reference for the default policy and how to add publishers, merge policies and publish them.
You can store your application whitelisting exceptions in catalog files and device guard whitelists the catalog entries. This can be done with the PackageInspector.exe command line tool. For more information, this series of TechNet How-To topics should be a good start for a great many things.
TechNet-article on server patching and WSUS
Microsoft security products overview
The world of security is always changing and that’s also the case for Microsoft. To follow all their updates, new products, what’s retiring and namechanges please use the following link to stay updated on all their blogs and updates. Here they discuss updated baselines and so much more.