|
1 | 1 | --- |
2 | 2 | title: Domain Controller Firewall |
3 | | -subtitle: Deployment Documentation |
4 | 3 | author: |
5 | 4 | - Pavel Formanek |
6 | 5 | - Michael Grafnetter |
@@ -31,6 +30,7 @@ keywords: |
31 | 30 | | 2024-11-23 | 1.1 | P. Formanek,<br>M. Grafnetter | Fixed some typos. | |
32 | 31 | | 2024-12-31 | 1.2 | M. Grafnetter | Added the [RestrictADWS](#restrictadws) parameter. | |
33 | 32 | | 2025-01-11 | 1.3 | M. Grafnetter | Improved [helper scripts](#dcfwtool-distribution-contents).<br>Added the [Port Scanning](#port-scanning) and expanded the [System Reboots](#system-reboots) sections. | |
| 33 | +| 2025-02-24 | 1.3.1 | P. Formanek | Expanded the [Firewall Rule Merging](#firewall-rule-merging) section. | |
34 | 34 |
|
35 | 35 | Script files referenced by this document are versioned independently: |
36 | 36 |
|
@@ -218,35 +218,49 @@ The firewall rule set described in this document therefore does not cover the DH |
218 | 218 |
|
219 | 219 | ### Firewall Rule Merging |
220 | 220 |
|
221 | | -To ensure the domain controllers are configured consistently, |
222 | | -their host-based firewalls should be managed centrally through a GPO. |
| 221 | +To ensure consistent configuration of domain controllers, |
| 222 | +their host-based firewalls should be managed centrally through one or more Group Policy Objects (GPOs). |
223 | 223 | Any **local settings on individual DCs should be ignored** during firewall rule evaluation. |
224 | 224 |
|
225 | | -This whitepaper and the policy object created by the `DCFWTool` only cover traffic related to domain controllers |
226 | | -and a few additional Windows Server roles often present on DCs. |
227 | | -If additional environment-specific firewall rules are needed (DC agents, SCCM management, etc.), |
228 | | -it is recommended to define them in separate GPOs. |
229 | | -The resulting firewall rule set, which will be honored by the DCs, will contain rules from all GPOs applied to these DCs. |
| 225 | +This whitepaper and the policy object created by the `DCFWTool` focus exclusively on traffic associated with domain controllers, |
| 226 | +as well as a few additional Windows Server roles often found on domain controllers. |
| 227 | +If additional environment-specific firewall rules are necessary (such as for DC agents, SCCM management, etc.), |
| 228 | +it is advisable to define them in separate GPOs. |
| 229 | +The resulting firewall rule set, which will be honored by the DCs, will contain rules from all GPOs applied to those DCs. |
230 | 230 |
|
231 | 231 | > [!NOTE] |
232 | 232 | > Please keep in mind that this whitepaper only focuses on the firewall configuration |
233 | 233 | > and does not cover any other aspects of domain controller security hardening. |
234 | | -> You should have a separate and dedicated security baseline GPO applied to your DCs. |
| 234 | +> It is essential to have a separate and dedicated security baseline GPO applied to your DCs. |
235 | 235 |
|
236 | | - |
| 236 | + |
237 | 237 |
|
238 | | -Contrary to the standard GPO merging mentioned above, there's unexpected interaction, where the rules merging is not additive but rather the winning GPO rule overwrites the rule with lower precedence. |
239 | | -This only happens, when the same rule (with different values) is created from "Predefined" rules in the new rule creation wizard. |
| 238 | +There is one unexpected caveat regarding rule merging: When the same **Predefined rule** |
| 239 | +is manually created using the "New Inbound Rule Wizard" in multiple GPOs with differing values, |
| 240 | +the rule in the winning GPO will overwrite the rule in the GPO with lower precedence, rather than applying both rules. |
240 | 241 |
|
241 | | - |
| 242 | + |
242 | 243 |
|
243 | | -Consider 2 GPOs, each containing 3 rules with the same name, defining different set or remote IP address in the rule. |
244 | | -Rules created through copy/paste or through new rule creation wizard, using "Custom" option, merge as expected, resulting in 4 rules in the target configuration (2 rules from each GPO). |
245 | | -Rule created through new rule creation wizard, using "Predefined" option results in 1 rule in the target configuration, as the GPO with higher preference overwrites any other GPO configuring the same rule. |
| 244 | +Consider two GPOs, each containing 3 rules with the same name but conflicting sets of remote IP addresses: |
246 | 245 |
|
247 | | - |
248 | | - |
249 | | - |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | +Predefined rules created through a **copy/paste** operation and new rules created using the **Custom** option |
| 251 | +will be merged as expected, resulting in a total of four firewall rules (i.e., two rules from each GPO). |
| 252 | + |
| 253 | +However, only a single predefined firewall rule created directly in the target GPO using the wizard |
| 254 | +will be included in the final configuration, |
| 255 | +as the GPO with higher precedence overwrites any others containing the same rule: |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | +> [!WARNING] |
| 260 | +> There is a known bug in Windows where the **Rule Source** column may sometimes display wrong values |
| 261 | +> that do not correspond to the respective values in the **Remote Addresses** column, |
| 262 | +> as illustrated in the screenshot above. |
| 263 | +> This behavior appears to occur randomly. |
250 | 264 |
|
251 | 265 | ### Identifying Management Traffic |
252 | 266 |
|
|
0 commit comments