Versions Compared

Key

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

Table of Contents

...

Logon

Request

Section


URLPOSThttp://localhost/omk/open-audit/index.php/logon
HeadersAcceptapplication/json
BodyTypeform-data

Keyusernameadmin

Keypasswordpassword

Response

Code Block
{
	"access_token": "[]",
	"active": "y",
	"messagedashboard_id": "Authenticated as user admin",
    "ok": 1
}

Read Devices

Logon as above, then.

Request

...

Response

Note - restricted to one item in the data array, normally you will retrieve all items.

Code Block
{
    "data": [
        {
            "attributes": {
                "locations."1",
	"devices_default_display_columns": "",
	"edited_by": "Administrator",
	"edited_date": "2024-10-02 11:40:15",
	"email": "admin@openaudit",
	"full_name": "Administrator",
	"id": 1,
	"lang": "en",
	"ldap": "",
	"list_table_format": "",
	"name": "admin",
	"org_id": 1,
                	"orgs.id": "[1]",
                "orgs.name	"password": "Default Organisation",
	"roles":
               "system.class": "virtual server",
                "system.dbus_identifier": "",
                "system.description": "win 2008r2 with iis",
                "system.dns_domain": "",
                "system.dns_fqdn": "",
                "system.dns_hostname": "",
                "system.domain": "open-audit.local",
                "system.environment": "production",
                "system.first_seen": "2020-03-19 11:47:50",
                "system.form_factor": "Virtual",
                "system.fqdn": "win2012r2_web02.open-audit.local",
                "system.function": "",
                "system.hostname": "win2012r2_web02",
                "system.icon": "windows",
                "system.id": 19,
                "system.identification": "Virtual server from VMware, Inc.",
                "system.ip": "192.168.1.138",
                "system.ip_padded": "192.168.001.138",
                "system.last_seen": "2020-03-19 11:48:42",
                "system.last_seen_by": "audit",
                "system.location_id": 1,
                "system.manufacturer": "VMware, Inc.",
                "system.model": "VMware Virtual Platform",
                "system.name": "win2012r2_web02",
                "system.org_id": 1,
                "system.os_family": "Windows 2008",
                "system.os_group": "Windows",
                "system.os_name": "Microsoft Windows Server 2008 R2 Standard",
                "system.os_version": "6.1.7601",
                "system.serial": "VMware-56 4d 3a 1e b9 d5 13 17-fc 68 fb 3d e5 5a b6 77",
                "system.snmp_oid": "",
                "system.status": "production",
                "system.sysContact": "",
                "system.sysDescr": "",
                "system.sysLocation": "",
                "system.sysName": "",
                "system.sysObjectID": "",
                "system.sysUpTime": "",
                "system.type": "computer",
                "system.uuid": "1E3A4D56-D5B9-1713-FC68-FB3DE55AB677"
            },
            "id": 19,
            "links": {
                "self": "http://localhost/omk/open-audit/system/19"
            },
            "type": "system"
        }
    ],
    "included": [],
    "links": {
        "first": "http://localhost/omk/open-audit/devices?properties=default",
        "last": "http://localhost/omk/open-audit/devices?properties=default",
        "next": "http://localhost/omk/open-audit/devices?properties=default",
        "prev": "http://localhost/omk/open-audit/devices?properties=default",
        "self": "http://localhost/omk/open-audit/devices"
    },
    "meta": {
        "access_token": "23652075c7660006c281bf33589620dc093bdbedf8eb7ed1223449a95748",
        "action": "collection",
        "baseurl": "http://localhost/omk/open-audit",
        "collection": "devices",
        "current": "y",
        "data_order": [
            "system.id",
            "system.uuid",
            "system.name",
            "system.ip",
            "system.hostname",
            "system.dns_hostname",
            "system.domain",
            "system.dns_domain",
            "system.dbus_identifier",
            "system.fqdn",
            "system.dns_fqdn",
            "system.description",
            "system.type",
            "system.icon",
            "system.os_group",
            "system.os_family",
            "system.os_name",
            "system.os_version",
            "system.manufacturer",
            "system.model",
            "system.serial",
            "system.form_factor",
            "system.status",
            "system.environment",
            "system.class",
            "system.function",
            "system.org_id",
            "system.location_id",
            "system.snmp_oid",
            "system.sysDescr",
            "system.sysObjectID",
            "system.sysUpTime",
            "system.sysContact",
            "system.sysName",
            "system.sysLocation",
            "system.first_seen",
            "system.last_seen",
            "system.last_seen_by",
            "system.identification",
            "orgs.name",
            "system.ip_padded",
            "orgs.id",
            "locations.id"
        ],
        "debug": false,
        "filter": [],
        "filtered": 19,
        "format": "json",
        "groupby": "",
        "header": "HTTP/1.1 200 OK",
        "heading": "Devices",
        "id": null,
        "ids": 0,
        "include": "",
        "limit": 1000,
        "offset": 0,
        "properties": "system.id,system.uuid,system.name,system.ip,system.hostname,system.dns_hostname,system.domain,system.dns_domain,system.dbus_identifier,system.fqdn,system.dns_fqdn,system.description,system.type,system.icon,system.os_group,system.os_family,system.os_name,system.os_version,system.manufacturer,system.model,system.serial,system.form_factor,system.status,system.environment,system.class,system.function,system.org_id,system.location_id,system.snmp_oid,system.sysDescr,system.sysObjectID,system.sysUpTime,system.sysContact,system.sysName,system.sysLocation,system.first_seen,system.last_seen,system.last_seen_by,system.identification",
        "query_parameters": [
            {
                "name": "properties",
                "operator": "",
                "value": "default"
            }
        ],
        "query_string": "properties=default",
        "received_data": [],
        "request_method": "GET",
        "requestor": "commercial",
        "sort": "",
        "sub_resource": "",
        "sub_resource_id": 0,
        "timestamp": "2020-03-24 13:47:56",
        "timezone": "UTC +1000",
        "total": 19,
        "version": 1
    }	[
		"admin",
		"org_admin"
	],
	"toolbar_style": "icontext",
	"type": "user"
}


