Skip to content

Commit

Permalink
mfw-4041 (#328)
Browse files Browse the repository at this point in the history
version: bug
  • Loading branch information
abriles1216 authored Dec 6, 2023
1 parent 4d4b93d commit 727a705
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions services/settings/policy/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ func (pCondition *PolicyCondition) UnmarshalJSON(data []byte) error {
// CLIENT and SOURCE mean the same thing - support both
// SERVER and DESTINATION mean the same thing - support both
"CLIENT_INTERFACE_TYPE", "SERVER_INTERFACE_TYPE",
"SOURCE_INTERFACE_TYPE", "DESTINATION_INTERFACE_TYPE":
"SOURCE_INTERFACE_TYPE", "DESTINATION_INTERFACE_TYPE",
"APPLICATION_RISK", "APPLICATION_RISK_INFERRED",
"APPLICATION_PRODUCTIVITY", "APPLICATION_PRODUCTIVITY_INFERRED":

if _, err := strconv.ParseUint(value, 10, 32); err != nil {
return fmt.Errorf("error while unmarshalling policy condition: value does not match type (%s) due to error (%v)", pCondition.CType, err)
}
Expand All @@ -64,8 +67,9 @@ func (pCondition *PolicyCondition) UnmarshalJSON(data []byte) error {
"CLIENT_INTERFACE_ZONE", "SERVER_INTERFACE_ZONE",
"SOURCE_INTERFACE_ZONE", "DESTINATION_INTERFACE_ZONE",

"PROTOCOL_TYPE", "APPLICATION_CATEGORY", "TIME_OF_DAY", "VLAN_TAG", "THREATPREVENTION",
"APPLICATION", "SERVER_APPLICATION", "CLIENT_APPLICATION", "HOSTNAME", "SERVER_DNS_HINT":
"PROTOCOL_TYPE", "TIME_OF_DAY", "VLAN_TAG", "THREATPREVENTION",
"APPLICATION", "SERVER_APPLICATION", "CLIENT_APPLICATION", "HOSTNAME", "SERVER_DNS_HINT",
"APPLICATION_NAME", "APPLICATION_NAME_INFERRED", "APPLICATION_CATEGORY", "APPLICATION_CATEGORY_INFERRED":

default:
return fmt.Errorf("error while unmarshalling policy condition: invalid type: %s", pCondition.CType)
Expand Down

0 comments on commit 727a705

Please sign in to comment.