Skip to main content
Foxx
New Member
September 23, 2022
Question

Automatically enable/ disable Policy using script

Hi all,

 

I'm looking for a solution to automatically enable/ disable a Policy using script.

Background:  

We have a invoicing system on a Windows VM with a web interface for access on PC's in our local network.

The invoicing system creates an automatic backup and sent the backup to our company cloud. 

One policy allows the invoicing VB to access the internet.

However, for security reason it is not necessary for the VM to have 24/7 internet access and the invoicing system works great without the policy enabled. The backup of the invoicing system takes about 10 min. 

We would like to use a script or other steps to turn off the policy and back on for the time the system does the backup and upload the backup to our cloud.

Is that possible or is there a other way?

 

Many thanks in advance

 

2 replies

jintrah_FTNT
Staff
Staff
September 23, 2022

Hi,

 

If the backup always occurs at fixed time during the day, you can device a schedule in the policy itself which makes the policy active during the scheduled time.

 

jintrah_FTNT_0-1663913896052.png

 

config firewall policy
edit 0
set srcintf "lan"
set dstintf "wan"
set srcaddr "VM_Invoicing_System"
set dstaddr "all"
set action accept
set schedule "Everyday-0900-0915"
set schedule-timeout enable
set service "ALL"
set nat enable
next
end

 

best regards,

Jin

Foxx
FoxxAuthor
New Member
September 23, 2022

Hi Jin,

 

This works like charming. Thank you very much :)

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT