hunt
Type: Function · Category: server
Create and launch a hunt.
This function will create a new hunt to collect the specified
artifacts. The artifacts to collect are provided in the
artifacts parameter. Artifact parameters are provided in the
spec parameter (see example below).
Notes
In the GUI hunts are always created in the paused state. This is not the default state when using this function (all hunts are immediately active - if you want the hunt to be created in the paused state provide the
pause=TRUEparameter).The expiry time is specified in any of the usual time specification ways (seconds since epoch, or ISO format like “2021-10-02”). If the expiry time is in the past, the hunt will not be created.
SELECT hunt(
description="A general hunt",
artifacts='Windows.KapeFiles.Targets',
spec=dict(`Windows.KapeFiles.Targets`=dict(
Device ='C:', VSSAnalysis='Y', KapeTriage='Y')),
expires=now() + 18000)
FROM scope()
- Hunt conditions are not additive! A hunt can only be targeted to an operating system, or label but not both.
| Argument | Type | Description |
|---|---|---|
description |
string | Description of the hunt |
tags |
list of string | A list of tags to add to the hunt |
artifacts |
list of string (required) | A list of artifacts to collect |
expires |
LazyExpr | A time for expiry (e.g. now() + 1800) |
spec |
Any | Parameters to apply to the artifacts |
timeout |
uint64 | Set query timeout (default 10 min) |
ops_per_sec |
float64 | Set query ops_per_sec value |
cpu_limit |
float64 | Set query ops_per_sec value |
iops_limit |
float64 | Set query ops_per_sec value |
max_rows |
uint64 | Max number of rows to fetch |
max_bytes |
uint64 | Max number of bytes to upload |
pause |
bool | If specified the new hunt will be in the paused state |
include_labels |
list of string | If specified only include these labels |
exclude_labels |
list of string | If specified exclude these labels |
os |
string | If specified target this OS |
org_id |
list of string | If set the collection will be started in the specified orgs. |
Required permissions: START_HUNT, ORG_ADMIN
Platforms: macOS, Linux, Windows
Source: vql/server/hunts/create.go