Read Devices

Logon as above, then.

Request

Section

URLGEThttp://localhost/open-audit/index.php/devices
HeadersAcceptapplication/json

Response

Note - restricted to one item in the data array, normally you will retrieve all items.


No Format
{
"meta": {
"action": "collection",
"collection": "devices",
"request_method": "GET",
"remote_addr": "::1",
"format": "json",
"id": null,
"access_token": "60485c922d98010d0b6e9a746b15bd50144eccc18ef8896ad28e1e11fc3f",
"baseurl": "http://localhost:8080/",
"debug": false,
"filtered": 1,
"groupby": "",
"header": 200,
"include": "",
"license_string": "",
"limit": 1,
"microtime": 1728348706.632546,
"offset": 0,
"properties": [
"devices.id",
"devices.icon",
"devices.type",
"devices.name",
"devices.ip",
"devices.uuid",
"devices.hostname",
"devices.dns_hostname",
"devices.domain",
"devices.dns_domain",
"devices.dbus_identifier",
"devices.fqdn",
"devices.dns_fqdn",
"devices.description",
"devices.os_group",
"devices.os_family",
"devices.os_name",
"devices.os_version",
"devices.manufacturer",
"devices.model",
"devices.serial",
"devices.form_factor",
"devices.status",
"devices.environment",
"devices.class",
"devices.function",
"devices.org_id",
"devices.location_id",
"devices.snmp_oid",
"devices.sysDescr",
"devices.sysObjectID",
"devices.sysUpTime",
"devices.sysContact",
"devices.sysName",
"devices.sysLocation",
"devices.first_seen",
"devices.last_seen",
"devices.last_seen_by",
"devices.identification",
"devices.tags"
],
"query_string": "limit=1",
"requestor": "",
"server_app_version": "5.6.0",
"server_platform": "MacOS 15.0.1 Sequoia",
"sort": "",
"time_start": 1728348706.64449,
"time_end": 1728348706.714915,
"time_elapsed": "0.08",
"total": 111,
"timestamp": "2024-10-08 10:51:46",
"timezone": "UTC +10:00",
"version": 1,
"filter": [
{
"name": "devices.org_id",
"function": "whereIn",
"operator": "in",
"value": [
"1"
]
}
],
"received_data": [],
"sql": [],
"heading": "Devices",
"icon": "fa fa-desktop",
"data_order": [
"id",
"icon",
"type",
"name",
"ip",
"uuid",
"hostname",
"dns_hostname",
"domain",
"dns_domain",
"dbus_identifier",
"fqdn",
"dns_fqdn",
"description",
"os_group",
"os_family",
"os_name",
"os_version",
"manufacturer",
"model",
"serial",
"form_factor",
"status",
"environment",
"class",
"function",
"org_id",
"location_id",
"snmp_oid",
"sysDescr",
"sysObjectID",
"sysUpTime",
"sysContact",
"sysName",
"sysLocation",
"first_seen",
"last_seen",
"last_seen_by",
"identification",
"tags"
]
},
"links": {},
"included": {
"antivirus": 8,
"audit_log": 140,
"bios": 70,
"change_log": 12642,
"disk": 342,
"dns": 0,
"edit_log": 3006,
"file": 35,
"firewall": 3,
"firewall_rule": 1073,
"executable": 101,
"ip": 301,
"log": 742,
"memory": 128,
"module": 619,
"monitor": 27,
"motherboard": 62,
"netstat": 2524,
"network": 618,
"nmap": 65,
"optical": 23,
"pagefile": 26,
"partition": 422,
"policy": 1033,
"print_queue": 10,
"processor": 77,
"route": 947,
"server": 65,
"server_item": 134,
"service": 12164,
"share": 47,
"software": 43305,
"software_key": 35,
"sound": 58,
"task": 4339,
"user": 1689,
"user_group": 2375,
"variable": 2142,
"video": 75,
"vm": 89,
"windows": 39
},
"logs": [],
"data": [
{
"id": 5,
"type": "devices",
"attributes": {
"id": 5,
"icon": "redhat",
"type": "computer",
"name": "redhat9",
"ip": "192.168.1.53",
"uuid": "9d762f99-55cb-5f42-a4ea-3704c5be0333",
"hostname": "redhat9",
"dns_hostname": "redhat9",
"domain": "open-audit.lan",
"dns_domain": "open-audit.local",
"dbus_identifier": "db348c97aadf4b38847d236483fe9f79",
"fqdn": "redhat9.open-audit.lan",
"dns_fqdn": "redhat9.open-audit.local",
"description": "",
"os_group": "Linux",
"os_family": "RedHat",
"os_name": "Red Hat Enterprise Linux release 9.4 (Plow)",
"os_version": "9.4",
"manufacturer": "innotek GmbH",
"model": "VirtualBox",
"serial": "",
"form_factor": "Virtual",
"status": "production",
"environment": "production",
"class": "server",
"function": "",
"org_id": 1,
"location_id": 1,
"snmp_oid": "",
"sysDescr": "",
"sysObjectID": "",
"sysUpTime": "",
"sysContact": "",
"sysName": "",
"sysLocation": "",
"first_seen": "2024-08-27 14:43:31",
"last_seen": "2024-09-27 13:20:29",
"last_seen_by": "audit_ssh",
"identification": "Server from innotek GmbH",
"tags": [],
"orgs.name": "Default Organisation",
"orgs.id": 1,
"locations.name": "Default Location",
"locations.id": 1,
"mycount": "1",
"audit_class": "fa fa-check text-success",
"audit_text": "Discovered and audited computer.",
"ip_padded": "192.168.001.053"
}
}
]
}






