Skip to content

Commit 64ac06a

Browse files
committed
feat(config,rules): Add authors field in rule definition
The new authors field allows specifying one or more authors of the detection rule.
1 parent e0e4541 commit 64ac06a

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

pkg/config/_fixtures/filters/default.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ notes: |
2323
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
2424
Ut ut ante id ligula molestie varius. Duis efficitur eros
2525
quis turpis accumsan, nec scelerisque libero euismod.
26+
authors:
27+
- rabbitstack
28+
- skynova

pkg/config/filters.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type FilterConfig struct {
5555
Notes string `json:"notes" yaml:"notes"`
5656
MinEngineVersion string `json:"min-engine-version" yaml:"min-engine-version"`
5757
Enabled *bool `json:"enabled" yaml:"enabled"`
58+
Authors []string `json:"authors" yaml:"authors"`
5859
}
5960

6061
// FilterAction wraps all possible filter actions.

pkg/config/filters_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func TestLoadRulesFromPaths(t *testing.T) {
5858
assert.NotNil(t, f1.Action)
5959
assert.Contains(t, f1.References, "ref2")
6060
assert.NotEmpty(t, f1.Notes)
61+
assert.Len(t, f1.Authors, 2)
6162

6263
acts, err := f1.DecodeActions()
6364
require.NoError(t, err)

pkg/config/schema_windows.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ var rulesSchema = `
524524
},
525525
"tags": {"type": "array", "items": [{"type": "string", "minLength": 1}]},
526526
"references": {"type": "array", "items": [{"type": "string", "minLength": 1}]},
527+
"authors": {"type": "array", "items": [{"type": "string", "minLength": 1}]},
527528
"action": {
528529
"type": "array",
529530
"items": {

0 commit comments

Comments
 (0)