Skip to content

Commit 596c32c

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
Add Microsoft.Windows/FirewallRuleList resource
1 parent df636d6 commit 596c32c

14 files changed

Lines changed: 1405 additions & 1 deletion

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ members = [
2121
"resources/sshdconfig",
2222
"resources/WindowsUpdate",
2323
"resources/windows_service",
24+
"resources/windows_firewall",
2425
"tools/dsctest",
2526
"tools/test_group_resource",
2627
"grammars/tree-sitter-dscexpression",
@@ -51,6 +52,7 @@ default-members = [
5152
"resources/sshdconfig",
5253
"resources/WindowsUpdate",
5354
"resources/windows_service",
55+
"resources/windows_firewall",
5456
"tools/dsctest",
5557
"tools/test_group_resource",
5658
"grammars/tree-sitter-dscexpression",
@@ -81,6 +83,7 @@ Windows = [
8183
"resources/sshdconfig",
8284
"resources/WindowsUpdate",
8385
"resources/windows_service",
86+
"resources/windows_firewall",
8487
"tools/dsctest",
8588
"tools/test_group_resource",
8689
"grammars/tree-sitter-dscexpression",
@@ -258,6 +261,7 @@ ipnetwork = { version = "0.21" }
258261
# WindowsUpdate, windows_service
259262
windows = { version = "0.62", features = [
260263
"Win32_Foundation",
264+
"Win32_NetworkManagement_WindowsFirewall",
261265
"Win32_System_Com",
262266
"Win32_System_Ole",
263267
"Win32_System_Services",

lib/dsc-lib-jsonschema/.versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"latestMajor": "V3",
33
"latestMinor": "V3_1",
4-
"latestPatch": "V3_1_2",
4+
"latestPatch": "V3_1_3",
55
"all": [
66
"V3",
77
"V3_1",
8+
"V3_1_3",
89
"V3_1_2",
910
"V3_1_1",
1011
"V3_1_0",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"Name": "windows_firewall",
3+
"Kind": "Resource",
4+
"IsRust": true,
5+
"SupportedPlatformOS": "Windows",
6+
"Binaries": [
7+
"windows_firewall"
8+
],
9+
"CopyFiles": {
10+
"Windows": [
11+
"windows_firewall.dsc.resource.json"
12+
]
13+
}
14+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "windows_firewall"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[package.metadata.i18n]
7+
available-locales = ["en-us"]
8+
default-locale = "en-us"
9+
load-path = "locales"
10+
11+
[dependencies]
12+
rust-i18n = { workspace = true }
13+
serde = { workspace = true }
14+
serde_json = { workspace = true }
15+
16+
[target.'cfg(windows)'.dependencies]
17+
windows = { workspace = true }
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
_version = 1
2+
3+
[main]
4+
missingOperation = "Missing operation. Usage: windows_firewall get --input <json> | set --input <json> | export [--input <json>]"
5+
unknownOperation = "Unknown operation: '%{operation}'. Expected: get, set, or export"
6+
missingInput = "Missing --input argument"
7+
missingInputValue = "Missing value for --input argument"
8+
invalidJson = "Invalid JSON input: %{error}"
9+
windowsOnly = "This resource is only supported on Windows"
10+
11+
[get]
12+
rulesArrayEmpty = "The rules array cannot be empty for get operations"
13+
selectorRequired = "Each firewall rule in a get request must include a name"
14+
failedSerializeOutput = "Failed to serialize get output: %{error}"
15+
16+
[set]
17+
rulesArrayEmpty = "The rules array cannot be empty for set operations"
18+
selectorRequired = "Each firewall rule in a set request must include a name"
19+
failedSerializeOutput = "Failed to serialize set output: %{error}"
20+
21+
[export]
22+
failedSerializeOutput = "Failed to serialize export output: %{error}"
23+
24+
[firewall]
25+
comInitFailed = "Failed to initialize COM for Windows Firewall access: %{error}"
26+
policyOpenFailed = "Failed to open the Windows Firewall policy: %{error}"
27+
ruleEnumerationFailed = "Failed to enumerate Windows Firewall rules: %{error}"
28+
ruleLookupFailed = "Failed to look up firewall rule '%{name}': %{error}"
29+
ruleCreateFailed = "Failed to create a firewall rule object: %{error}"
30+
ruleAddFailed = "Failed to add firewall rule '%{name}': %{error}"
31+
ruleRemoveFailed = "Failed to remove firewall rule '%{name}': %{error}"
32+
ruleUpdateFailed = "Failed to update firewall rule '%{name}': %{error}"
33+
ruleReadFailed = "Failed to read firewall rule '%{name}': %{error}"
34+
portsNotAllowed = "Ports cannot be specified for firewall rule '%{name}' because protocol %{protocol} does not support ports"
35+
invalidProfiles = "Invalid profiles value '%{value}'. Valid values are Domain, Private, Public, or All"
36+
invalidInterfaceType = "Invalid interface type '%{value}'. Valid values are RemoteAccess, Wireless, Lan, or All"
37+
invalidProtocol = "Invalid protocol number '%{value}'. Must be between 0 and 256"

0 commit comments

Comments
 (0)