RackSec / desdemona

Data-backed security operations
Eclipse Public License 1.0
2 stars 7 forks source link

Function expansion #115

Open lvh opened 8 years ago

lvh commented 8 years ago

Right now, we have a lot of sample queries like:

(= (:ip x) "10.0.0.1")

... but (:ip x) can mean a lot of things. Specifically, that probably means either source or destination IP. However, you don't necessarily want to duplicate all of the data that we might be querying for, for two reasons:

So,

(= (:ip x) "10.0.0.1")

should probably expand to

(or (= (:src-ip x) "10.0.0.1")
     (= (:dst-ip x) "10.0.0.1"))

(although the level at which that expansion happens, logic-program level or dsl->dsl level, is up to the implementor)