Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/YAMLFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,28 @@ name

*Note: The name specified here is used as part of the test execution name, in conjunction with the test_title.

annotation
----
**Description**: Arbitrary meta data that can be used by programs that extend FTW.

**Syntax:** ```annotation: "<object of any type>"```

**Example Usage:**

```
annotation:
test-sets: ["test-setA", "test-setX"]
```

**Default Value:** ""

**Scope:** Metadata

**Added Version:** TBF

*Note: This field itself has no effect on FTW.
However, programs that extend the FTW can use this field to embed arbitrary metadata in each test file in a format they define.

Tests Parameters
================
The tests area is made up of multiple tests. Each test contains Stages and an optional rule_id. Within the Stage there is additional information that is outlined in Stage Parameters
Expand Down Expand Up @@ -124,6 +146,30 @@ desc

*Note: this keyword isn't mandatory, and not part of the structure of test case, ftw doesn't use it*

annotation
----
**Description**: Arbitrary meta data that can be used by programs that extend FTW.

**Syntax:** ```annotation: "<object of any type>"```

**Example Usage:**

```
annotation:
skip:
runtime:
is: modsec3-nginx
```

**Default Value:** ""

**Scope:** Tests

**Added Version:** TBF

*Note: This field itself has no effect on FTW.
However, programs that extend the FTW can use this field to embed arbitrary metadata per test case in a format they define.

Stage Parameters
================
There can be multiple stages per test. Each stage represents a single request/response. Each stage parameter encapsulates an input and output parameters.
Expand Down
6 changes: 6 additions & 0 deletions ftw/ruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ def __init__(self, test_dict, ruleset_meta):
self.enabled = True
if 'enabled' in self.test_dict:
self.enabled = self.test_dict['enabled']
self.annotation = None
if 'annotation' in self.test_dict:
self.annotation = self.test_dict['annotation']

def build_stages(self):
"""
Expand All @@ -175,6 +178,9 @@ def __init__(self, yaml_file):
self.author = self.meta['author']
self.description = self.meta['description']
self.enabled = self.meta['enabled']
self.annotation = None
if 'annotation' in self.meta:
self.annotation = self.meta['annotation']
self.tests = self.extract_tests() if self.enabled else []

def extract_tests(self):
Expand Down