3.8. Schedules

It can sometimes be useful to control not only what functionality is enabled, but also when that functionality can be used.

For instance, an enterprise might require that web traffic from a certain department is only allowed Internet access during normal office hours. Another example might be that authentication using a specific VPN connection is only permitted on weekdays.

cOS Core addresses this time-based requirement using either of the following types of configuration objects:

Either of these object types can be created and then assigned to the Schedule property of many different types of configuration objects, including IP rule set entries, traffic shaping rules, IDP rules and routing rules. The assigned schedule then determines when the object is enabled and when it is disabled.

[Important] Important: The system date and time should be correct

As schedules depend on an accurate system date and time so it is important that this is set correctly. This can also be important for some other cOS Core features such as certificate usage with VPN tunnels.

It is recommended that the automatic time synchronization feature in cOS Core is enabled to ensure the system time is set correctly. This is discussed further in Section 2.2, System Date and Time.

Schedule Profiles

The Schedule Profile object provides the simplest form of scheduling. Multiple times can be specified for each day of the week and a start and a stop date can also be specified.

A Schedule Profile object has the following properties:

Example 3.50. Setting up a Schedule Profile with an IP Policy

This example creates a Schedule Profile object for office hours (08:00 to 17:00) on weekdays and uses it with a NATing IP Policy that allows HTTP and HTTPS traffic to flow from internal clients to the Internet. The schedule will begin to apply on the 24th of December, 2021 so the IP policy will not be active before that date.

Command-Line Interface

Device:/> add ScheduleProfile my_basic_schedule
		Mon=8-17 Tue=8-17 Wed=8-17 Thu=8-17 Fri=8-17
		StartDate=2021-12-24

Create the IP policy that uses this schedule:

Device:/> add IPPolicy Name=my_client_access_policy
			SourceInterface=lan
			SourceNetwork=lan_net
			DestinationInterface=any
			DestinationNetwork=all-nets
			Service=http-all
			Action=Allow
			SourceAddressTranslation=NAT
			NATSourceAddressAction=OutgoingInterfaceIP
			Schedule=my_basic_schedule

InControl

Follow similar steps to those used for the Web Interface below.

Web Interface

  1. Go to: Policies > Firewalling > Schedules > Add > Schedule Profile
  2. Enter the following:
    • Name: my_basic_schedule
  3. Select 08-17, Monday to Friday in the grid
  4. For Start Date enter 2021-12-24
  5. Click OK

Create the IP policy that uses this schedule:

  1. Go to: Policies > Firewalling > Main IP Rules > Add > IP Policy
  2. Now enter:
    • Name: my_client_access_policy
    • Action: Allow
  3. Under Filter enter:
    • SourceInterface: lan
    • SourceNetwork lan_net
    • DestinationInterface: any
    • DestinationNetwork: all-nets
    • Service: http
    • Schedule: my_basic_schedule
  4. Under Source Translation enter:
    • Address Translation: NAT
    • Address Action: Outgoing Interface IP
  5. Click OK

Advanced Schedule Profiles

The Advanced Schedule Profile object extends the idea of the more basic Schedule Profile object by allowing multiple Advanced Schedule Occurrence objects to be added to it as children.

This provides the ability to create a more complex schedule when compared to the Schedule Profile object. For example, the Advanced Schedule Profile makes it possible to chain together multiple days without interruptions. It also allows schedules to be constructed based on months rather than just days of the week.

The Advanced Schedule Profile has no other properties apart from the Name and Comments properties. The Advance Schedule Occurrence objects added as children have the following properties:

Example 3.51. Setting up an Advanced Schedule Profile with an IP Policy

This example creates an Advanced Schedule Profile object that is used with a NATing IP Policy that allows HTTP and HTTPS traffic to flow from internal clients to the Internet during 7:15 to 17:45 from monday to friday and during 11:30 to 16:15 on saturday and sunday.

Command-Line Interface

Device:/> add AdvancedScheduleProfile my_adv_schedule
Device:/> cc AdvancedScheduleProfile my_adv_schedule
Device:/my_adv_schedule> add AdvancedScheduleOccurence
			StartTime=7:15
			EndTime=17:45
			Occurrence=Weekly
			Weekly=1-5

Add the second occurrence:

Device:/my_adv_schedule> add AdvancedScheduleOccurence
			StartTime=11:30
			EndTime=16:15
			Occurrence=Weekly
			Weekly=6-7
Device:/my_adv_schedule> cc
Device:/> 

Create the IP policy that uses this schedule:

Device:/> add IPPolicy Name=http_during_office_hour
			SourceInterface=lan
			SourceNetwork=lan_net
			DestinationInterface=any
			DestinationNetwork=all-nets
			Service=http-all
			Action=Allow
			SourceAddressTranslation=NAT
			NATSourceAddressAction=OutgoingInterfaceIP
			Schedule=my_adv_schedule

InControl

Follow similar steps to those used for the Web Interface below.

Web Interface

  1. Go to: Policies > Firewalling > Schedules > Add > Schedule Profile
  2. Enter the following:
    • Name: my_adv_schedule
  3. Select the Occurrences tab
  4. Select Add > Advanced Schedule Occurrence
  5. Enter the following:
    • Start Time: 7:15
    • End Time: 17:45
    • Occurrence: Weekly
    • Enable days Monday to Friday
  6. Click OK to close the occurrence

Add the second occurrence:

  1. Select Add > Advanced Schedule Occurrence
  2. Enter the following:
    • Start Time: 11:30
    • End Time: 16:15
    • Occurrence: Weekly
    • Enable days Saturday and Friday
  3. Click OK to close the occurrence
  4. Click OK to close the schedule

Create the IP policy that uses this schedule:

  1. Go to: Policies > Firewalling > Main IP Rules > Add > IP Policy
  2. Now enter:
    • Name: http_during_office_hours
    • Action: Allow
  3. Under Filter enter:
    • SourceInterface: lan
    • SourceNetwork lan_net
    • DestinationInterface: any
    • DestinationNetwork: all-nets
    • Service: http
    • Schedule: my_adv_schedule
  4. Under Source Translation enter:
    • Address Translation: NAT
    • Address Action: Outgoing Interface IP
  5. Click OK

Closing Existing Connections Related To Scheduled IP Rule Set Entries

A question that can arise is how to close existing connections when an IP rule set entry prevents specific connections opening according to a schedule. For example, an IP Policy might prevent connections to particular resources at certain times of the day or week. However, there may be existing connections that were established before the schedule triggered.

This scenario is discussed in an article in the Clavister Knowledge Base at the following link:

https://kb.clavister.com/324736005