SigmaHQ/README.md

213 lines
5.6 KiB
Markdown
Raw Normal View History

2016-12-24 10:56:10 +00:00
![sigma_logo](./images/Sigma_0.3.png)
2016-12-26 01:23:34 +00:00
# Sigma
2016-12-26 10:14:15 +00:00
Generic Signatures for SIEM Systems
2016-12-26 01:23:34 +00:00
# What is Sigma?
2017-01-07 21:39:06 +00:00
- Generic signature format to describe relevant events in log files
2016-12-26 10:14:15 +00:00
- Open repository for sigma signatures
- Set of converters that generate searches/queries for different SIEM systems
2016-12-26 01:23:34 +00:00
![sigma_description](./images/Sigma-description.png)
2017-01-07 21:39:06 +00:00
# Specification
The rules consist of a few required sections and several optional ones.
```
title
status [optional]
2017-01-07 21:39:06 +00:00
description [optional]
reference [optional]
2017-01-07 21:39:06 +00:00
detection
{search-identifier} [optional]
{string-list} [optional]
{field: value} [optional]
...
timeframe [optional]
condition
falsepositives [optional]
level [optional]
```
## Title
A brief title for the rule that should contain what the rules is supposed to detect (max. 256 characters)
## Status
Declares the status of the rule:
- stable: the rule is considered as stable and may be used in production systems or dashboards.
- test: an almost stable rule that possibly could require some fine tuning.
- experimental: an experimental rule that could lead to false results or be noisy, but could also identify interesting
events.
2017-01-07 21:39:06 +00:00
## Description
A short description of the rule and the malicious activity that can be detected (max. 65,535 characters)
## Detection
A set of search-identifiers that represent searches on log data
## Search-Identifier
A definition that can consist of two different data structures - lists and maps.
### Lists
The lists contain strings that are applied to the full log message and are logically linked with an 'OR'y.
Example:
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
detection:
keywords:
- EVILSERVICE
- svchost.exe -n evil
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
2017-01-08 16:40:40 +00:00
This example results in the following search expression:
2017-01-07 21:39:06 +00:00
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
EvilService OR "svchost.exe -n evil"
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
### Maps
Maps (or dictionaries) consist of key/value pairs, in which the key is a field in the log data and the value a string or integer value. Lists of maps are joined with a logical 'OR'. All elements of a map are joined with a logical 'AND'.
Examples:
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
detection:
selection:
- EventLog: Security
EventID:
- 517
- 1102
condition: selection
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
2017-01-08 16:40:40 +00:00
Splunk Search (implicit AND):
2017-01-07 21:39:06 +00:00
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
EventLog=Security ( EventID=517 OR EventID=1102 )
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
### TimeFrame
A relative time frame definition using the typical abbreviations for day, hour, minute, second.
Examples:
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
15s
30m
12h
7d
3M
2017-01-08 16:40:40 +00:00
```
2017-01-07 21:39:06 +00:00
Note: The time frame is often a manual setting that has to be defined within the SIEM system and is not part of the generated query.
2017-01-08 16:40:40 +00:00
## Condition
The condition is the most complex part of the specification and will be subject to change over time and arising requirements. In the first release it will support the following expressions.
- Logical AND/OR
```keywords1 or keywords2```
- X of search-identifier
```1 of keywords```
2017-01-10 22:27:47 +00:00
Same as just 'keywords' if keywords are dafined in a list. X may be:
- 1 (logical or across alternatives)
- all (logical and across alternatives)
2017-01-08 16:40:40 +00:00
- Negation with 'not'
```keywords and not filters```
2017-01-10 22:27:47 +00:00
- Pipe
2017-01-08 16:40:40 +00:00
```expression1 | expression2```
2017-01-10 22:27:47 +00:00
A pipe indicates that the result of search *expression1* is:
- filtered by search *expression2* (equivalent to logical *and*)
- aggregated by aggregation *expression2* and possibly compared with a value
The first expression must be a search expression that may be followed by an arbitrary number of filtering search
expressions and finally followed by an aggregation expression with a condition.
2017-01-08 16:40:40 +00:00
- Brackets
2017-01-07 21:39:06 +00:00
2017-01-08 16:40:40 +00:00
```selection1 and (keywords1 or keywords2)```
2017-01-07 21:39:06 +00:00
2017-01-10 22:27:47 +00:00
- Aggregation expression
agg-function(agg-field) [ by group-field ] comparison-op value
agg-function may be:
- count
- distcount (count distinct values)
- min
- max
- avg
- sum
Example: ```count(UserName) by SourceWorkstation > 3```
The comparison operates on the result values of all aggregation groups or buckets. It is sufficient when one group matches
the condition.
Operator Precedence (least to most binding)
- |
- or
- and
- not
- x of search-identifier
- ( expression )
2017-01-08 16:40:40 +00:00
## FalsePositives
2017-01-07 21:39:06 +00:00
A list of known false positives that may occur.
2017-01-08 16:40:40 +00:00
## Level
2017-01-07 21:39:06 +00:00
A score between 0 and 100 to define the degree of likelyhood that generated events are actually incidents.
A rough guideline would be:
- 20 : Interesting event but less likely that it's actually an incident. A security analyst has to review the events and spot anomalies or suspcious indicators. Use this in a dashboard panel, maybe in form of a chart.
- 40 : Interesting event, that shouldn't trigger too often. A security analyst has to review the events and spot anomalies or suspcious indicators. List the events in a dashboard panel for manual review.
- 60 : Relevant event that should be reviewed manually on a more frequent basis. A security analyst has to review the events and spot anomalies or suspcious indicators. List the events in a dashboard panel for manual review.
- 80 : Relevant event that should trigger an internal alert and has to be reviewed immediately.
- 100 : Highly relevant event that triggers an internal alert and causes external notifications (eMail, SMS, ticket). Events are clear matches with no known false positives.
## Examples
```
title: Eventlog Cleared
description: Some threat groups tend to delete the local 'Security'' Eventlog using certain utitlities
2017-01-07 21:39:06 +00:00
detection:
selection:
- EventLog: Security
EventID:
- 517
- 1102
condition: selection
falsepositives:
- Rollout of log collection agents (the setup routine often includes a reset of the local Eventlog)
- System provisioning (system reset before the golden image creation)
level: 70
```