Documentation
¶
Overview ¶
Package fwstats collects firewall visibility from agent heartbeats (§8.3): per-rule hit counters, dropped connection attempts (the drop log) and nodes where security groups cannot be enforced.
Index ¶
- type Drop
- type DropFilter
- type Stats
- func (s *Stats) Counters() map[string]firewall.Counts
- func (s *Stats) Drops(f DropFilter, limit int) []Drop
- func (s *Stats) DropsFromLogs(ctx context.Context, f DropFilter, since time.Duration, limit int) ([]Drop, error)
- func (s *Stats) Name(ip string) string
- func (s *Stats) NodeCounters(node string) map[string]firewall.Counts
- func (s *Stats) OnHeartbeat(node store.Node, hb *agentv1.Heartbeat)
- func (s *Stats) SecurityErrors() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Drop ¶
type Drop struct {
At time.Time `json:"at"`
Node string `json:"node"`
Direction string `json:"direction"` // host | in | out
Src string `json:"src"`
SrcName string `json:"srcName,omitempty"`
Dst string `json:"dst,omitempty"`
DstName string `json:"dstName,omitempty"`
Protocol string `json:"protocol"`
Port uint32 `json:"port"`
Packets uint64 `json:"packets"`
}
Drop is a dropped flow seen by one node, with names for its addresses.
type DropFilter ¶
DropFilter selects drops; empty fields match everything.
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats is fed by heartbeats and read by the API.
func (*Stats) Drops ¶
func (s *Stats) Drops(f DropFilter, limit int) []Drop
Drops returns recent drops kept in memory, newest first.
func (*Stats) DropsFromLogs ¶
func (s *Stats) DropsFromLogs(ctx context.Context, f DropFilter, since time.Duration, limit int) ([]Drop, error)
DropsFromLogs reads the drop log from VictoriaLogs (history beyond the controller's memory), newest first.
func (*Stats) NodeCounters ¶
NodeCounters returns one node's counters.
func (*Stats) OnHeartbeat ¶
OnHeartbeat records a node's counters and drops.
func (*Stats) SecurityErrors ¶
SecurityErrors lists nodes that cannot enforce security groups.