Skip to content

Commit

Permalink
Transformer integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilm3 committed Jul 27, 2023
1 parent 98b01f8 commit 2f5819f
Show file tree
Hide file tree
Showing 14 changed files with 1,172 additions and 0 deletions.
858 changes: 858 additions & 0 deletions tests/integration/transformers/test.cpp

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/js_decode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ js_decode ]
regex: A JS transformation
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ jsDecode ]
regex: A JS transformation
14 changes: 14 additions & 0 deletions tests/integration/transformers/yaml/lowercase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ lowercase ]
regex: arachni
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/normalize_path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ normalize_path ]
regex: /etc/passwd
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ normalizePath ]
regex: /etc/passwd
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/normalize_path_win.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ normalize_path_win ]
regex: /etc/passwd
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ normalizePathWin ]
regex: /etc/passwd
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/remove_comments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ remove_comments ]
regex: passwd
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ removeComments ]
regex: passwd
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/remove_nulls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ remove_nulls ]
regex: /etc/passwd
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ removeNulls ]
regex: /etc/passwd
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/shell_unescape.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ shell_unescape ]
regex: /etc/passwd
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ cmdLine ]
regex: /etc/passwd
14 changes: 14 additions & 0 deletions tests/integration/transformers/yaml/unicode_normalize.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ unicode_normalize ]
regex: /etc/passwd
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/url_basename.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ url_basename ]
regex: index.php
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ _sqr_basename ]
regex: index.php
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/url_decode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ url_decode_iis ]
regex: an attack value
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ urlDecodeUni ]
regex: an attack value
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/url_decode_iis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ url_decode ]
regex: an attack value
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ urlDecode ]
regex: an attack value
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/url_path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ url_path ]
regex: /path/to/index.php
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ _sqr_filename ]
regex: /path/to/index.php
26 changes: 26 additions & 0 deletions tests/integration/transformers/yaml/url_querystring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2.1'
rules:
- id: 1
name: rule1
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value1
transformers: [ url_querystring ]
regex: a=b
- id: 2
name: rule2
tags:
type: flow1
category: category1
conditions:
- operator: match_regex
parameters:
inputs:
- address: value2
transformers: [ _sqr_querystring ]
regex: a=b

0 comments on commit 2f5819f

Please sign in to comment.