Skip to content

Commit

Permalink
Support processors and scanners updates for API Sec via RC (#3981)
Browse files Browse the repository at this point in the history
  • Loading branch information
uurien authored Jan 30, 2024
1 parent 7c3157e commit 32ea712
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/dd-trace/src/appsec/rule_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ function updateWafFromRC ({ toUnapply, toApply, toModify }) {
item.apply_error = 'Multiple ruleset received in ASM_DD'
} else {
if (file && file.rules && file.rules.length) {
const { version, metadata, rules } = file
const { version, metadata, rules, processors, scanners } = file

newRuleset = { version, metadata, rules }
newRuleset = { version, metadata, rules, processors, scanners }
newRulesetId = id
}

Expand Down
54 changes: 54 additions & 0 deletions packages/dd-trace/test/appsec/rule_manager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,33 @@ describe('AppSec Rule Manager', () => {
'confidence': '1'
},
'conditions': []
}],
processors: [{
id: 'test-processor-id',
generator: 'test-generator',
evaluate: false,
output: true
}],
scanners: [{
id: 'test-scanner-id',
name: 'Test name',
key: {
operator: 'match_regex',
parameters: {
regex: 'test-regex'
}
},
value: {
operator: 'match_regex',
parameters: {
regex: 'test-regex-2'
}
},
tags: {
type: 'card',
card_type: 'test',
category: 'payment'
}
}]
}

Expand Down Expand Up @@ -333,6 +360,33 @@ describe('AppSec Rule Manager', () => {
'confidence': '1'
},
'conditions': []
}],
processors: [{
id: 'test-processor-id',
generator: 'test-generator',
evaluate: false,
output: true
}],
scanners: [{
id: 'test-scanner-id',
name: 'Test name',
key: {
operator: 'match_regex',
parameters: {
regex: 'test-regex'
}
},
value: {
operator: 'match_regex',
parameters: {
regex: 'test-regex-2'
}
},
tags: {
type: 'card',
card_type: 'test',
category: 'payment'
}
}]
}

Expand Down

0 comments on commit 32ea712

Please sign in to comment.