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

    Writing rules via shell command or scripts

    Scheduled Pinned Locked Moved Firewalling
    2 Posts 2 Posters 1.9k 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.
    • I
      ilasa01
      last edited by

      Hello All,

      My question relates whether is possible to write a FW rule via invoking the UNIX shell script and or write it manually. I am trying to use a SIEM functionality which includes running a script and add the rule in the FW.

      Thanks.
      Regards

      1 Reply Last reply Reply Quote 0
      • H
        heper
        last edited by

        easiest would probably be to use the 'easyrule' scripting by using the developers shell
        https://doc.pfsense.org/index.php/Using_the_PHP_pfSense_Shell

        https://github.com/pfsense/pfsense/blob/RELENG_2_3_2/src/usr/local/www/easyrule.php#L63-L86

        you can search the easyrule.inc if you want to dig further into it, but using the builtin functions provides some sort of safety because input validation is already in place.

        enjoy

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