Skip to content

Commit 9a628e6

Browse files
authored
update tests
1 parent 38cb54d commit 9a628e6

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

packages/dd-trace/test/appsec/rasp/command_injection.spec.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ describe('RASP - command_injection.js', () => {
105105

106106
start.publish(ctx)
107107

108-
const persistent = { [addresses.SHELL_COMMAND]: 'cmd' }
108+
const ephemeral = { [addresses.SHELL_COMMAND]: 'cmd' }
109109
sinon.assert.calledOnceWithExactly(
110-
waf.run, { persistent }, req, { type: 'command_injection', variant: 'shell' }
110+
waf.run, { ephemeral }, req, { type: 'command_injection', variant: 'shell' }
111111
)
112112
})
113113

@@ -122,9 +122,9 @@ describe('RASP - command_injection.js', () => {
122122

123123
start.publish(ctx)
124124

125-
const persistent = { [addresses.SHELL_COMMAND]: ['cmd', 'arg0', 'arg1'] }
125+
const ephemeral = { [addresses.SHELL_COMMAND]: ['cmd', 'arg0', 'arg1'] }
126126
sinon.assert.calledOnceWithExactly(
127-
waf.run, { persistent }, req, { type: 'command_injection', variant: 'shell' }
127+
waf.run, { ephemeral }, req, { type: 'command_injection', variant: 'shell' }
128128
)
129129
})
130130

@@ -154,9 +154,9 @@ describe('RASP - command_injection.js', () => {
154154

155155
start.publish(ctx)
156156

157-
const persistent = { [addresses.EXEC_COMMAND]: ['ls'] }
157+
const ephemeral = { [addresses.EXEC_COMMAND]: ['ls'] }
158158
sinon.assert.calledOnceWithExactly(
159-
waf.run, { persistent }, req, { type: 'command_injection', variant: 'exec' }
159+
waf.run, { ephemeral }, req, { type: 'command_injection', variant: 'exec' }
160160
)
161161
})
162162

@@ -171,9 +171,9 @@ describe('RASP - command_injection.js', () => {
171171

172172
start.publish(ctx)
173173

174-
const persistent = { [addresses.EXEC_COMMAND]: ['ls', '-la', '/tmp'] }
174+
const ephemeral = { [addresses.EXEC_COMMAND]: ['ls', '-la', '/tmp'] }
175175
sinon.assert.calledOnceWithExactly(
176-
waf.run, { persistent }, req, { type: 'command_injection', variant: 'exec' }
176+
waf.run, { ephemeral }, req, { type: 'command_injection', variant: 'exec' }
177177
)
178178
})
179179

packages/dd-trace/test/appsec/rasp/lfi.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ describe('RASP - lfi.js', () => {
108108

109109
fsOperationStart.publish(ctx)
110110

111-
const persistent = { [FS_OPERATION_PATH]: path }
112-
sinon.assert.calledOnceWithExactly(waf.run, { persistent }, req, { type: 'lfi' })
111+
const ephemeral = { [FS_OPERATION_PATH]: path }
112+
sinon.assert.calledOnceWithExactly(waf.run, { ephemeral }, req, { type: 'lfi' })
113113
})
114114

115115
it('should NOT analyze lfi for child fs operations', () => {

packages/dd-trace/test/appsec/rasp/sql_injection.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ describe('RASP - sql_injection', () => {
5151

5252
pgQueryStart.publish(ctx)
5353

54-
const persistent = {
54+
const ephemeral = {
5555
[addresses.DB_STATEMENT]: 'SELECT 1',
5656
[addresses.DB_SYSTEM]: 'postgresql'
5757
}
58-
sinon.assert.calledOnceWithExactly(waf.run, { persistent }, req, { type: 'sql_injection' })
58+
sinon.assert.calledOnceWithExactly(waf.run, { ephemeral }, req, { type: 'sql_injection' })
5959
})
6060

6161
it('should not analyze sql injection if rasp is disabled', () => {
@@ -122,11 +122,11 @@ describe('RASP - sql_injection', () => {
122122

123123
mysql2OuterQueryStart.publish(ctx)
124124

125-
const persistent = {
125+
const ephemeral = {
126126
[addresses.DB_STATEMENT]: 'SELECT 1',
127127
[addresses.DB_SYSTEM]: 'mysql'
128128
}
129-
sinon.assert.calledOnceWithExactly(waf.run, { persistent }, req, { type: 'sql_injection' })
129+
sinon.assert.calledOnceWithExactly(waf.run, { ephemeral }, req, { type: 'sql_injection' })
130130
})
131131

132132
it('should not analyze sql injection if rasp is disabled', () => {

packages/dd-trace/test/appsec/rasp/ssrf.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ describe('RASP - ssrf.js', () => {
5151

5252
httpClientRequestStart.publish(ctx)
5353

54-
const persistent = { [addresses.HTTP_OUTGOING_URL]: 'http://example.com' }
55-
sinon.assert.calledOnceWithExactly(waf.run, { persistent }, req, { type: 'ssrf' })
54+
const ephemeral = { [addresses.HTTP_OUTGOING_URL]: 'http://example.com' }
55+
sinon.assert.calledOnceWithExactly(waf.run, { ephemeral }, req, { type: 'ssrf' })
5656
})
5757

5858
it('should not analyze ssrf if rasp is disabled', () => {

0 commit comments

Comments
 (0)