Versions Compared

Key

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

...

To create an entry to track either a single file or a directory of files, use Open-AudIT Enterprise and go to menu: Discover-> Files -> Create Files. Create a file by providing values for the path (either the file or a directory with a trailing slash) and an optional description. Click Submit. Once you have created the file you will see it appear in the list at Discover -> Files -> List Files.

Image RemovedImage Added

Image RemovedImage Added

An entry will be create in the Open-AudIT database, in the "files" table.

...

You will see a list of files. You can view a file by clicking on the blue view icon. You can also edit or delete your file.

Image RemovedImage Added

Database Schema

The schema for the database is below. It can also be found in the application if the user has database::read permission by going to menu: Manage -> Database -> List, then clicking on the "files" table. 

Code Block
language
languagetext
themeEclipsetext
CREATE TABLE `files` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL DEFAULT '',
  `org_id` int(10) unsigned NOT NULL DEFAULT '1',
  `path` text NOT NULL,
  `description` text NOT NULL,
  `edited_by` varchar(200) NOT NULL DEFAULT '',
  `edited_date` datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

...

Files are stored in the database in the "files" table. A typical entry will look as below (for a single file).

Code Block
languagetext
themeEclipselanguagetext
               id: 48
        system_id: 8
          current: y
       first_seen: 2016-08-04 00:56:35
        last_seen: 2016-08-04 00:56:35
         files_id: NULL
             name: single
        full_name: /etc/init.d/single
             size: 590
        directory: /etc/init.d
             hash: 27579d05edbd1b71307d2059a6c3370a00823c54
     last_changed: 2014-03-13 11:33:14
meta_last_changed: 2014-08-22 17:42:38
       permission: 755
            owner: root
            group: root
             type: 
          version: 
            inode: 5374232

...

You can access the /files collection using the normal Open-AudIT JSON based API. Just like any other collection. Please see the API documentation for further details.

API Routes

Request MethodIDActionResulting FunctionURL ExampleNotesExample Response
GETn
 

collection/filesReturns a list of files.files_collection.json
GETy
 

read/files/{id}Returns a file's details.files_read.json
PATCHy
 

update/files/{id}Update an attribute of a file entry.files_patch.json
POSTn
 

create/filesInsert a new file entry.files_create.json
DELETEy
 

delete/files/{id}Delete a file entry.files_delete.json

Web Application Routes

Only available under Open-AudIT Enterprise

Request MethodIDActionResulting FunctionURL ExampleNotes
GETncreatecreate_form/files/createDisplays a standard web form for submission to POST /files.
GETyupdateupdate_form/files/{id}/updateShow the script details with the option to update attributes using PATCH to /files/{id}

 

 

 

...