This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to edit packetfilter rules with PowerShell?

I am trying to create a script, that can switch on/off a specific packetfilter rule in the Sophos UTM.

I already have a script that shows me a list of the rules, but I still have no idea how to edit them.

Does anyone maybe already have a script to share?



This thread was automatically locked due to age.
Parents
  • You can do this with cc

    Show Firewall Rules objects

    su -

    cc

    packetfilter

    rules@

    press TAB to see the objects

    ---

    show the settings:

    OBJS

    REF_xxxxxxxx

    ---

    turn the rule on

    cc change_object REF_xxxxxxxx status 1

    or off

    cc change_object REF_xxxxxxxx status 0

     

     

     

     

     

     

     

  • This works fine when I connect to the firewall with putty, but I just can't make it work in an automated script.

    I tried executing this with plink, but I always get "bash: cc: command not found" as a result.

    Standard Linux commands do work with plink, so the connection is established successfully.

    My goal is to have script that a user just has to click a button and the rule is enabled/disabled.

  • Looks like you dont get the right env, you must log with su -  

    Or you could try with

    /usr/local/bin/confd-client.plx change_object REF_xxxxx status x

Reply Children