Versions Compared

Key

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

...

Code Block
http://{server}/omk/open-audit/login

POSTing data

To create a resource, you should POST the required data. The format of your data shoudl be in the form:

data[attributes][ATTRIBUTE_NAME]

You should substitute the required column (eg, org_id) for ATTRIBUTE_NAME.

In the case where we store several fields (usually in JSON format) inside a BIGTEXT MySQL field (eg: credentials.credentials - the credentials column in the credentials table), you should use the format:

data[attributes][credentials][credentials][username]

Examples at the bottom of this page.

All endpoints also have a minimum list of required fields. These are:

attributes -   'name', 'org_id', 'type', 'resource', 'value'
collectors - 'name', 'org_id', 'status'
connections - 'name', 'org_id'
credentials - 'name', 'org_id', 'type', 'credentials'
discoveries - 'name', 'org_id', 'type', 'network_address', 'other'
fields - 'name', 'org_id', 'type', 'placement', 'group_id'
files - 'name', 'org_id', 'path'
groups - 'name', 'org_id', 'sql'
ldap_servers - 'name', 'org_id', 'lang', 'host', 'port', 'secure', 'domain', 'type', 'version', 'use_roles', 'refresh'
licenses - 'name', 'org_id', 'org_descendants', 'purchase_count', 'match_string'
locations - 'name', 'org_id'
networks - 'name', 'org_id', 'network'
orgs - 'name', 'parent_id'
queries - 'name', 'org_id', 'sql', 'menu_category', 'menu_display'
roles - 'name', 'permissions'
scripts - 'name', 'org_id', 'options', 'based_on'
summaries - 'name', 'org_id', 'table', 'column', 'menu_category'
tasks - 'name', 'org_id', 'type', 'sub_resource_id', 'uuid', 'enabled', 'minute', 'hour', 'day_of_month', 'month', 'day_of_week'
users - 'name', 'org_id', 'lang', 'active', 'roles', 'orgs'

The Endpoints

At present we have endpoints for nearly every collection. They are listed here - Collections.

...

Code Block
GET http://{server}/omk/open-audit/devices?system.os_name=likeWindows 2008

 

CURL Examples

Logging in

Code Block
curl --cookie-jar cookies.txt --form password=password --form username=admin http://localhost/open-audit/index.php/logon

Creating Credentials

Code Block
curl -X POST -b cookies.txt http://localhost/open-audit/index.php/credentials -d "data[attributes][name]=test_creds&data[attributes][org_id]=1&data[attributes][type]=ssh&data[attributes][credentials][username]=my_new_user&data[attributes][credentials][password]=my_new_password"

Retrieving a List of Credentials

Code Block
curl -X GET -b cookies.txt http://localhost/open-audit/index.php/credentials