Overview
The Snare advanced events search capability allows you to build structured queries using the Snare Query Language (SnareQL) to search for events.
With SnareQL, you can specify advanced criteria using tools such as:
Operators such as =, !=, >, LIKE, CONTAINS or regular expressions,
Specific field comparisons, such as USERNAME=AJSmith
Advanced date limitations such as DATE='last monday'
Precedence using parentheses, such as EVENTID='login' AND (TIME < 08:00:00 OR TIME > 17:00:00)
Note, SnareQL is not a database query language, even though it uses a subset and superset of SQL syntax.
SnareQL
SnareQL queries consist of query components, joined by logic operators.
Each query component consists of a field, an operator, and a value. For example:
USERNAME='AJSMITH'
This query will search for events that have a field called “USERNAME” that contains (=) the value “AJSMITH”.
Snare Central is capable of storing massive amounts of forensic data. A simple search like this one, without date/time range limitations could potentially take a very long time to run, since it will attempt to search the entire Snare Central data store.
The Snare Central advanced query tool will impose a query timeout on queries by default, to help you narrow down your search criteria in a reasonable timeframe.
A more complex query may look like this:
USERNAME='AJSMITH' AND EVENTID LIKE '%login' AND SYSTEM REGEX '^(AU|US|UK)-' AND ((DATE='WEEKDAY' AND (TIME < '08:00:00' OR TIME > '17:00:00')) OR DATE='WEEKEND')
This query will search for 'out of hours' logins by AJSmith, from systems with a hostname that identifies them as Australia, US or UK.
Different log types will often contain different fields, and event fields with the same names may be formatted slightly differently. Windows uses numeric identifiers for the field EVENTID (eg: 512, 4593), whereas Solaris and Linux will use more descriptive terms such as “login - ftp”.
DATE and TIME fields, though stored in the format YYYY-MM-DD and HH:MM:SS respectively within the Snare Central data store, can support indirect values such as “this time last week” or “the first day of this month”, or “last saturday”, or “5” (which translates to ‘now minus 5 days’, in the case of DATE, or ‘now minus 5 seconds’ in the case of TIME) .
In addition, some functions are available that can modify field contents.
USERNAME='AJSMITH' AND EVENTID LIKE '%login' AND MINUTE(TIME) < 15 AND DATE='today'
This query will search for logins by AJSmith, in the first 15 minutes of each hour of the current day.
Precedence in Queries
Snare query components are evaluated in the order specified in the query; however precedence can be explicitly specified using brackets……
Note: See Atlassian doco for sample..
Reference
Description | Reference | |
---|---|---|
Field | A field in SnareQL is a word that represents a field within a particular log type. | Events within each logtype are guaranteed by the Snare Central collection subsystem to include the following fields:
Depending on the source log type, events may also include fields such as:
The fields available for each type of log are detailed in a table below. Note that new log types are added on a regular basis. |
Operator | An operator in SnareQL is one or more symbols or words that compare the value of a field on its left with one or more values on its right. Some operators may use the negate symbol (!) to reverse the meaning - eg: !=, !REGEX |
|
Logical Element | A logical element in SnareQL is a word that joins two or more clauses together to forma a complex SnareQL query |
|
Value | A string designed to represent the contents of a field in an event within the Snare Central datastore. The value may be a simple string, or a complex regular expression, depending on the operator selected. Quotations are optional for simple values comprising a single word. Single or double quotes are recommended for more complex values such as regular expressions, and are required for strings that contain whitespace. |
|
Function | A function in SnareQL appears as a word followed by parentheses, which may contain a field. A function performs a calculation on the contents of the field (the value) and returns the results. |
|
Log Type / Table | Description | Fields |
---|---|---|
ACF2Log | Todo |
|
AgentHeartBeat |
| |
AIXAudit |
| |
ApacheLog |
| |
AppleBSM |
| |
Browser |
| |
CarbonBlack |
| |
CISCORouterLog |
| |
CuramAuthenticationLog |
| |
CuramAuthorisationLog |
| |
CuramOpAuditLog |
| |
CyberGuardFirewallLog |
| |
DhcpSrvLog |
| |
Exch2008MTLog |
| |
ExchMTLog |
| |
F5Violations |
| |
Firewall1Log |
| |
Fortigate |
| |
FWOBJActionsLog |
| |
FWOBJActionsRawLog |
| |
GauntletFirewallLog |
| |
GenericLog |
| |
IISWebLog |
| |
IPTablesFirewall |
| |
IrixSAT |
| |
ISAFWSLog |
| |
ISAWebLogDVA |
| |
ISAWebLog |
| |
ISAWebLogImport |
| |
LinuxAudit |
| |
LinuxKAudit |
| |
LotusNotesLog |
| |
MailLog |
| |
MSDNSServer |
| |
MSProxySvr |
| |
MSSQLLog |
| |
MSWinEventLog |
| |
MSWinEventLog |
| |
NCRATMLog |
| |
NetgearFirewallLog |
| |
NetgearRouterLog |
| |
NetscalerLog |
| |
NetScreenFirewall |
| |
NortelVPNRouter |
| |
ObjectAccess |
| |
ObjectStarLog |
| |
OracleLog |
| |
OS400Log |
| |
PIXLog |
| |
QUASARSAudit |
| |
RACFLog |
| |
SidewinderFirewallLog |
| |
SidewinderLog |
| |
SMTPSvcLog |
| |
SnareServerLog |
| |
SNMPTrap |
| |
Snort |
| |
SOCKSLog |
| |
SolarisBSM |
| |
SonicWall |
| |
SonicWallSSLVPN |
| |
SophosDataControlLog |
| |
SophosWeb |
| |
SquidProxyLog |
| |
TandemLog |
| |
TopicLog |
| |
TrendDSM |
| |
Tru64Audit |
| |
VMSLog |
| |
VWActionsLog |
| |
WebLog |
| |
WinDHCP |
|