Skip to content

Commit d4c623b

Browse files
Expanded Rule Merging section
1 parent 5322e40 commit d4c623b

File tree

5 files changed

+38
-21
lines changed

5 files changed

+38
-21
lines changed

ADDS/README.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Domain Controller Firewall
3-
subtitle: ​​Deployment Documentation​
43
author:
54
- Pavel Formanek
65
- Michael Grafnetter
@@ -31,6 +30,7 @@ keywords:
3130
| 2024-11-23 | 1.1 | P. Formanek,<br>M. Grafnetter | Fixed some typos. |
3231
| 2024-12-31 | 1.2 | M. Grafnetter | Added the [RestrictADWS](#restrictadws) parameter. |
3332
| 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. |
3434

3535
Script files referenced by this document are versioned independently:
3636

@@ -218,35 +218,49 @@ The firewall rule set described in this document therefore does not cover the DH
218218

219219
### Firewall Rule Merging
220220

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).
223223
Any **local settings on individual DCs should be ignored** during firewall rule evaluation.
224224

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.
230230

231231
> [!NOTE]
232232
> Please keep in mind that this whitepaper only focuses on the firewall configuration
233233
> 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.
235235
236-
![GPO precedence](../Images/Screenshots/firewall-precedence-gpo.png)
236+
![GPO precedence / link order](../Images/Screenshots/firewall-precedence-gpo.png)
237237

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.
240241

241-
![Predefined firewall rule](../Images/Screenshots/firewall-predefined-rules.png)
242+
![Creating predefined firewall rules](../Images/Screenshots/firewall-predefined-rules.png)
242243

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:
246245

247-
![GPO firewall example 01](../Images/Screenshots/firewall-gpo01.png)
248-
![GPO firewall example 02](../Images/Screenshots/firewall-gpo02.png)
249-
![GPO firewall merge result](../Images/Screenshots/firewall-rulemerge-result.png)
246+
![Sample GPO firewall policy FW_GPO_01](../Images/Screenshots/firewall-gpo01.png)
247+
248+
![Sample GPO firewall policy FW_GPO_02](../Images/Screenshots/firewall-gpo02.png)
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+
![Resultant set of firewall rules from FW_GPO_01 and FW_GPO_02](../Images/Screenshots/firewall-rulemerge-result.png)
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.
250264
251265
### Identifying Management Traffic
252266

Generators/mkdocs/mkdocs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RepoRoot=$(dirname -- "$(dirname -- "$ScriptRoot")")
88

99
# Copy CSS files
1010
mkdir --parents --verbose "$RepoRoot/docs/assets/stylesheets"
11-
cp "$ScriptRoot/extra.css" "$RepoRoot/docs/assets/stylesheets/extra.css"
11+
cp --verbose "$ScriptRoot/extra.css" "$RepoRoot/docs/assets/stylesheets/extra.css"
1212

1313
# Copy markdown and HTML files
1414
mkdir --parents --verbose "$RepoRoot/docs/ADDS"
@@ -25,7 +25,7 @@ rsync --archive --no-relative --exclude='*.md' --verbose "$RepoRoot/Images/"**/*
2525
find "$RepoRoot/docs" -name "*.md" -exec sed --in-place 's/\.\.\/Images\/\w\+\//..\/assets\/images\//g' {} \;
2626

2727
# Case 2: Replace paths like Images/Screenshots/ with assets/images/
28-
find "$RepoRoot/docs" -name "*.md" -exec sed --in-place 's/(Images\/\w\+\//(assets\/images\//g' {} \;
28+
find "$RepoRoot/docs" -name "*.md" -exec sed --in-place 's/(Images\/\w\+\//(assets\/images\//g' {} \;
2929

3030
# Normalize named anchors in markdown files by replacing 3 consecutive hyphens with a single one
3131
# Example: Replace #active-directory-domain-controller---ldap-tcp-in with #active-directory-domain-controller-ldap-tcp-in

Generators/mkdocs/mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ nav:
1717
theme:
1818
name: material
1919
locale: en
20+
favicon: assets/images/favicon.png
2021
icon:
2122
logo: fontawesome/solid/book
2223
palette:
@@ -47,6 +48,7 @@ theme:
4748
- navigation.instant
4849
- navigation.instant.progress
4950
- navigation.expand
51+
- navigation.top
5052
markdown_extensions:
5153
- abbr
5254
- admonition

Generators/pandoc/metadata.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ listings-disable-line-numbers: true
1111
classoption: oneside
1212
geometry: a4paper,margin=2cm
1313
colorlinks: true
14+
subtitle: ​​Deployment Documentation​

Images/Logos/favicon.png

657 Bytes
Loading

0 commit comments

Comments
 (0)