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

    Suricata $WAN_ADDRESS

    Scheduled Pinned Locked Moved IDS/IPS
    3 Posts 2 Posters 1.1k 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.
    • F
      fsansfil
      last edited by

      Hello,

      For Suricata, I want to make a $WAN_ADDRESS, but since im not on static IP and i dont want to input it manually each change of IP, what should I put in /usr/local/pkg/suricata/suricata_yaml_template.inc ?

      I know its included in $HOME_NET, but I just need $WAN_ADDRESS ;)

      address-groups:
      WAN_ADDRESS: ???

      Thanks.

      F.

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

        Not sure how you are going to pull this one off.  Variables can be defined in the YAML configuration and then subsequently used in the rules, but you must provide a hard-coded definition in the YAML file for each variable.  In other words, you would have to manually enter something like $WAN_ADDRESS = 1.2.3.4 in the suricata.yaml configuration file.

        There is nothing now within the Suricata binary nor the GUI package that can handle automatically updating that.  However, you could write a shell script that used utilities like sed or similar text modifiers to grab the new WAN IP, write it to the suricata.yaml file, and then restart Suricata so it will re-read the configuration.  In order to fire off this custom script, you would need to modify /etc/rc.newwanip to call your script.

        It's a lot of manual effort that would be wiped out on each pfSense update (since /etc/rc.newwanip would get overwritten).

        Bill

        1 Reply Last reply Reply Quote 0
        • F
          fsansfil
          last edited by

          Cool, Ill do that, thanks for your support Bill.

          F.

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