xFirewall Can't Detect Rules Created via the GUI (Windows 2012/WMF4)
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- powershell
调研方向
从 DSCResources/MSFT_xFirewall/MSFT_xFirewall.psm1 开始,重点查看 Get-FirewallRule 和 Test-TargetResource,然后使用 Get-NetFirewallRule 和所示的通过 GUI 创建的规则重现该行为。当 Test-TargetResource 能够检测到 DisplayName 与请求的名称匹配的规则,即使其 Name 是 GUID 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I'm running Windows 2012 (non R2) with WMF4. We have manually created some firewall rules using the GUI, and are now trying to detect and monitor these rules using DSC. When created with the GUI, the resources get a Name that is a GUID, and a DisplayName of whatever you intended the name to be. All the -NetFirewallRule checks in the xFirewall resource use -Name, so it is unable to detect the rule properly. A possible fix would be to have -NetFirewallRule check for either Name or DisplayName matches.
Output:
Here's what happens when I try to Test-TargetResource:
PS C:\Program Files\WindowsPowerShell\Modules\xNetworking\DSCResources\MSFT_xFirewall> $parms
Name Value
Action Allow
Ensure Present
Profile Domain
Description Allow Trend for Exchange2013
LocalPort {80, 443, 5168, 16372...}
Name TrendFirewallPortsforExchange2013 (TCP-IN)
Direction Inbound
Protocol Tcp
DisplayName TrendFirewallPortsforExchange2013 (TCP-IN)
PS C:\Program Files\WindowsPowerShell\Modules\xNetworking\DSCResources\MSFT_xFirewall> Import-Module .\MSFT_xFirewall.psm1
PS C:\Program Files\WindowsPowerShell\Modules\xNetworking\DSCResources\MSFT_xFirewall> Test-TargetResource @parms -Verbose
VERBOSE: Test-TargetResource: Checking settings for firewall rule with Name 'TrendFirewallPortsforExchange2013 (TCP-IN)'.
VERBOSE: Test-TargetResource: Find firewall rule with Name 'TrendFirewallPortsforExchange2013 (TCP-IN)'.
VERBOSE: Get-FirewallRule: No Firewall Rule found with Name 'TrendFirewallPortsforExchange2013 (TCP-IN)'.
VERBOSE: Test-TargetResource: Firewall rule with Name 'TrendFirewallPortsforExchange2013 (TCP-IN)' does not exist.
VERBOSE: Test-TargetResource: Check Firewall rule with Name 'TrendFirewallPortsforExchange2013 (TCP-IN)' returning False.
False
Here's the resource props:
[DBG]: PS C:\Program Files\WindowsPowerShell\Modules\xNetworking\DSCResources\MSFT_xFirewall>> Get-NetFirewallRule | where {$_.DisplayName -like "Trend"} | fl
Name : {615DCE6C-32DD-49B0-B81E-808BA37473DC}
DisplayName : TrendFirewallPortsforExchange2013 (TCP-IN)
Description : Allow Trend for Exchange2013
DisplayGroup :
Group :
Enabled : True
Profile : Domain
Platform : {}
Direction : Inbound
Action : Allow
EdgeTraversalPolicy : Block
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
Here's a pic of the GUI:
- 主要语言
- PowerShell
- 星标
- 234
- 派生
- 92
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dsccommunity/NetworkingDsc 的其他 Issue
-
chore
难度 2/5 1-3 小时 新手友好度 72/100
dsccommunity/NetworkingDsc#544 ·
-
chore
难度 4/5 3-5 天 新手友好度 72/100
dsccommunity/NetworkingDsc#542 ·
-
chore
难度 3/5 1-2 天 新手友好度 68/100
dsccommunity/NetworkingDsc#543 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
dsccommunity/NetworkingDsc#539 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
dsccommunity/NetworkingDsc#538 ·
查看 dsccommunity/NetworkingDsc 的全部 Issue
相似的 Issue
-
accepted bug via-triage
难度 2/5 1-3 小时 新手友好度 69/100
pingdotgg/t3code#20931 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
ScoopInstaller/Extras#19070 ·
维护者通常 1 天内回复
-
agent/quality help wanted origin/quality quality stage/010-actionable testing
难度 2/5 1-3 小时 新手友好度 75/100
hivecommons/hotshot#227 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
healthchecks/healthchecks#1349 ·
-
难度 2/5 1-3 小时 新手友好度 77/100
lidofinance/diffyscan#239 ·
维护者通常 1 天内回复