isEntryAllowed determines the observed outcome of a request. This mirrors the classification logic used by the firewall log parser.
(entry AuditLogEntry)
| 234 | // isEntryAllowed determines the observed outcome of a request. |
| 235 | // This mirrors the classification logic used by the firewall log parser. |
| 236 | func isEntryAllowed(entry AuditLogEntry) bool { |
| 237 | status := entry.Status |
| 238 | if status == http.StatusOK || status == http.StatusPartialContent || status == http.StatusNotModified { |
| 239 | return true |
| 240 | } |
| 241 | if status == http.StatusForbidden || status == http.StatusProxyAuthRequired { |
| 242 | return false |
| 243 | } |
| 244 | decision := entry.Decision |
| 245 | if strings.Contains(decision, "TCP_TUNNEL") || |
| 246 | strings.Contains(decision, "TCP_HIT") || |
| 247 | strings.Contains(decision, "TCP_MISS") { |
| 248 | return true |
| 249 | } |
| 250 | if strings.Contains(decision, "NONE_NONE") || |
| 251 | strings.Contains(decision, "TCP_DENIED") { |
| 252 | return false |
| 253 | } |
| 254 | return false |
| 255 | } |
| 256 | |
| 257 | // protocolMatches checks if a rule's protocol constraint matches the request. |
| 258 | // "both" matches everything; "https" matches only HTTPS; "http" matches only HTTP. |
no outgoing calls