How to effetively cut off communication at a scheduled time

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

How to effetively cut off communication at a scheduled time

L3 Networker

Hi,

We are running a PA500 box with software at ver 6.0.4. at a boarding school.

At a certain time during the night we need to switch off internet access completely (so the students get som sleep before next day).  When we do this using schedules in security policies I understand it only denies the creation of new sessions.  Ongoing sessions will continue to flow until they are closed by the client.  Am I correct ?

As you might understand I'm looking for a way to simply 'cut off' everything at a scheduled time.  If PA interfaces could be disabled / enabled using a schedule that would be nice, but they can't.  In I see the point that users can lock themselves out...

But how can I achieve what I need?  Can I issue an external CLI command to disable an interface and enable it shortly after (I assume that ongoing sessions will timeout rather soon if the interface is switched off for 15 minutes or so)...?

Thanks a lot for comments and suggestions to remedy this situation

best regards

Tor

15 REPLIES 15

Cyber Elite
Cyber Elite

Hi Tor

you could run an API that clears all the open sessions at the cutoff time:

https://x.x.x.x/api/?REST_API_TOKEN=<token>&type=op&cmd=<clear><session><all></all></session></clear>



you can also add a filter for the rule so you only clear that traffic:

<clear><session><all><filter><rule>internet_for_students</rule></filter></all></session></clear>

Tom Piens
PANgurus - Strata specialist; config reviews, policy optimization

Hi, and thanks a lot for this tip.

Can I enter a command like this as some 'scheduled task' in the PA500 box so it runs by itself every night?

Hi Tor

You'd need to run this off of an external device as you can't enter scheduled tasks on the firewall

Tom Piens
PANgurus - Strata specialist; config reviews, policy optimization

L6 Presenter

Hi IKT,

There is no way to enable or disable interfaces on schedule via configurable option.

However, you can pass this information via script or XML API. Which means run a CRON on linux server to run those scripts which can enable or disable interfaces.

Regards,

Hardik Shah

L6 Presenter

When we do this using schedules in security policies I understand it only denies the creation of new sessions.  Ongoing sessions will continue to flow until they are closed by the client.  Am I correct ?

I am not sure about that.Rematch sessions should solve that for most.

Here is the explanation from help :

"For example, assume that Telnet was previously allowed and then changed to Deny in the last commit. The default behavior is for any Telnet sessions that were started before the commit to be rematched and blocked."

How to Schedule Policy Actions

from that document

Note: Sessions begun prior to the scheduled start time will not be affected by the policy if session rematch is not enabled (Device > Setup > Session)

Panos:  The Rematch Session property only works when policy changes are committed, not at schedule transitions.  This is specifically stated in 6.0.4.  Unfortunately 😐

Quote hshah: "However, you can pass this information via script or XML API. Which means run a CRON on linux server to run those scripts which can enable or disable interfaces."

That would be nice.  How would that linux script look like in detail?  I would like to try that, but I have never used PanOS API scripts...

regards Tor

then you can commit force at that time.

I tested this

did not work either.

Hi IKT,

I am not a script guy, but if any one knows script it can be written in 30 minutes or so.

Regards,

Hardik Shah

Does anyone know if a feature request is in to have the sessions rematched when a schedule is applied?

Steve Puluka BSEET - IP Architect - DQE Communications (Metro Ethernet/ISP)
ACE PanOS 6; ACE PanOS 7; ASE 3.0; PSE 7.0 Foundations & Associate in Platform; Cyber Security; Data Center

No, I don't think so.

How do I check and / or whom do I convince to append it to the list 🙂

Tor

  • 4431 Views
  • 15 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!