Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

As at 1.12.8 we have removed the old functionality of "Create a Windows Audit Script" and replaced it with the Scripts endpoint. You can now create a script with all the options for any of the existing audit scripts - not just Windows. AIX, ESX, Linux, OSX and Windows are all covered.

...

We initially setup the default list of scripts with the default options. The list of script is viewable at /scripts. These default scripts cannot be deleted. You can create additional scripts for use by you as required. Your script will be based on one of the existing scripts and have custom options applied. The scripts can then be downloaded from the list page at menu: Discover -> Admin -> Audit Scripts -> List Audit Scripts.

Modifying an Existing Script

You are always free to modify the audit scripts themselves to suit your specific requirements. You will need to (re)incorporate those changes whenever you upgrade as they will be overwritten by the default scripts. I would suggest saving a master copy of your modified script, upgrading Open-AudIT, then running a diff between the new default script and your modified script and applying the differences. The audit scripts are native scripts (Windows is VBScript, all others are Bash). Simple and easy to modify - just make sure to have a copy of your changes before you upgrade.

Debugging a Script

So a script isn't working on a recalcitrant device. Grrr. The scripts for Windows, Linux, and MacOS all accept the debugging argument. This can be set in the script itself, or provided on the command line. Run the script using that option set to 5 and you should see in which section of the script the failure occurs. For example -

Code Block
./audit_linux.sh debugging=5 submit_online=n create_file=y 

Or

Code Block
cscript audit_windows.vbs debugging=5 submit_online=n create_file=y

And if you can't determine why it's failing, log a support ticket - we'll help (smile)

Creating a Script

To make another script use the menu and go to menu: Discover -> Admin Audit Scripts -> Scripts -> Create Script> Create Audit Scripts. Provide a name and optionally a description. Choose a type of script to base your custom script upon. Once you do this, the Options section will populate with the available configurable options. At present Windows and Linux scripts will have the "files" details injected. See details about files here - Files.

...

URL - If you leave the URL option as set, Open-AudIT will inject the config value for default_network_address into the URL option. With the default scripts, if left as set, Open-AudIT will inject the default network address when the script is downloaded. 


Image Added
.
Image RemovedImage Added

Viewing Script Details

Go to menu: Discover -> Admin -> Audit Scripts -> List Audit Scripts.

Image Removed

You will see a list of

...

scripts. You can view a script by clicking on the

...

blue view icon. You can also

...

edit or delete

...

your script.

Image Removed

Scripts are stored in the database in the "scripts" table. A typical entry will look as below. The "hash" column is not used at present.

         id: 12
       name: my_audit_aix.sh
    options: {"create_file":"n","debugging":"1","org_id":"","submit_online":"y","system_id":"","url":"http:\/\/192.168.88.240\/open-audit\/index.php\/system\/add_system"}
description: 
   based_on: audit_aix.sh
       hash: 
  edited_by: Administrator
edited_date: 2016-08-04 10:40:36

 

API / Web Access?

...


Image Added

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.

API Routes

Request MethodIDActionResulting FunctionURL ExampleNotesExample Response
GETn collection/scriptsReturns a list of scripts.script_collection.json
GETy read/scripts/{id}Returns a scripts details.script_read.json
PATCHy update/scripts/{id}Update an attribute of a scripts entry.script_patch.json
POSTn create/scriptsInsert a new scripts entry. 
DELETEy delete/scripts/{id}Delete a script entry. 

Web Application Routes

Request MethodIDActionResulting FunctionURL ExampleNotes
GETncreatecreate_form/scripts/createDisplays a standard web form for submission to POST /scripts.
GETyupdateupdate_form/scripts/{id}/updateShow the script details with the option to update attributes using PATCH to /scripts/{id}
GETydownloaddownload/scripts/{id}/downloadDownload a complete audit script based on the script entry.

 


Default Items

Shipped are a set of default items. These can be found by going to menu: Help → Defaults → Scripts.

...