r/linuxadmin • • Oct 19 '26

How do you decide an outbound connection from a process is actually new behaviour and not just normal drift?

Mix of EC2 and a few bare-metal boxes running Kubernetes, maybe 25 clusters, mostly Debian under the hood. Platform team of three and I'm the one who ended up owning security. The thing I keep getting stuck on: a process inside a container opens an outbound connection to something it hasn't talked to before. Sometimes that's a real signal. Most of the time it's a new dependency, a mirror that changed, a sidecar someone added, or a job that only runs monthly and looks new every time.

We've got basic egress logging via VPC flow logs plus some Falco rules for unexpected network activity. The Falco side is drowning us. Every deploy churns the baseline and we get a wave of "new connection" alerts that are 95% noise. I've tried maintaining allowlists per workload but it rots the second someone bumps a chart version.

What I'm actually trying to answer is: for a given process making an outbound connection, is this connection new for that process/image, and has it been seen before across the fleet, so I can tell drift from a genuine first-time behaviour. Ideally scoped to the binary and image rather than the pod, which is ephemeral. Someone on another team showed me Upwind's runtime view, which says it baselines per image, but I haven't seen how it holds up on real traffic.

How are people doing this without hand-maintaining baselines? Is the answer eBPF with some kind of learned baseline per workload, or is everyone just accepting the noise and triaging? Curious what's actually working in production vs what sounds good on paper.

6 Upvotes

14 comments sorted by

2

u/Faye-Vozora Oct 19 '26

i'd stop alerting on first-seen and key the baseline on workload name plus destination domain, not pod, image tag or IP. IPs churn constantly with CDNs and mirrors, so resolve to the DNS name (cilium hubble or a dns log gets you that) and drop the chart version from the key. keep the baseline window longer than your slowest cron, like 35 days, or the monthly jobs look new forever. then only page on first-seen destinations that are public internet and not in-cluster, and send the rest to a daily digest.

2

u/Junior_Bee7274 Oct 19 '26

Falco firing on every deploy is baselining problem, not a Falco problem. It has no memory of what's normal, it just matches rules, so anything stateful you have to build yourself or bolt on. We ended up shipping the network events to a store and doing the "seen before for this image" lookup out of band, which is basically building the thing you don't want to build.

2

u/OrganicOnePiece Oct 20 '26

DNS logs are often more useful than flow logs here. Log queries from CoreDNS with pod and namespace metadata, then map pods back to their images. New domains per image are far more stable to baseline than IPs, and a process connecting to a raw IP without any DNS lookup is a great high-signal detection on its own.

2

u/throwaway12-ffs Oct 19 '26

Tldria (to lazy didn't read it all) but basically it just take research and digging each time. Eventually you learn tricks to determine quicker.

1

u/Junior_Bee7274 Oct 21 '26

Realize this is slightly off your question but if the monthly job thing is a big chunk of your noise, you can also just tag those workloads and route their alerts differently. Doesn't fix drift detection but stops the known-periodic stuff from burying the actual signal while you sort the bigger problem out.

1

u/Muchy_Tangerine Oct 22 '26

how are you scoping "new"? new dst IP, new dst port, new domain? because IPs churn constantly behind a load balancer or a CDN and you'll chase your tail. if you baseline on resolved domain or on the destination service identity it holds up a lot better than raw tuples.

1

u/Logan_Bennett1 Oct 20 '26

it sounds like you're dealing with a ton of noise. have you thought about tagging your outbound connections with metadata? something that links them to specific workloads and purposes could help filter alerts better.

1

u/SpartanHydrazine117 Oct 20 '26

to the point about scoping on domain vs ip, this. we wasted a month on ip based rules before realizing half our new connections were just s3 and ecr rotating adresses tbh. domain or the aws service prefix lists cut that out immediately tho

1

u/Kahless_2K Oct 20 '26

I just block the new connection until the application owner complains and tells me they actually need it and why.

1

u/pdp10 Oct 20 '26

How are people doing this without hand-maintaining baselines?

Your whole post is trying to do this in some clever way without actually investigating the code. Unless you're trying to solve the problem for a hundred organizations simultaneously, the answer is that you investigate the code.

A different approach is to put egress rules into the dev/test/QA infrastructure, so nothing makes it into production without behavior being documented. This can cause friction if the devs aren't the ones writing the rules and comments, but you know, four-eyes rule was necessary in the first place.

1

u/Square-Nebula-7530 Oct 26 '26

The key insight is scoping to the binary+image, not the pod, which you already landed on. The ephemeral pod is why your allowlists rot. Baseline the destination as a DNS name keyed to the image digest and keep the window past your slowest cron.

We looked at Sysdig, Aqua and Upwind for this. Upwind’s eBPF baseline per image held up better than Falco’s stateless matching on our monthly jobs, but you still eat a couple weeks of tuning while it learns. No tool skips that part.