Project

General

Profile

Writing Definitions » History » Version 13

Luke Murphey, 04/23/2010 01:33 PM

1 9 Luke Murphey
{{>toc}}
2 9 Luke Murphey
3 4 Luke Murphey
h1. Definitions
4 1 Luke Murphey
5 1 Luke Murphey
h2. Definition Types
6 1 Luke Murphey
7 12 Luke Murphey
NSIA supports two types of definitions, see below for a comparison:
8 2 Luke Murphey
9 3 Luke Murphey
|*ThreatScript*                                                       |*ThreatPattern*|
10 2 Luke Murphey
|Written in ECMAScript / JavaScript                                   |Written in a format similar to Snort|
11 2 Luke Murphey
|Somewhat complex to create                                           |Simple and easy to create|
12 4 Luke Murphey
|Can auto-baseline tune itself                                        |Must be ignored completely when it triggers as a false positive|
13 2 Luke Murphey
|Is stateful (remember things from previous scans)                    |Is stateless (cannot remember things from previous scans)|
14 2 Luke Murphey
|Are slower than ThreatSignatures                                     |Are faster than ThreatScripts|
15 1 Luke Murphey
|Very flexible detection logic; can be used to detect nearly anything |Functionality limited to what regular expressions|
16 2 Luke Murphey
17 4 Luke Murphey
h2. Definition IDs
18 1 Luke Murphey
19 2 Luke Murphey
Custom definitions must have an ID of 1000000 or more; only official definitions can have IDs of less than 1000000.
20 1 Luke Murphey
21 4 Luke Murphey
h2. Identifying Definition Errors
22 1 Luke Murphey
23 1 Luke Murphey
NSIA will parse definitions before they are saved in order to identify syntax and some semantic errors. Errors that are discovered during runtime are noted on the definition errors page (e.g. http://127.0.0.1:8080/Definitions/Errors) and in the event logs (e.g. http://127.0.0.1:8080/System/Eventlog).
24 1 Luke Murphey
25 13 Luke Murphey
Note that ThreatScript definitions will be flagged as having an error if they fail to complete within 10 seconds (see ScriptDefinition.MAX_SCRIPT_RUNTIME in source:trunk/src/net/lukemurphey/nsia/scan/ScriptDefinition.java).
26 1 Luke Murphey
27 11 Luke Murphey
h2. Creating Definitions
28 1 Luke Murphey
29 11 Luke Murphey
See the following for detailed information about creating definitions:
30 2 Luke Murphey
31 11 Luke Murphey
 * [[ThreatPattern Definitions|ThreatPattern Definition]]
32 11 Luke Murphey
 * [[ThreatScript Definitions|ThreatScript Definition]]