Skip to content

Commit

Permalink
Add additional global state return value to socketfilterfw parser (#1842
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Micah-Kolide authored Aug 20, 2024
1 parent c48ff7c commit c716c19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion ee/tables/execparsers/socketfilterfw/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ func sanitizeState(state string) string {
// When the "block all" firewall option is enabled, it doesn't
// include a state like string, which is why we match on
// the string value of "connections" for that mode.
case "1", "on", "enabled", "connections":
//
// When both the Firewall and Stealth Mode are enabled,
// the global firewall state value is `2` instead of `1`.
case "1", "2", "on", "enabled", "connections":
return "1"
case "throttled", "brief", "detail":
// The "logging option" value differs from the booleans.
Expand Down
2 changes: 1 addition & 1 deletion ee/tables/execparsers/socketfilterfw/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestParse(t *testing.T) {
"block_all_enabled": "0",
"allow_built-in_signed_enabled": "1",
"allow_downloaded_signed_enabled": "1",
"stealth_enabled": "0",
"stealth_enabled": "1",
"logging_enabled": "1",
"logging_option": "throttled",
},
Expand Down
4 changes: 2 additions & 2 deletions ee/tables/execparsers/socketfilterfw/test-data/data.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Firewall is enabled. (State = 1)
Firewall is enabled. (State = 2)
Firewall has block all state set to disabled.
Automatically allow built-in signed software ENABLED.
Automatically allow downloaded signed software ENABLED.
Firewall stealth mode is off
Stealth mode enabled
Log mode is on
Log Option is throttled

0 comments on commit c716c19

Please sign in to comment.