So while doing some work with YAML we ran into a few issues that I'd like to bring up here. They all revolve around defining variables/macros.<br><br>With respect to HOME_NET and EXTERNAL_NET equivalents you might want to do something like:<br>
<br>vars:<br> HOME_NET: <a href="http://172.16.1.0/24">172.16.1.0/24</a><br> EXTERNAL_NET: !$HOME_NET<br><br>Note: YAML doesn't do the variable expansion for us, that would be the app.<br><br>The issue here is that "!" can't be used outside quotes in YAML as it has special meaning. The ":" character also has special meaning. So if we want Snort like variable definitions, we need to quote everything. For example:<br>
<br>vars:<br> HOME_NET: "<a href="http://172.16.1.0/24">172.16.1.0/24</a>"<br> EXTERNAL_NET: "!$HOME_NET"<br> HTTP_PORTS: "[80, 8080]"<br> WINDOWS_HOSTS: "[<a href="http://192.168.0.0/16">192.168.0.0/16</a>, ![<a href="http://192.168.45.0/24">192.168.45.0/24</a>, <a href="http://192.168.46.0/24]">192.168.46.0/24]</a>]"<br>
PRIV_PORTS: "1:1024"<br><br>From a programming point of view we now have to write our own code to parse the variable values into something usable, when ideally we'd let the YAML parser do it for us.<br><br>
On the other hand YAML does work pretty well for other types of structures, for example:<br><br>---<br>default-log-dir: /var/log/ids<br><br>tcp:<br> max-sessions: 256K<br> session-on-syn: true<br> checksums: yes<br>---<br>
<br>In comparison, a custom grammar could be tailored exactly to our needs, and if done write could map well to something like XML should someone desire to do a converter.<br><br>Anyways, the team would like to open this up for a little more comments and discussion. Anyone?<br>
<br>Thanks,<br>Jason<br>