Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How do I change a Suricata setting from the root command line?

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 3 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      templateunheard
      last edited by

      I need to have a script that runs at intervals that changes based on a variable setting. How do I do that? I've looked and I'm having trouble finding the suricata settings and I also read something about how it wouldn't change anyway as pfsense write the whole config file each time? I may be wrong though. Thanks for any help

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        You don't.

        But if you really have to you might be able to change the conf file and restart the service.

        As you read the Suricata conf file is generated from the main pfSense conf file so any chnage there would be temporary. Which might be OK in your situation.

        Steve

        T 1 Reply Last reply Reply Quote 0
        • T
          templateunheard @stephenw10
          last edited by

          @stephenw10 How long would that actually change it for? as in if I were to make this script run every x amount of time, how often would it have to run before it defaults? Thanks for the help steve

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            I would expect it to survive until the next time the Suricata config was generated which would be when a change is made is suricata or the complete pfSense config is reloaded.

            Steve

            T 1 Reply Last reply Reply Quote 0
            • T
              templateunheard @stephenw10
              last edited by

              @stephenw10 Ok, thanks. Lastly, mind telling me where the suricata config file is? I need to change the IPS threat level setting on an interface but I can only find the installation config file. Thanks

              bmeeksB 1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                You probably want something in: /usr/local/etc/suricata

                1 Reply Last reply Reply Quote 0
                • bmeeksB
                  bmeeks @templateunheard
                  last edited by bmeeks

                  @templateunheard said in How do I change a Suricata setting from the root command line?:

                  @stephenw10 Ok, thanks. Lastly, mind telling me where the suricata config file is? I need to change the IPS threat level setting on an interface but I can only find the installation config file. Thanks

                  Suricata creates independent and unique config files for each running instance (as in each configured Suricata interface). The files are put in sub-directories underneath /usr/local/etc/suricata. There is a sub-directory there for each configured interface. The name of the interface is part of the directory name to help you identify them. Absolutely nothing in terms of configuration is loaded from the top-level /usr/local/etc/suricata directory. Those are just boilerplate config files distributed with the binary.

                  Editing the config files directly is strongly not recommended. As mentioned here, any change is temporary at best. Each time Suricata is restarted, the suricata.yaml file for the interface is recreated from the data stored for Suricata in the firewall's config.xml master configuration file. Ditto for any time you make any edit in the GUI for Suricata. Suricata can restart on its own without user intervention for many reasons, including something as simple as the daily rules update job executing and updating the rules.

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    So pretty much "You don't" then. 😉

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.