Tasks
This page describes Open-AudIT version 7. Content for earlier versions is kept further down the page, under Pre version 7.
Tasks
What is it?
Anything worth doing in Open-AudIT is worth not doing by hand every week. Tasks is the scheduler. Pick a thing, a discovery, a query, a cloud, give it a cron style schedule, and it runs itself from then on. The nightly discovery, the monthly certificate expiry report landing in the right inbox, the integration sync at 6am, all of it is a task.
You'll find it at menu > Admin > Tasks. It is a feature available to Open-AudIT Professional and Enterprise licensed customers.
What does it do?
It runs your things on your schedule. A task is a type, the specific item of that type, and a schedule. Pick the type first and the form asks for what that type needs. Tasks work the same whether your Open-AudIT server runs on Windows or Linux.
Type | What it runs |
|---|---|
Discovery | A discovery you've created. The workhorse, and worth several. The same subnet can be scheduled more than once with different discoveries, say different credentials or scan options. |
Cloud Discovery | A cloud, asking AWS, Azure or Google what you're running. See the Clouds page. |
Query | A query, with the result emailed to an address you give. The email carries an HTML copy of the result in the body and the result attached in the format you pick, |
Baseline | A baseline definition, checked against its specified group of devices. |
Integration | An integration run, on whatever rhythm suits it. |
Benchmark | Created automatically when a benchmark is created, listed here so the schedule can be adjusted. |
Vulnerabilities | The vulnerability data refreshes. Two ship enabled by default, Vulnerability Retrieval, which fetches new vulnerability records from FirstWave, and Run All Vulnerabilities, which recalculates every vulnerability for every org and device. |
Collector tasks appear in the list too, created automatically when the collector feature is in use. They're not something to create by hand, though their frequency can be edited after creation.
The schedule is cron, in friendly clothing. Five fields: minute (0 to 59), hour (0 to 23), day of month (1 to 31), month (1 to 12) and day of week (0 to 6). Every day at 2am is minute 0, hour 2, everything else any. First of the month is day of month 1. If cron is new to you, the Wikipedia primer at https://en.wikipedia.org/wiki/Cron applies directly.
The server does the watching. A cron job on the Open-AudIT server runs the task checker every minute, which looks for tasks whose time has come and sets them going. Your part ends at saving the task. Each task shows its last run on the list page, and can be disabled without being deleted.
Collectors get their work from here too. When collectors report to your server, discovery tasks grow a dropdown for which collector should run the discovery. Discovery is the only task type collectors run. Schedule those on the five minute marks, since collectors poll for work every five minutes by default (the collector_check_minutes configuration item).
Why?
Current data without anybody remembering. The whole value of an inventory is that it's true today, and it's only true today if discovery ran recently. A schedule is how that happens on the weekend, on holidays, and after the person who used to click the button has moved on.
Reports become something that arrives. A scheduled query turns "log in and check" into an email in the right inbox on the first of the month. The certificate expiry report from the Certificates page is the canonical example.
The timing can respect the network. Discovery at 2am touches nobody's morning. Different sites, different windows, each its own task.
How?
Three steps, one prerequisite.
1. For query tasks, have email working first. Scheduled queries are delivered by email, so set the mail items at menu > Admin > Configuration > Email Configuration and use the Test Email button there to prove them before a schedule depends on it. A modal tells you whether the send worked, and the test email itself arriving is the real proof.
2. Create the task. Go to menu > Admin > Tasks > Create Tasks. Name it, pick the organisation, pick the type, and the form asks for the rest: which discovery or query or cloud, the email address and format for a query, the collector if one should run it. Set the five schedule fields and Submit. There's an import at menu > Admin > Tasks > Import Tasks when you're setting up many at once.
The Create Tasks form in version 7.
3. Check it ran. The list at menu > Admin > Tasks > List Tasks shows each task's schedule and last run. A discovery task's results show on the discovery itself, and a query task's result should be in the inbox. If a task never fires, confirm it's enabled and that the server's own cron job is in place, since that's the heartbeat everything here depends on.
Pre version 7. Everything below this line describes Open-AudIT before version 7. Menus, screens and behaviour may differ.
Pre version 7
- 1 Tasks
- 1.1 What is it?
- 1.2 What does it do?
- 1.3 Why?
- 1.4 How?
- 2 Pre version 7
- 3 Introduction
- 4 Listing Tasks
- 5 Creating
- 6 Baselines
- 7 Collectors
- 8 Discoveries
- 9 Reports
- 10 Queries
- 11 Summaries
- 12 Database Schema
- 13 API / Web Access
- 14 Default Items
Introduction
As at version 2.0.6 of Open-AudIT we have rewritten the tasks functionality.
Tasks now offer full CRON type scheduling under both Linux and Windows. There is a single entry in either cron (/etc/cron.d/open-audit) or under Windows Task Manager (open-audit). This task runs every minute and checks the list of tasks within Open-AudIT for those that should be run. If there is a scheduled match, the task(s) is executed.
Tasks can be one of several distinct types: Baseline, Discovery, Report, Query, Summary or Collector.
Special Note - If you are using https for Open-AudIT, you will need to manually edit the files /usr/local/omk/bin/open-audit_tasks.[sh|vbs]. You will need to update the URL to reflect the https prefix. To use https, there is a line below that should be uncommented, and the regular line commented out. that's all there is to it.
Join Paul McClendon, an Opmantek Support Engineer, as he demonstrates how to schedule tasks to run automatically in Open-AudIT.
Listing Tasks
All scheduled tasks are listed in the Admin section of the Open-AudIT Enterprise menu.
Menu -> Admin -> Tasks -> List Tasks. From this screen, you can add, remove and edit tasks.
Creating
All tasks can be created the same in Windows and Linux. Tasks use the CRON method for scheduling execution.
Minute: (0-59)
Hour: (0-23)
Day of Month: (1-31)
Month: (1-12)
Day of Week: (0-6)
For a primer on cron, see this Wikipedia page: https://en.wikipedia.org/wiki/Cron
On the Tasks List page, click the "Add New" button to configure a task.
Choose the "type" of the task from the first drop down. This will configure the additional fields required depending on the type of task.
If the Open-AudIT Server has Collectors reporting to it, an additional drop down is provided. You can select this to specify which Collector the task should run on. Only Discovery tasks are supported for Collectors.
Baselines
Once you have generated a Baseline Definition you can schedule it to be run against a specified group of devices.
Collectors
Collector tasks are automatically setup when the collector feature is enabled. Collector tasks should not be created directly by users. Collector tasks can have their frequency edited after creation. If the Open-AudIT Server has Collectors reporting to it, an additional drop down is provided. You can select this to specify which Collector the task should run on. Only Discovery tasks are supported for Collectors.
Discoveries
Setting up Discovery on a subnet is almost identical to running a regular Discovery via the web interface. The only additional items are the scheduled hour and day(s) and a name for the Scheduled Task itself. You can take advantage of this to schedule multiple discoveries using different sets of credentials.
As per the Subnet Discovery, the Active Directory Discovery is also simply the same fields as a regular Active Directory Discovery with the addition of a day, hour(s) and name.
If the Open-AudIT Server has Collectors reporting to it, an additional drop down is provided. You can select this to specify which Collector the task should run on. Only Discovery tasks are supported for Collectors. Specify the same items as a regular Discovery, but provide the alternate Collector to run this task.
Reports
When you enable a Report to be run on a schedule, the report is emailed to your chosen address. You must have set up email via menu -> Admin -> Enterprise -> Email Config. We also have a "test email" button on that page. Input your details, save it and then test it. You should have a modal box that informs you if it successful or not and obviously a test email should arrive if it is successful. Once you have email configured, your scheduled reports can be configured.
Provide a name, optional description, choose 'Report' type, select the desired report, provide an email address, choose a format and set the schedule.
Provide an hour (hour only, no minutes as yet), give the task a name (this is not the name of the actual scheduled report itself), select which days you would like the report run, choose which report you would like run, supply an email address and choose a report format and you're done.
Reports will be sent with an email body of the report (in html format) and the report attached in the requested format.
Queries
Queries take the same arguments as Reports.
Summaries
Summaries take the same arguments as Reports.
Database Schema
The database schema can be found in the application is the user has database::read permission by going to menu: Admin -> Database -> List Tables, then clicking on the details button for the table.
API / Web Access
You can access the collection using the normal Open-AudIT JSON based API. Just like any other collection. Please see The Open-AudIT API documentation for further details.
Default Items
Shipped are a set of default items. These can be found by going to menu: Help → Defaults → Discovery Scan Options.