Allow verdict to change from initial non-allow state
This commit is contained in:
@@ -635,12 +635,14 @@ var verdictRating = []network.Verdict{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func finalizeVerdict(conn *network.Connection) {
|
func finalizeVerdict(conn *network.Connection) {
|
||||||
// Update worst verdict.
|
// Update worst verdict at the end.
|
||||||
for _, worstVerdict := range verdictRating {
|
defer func() {
|
||||||
if conn.Verdict.Firewall == worstVerdict {
|
for _, worstVerdict := range verdictRating {
|
||||||
conn.Verdict.Worst = worstVerdict
|
if conn.Verdict.Firewall == worstVerdict {
|
||||||
|
conn.Verdict.Worst = worstVerdict
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}()
|
||||||
|
|
||||||
// Check for non-applicable verdicts.
|
// Check for non-applicable verdicts.
|
||||||
// The earlier and clearer we do this, the better.
|
// The earlier and clearer we do this, the better.
|
||||||
@@ -660,6 +662,14 @@ func finalizeVerdict(conn *network.Connection) {
|
|||||||
// Apply first verdict without change.
|
// Apply first verdict without change.
|
||||||
conn.Verdict.Active = conn.Verdict.Firewall
|
conn.Verdict.Active = conn.Verdict.Firewall
|
||||||
|
|
||||||
|
case conn.Verdict.Worst == network.VerdictBlock ||
|
||||||
|
conn.Verdict.Worst == network.VerdictDrop ||
|
||||||
|
conn.Verdict.Worst == network.VerdictFailed ||
|
||||||
|
conn.Verdict.Worst == network.VerdictUndeterminable:
|
||||||
|
// Always allow to change verdict from any real initial/worst non-allowed state.
|
||||||
|
// Note: This check needs to happen before updating the Worst verdict.
|
||||||
|
conn.Verdict.Active = conn.Verdict.Firewall
|
||||||
|
|
||||||
case reference.IsPacketProtocol(conn.Entity.Protocol):
|
case reference.IsPacketProtocol(conn.Entity.Protocol):
|
||||||
// For known packet protocols, apply firewall verdict unchanged.
|
// For known packet protocols, apply firewall verdict unchanged.
|
||||||
conn.Verdict.Active = conn.Verdict.Firewall
|
conn.Verdict.Active = conn.Verdict.Firewall
|
||||||
|
|||||||
Reference in New Issue
Block a user