Project

General

Profile

Writing Definitions » History » Version 14

Luke Murphey, 08/13/2010 11:15 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 14 Luke Murphey
Custom definitions must have an ID of 1000000 or more; only official definitions can have IDs of less than 1000000. Below is the range of definitions currently used.
20 14 Luke Murphey
21 14 Luke Murphey
| *ID Range* | *Description*                   |
22 14 Luke Murphey
| 1-222      | General definitions             |
23 14 Luke Murphey
| 2001-3679  | Offensive language definitions  |
24 1 Luke Murphey
25 4 Luke Murphey
h2. Identifying Definition Errors
26 1 Luke Murphey
27 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).
28 1 Luke Murphey
29 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).
30 1 Luke Murphey
31 11 Luke Murphey
h2. Creating Definitions
32 1 Luke Murphey
33 11 Luke Murphey
See the following for detailed information about creating definitions:
34 2 Luke Murphey
35 11 Luke Murphey
 * [[ThreatPattern Definitions|ThreatPattern Definition]]
36 11 Luke Murphey
 * [[ThreatScript Definitions|ThreatScript Definition]]