Skip to content

Commit

Permalink
MFW-3947-INTERFACE_NAMEs (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlistairJohnParker authored Nov 30, 2023
1 parent 2d53e6c commit dcda7c7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions services/settings/policy/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,23 @@ func (pCondition *PolicyCondition) UnmarshalJSON(data []byte) error {
}
}
case "IP_PROTOCOL", "CLIENT_PORT", "SERVER_PORT",
// 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":
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)
}
// just string type values on these, no need to validate
case "CERT_SUBJECT_CN", "CERT_SUBJECT_DNS", "CERT_SUBJECT_O",
"DAY_OF_WEEK", "SERVER_GEOIP", "CLIENT_GEOIP", "INTERFACE", "SERVICE", "SERVER_SERVICE", "CLIENT_SERVICE",
// CLIENT and SOURCE mean the same thing - support both
// SERVER and DESTINATION mean the same thing - support both
"CLIENT_INTERFACE_NAME", "SERVER_INTERFACE_NAME",
"SOURCE_INTERFACE_NAME", "DESTINATION_INTERFACE_NAME",
"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":

Expand Down

0 comments on commit dcda7c7

Please sign in to comment.