netsec-scan: deterministic sensor (6 PromQL tripwires + 2 flow-store novelty rules)
Silent ticks (empty stdout, exit 0), one line per stable fingerprint, cumulative union-only seen-set at ~/.hermes/cron/netsec-scan-state.json, memoized sensor- degradation line, daily baseline report. Stdlib only; reads the collector's JSONL over SSH with per-file byte offsets and Prometheus via the k8s API proxy. 40 unit tests against fixtures recorded from the live collector.
This commit is contained in:
commit
68b2616cc5
19 changed files with 1902 additions and 0 deletions
24
tests/fixtures/beacon-shaped.jsonl
vendored
Normal file
24
tests/fixtures/beacon-shaped.jsonl
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{"flow":{"time":"2026-11-27T04:00:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40000,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:00:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40001,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:01:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40002,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:01:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40003,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:02:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40004,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:02:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40005,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:03:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40006,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:03:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40007,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:04:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40008,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:04:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40009,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:05:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40010,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:05:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40011,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:06:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40012,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:06:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40013,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:07:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40014,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:07:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40015,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:08:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40016,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:08:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40017,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:09:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40018,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:09:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40019,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:10:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40020,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:10:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40021,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:11:00.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40022,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
{"flow":{"time":"2026-11-27T04:11:30.000000Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":40023,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]}}
|
||||
6
tests/fixtures/egress-sample.jsonl
vendored
Normal file
6
tests/fixtures/egress-sample.jsonl
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{"flow":{"time":"2026-11-27T05:10:15.315310912Z","uuid":"29e775f0-ff10-48c3-8ed1-8b88b9b9e794","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"104.18.30.120","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":37046,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]},"node_name":"siriussec","time":"2026-11-27T05:10:15.315310912Z"}
|
||||
{"flow":{"time":"2026-11-27T05:10:15.660605421Z","uuid":"644cc08a-ab06-4fae-8e27-e5c0694de1af","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"172.67.209.185","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":50598,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]},"node_name":"siriussec","time":"2026-11-27T05:10:15.660605421Z"}
|
||||
{"flow":{"time":"2026-11-27T05:10:15.775821370Z","uuid":"17c8d78e-fb51-4539-b739-be6be7554cf6","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"185.199.108.153","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":50724,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]},"node_name":"siriussec","time":"2026-11-27T05:10:15.775821370Z"}
|
||||
{"flow":{"time":"2026-11-27T05:10:16.124686167Z","uuid":"b468af8e-37d5-4205-a5de-75a943ca1d80","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"f2:dc:16:84:bb:34","destination":"c6:f6:e9:76:45:36"},"IP":{"source":"10.244.0.184","destination":"185.199.109.153","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":34462,"destination_port":443,"flags":{"SYN":true}}},"source":{"ID":455,"identity":40606,"cluster_name":"default","namespace":"flux-system","labels":["gen:io.cilium.k8s.named-ports=healthz.TCP.9440_http.TCP.9090_http-prom.TCP.8080","k8s:app.kubernetes.io/component=source-controller","k8s:app.kubernetes.io/instance=flux-system","k8s:app.kubernetes.io/part-of=flux","k8s:app.kubernetes.io/version=v2.9.5","k8s:app=source-controller","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/instance=flux-system","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=flux","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/version=v2.9.5","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=flux-system","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn-version=latest","k8s:io.cilium.k8s.namespace.labels.pod-security.kubernetes.io/warn=restricted","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=source-controller","k8s:io.kubernetes.pod.namespace=flux-system"],"pod_name":"source-controller-56549698b5-2lvmc","workloads":[{"name":"source-controller","kind":"Deployment"}]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":5},"traffic_direction":"EGRESS","policy_match_type":4,"is_reply":false,"Summary":"TCP Flags: SYN","egress_allowed_by":[{"name":"allow-egress","namespace":"flux-system","labels":["k8s:io.cilium.k8s.policy.derived-from=NetworkPolicy","k8s:io.cilium.k8s.policy.name=allow-egress","k8s:io.cilium.k8s.policy.namespace=flux-system","k8s:io.cilium.k8s.policy.uid=1baa50f5-a60f-4c58-bc53-34ab012d2ccc"],"revision":"17","kind":"NetworkPolicy"}],"policy_log":[""]},"node_name":"siriussec","time":"2026-11-27T05:10:16.124686167Z"}
|
||||
{"flow":{"time":"2026-11-27T05:05:12.419235937Z","uuid":"6e8a40c9-a705-4a3d-b821-3df671782225","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"98:fa:9b:3c:02:91","destination":"e4:6c:d1:47:be:49"},"IP":{"source":"192.168.1.179","destination":"9.9.9.11","ipVersion":"IPv4"},"l4":{"UDP":{"source_port":54439,"destination_port":53}},"source":{"identity":1,"labels":["reserved:host","reserved:kube-apiserver"]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":4,"sub_type":11},"traffic_direction":"EGRESS","trace_observation_point":"TO_NETWORK","trace_reason":"NEW","is_reply":false,"interface":{"index":2,"name":"enp0s31f6"},"Summary":"UDP"},"node_name":"siriussec","time":"2026-11-27T05:05:12.419235937Z"}
|
||||
{"flow":{"time":"2026-11-27T05:04:01.009014238Z","uuid":"3dc20d0a-6145-4393-84b9-081e00ef30ed","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","ethernet":{"source":"98:fa:9b:3c:02:91","destination":"2c:cf:67:c2:94:0b"},"IP":{"source":"192.168.1.179","destination":"192.168.1.125","ipVersion":"IPv4"},"l4":{"UDP":{"source_port":35630,"destination_port":51820}},"source":{"identity":1,"labels":["reserved:host","reserved:kube-apiserver"]},"destination":{"identity":2,"labels":["reserved:world"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":4,"sub_type":11},"traffic_direction":"EGRESS","trace_observation_point":"TO_NETWORK","trace_reason":"ESTABLISHED","is_reply":false,"interface":{"index":2,"name":"enp0s31f6"},"Summary":"UDP"},"node_name":"siriussec","time":"2026-11-27T05:04:01.009014238Z"}
|
||||
6
tests/fixtures/l7-and-drop.jsonl
vendored
Normal file
6
tests/fixtures/l7-and-drop.jsonl
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{"flow":{"time":"2026-11-27T05:04:00.512733267Z","uuid":"34ca81e8-9c3e-4906-a55f-4caa87a376c8","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","IP":{"source":"10.10.0.1","destination":"10.244.0.174","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":47992,"destination_port":3000}},"source":{"identity":8,"labels":["reserved:ingress"]},"destination":{"ID":547,"identity":9593,"cluster_name":"default","namespace":"forgejo","labels":["gen:io.cilium.k8s.named-ports=http.TCP.3000","k8s:app=forgejo","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=forgejo","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=apps","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=default","k8s:io.kubernetes.pod.namespace=forgejo"],"pod_name":"forgejo-f566c6856-mlvmc","workloads":[{"name":"forgejo","kind":"Deployment"}]},"Type":"L7","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"l7":{"type":"REQUEST","http":{"method":"GET","url":"http://forgejo.siriusdevops.com/sirius/gcloud-lab/blame/commit/777f98a5ff8ef7823f730e6756c80b22cb54050d/trading-platform/dockerfiles/execute-service/.dockerignore","protocol":"HTTP/1.1","headers":[{"key":":scheme","value":"http"},{"key":"Accept","value":"*/*"},{"key":"Accept-Encoding","value":"gzip, br"},{"key":"Cdn-Loop","value":"cloudflare; loops=1"},{"key":"Cf-Connecting-Ip","value":"74.7.242.34"},{"key":"Cf-Ipcountry","value":"US"},{"key":"Cf-Ray","value":"a60e96f31949f142-ATL"},{"key":"Cf-Visitor","value":"{\"scheme\":\"https\"}"},{"key":"Cf-Warp-Tag-Id","value":"67539f9e-0e9e-4290-aca2-02a95152a194"},{"key":"From","value":"gptbot(at)openai.com"},{"key":"Referer","value":"https://forgejo.siriusdevops.com/sirius/gcloud-lab/src/commit/777f98a5ff8ef7823f730e6756c80b22cb54050d/trading-platform/dockerfiles/execute-service/.dockerignore"},{"key":"User-Agent","value":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.4; +https://openai.com/gptbot)"},{"key":"X-Envoy-External-Address","value":"10.10.0.1"},{"key":"X-Forwarded-For","value":"74.7.242.34,10.10.0.1"},{"key":"X-Forwarded-Host","value":"forgejo.siriusdevops.com"},{"key":"X-Openai-Host-Hash","value":"477764235"},{"key":"X-Request-Id","value":"6066b461-e1ab-41f6-8b52-fff01dbd1128"}]}},"event_type":{"type":129},"traffic_direction":"EGRESS","is_reply":false,"Summary":"HTTP/1.1 GET http://forgejo.siriusdevops.com/sirius/gcloud-lab/blame/commit/777f98a5ff8ef7823f730e6756c80b22cb54050d/trading-platform/dockerfiles/execute-service/.dockerignore"},"node_name":"siriussec","time":"2026-11-27T05:04:00.512733267Z"}
|
||||
{"flow":{"time":"2026-11-27T05:04:00.574820730Z","uuid":"64901b78-41ef-416e-8191-23f2ed1d7694","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","IP":{"source":"10.244.0.174","destination":"10.10.0.1","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":3000,"destination_port":47992}},"source":{"ID":547,"identity":9593,"cluster_name":"default","namespace":"forgejo","labels":["gen:io.cilium.k8s.named-ports=http.TCP.3000","k8s:app=forgejo","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=forgejo","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=apps","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=default","k8s:io.kubernetes.pod.namespace=forgejo"],"pod_name":"forgejo-f566c6856-mlvmc","workloads":[{"name":"forgejo","kind":"Deployment"}]},"destination":{"identity":8,"labels":["reserved:ingress"]},"Type":"L7","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"l7":{"type":"RESPONSE","latency_ns":"63166145","http":{"code":200,"method":"GET","url":"http://forgejo.siriusdevops.com/sirius/gcloud-lab/blame/commit/777f98a5ff8ef7823f730e6756c80b22cb54050d/trading-platform/dockerfiles/execute-service/.dockerignore","protocol":"HTTP/1.1","headers":[{"key":"Cache-Control","value":"max-age=0, private, must-revalidate"},{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Date","value":"Fri, 27 Nov 2026 05:04:00 GMT"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"X-Envoy-Upstream-Service-Time","value":"62"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Request-Id","value":"6066b461-e1ab-41f6-8b52-fff01dbd1128"}]}},"reply":true,"event_type":{"type":129},"traffic_direction":"EGRESS","is_reply":true,"Summary":"HTTP/1.1 200 63ms (GET http://forgejo.siriusdevops.com/sirius/gcloud-lab/blame/commit/777f98a5ff8ef7823f730e6756c80b22cb54050d/trading-platform/dockerfiles/execute-service/.dockerignore)"},"node_name":"siriussec","time":"2026-11-27T05:04:00.574820730Z"}
|
||||
{"flow":{"time":"2026-11-27T05:04:00.873825673Z","uuid":"0cfb1741-c1cb-4f6b-97e8-339d58e39637","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"FORWARDED","IP":{"source":"10.10.0.1","destination":"10.244.0.174","ipVersion":"IPv4"},"l4":{"TCP":{"source_port":47992,"destination_port":3000}},"source":{"identity":8,"labels":["reserved:ingress"]},"destination":{"ID":547,"identity":9593,"cluster_name":"default","namespace":"forgejo","labels":["gen:io.cilium.k8s.named-ports=http.TCP.3000","k8s:app=forgejo","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=forgejo","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=apps","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=default","k8s:io.kubernetes.pod.namespace=forgejo"],"pod_name":"forgejo-f566c6856-mlvmc","workloads":[{"name":"forgejo","kind":"Deployment"}]},"Type":"L7","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"l7":{"type":"REQUEST","http":{"method":"GET","url":"http://forgejo.siriusdevops.com/mayx/blog/blame/commit/38caae08aa02b9f96ba7ac271d5fcd56f52b3c25/_posts/2021-02-28-discuz.md","protocol":"HTTP/1.1","headers":[{"key":":scheme","value":"http"},{"key":"Accept","value":"*/*"},{"key":"Accept-Encoding","value":"gzip, br"},{"key":"Cdn-Loop","value":"cloudflare; loops=1"},{"key":"Cf-Connecting-Ip","value":"2a03:2880:f80e:2::"},{"key":"Cf-Ipcountry","value":"US"},{"key":"Cf-Ray","value":"a60e96f4fbf20f27-LAX"},{"key":"Cf-Visitor","value":"{\"scheme\":\"https\"}"},{"key":"Cf-Warp-Tag-Id","value":"67539f9e-0e9e-4290-aca2-02a95152a194"},{"key":"User-Agent","value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 (compatible; meta-externalagent/1.1 (+https://developers.facebook.com/docs/sharing/webmasters/crawler))"},{"key":"X-Envoy-External-Address","value":"10.10.0.1"},{"key":"X-Forwarded-For","value":"2a03:2880:f80e:2::,10.10.0.1"},{"key":"X-Forwarded-Host","value":"forgejo.siriusdevops.com"},{"key":"X-Request-Id","value":"a9dc8013-4616-49e7-b8a2-62e0d1d32143"}]}},"event_type":{"type":129},"traffic_direction":"EGRESS","is_reply":false,"Summary":"HTTP/1.1 GET http://forgejo.siriusdevops.com/mayx/blog/blame/commit/38caae08aa02b9f96ba7ac271d5fcd56f52b3c25/_posts/2021-02-28-discuz.md"},"node_name":"siriussec","time":"2026-11-27T05:04:00.873825673Z"}
|
||||
{"flow":{"time":"2026-11-27T05:04:00.745040808Z","uuid":"2467ad53-c069-41ed-83f4-bdf067e7c1c9","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"DROPPED","drop_reason":139,"ethernet":{"source":"62:52:35:53:a0:e9","destination":"33:33:00:00:00:16"},"IP":{"source":"fe80::6052:35ff:fe53:a0e9","destination":"ff02::16","ipVersion":"IPv6"},"l4":{"ICMPv6":{"type":143}},"source":{"identity":18533,"cluster_name":"default","labels":["k8s:app.kubernetes.io/name=hubble-flow-collector","k8s:app.kubernetes.io/part-of=netsec","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=netsec","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=netsec","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=apps","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=default","k8s:io.kubernetes.pod.namespace=netsec"]},"destination":{"labels":["reserved:unknown"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":1,"sub_type":139},"traffic_direction":"INGRESS","file":{"name":"bpf_lxc.c","line":1843},"drop_reason_desc":"UNSUPPORTED_L3_PROTOCOL","Summary":"ICMPv6 143(0)"},"node_name":"siriussec","time":"2026-11-27T05:04:00.745040808Z"}
|
||||
{"flow":{"time":"2026-11-27T05:04:00.745057200Z","uuid":"3e44a8b8-83e7-456f-8be3-3c24f6c9630a","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"DROPPED","drop_reason":139,"ethernet":{"source":"62:52:35:53:a0:e9","destination":"33:33:00:00:00:02"},"IP":{"source":"fe80::6052:35ff:fe53:a0e9","destination":"ff02::2","ipVersion":"IPv6"},"l4":{"ICMPv6":{"type":133}},"source":{"identity":18533,"cluster_name":"default","labels":["k8s:app.kubernetes.io/name=hubble-flow-collector","k8s:app.kubernetes.io/part-of=netsec","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=netsec","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=netsec","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=apps","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=default","k8s:io.kubernetes.pod.namespace=netsec"]},"destination":{"labels":["reserved:unknown"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":1,"sub_type":139},"traffic_direction":"INGRESS","file":{"name":"bpf_lxc.c","line":1843},"drop_reason_desc":"UNSUPPORTED_L3_PROTOCOL","Summary":"ICMPv6 RouterSolicitation"},"node_name":"siriussec","time":"2026-11-27T05:04:00.745057200Z"}
|
||||
{"flow":{"time":"2026-11-27T05:04:00.908567453Z","uuid":"ba375649-89be-43bd-baa8-e7b69c310ff9","emitter":{"name":"Hubble","version":"1.20.1+g7d68cfb3"},"verdict":"DROPPED","drop_reason":139,"ethernet":{"source":"62:52:35:53:a0:e9","destination":"33:33:00:00:00:16"},"IP":{"source":"fe80::6052:35ff:fe53:a0e9","destination":"ff02::16","ipVersion":"IPv6"},"l4":{"ICMPv6":{"type":143}},"source":{"identity":18533,"cluster_name":"default","labels":["k8s:app.kubernetes.io/name=hubble-flow-collector","k8s:app.kubernetes.io/part-of=netsec","k8s:io.cilium.k8s.namespace.labels.app.kubernetes.io/part-of=netsec","k8s:io.cilium.k8s.namespace.labels.kubernetes.io/metadata.name=netsec","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/name=apps","k8s:io.cilium.k8s.namespace.labels.kustomize.toolkit.fluxcd.io/namespace=flux-system","k8s:io.cilium.k8s.policy.cluster=default","k8s:io.cilium.k8s.policy.serviceaccount=default","k8s:io.kubernetes.pod.namespace=netsec"]},"destination":{"labels":["reserved:unknown"]},"Type":"L3_L4","node_name":"siriussec","node_labels":["beta.kubernetes.io/arch=amd64","beta.kubernetes.io/os=linux","gateway=true","kubernetes.io/arch=amd64","kubernetes.io/hostname=siriussec","kubernetes.io/os=linux","node-role.kubernetes.io/control-plane=","node-role.kubernetes.io/gateway=true","node-role.kubernetes.io/worker=","node.kubernetes.io/exclude-from-external-load-balancers="],"event_type":{"type":1,"sub_type":139},"traffic_direction":"INGRESS","file":{"name":"bpf_lxc.c","line":1843},"drop_reason_desc":"UNSUPPORTED_L3_PROTOCOL","Summary":"ICMPv6 143(0)"},"node_name":"siriussec","time":"2026-11-27T05:04:00.908567453Z"}
|
||||
51
tests/helpers.py
Normal file
51
tests/helpers.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"""Shared helpers for the tests: a fake Prometheus and fixture loading."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
FIXTURES = Path(__file__).parent / "fixtures"
|
||||
|
||||
|
||||
def fixture_lines(name: str) -> List[str]:
|
||||
return [ln for ln in (FIXTURES / name).read_text().splitlines() if ln.strip()]
|
||||
|
||||
|
||||
def fixture_flows(name: str):
|
||||
from netsec_scan.flows import parse_flow
|
||||
|
||||
return [parse_flow(json.loads(ln)) for ln in fixture_lines(name)]
|
||||
|
||||
|
||||
class FakeProm:
|
||||
"""Substring-matched query/scalar responses; no network, no kubectl.
|
||||
|
||||
Keys are matched by `key in expr`, so the tests assert *which* rule query
|
||||
ran without pinning the exact PromQL text.
|
||||
"""
|
||||
|
||||
def __init__(self, scalars: Dict[str, float] = None,
|
||||
vectors: Dict[str, List[Tuple[dict, float]]] = None):
|
||||
self.scalars = scalars or {}
|
||||
self.vectors = vectors or {}
|
||||
self.queries: List[str] = []
|
||||
|
||||
def _lookup(self, table, expr: str):
|
||||
# Longest matching key wins, so `...[5m]))[6h:5m]` beats `...[5m]`
|
||||
# when both are substrings of a 6h subquery expression.
|
||||
hits = [(key, value) for key, value in table.items() if key in expr]
|
||||
if not hits:
|
||||
return None
|
||||
return max(hits, key=lambda kv: len(kv[0]))[1]
|
||||
|
||||
def query(self, expr: str):
|
||||
self.queries.append(expr)
|
||||
value = self._lookup(self.vectors, expr)
|
||||
return value if value is not None else []
|
||||
|
||||
def scalar(self, expr: str) -> float:
|
||||
self.queries.append(expr)
|
||||
value = self._lookup(self.scalars, expr)
|
||||
return float(value) if value is not None else 0.0
|
||||
114
tests/test_flows.py
Normal file
114
tests/test_flows.py
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
"""Parser tests: workload attribution, egress classification, chunk handling."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import unittest
|
||||
|
||||
from helpers import fixture_flows, fixture_lines
|
||||
|
||||
from netsec_scan.flows import (
|
||||
RemoteFlowStore,
|
||||
is_external,
|
||||
iter_lines,
|
||||
parse_flow,
|
||||
workload_name,
|
||||
)
|
||||
|
||||
|
||||
class TestIterLines(unittest.TestCase):
|
||||
def test_partial_tail_is_carried_not_consumed(self):
|
||||
lines, partial = iter_lines(b'{"a":1}\n{"b":2}\n{"c":')
|
||||
self.assertEqual(lines, ['{"a":1}', '{"b":2}'])
|
||||
self.assertEqual(partial, b'{"c":')
|
||||
|
||||
def test_no_newline_yet(self):
|
||||
lines, partial = iter_lines(b'{"a":1}')
|
||||
self.assertEqual(lines, [])
|
||||
self.assertEqual(partial, b'{"a":1}')
|
||||
|
||||
def test_empty(self):
|
||||
self.assertEqual(iter_lines(b""), ([], b""))
|
||||
|
||||
|
||||
class TestEgressClassification(unittest.TestCase):
|
||||
def test_external_only_global_unicast(self):
|
||||
for ip in ("203.0.113.9", "172.67.209.185", "2606:4700::1111"):
|
||||
self.assertTrue(is_external(ip), ip)
|
||||
for ip in ("10.244.0.5", "10.10.0.2", "192.168.1.179", "127.0.0.1",
|
||||
"fe80::1", "ff02::2", "100.100.100.100", "10.96.0.1"):
|
||||
self.assertFalse(is_external(ip), ip)
|
||||
|
||||
def test_no_ip_is_not_external(self):
|
||||
self.assertFalse(is_external(None))
|
||||
self.assertFalse(is_external(""))
|
||||
|
||||
|
||||
class TestWorkloadAttribution(unittest.TestCase):
|
||||
def test_reserved_identity_has_no_workload(self):
|
||||
self.assertIsNone(workload_name({"identity": 1, "labels": ["reserved:host"]}))
|
||||
self.assertIsNone(workload_name(None))
|
||||
|
||||
def test_pod_name_change_does_not_change_identity(self):
|
||||
a = {"namespace": "osint",
|
||||
"pod_name": "osint-app-7d9f8c6b5-abcde",
|
||||
"labels": ["k8s:app=osint-app"]}
|
||||
b = {"namespace": "osint",
|
||||
"pod_name": "osint-app-5bb4d7f9c-xyzwq",
|
||||
"labels": ["k8s:app=osint-app"]}
|
||||
self.assertEqual(workload_name(a), "osint/osint-app")
|
||||
self.assertEqual(workload_name(a), workload_name(b))
|
||||
|
||||
def test_deployment_workload_wins_over_label(self):
|
||||
peer = {"namespace": "flux-system", "pod_name": "source-controller-abc12-def34",
|
||||
"labels": ["k8s:app=source-controller"],
|
||||
"workloads": [{"name": "source-controller", "kind": "Deployment"}]}
|
||||
self.assertEqual(workload_name(peer), "flux-system/source-controller")
|
||||
|
||||
def test_pod_name_fallback_strips_hashes(self):
|
||||
peer = {"namespace": "x", "pod_name": "web-7d9f8c6b5-abcde"}
|
||||
self.assertEqual(workload_name(peer), "x/web")
|
||||
|
||||
|
||||
class TestRealFixtures(unittest.TestCase):
|
||||
def test_egress_fixture_parses_and_keeps_only_workload_egress(self):
|
||||
flows = fixture_flows("egress-sample.jsonl")
|
||||
self.assertGreaterEqual(len(flows), 5)
|
||||
external = [f for f in flows if f.src_workload and is_external(f.dst_ip)]
|
||||
# 4 workload->public 443 lines + 1 :80 line; the reserved:host and LAN
|
||||
# lines must not qualify.
|
||||
self.assertGreaterEqual(len(external), 4)
|
||||
self.assertTrue(all(f.dst_port for f in external))
|
||||
self.assertTrue(all(f.src_workload for f in external))
|
||||
|
||||
def test_reserved_host_egress_is_not_attributed_to_a_workload(self):
|
||||
flows = fixture_flows("egress-sample.jsonl")
|
||||
host_flows = [f for f in flows if not f.src_workload and is_external(f.dst_ip)]
|
||||
self.assertTrue(host_flows, "fixture should contain a reserved:host to-world flow")
|
||||
|
||||
def test_l7_and_drop_fixture_parses(self):
|
||||
flows = fixture_flows("l7-and-drop.jsonl")
|
||||
self.assertTrue(any(f.type == "L7" for f in flows))
|
||||
self.assertTrue(any(f.verdict == "DROPPED" for f in flows))
|
||||
|
||||
def test_garbage_line_is_skipped(self):
|
||||
self.assertIsNone(parse_flow({"flow": None}))
|
||||
self.assertIsNone(parse_flow({}))
|
||||
self.assertIsNone(parse_flow({"flow": {"Type": "L3_L4"}}))
|
||||
|
||||
|
||||
class TestRemoteStoreCommand(unittest.TestCase):
|
||||
def test_list_command_does_not_quote_the_glob(self):
|
||||
"""A quoted glob is literal, and stat then fails with 'No such file'."""
|
||||
cmd = "sudo -n find %s -maxdepth 1 -type f -name %s -printf '%%f %%s\\n'" % (
|
||||
"'/var/log/netsec'", "'flows-*.jsonl'")
|
||||
self.assertIn("flows-*.jsonl", cmd)
|
||||
self.assertNotIn("'/var/log/netsec/flows-*.jsonl'", cmd)
|
||||
|
||||
def test_remote_store_defaults(self):
|
||||
store = RemoteFlowStore()
|
||||
self.assertIn("@", store.host)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
181
tests/test_rules.py
Normal file
181
tests/test_rules.py
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
"""Rule tests: novelty, dedupe semantics, ratios, thresholds and line shape."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
from helpers import FakeProm, fixture_flows
|
||||
|
||||
from netsec_scan import config, rules
|
||||
from netsec_scan.rules import Finding
|
||||
|
||||
|
||||
def utc(*args):
|
||||
return datetime(*args, tzinfo=timezone.utc)
|
||||
|
||||
|
||||
class TestFirstSeenEgress(unittest.TestCase):
|
||||
def test_same_tuple_fires_once(self):
|
||||
flows = fixture_flows("egress-sample.jsonl")
|
||||
seen = {}
|
||||
now = utc(2026, 11, 27, 5, 20)
|
||||
first = rules.rule_egress_first_seen(flows, seen, now)
|
||||
self.assertTrue(first)
|
||||
self.assertTrue(all(f.rule == "egress-new-dst" for f in first))
|
||||
# second evaluation over the same flows must be silent
|
||||
second = rules.rule_egress_first_seen(flows, seen, now)
|
||||
self.assertEqual(second, [])
|
||||
|
||||
def test_union_semantics_keeps_history(self):
|
||||
flows = fixture_flows("egress-sample.jsonl")
|
||||
seen = {}
|
||||
rules.rule_egress_first_seen(flows, seen, utc(2026, 11, 27, 5, 20))
|
||||
before = dict(seen)
|
||||
# a later, unrelated evaluation must not shrink the seen-set
|
||||
rules.rule_egress_first_seen([], seen, utc(2026, 11, 27, 5, 25))
|
||||
self.assertEqual(seen, before)
|
||||
|
||||
def test_fingerprint_is_stable_across_runs(self):
|
||||
flows = fixture_flows("egress-sample.jsonl")
|
||||
a = rules.rule_egress_first_seen(flows, {}, utc(2026, 11, 27, 5, 20))
|
||||
b = rules.rule_egress_first_seen(flows, {}, utc(2027, 1, 2, 9, 0))
|
||||
self.assertEqual([f.fingerprint for f in a], [f.fingerprint for f in b])
|
||||
|
||||
def test_severity_by_port(self):
|
||||
flows = fixture_flows("egress-sample.jsonl")
|
||||
findings = rules.rule_egress_first_seen(flows, {}, utc(2026, 11, 27, 5, 20))
|
||||
for f in findings:
|
||||
port = int(f.entity.rsplit(":", 1)[1].split("/")[0])
|
||||
want = "MEDIUM" if port in config.WEB_PORTS else "HIGH"
|
||||
self.assertEqual(f.severity, want, f.entity)
|
||||
|
||||
def test_nonexternal_and_reserved_are_ignored(self):
|
||||
flows = fixture_flows("egress-sample.jsonl")
|
||||
findings = rules.rule_egress_first_seen(flows, {}, utc(2026, 11, 27, 5, 20))
|
||||
for f in findings:
|
||||
self.assertNotIn("reserved:", f.entity)
|
||||
self.assertNotIn("192.168.", f.entity)
|
||||
|
||||
|
||||
class TestBeacon(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.now = utc(2026, 11, 27, 5, 0).timestamp()
|
||||
|
||||
def test_regular_beacon_fires(self):
|
||||
flows = fixture_flows("beacon-shaped.jsonl")
|
||||
findings = rules.rule_beacon(flows, {}, self.now)
|
||||
self.assertEqual(len(findings), 1)
|
||||
self.assertEqual(findings[0].rule, "beacon-shape")
|
||||
self.assertEqual(findings[0].severity, "HIGH")
|
||||
self.assertIn("jitter 0.0", findings[0].detail)
|
||||
|
||||
def test_irregular_traffic_does_not_fire(self):
|
||||
flows = fixture_flows("beacon-shaped.jsonl")
|
||||
# stretch the gaps so the inter-arrival spread is not periodic
|
||||
for i, flow in enumerate(flows):
|
||||
flow.time = flows[0].time + timedelta(seconds=(i * i * 7) + i * 3)
|
||||
findings = rules.rule_beacon(flows, {}, self.now)
|
||||
self.assertEqual(findings, [])
|
||||
|
||||
def test_too_few_connections_do_not_fire(self):
|
||||
flows = fixture_flows("beacon-shaped.jsonl")[: config.BEACON_MIN_CONNS - 1]
|
||||
self.assertEqual(rules.rule_beacon(flows, {}, self.now), [])
|
||||
|
||||
def test_same_socket_is_one_connection(self):
|
||||
"""Many packets on one long-lived connection must not count as many conns."""
|
||||
flows = fixture_flows("beacon-shaped.jsonl")
|
||||
for flow in flows:
|
||||
flow.src_port = 40000
|
||||
self.assertEqual(rules.rule_beacon(flows, {}, self.now), [])
|
||||
|
||||
|
||||
class TestPromRules(unittest.TestCase):
|
||||
def test_lost_events_per_node(self):
|
||||
prom = FakeProm(vectors={ # noqa: E501
|
||||
"hubble_lost_events_total":
|
||||
[({"node": "siriussec"}, 0.60), ({"node": "rpi"}, 0.0)]})
|
||||
findings = rules.rule_lost_events(prom)
|
||||
self.assertEqual(len(findings), 1)
|
||||
self.assertEqual(findings[0].entity, "node=siriussec")
|
||||
self.assertEqual(findings[0].severity, "HIGH")
|
||||
|
||||
def test_drop_spike_needs_floor_and_ratio(self):
|
||||
quiet = FakeProm(scalars={"hubble_drop_total": 0.02})
|
||||
self.assertEqual(rules.rule_drop_spike(quiet), [])
|
||||
# same absolute rate, 10x baseline: floor still blocks it
|
||||
below_floor = FakeProm(scalars={"hubble_drop_total{protocol!=\"ICMPv6\"}[5m]": 0.02,
|
||||
"hubble_drop_total{protocol!=\"ICMPv6\"}[1h] offset 5m": 0.0})
|
||||
self.assertEqual(rules.rule_drop_spike(below_floor), [])
|
||||
fired = FakeProm(scalars={
|
||||
"hubble_drop_total{protocol!=\"ICMPv6\"}[1h] offset 5m": 0.01,
|
||||
"hubble_drop_total{protocol!=\"ICMPv6\"}[5m]": 0.30,
|
||||
"hubble_drop_total{protocol!=\"ICMPv6\"}": 0.30,
|
||||
})
|
||||
out = rules.rule_drop_spike(fired)
|
||||
self.assertTrue(out)
|
||||
self.assertIn("vs 1h baseline 0.01/s", out[0].detail)
|
||||
# and when the baseline is genuinely zero the detail must say so
|
||||
no_base = FakeProm(scalars={
|
||||
"hubble_drop_total{protocol!=\"ICMPv6\"}[1h] offset 5m": 0.0,
|
||||
"hubble_drop_total{protocol!=\"ICMPv6\"}[5m]": 0.30,
|
||||
})
|
||||
self.assertIn("no 1h baseline", rules.rule_drop_spike(no_base)[0].detail)
|
||||
|
||||
def test_syn_sweep_ratio_and_floor(self):
|
||||
normal = FakeProm(scalars={'hubble_tcp_flags_total{flag="SYN"}[5m]': 10.6,
|
||||
'hubble_tcp_flags_total{flag="SYN-ACK"}[5m]': 6.7})
|
||||
self.assertEqual(rules.rule_syn_sweep(normal), [])
|
||||
sweep = FakeProm(scalars={'hubble_tcp_flags_total{flag="SYN"}[5m]': 40.0,
|
||||
'hubble_tcp_flags_total{flag="SYN-ACK"}[5m]': 2.0})
|
||||
self.assertTrue(rules.rule_syn_sweep(sweep))
|
||||
|
||||
def test_rst_storm_ratio(self):
|
||||
calm = FakeProm(scalars={'hubble_tcp_flags_total{flag="RST"}[5m]': 2.5,
|
||||
'hubble_tcp_flags_total{flag="RST"}[5m]))[6h:5m]': 2.4})
|
||||
self.assertEqual(rules.rule_rst_storm(calm), [])
|
||||
storm = FakeProm(scalars={'hubble_tcp_flags_total{flag="RST"}[5m]': 60.0,
|
||||
'hubble_tcp_flags_total{flag="RST"}[5m]))[6h:5m]': 2.4})
|
||||
self.assertTrue(rules.rule_rst_storm(storm))
|
||||
|
||||
def test_new_port_ignores_ephemeral_ports(self):
|
||||
prom = FakeProm(vectors={"hubble_port_distribution_total": [
|
||||
({"port": "3100"}, 3.0), ({"port": "54321"}, 1.0), ({"port": "0"}, 3.0)]})
|
||||
findings = rules.rule_new_port(prom)
|
||||
self.assertEqual([f.entity for f in findings], ["port=3100"])
|
||||
self.assertEqual(findings[0].severity, "LOW")
|
||||
|
||||
def test_http_error_ratio_needs_traffic_floor(self):
|
||||
quiet = FakeProm(scalars={"sum(rate(hubble_http_requests_total[15m]))": 0.2,
|
||||
'status=~"4..|5.."': 0.2})
|
||||
self.assertEqual(rules.rule_http_errors(quiet), [])
|
||||
busy = FakeProm(scalars={"sum(rate(hubble_http_requests_total[15m]))": 4.0,
|
||||
'status=~"4..|5.."': 3.0})
|
||||
self.assertTrue(rules.rule_http_errors(busy))
|
||||
|
||||
|
||||
class TestOutputShape(unittest.TestCase):
|
||||
def test_render_is_bounded_and_starts_with_severity_and_fingerprint(self):
|
||||
from netsec_scan.__main__ import render
|
||||
|
||||
finding = Finding(rule="egress-new-dst", kind="novelty", severity="HIGH",
|
||||
entity="osint/osint-app->203.0.113.9:4444/tcp",
|
||||
detail="x" * 400)
|
||||
line = render(finding)
|
||||
self.assertLessEqual(len(line), config.MAX_LINE)
|
||||
self.assertTrue(line.startswith("HIGH "))
|
||||
self.assertEqual(line.split(" ")[1], finding.fingerprint)
|
||||
|
||||
def test_fingerprint_ignores_counts_and_time(self):
|
||||
a = Finding(rule="drop-spike", kind="state", severity="MEDIUM",
|
||||
entity="cluster", detail="3 drops")
|
||||
b = Finding(rule="drop-spike", kind="state", severity="MEDIUM",
|
||||
entity="cluster", detail="300 drops at 09:00Z")
|
||||
self.assertEqual(a.fingerprint, b.fingerprint)
|
||||
c = Finding(rule="drop-spike", kind="state", severity="MEDIUM",
|
||||
entity="cluster=other", detail="3 drops")
|
||||
self.assertNotEqual(a.fingerprint, c.fingerprint)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
92
tests/test_state.py
Normal file
92
tests/test_state.py
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
"""State-file semantics: union, atomic write, rollover, bounds, corruption."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from netsec_scan import config, state as state_mod
|
||||
from netsec_scan.prom import SensorError
|
||||
|
||||
|
||||
class TestStateFile(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
self.path = Path(self.tmp.name) / "state.json"
|
||||
|
||||
def tearDown(self):
|
||||
self.tmp.cleanup()
|
||||
|
||||
def test_missing_file_is_a_fresh_state(self):
|
||||
st = state_mod.load(self.path)
|
||||
self.assertFalse(st["seeded"])
|
||||
self.assertEqual(st["seen"], {})
|
||||
self.assertEqual(st["files"], {})
|
||||
|
||||
def test_roundtrip_and_mode(self):
|
||||
st = state_mod.load(self.path)
|
||||
st["seen"]["abc"] = {"rule": "x", "kind": "state", "entity": "e",
|
||||
"severity": "LOW", "first": "2026-11-27T00:00:00+00:00",
|
||||
"last_alert": "2026-11-27T00:00:00+00:00"}
|
||||
state_mod.save(self.path, st)
|
||||
again = state_mod.load(self.path)
|
||||
self.assertIn("abc", again["seen"])
|
||||
self.assertEqual(os.stat(self.path).st_mode & 0o777, 0o600)
|
||||
|
||||
def test_corrupt_file_raises_instead_of_resetting(self):
|
||||
self.path.write_text("{not json")
|
||||
with self.assertRaises(SensorError) as ctx:
|
||||
state_mod.load(self.path)
|
||||
self.assertEqual(ctx.exception.cls, "state-corrupt")
|
||||
|
||||
def test_missing_key_is_added_not_replaced(self):
|
||||
st = state_mod.load(self.path)
|
||||
st["egress"]["a->1.2.3.4:443/tcp"] = "2026-11-27T00:00:00+00:00"
|
||||
state_mod.save(self.path, st)
|
||||
again = state_mod.load(self.path)
|
||||
again["egress"]["b->5.6.7.8:80/tcp"] = "2026-11-27T00:01:00+00:00"
|
||||
state_mod.save(self.path, again)
|
||||
final = json.loads(self.path.read_text())
|
||||
self.assertEqual(len(final["egress"]), 2)
|
||||
|
||||
def test_prune_bounds_the_seen_set(self):
|
||||
st = state_mod.load(self.path)
|
||||
for i in range(config.MAX_SEEN + 500):
|
||||
st["seen"][f"fp{i}"] = {"first": "2026-11-27T00:00:%02d+00:00" % (i % 60)}
|
||||
state_mod.prune(st)
|
||||
self.assertLessEqual(len(st["seen"]), config.MAX_SEEN)
|
||||
|
||||
def test_day_rolls_over(self):
|
||||
st = state_mod.load(self.path)
|
||||
st["day"] = {"date": "1999-01-01", "flows": 42, "rules": {"x": 1},
|
||||
"egress": [], "new_dsts": []}
|
||||
state_mod.roll_day(st)
|
||||
self.assertNotEqual(st["day"]["date"], "1999-01-01")
|
||||
self.assertEqual(st["day"]["flows"], 0)
|
||||
|
||||
def test_day_kept_within_same_day(self):
|
||||
st = state_mod.load(self.path)
|
||||
today = st["day"]["date"]
|
||||
st["day"]["flows"] = 7
|
||||
state_mod.roll_day(st)
|
||||
self.assertEqual(st["day"]["date"], today)
|
||||
self.assertEqual(st["day"]["flows"], 7)
|
||||
|
||||
|
||||
class TestDegradeMemo(unittest.TestCase):
|
||||
def test_memo_window(self):
|
||||
memo = {}
|
||||
state_mod.note_degraded({"degraded": memo}, "timeout")
|
||||
now = time.time()
|
||||
self.assertTrue(state_mod.degraded_memo({"degraded": memo}, "timeout", now))
|
||||
self.assertFalse(state_mod.degraded_memo({"degraded": memo}, "other", now))
|
||||
later = now + config.DEGRADED_MEMO + 1
|
||||
self.assertFalse(state_mod.degraded_memo({"degraded": memo}, "timeout", later))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Loading…
Reference in a new issue