OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 16.1 Legacy Series »
  • [SOLVED] Intrusion Detection - Schedule Task
« previous next »
  • Print
Pages: [1]

Author Topic: [SOLVED] Intrusion Detection - Schedule Task  (Read 7887 times)

interkrome

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 3
    • View Profile
[SOLVED] Intrusion Detection - Schedule Task
« on: February 25, 2016, 07:54:23 am »
Hi!

How possible to schedule the service (suricata) to be shutdown at certain time then restart it back at certain time?
« Last Edit: April 08, 2016, 07:59:20 am by franco »
Logged

interkrome

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 3
    • View Profile
Re: Intrusion Detection - Schedule Task
« Reply #1 on: April 06, 2016, 07:04:44 am »
Managed to update the drop-down option from "update IDS rules" to "reload IDS rules" which before this both showing "update IDS rules".

But, how to add another option in that drop-down menu such as start and stop function of suricata. Any idea?
Logged

AdSchellevis

  • Administrator
  • Hero Member
  • *****
  • Posts: 850
  • Karma: 163
    • View Profile
Re: Intrusion Detection - Schedule Task
« Reply #2 on: April 06, 2016, 11:36:30 am »
Hi interkrome,

You can build your own configd actions to do so, development documentation is available here https://docs.opnsense.org/development/examples/helloworld.html?highlight=configd

For example, create a file here:
Code: [Select]
/usr/local/opnsense/service/conf/actions.d/actions_myactions.conf
Containing something like this:
Code: [Select]
[stop]
command:/usr/local/etc/rc.d/suricata stop
parameters:
type:script
message:reload suricata rules
description: stop suri


(when a description is available, you should be able to schedule the item from https://<your address>/ui/cron/ )


Don't forget to restart configd after adding new templates:
Code: [Select]
service configd restart
Next test your action, using:

Code: [Select]
configctl myactions stop
Regards,

Ad
Logged

interkrome

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 3
    • View Profile
Re: Intrusion Detection - Schedule Task
« Reply #3 on: April 06, 2016, 01:00:49 pm »
It works!

Thanks Ad!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 16.1 Legacy Series »
  • [SOLVED] Intrusion Detection - Schedule Task
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2