GNU General Public License v3.0

项目介绍

SteveUnderScoreN/WindowsFirewall 是一个托管在 GitHub 上的开源项目,主要使用 PowerShell 编写,采用 GNU General Public License v3.0 许可证,目前获得 67 个 Star、9 次 Fork。

仓库全名
SteveUnderScoreN/WindowsFirewall
开源许可证
GNU General Public License v3.0
Star 数
67
Fork 数
9
未关闭 Issue
1

README 摘要

Windows Defender Firewall, PowerShell scripts/GUI tools As part of a defence in depth strategy application whitelisting needs to be enforced at the OS level, this mitigates much of the malware in the current threat landscape. The OS should whitelist no only what is allowed to run, enforced with AppLocker and CI policies, but also what network connectivity an application is granted. This repository contains…

完整内容见 GitHub 原始 README 或本页 。

常见问题

WindowsFirewall 用什么语言开发?

主要使用 PowerShell 编写,采用 GNU General Public License v3.0 许可证,目前有 67 个 Star。

WindowsFirewall 可以免费商用吗?

仓库标注的许可证为 GNU General Public License v3.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 WindowsFirewall 的源码?

可以直接克隆仓库:git clone https://github.com/SteveUnderScoreN/WindowsFirewall.git,默认分支为 master;安装与运行步骤见仓库 README。

WindowsFirewall 最近还在维护吗?

仓库最近一次更新为 2021年12月4日,当前有 1 个未关闭 Issue;Star 数为 67,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

PowerShell scripts/GUI tools for the enterprise to harden Windows Defender Firewall via group policy (GPO). These can be used to enforce network level application whitelisting and strengthen the security posture of devices to defend against attacks such as software supply chain and can be used with privileged access workstations (PAW).

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

PowerShell

Release

README

Windows Defender Firewall, PowerShell scripts/GUI tools

As part of a defence in depth strategy application whitelisting needs to be enforced at the OS level, this mitigates much of the malware in the current threat landscape. The OS should whitelist no only what is allowed to run, enforced with AppLocker and CI policies, but also what network connectivity an application is granted. This repository contains PowerShell scripts and firewall policies to configure Windows clients and servers including protocol, port, IP and application to help achieve that goal. These policies can be used with privileged access workstations as documented here. The scripts can be populated with the host names and/or IP addresses of your domain resources which will create very specific firewall rules for your domain. Any domain resources that do not exist in your domain can be left as the default loopback addresses as defined in the scripts. These policies should not be modified outside the scripts provided, domain specific policies should be created that sit above these baselines in the group policy link order. These domain specific policies (e.g. Domain Firewall, Tier 0 Devices Firewall, Server Role - Remote Administration Firewall) can have additional firewall allow or block rules. A block rule will override any rule in the baseline. These baselines must be above any computer baseline provided by Microsoft (e.g. MSFT Windows 10 RS3 - Computer).
The domain firewall baseline enables auditing of denied connection attempts within the security event log (ID 5157), the tier x device firewall baseline enables auditing of denied and permitted connections (ID 5156). Permitted and denied connections are essential forensic evidence and should be archived. Logs should be set to automatically backup when full, a scheduled task can be created on event ID 1105 which runs a script to zip the logs locally. These logs can then be harvested by a central server and stored or imported into the event management system. Along with process creation auditing (and a little HEX to DEC conversion) these firewall audit entries can be used to track the user identity associated with particular network activity which is essential in the investigation in a multi-user environment like Terminal Services.

Notes

Supported

  • IPSEC VPN
  • IPv6
  • Windows 10
  • Windows Server 2012 R2/2016/2019
  • Privileged access workstations
  • ‘Predefined set of computers’ is supported and the following applies;
    • ‘Local Subnet’ - includes the connected IP range for which an IP address has been assigned
    • ‘Intranet’ - includes the IP subnets that have been added to ‘Sites and Services (dssite.msc)’, these are harvested by the IP helper service and can be seen in the following registry key;
      HKLM:\SYSTEM\CurrentControlSet\Services\iphlpsvc\Parameters\ADHarvest
    • ‘DNS Servers’ - does not include the IPv6 addresses of DNS servers
    • ‘Internet’ - is everything that isn’t in the ADHarvest registry key

Not supported

  • DirectAccess (at least not for now, consider migrating to IKEv2 ‘Always On VPN’ device tunnels)
  • NetBIOS
  • WINS

Other

  • NTLM should be blocked forcing mutual authentication via Kerberos, if there is a requirements for NTLM authentication to a server it should be whitelisted in the NTLM exceptions within a group policy object
  • Some SVCHOST services do not honour the firewall settings, there are some temporary SVCHOST rules to cover these that may be refined at a later date

Changes

I’ve modified the existing scripts to use the “Group” parameter that matches the domain resources defined. This allows us to have a rule to set new parameter values on all rules that are in a specific group, for example;

  • I have 35 rules that have domain controllers as the destination IP address
  • I change the IP address of a domain controller which is updated in DNS
  • I add an IPv6 address to an existing domain controller which is created in DNS
  • I have a new domain controller at a new site and the address is created in DNS
  • I update the $DomainControllers domain resource variable to add the new server name along side the existing server names
  • I run the script against the GPO with the 35 rules
  • The script converts $DomainControllers from the names of the servers to an array of IP addresses
  • The script detects the existing GPO and presents a menu to select the “Update existing” option
  • When selected the script, with 1 line, updates all 35 rules that have the group as “DomainControllers”
  • The GPO is then saved back to the domain and is ready to be applied

评论

暂无评论