Adding my own Snort rules to custom.rules via command line
-
I know that I am able to add custom rules into pfSense Snort via the text box. However, I am required to automate the uploading of a huge number of custom rules (hence requiring the use of the command line).
I am able to copy my rules from a Linux machine into the pfSense box as 'custom.rules' for the interface via the command line. However once I restart Snort, the custom rules are "overwritten" and becomes a blank file again. Do I have to do some other form of configuration?
-
There is nothing to do unless you want to modify the Snort section of the
config.xml
file on the firewall and stuff the custom rules in there as Baee64 encoded text. The package always rewrites its configuration files from scratch each time the binary is started or restarted. Any customizations you make at the OS level are overwritten as you observed.The package is not designed for CLI interoperability. It has a GUI interface. If you want a pure CLI interoperable Snort installation, then abandon the pfSense GUI package and install the binary Snort package and do all the configuration by hand via the command-line.