googleforgames / quilkin

Quilkin is a non-transparent UDP proxy specifically designed for use with large scale multiplayer dedicated game server deployments, to ensure security, access control, telemetry data, metrics and more.
Apache License 2.0
1.26k stars 89 forks source link

Filter idea: Asynchronous Filtering #12

Open markmandel opened 4 years ago

markmandel commented 4 years ago

Be able to have a filter that is processed Asynchronously.

This wouldn't have the ability to block, or route requests, but would allow for processing and parsing of packets not on the critical path.

We could also provide options to have a "sample-rate" in which you could retrieve a percentage of packets, either randomly, or deliberately sequentially, for systems that don't need to query every packet to process.

The main use case I can think of is doing something like deep introspection of packets for malicious elements - taking a random sample of packets for processing, could be fast enough to find a bad actor without them being able to cause large scale harm, without slowing down processing speed drastically.

XAMPPRocky commented 3 years ago

I'm adding this as a task for the load balancer, as we need to have the ability to block some packets on proceeding until we have validated some piece of the packet from a request from an external resource without also dropping them in the process.

It's either that or we have filters which call Runtime::block_on inside their implementations to call async APIs. Which seems like an anti-pattern.