tkuester / taky

A simple python TAK server
MIT License
188 stars 43 forks source link

Implement OG TAK Server "filter groups" #26

Open tkuester opened 3 years ago

tkuester commented 3 years ago

It would be useful to configure the routing engine with custom rules on packet delivery.

Perhaps the blue and red group cannot see each others packets, but the white group can monitor them both. This would be useful for training exercises, where two opposing teams should not see each other's data, but the instructor wants to supervise.

tkuester commented 3 years ago

This would be good to develop as a modular system. For example, a user could write a custom hook that drops data package download requests, or rate limits geochats.

tkuester commented 3 years ago

Another interesting filter would be adding noise / error to location updates.

sgofferj commented 3 years ago

I have been thinking about this. I could think of 2 possibilities which are not mutually exclusive. The first would be a routing file similar to Postfix client checks. The second would be an out-socket and an in-socket in taky which would allow any app (security measures!!!) to receive a package and send it back with a routing decision. The former is probably easier to implement, hence I spin the idea a little further here...

  1. The routing config file could be dynamically loaded (inotify...) without having to restart the server. Another option could be something like takyctl reload routing.
  2. In case of an error in the config file, ideally, only the erroneous line will be ignored, not the whole filter set.
  3. Format... As written, I was thinking something along the lines of a Postfix file...
    • Basic format: one line per route
    • \<filter>:\<decision>
    • Filter could reference all attributes from the object tree as well as some additional ones which seem important
    • Filter would accept regexes
    • Decision could be as simple as FORWARD, REJECT or then ROUTE with a target (which ideally could also be a regex)
    • Examples:
      ip.src==195.123.160.0/21: REJECT
      ip.src==192.168.1.0/24: FORWARD
      event.detail.__group.name=="Blue": ROUTE detail.__group.name=="Blue" AND ROUTE detail.__group.name=="White"
      event.detail.__group.name=="Blue": ROUTE !detail.__group.name=="Red"
      event.detail.__group.name~=(Blue|Red): ROUTE detail.__group.name=="White"

That's, of course, just some rough ideas...