The QuoLab Add-On for Splunk adds the quolabquery
generating command to a Splunk environment, allowing an authorized user to make requests to one or more QuoLab servers to bring in data to Splunk for additional forensic and analytic investigation.
This add-on comprises an authentication lookup and a python script that implements quolabquery
, a generating command. quolabquery
wraps and simplifies requests to the QuoLab REST API. Requests will be sent through web hooks to the same url as the user interface.
Steps:
admin
).quolab
to simplify your usage later.quolabquery
search to test for a response.| quolabquery type=ip-address id="8.8.8.8"
.| quolabquery server=MY-SERVER-NAME type=ip-address id="8.8.8.8"
quolab_servers_user
role, or inherit that roles from role(s) that already exist within your organization.admin
role will be able to run this automatically.QuoLab users looking to further enrich their investigations can now bring QuoLab artifacts into Splunk to leverage Splunk's ecosystem and analytics. See Combining QuoLab with Splunk below for expanded examples.
| quolabquery type=domain id=google.com
| quolabquery type=case facets="display,tagged" limit=30
| quolabquery query="{'class': 'sysref', 'type': 'encases', 'target': {'id': '1.2.3.4', 'class': 'fact', 'type': 'ip-address'}}"
No special upgrade procedures are necessary.
This add-on creates a new collection of entities called quolab_servers
.
At least one server must be defined to use the custom SPL command.
Each server contains the following attributes:
Attribute | Type | Description |
---|---|---|
url |
URL | The server name and port where QuoLab API requests will be sent |
username |
String | Name of the QuoLab user account, or <TOKEN> if using token-based authentication |
secret |
Password or Token |
The password associated with the given username or a token |
verify |
Boolean | The QuoLab HTTPS listener using a publicly signed certificate. Please understand the security implications of settings this to false .This should never be false if your QuoLab server is accessed on a public internet connection. |
max_batch_size |
Integer | The maximum number of results that can be fetched in a single query to the API. If more events are requested at search time then multiple queries will be send to the API using the supported pagination technique. |
max_execution_time |
Integer | The longest duration in seconds that any individual query may last. |
The quolabquery
command supports simple and advanced queries against a QuoLab catalog.
In simple mode, a user can specify just the type
of object to query and optionally specify one or more specific ids to search for.
In advanced mode you can specify a query in JSON mode so the full power of the QuoLab query language is at your disposal.
Simple Usage:
| quolabquery [server=<server>] type=<quolab-type> [id=<list>]
Advanced Usage:
| quolabquery [server=<server>] query="<json-query>"
Parameters:
type=<type>
: For simple searches, provide one of the QuoLab catalog types here.case
, endpoint
, or ip-address
.class
associated with each type
.id=<value>
: For simple searches, this can be used to specify one or more values (id
s) to search for.query=<json-query>
: In advanced mode, a custom query can be provided in JSON mode.quolabquery
command accepts a JSON-like syntax that uses single quotes as shown in some of the examples later.query
key), or a simpler query where it's assumed that the entire JSON body is the child of the query
key. (If none of that made sense to you, start with the simple query.)Optional parameters:
server=<quolab-server>
: Use this to determine which backend QuoLab server to query.quolab
.limit=<int>
: Restrict the number of query results.facets=<facet>
: Facets are related data to be fetched and returned along with the primary data.order=[-+]<field>
: Return results based on field ordering.+
to sort in ascending order and -
to sort in descending order.Example searches:
| quolabquery server=quolab type=wallet
| quolabquery type=ip-address id="8.8.8.8, 1.2.3.4"
| quolabquery type=endpoint id=tlsh:tlsh=virtual facets=display
| quolabquery query="{'query':{'class': 'sysfact', 'type': 'case' },'limit': 15, 'facets': {'display': 1,'tagged': true}}"
| quolabquery query="[{'class': 'sysfact', 'type': 'endpoint'}, {'class': 'sysfact', 'type': 'connector'}]" limit=100
| quolabquery query="{'class': 'sysfact', 'type': 'endpoint'}" limit=100 facets="refcount,display"
HINT: If you're trying to learn the query language, you can use the quolabquery
command with a simple query, and view the actual JSON query sent to QuoLab at the top of Splunk's Job Inspector.
Sourcetype | Purpose |
---|---|
command:quolabquery | Internal logs and stats related to custom QuoLab SPL command. |
Role | Capability | Description |
---|---|---|
admin |
edit_quolab_servers_config read_quolab_servers_config |
By default, administrators can both edit server entries and execute the quolabquery command. |
quolab_servers_user |
read_quolab_servers_config |
Users with this role can execute the quolabquery command. |
This add-on creates a custom configuration file named quolab_servers.conf
.
For security reasons, the secret for each server is stored securely in passwords.conf
and is encrypted at rest.
Typically there is no reason to modify these files directly.
The real power of the quolabquery
command is that it can be combined with other Splunk search commands. We'd love to expand this section to showcase real-life use cases. Please reach out with with your success stories. In the meantime, here are some ideas to get you started:
Combining the quolabquery
command with outputlookup
allows you to overwrite or append an existing lookup table within Splunk.
| quolabquery limit=5000 type=known-as facets=refcount | search fact.type="tor-descriptor"
| rename fact.* as * | table id type label refcount.*
| outputlookup quolab_tor_descriptor.csv
This technique uses Splunk's subsearch feature to insert specific fields returned by quolabquery
command into a dynamic search. In this example, Splunk looks in the firewall
index for ip addresses in the src_ip
field.
index=firewall [
| quolabquery query="{'class': 'sysref', 'type': 'encases', 'target': {'class': 'fact', 'type': 'ip-address'}}" facets="display"
| return 1000 src_ip=target.display.label ]
| table _time, sourcetype, src_ip, src_port, dest_ip, dest_port, action
The final search Splunk executes will look like:
index=firewall (src_ip="1.2.3.4") OR (src_ip="99.99.99.99") OR ...
| table _time, sourcetype, src_ip, src_port, dest_ip, dest_port, action
This is an open source project. See LICENSE
for full details.
Full source code for TA-quolab is available on GitHub.
Please check it out and send us your ideas about how to improve it. Pull requests are greatly appreciated!
Community support is available on a best-effort basis. For information about commercial support, contact Kintyre.
Issues are tracked via GitHub issues.
See the full change log.
* Support for authentication via tokens. (Place the special marker "<TOKEN>" in username, and token value in the password field)
* Resolve pagination bug caused by order not being always explicitly set.
* Add links back to the docs (GH & Splunkbase) from the in-app dashboard.
* Using the name id (rather than value for specifying specific entities in the quolabquery SPL command)
* Avoid password being sent to the browser behind the scenes when configuring servers via the UI.
First pre-public release.
Splunk AppInspect evaluates Splunk apps against a set of Splunk-defined criteria to assess the validity and security of an app package and components.
As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps and add-ons from Splunk, our partners and our community. Find an app or add-on for most any data source and user need, or simply create your own with help from our developer portal.