Create Discovery

Logon as above, then request list of devices (or any available endpoint) so we can use the meta → access_token in our request (see above response).

Request

Section


URLPOSThttp://localhost/omk/open-audit/discoveries
HeadersAcceptapplication/json
BodyTypeform-data

Keydata
    {
        "access_token": "bcb3f959c14f0daf959e3de92e4213201a56bc205e31b63f35c3f9299670",
      "type": "discoveries",
        "attributes":
        {
            "description": "Subnet - 192.168.1.0/24",
            "match_options": "{\"match_dbus\":\"\",\"match_dns_fqdn\":\"\",\"match_dns_hostname\":\"\",\"match_fqdn\":\"\",\"match_hostname\":\"\",\"match_hostname_dbus\":\"\",\"match_hostname_serial\":\"\",\"match_hostname_uuid\":\"\",\"match_ip\":\"\",\"match_ip_no_data\":\"\",\"match_mac\":\"\",\"match_mac_vmware\":\"\",\"match_serial\":\"\",\"match_serial_type\":\"\",\"match_sysname\":\"\",\"match_sysname_serial\":\"\",\"match_uuid\":\"\"}",
            "name": "My Testing Discovery",
            "org_id": 1,
            "scan_options": "{\"exclude_ip\":\"\",\"exclude_tcp_ports\":\"\",\"exclude_udp_ports\":\"\",\"filtered\":\"\",\"id\":\"1\",\"nmap_tcp_ports\":\"\",\"nmap_udp_ports\":\"\",\"open|filtered\":\"\",\"ping\":\"\",\"service_version\":\"\",\"ssh_ports\":\"\",\"tcp_ports\":\"\",\"timeout\":\"\",\"timing\":\"\",\"udp_ports\":\"\",\"script_timeout\":\"\",\"snmp_timeout\":\"\",\"ssh_timeout\":\"\",\"wmi_timeout\":\"\"}",
          "subnet": "192.168.1.0/24",
            "type": "subnet"
      }
    }

...

Logon as above, then.

Request

Section


URLPATCHhttp://localhost/omk/open-audit/discoveries/5
HeadersAcceptapplication/json
BodyTypex-www-form-urlencoded

Keydata
{
   "id": 5,
   "type": "discoveries",
   "attributes": {
      "name": "My New Name OMK"
   }
}

...

Logon as above, then.

Request

Section

URLDELETEhttp://localhost/omk/open-audit/discoveries/5
HeadersAcceptapplication/json

...