-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security] Adds field mapping support to rule creation Part I #70288
Changes from all commits
3f6e113
0e8fafa
bf55585
37f7915
1d05806
be0b05f
a3d0075
ac86c2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -261,6 +261,9 @@ describe('add prepackaged rules schema', () => { | |
const message = pipe(checked, foldLeftRight); | ||
expect(getPaths(left(message.errors))).toEqual([]); | ||
const expected: AddPrepackagedRulesSchemaDecoded = { | ||
author: [], | ||
severity_mapping: [], | ||
risk_score_mapping: [], | ||
rule_id: 'rule-1', | ||
risk_score: 50, | ||
description: 'some description', | ||
|
@@ -333,6 +336,9 @@ describe('add prepackaged rules schema', () => { | |
const message = pipe(checked, foldLeftRight); | ||
expect(getPaths(left(message.errors))).toEqual([]); | ||
const expected: AddPrepackagedRulesSchemaDecoded = { | ||
author: [], | ||
severity_mapping: [], | ||
risk_score_mapping: [], | ||
rule_id: 'rule-1', | ||
risk_score: 50, | ||
description: 'some description', | ||
|
@@ -430,6 +436,9 @@ describe('add prepackaged rules schema', () => { | |
const message = pipe(checked, foldLeftRight); | ||
expect(getPaths(left(message.errors))).toEqual([]); | ||
const expected: AddPrepackagedRulesSchemaDecoded = { | ||
author: [], | ||
severity_mapping: [], | ||
risk_score_mapping: [], | ||
rule_id: 'rule-1', | ||
description: 'some description', | ||
from: 'now-5m', | ||
|
@@ -508,6 +517,9 @@ describe('add prepackaged rules schema', () => { | |
const message = pipe(checked, foldLeftRight); | ||
expect(getPaths(left(message.errors))).toEqual([]); | ||
const expected: AddPrepackagedRulesSchemaDecoded = { | ||
author: [], | ||
severity_mapping: [], | ||
risk_score_mapping: [], | ||
rule_id: 'rule-1', | ||
risk_score: 50, | ||
description: 'some description', | ||
|
@@ -1354,6 +1366,9 @@ describe('add prepackaged rules schema', () => { | |
const message = pipe(checked, foldLeftRight); | ||
expect(getPaths(left(message.errors))).toEqual([]); | ||
const expected: AddPrepackagedRulesSchemaDecoded = { | ||
author: [], | ||
severity_mapping: [], | ||
risk_score_mapping: [], | ||
rule_id: 'rule-1', | ||
description: 'some description', | ||
from: 'now-5m', | ||
|
@@ -1404,6 +1419,9 @@ describe('add prepackaged rules schema', () => { | |
const message = pipe(checked, foldLeftRight); | ||
expect(getPaths(left(message.errors))).toEqual([]); | ||
const expected: AddPrepackagedRulesSchemaDecoded = { | ||
author: [], | ||
severity_mapping: [], | ||
risk_score_mapping: [], | ||
rule_id: 'rule-1', | ||
description: 'some description', | ||
from: 'now-5m', | ||
|
@@ -1462,6 +1480,9 @@ describe('add prepackaged rules schema', () => { | |
const message = pipe(checked, foldLeftRight); | ||
expect(getPaths(left(message.errors))).toEqual([]); | ||
const expected: AddPrepackagedRulesSchemaDecoded = { | ||
author: [], | ||
severity_mapping: [], | ||
risk_score_mapping: [], | ||
rule_id: 'rule-1', | ||
description: 'some description', | ||
from: 'now-5m', | ||
|
@@ -1539,6 +1560,9 @@ describe('add prepackaged rules schema', () => { | |
const message = pipe(checked, foldLeftRight); | ||
expect(getPaths(left(message.errors))).toEqual([]); | ||
const expected: AddPrepackagedRulesSchemaDecoded = { | ||
author: [], | ||
severity_mapping: [], | ||
risk_score_mapping: [], | ||
rule_id: 'rule-1', | ||
description: 'some description', | ||
from: 'now-5m', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should add a test where you exercise each of these array values to convince yourself they will work as well as one where you have an invalid data type such as a string instead of an array or a number instead of a string. Then basically cut across the other schemas and add the "proof" that it validates to each of those. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! I've noted and will include those in |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You can use maybe:
OperatorEnum['EQUALS']: null
here. That would reduce one area of manual typing.