Skip to content

Commit

Permalink
Fix appsec session_id smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-alvarez-alvarez committed Jan 2, 2025
1 parent a8933e8 commit 6cd2d89
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -539,18 +539,18 @@ class SpringBootSmokeTest extends AbstractAppSecServerSmokeTest {
waitForTraceCount(2)
secondResponse.code() == 403
secondResponse.body().string().contains('You\'ve been blocked')
final rootSpan = this.rootSpans.find { it.meta['usr.session_id'] != null }
rootSpan != null
assert rootSpan.meta.get('appsec.blocked') == 'true', 'appsec.blocked is not set'
assert rootSpan.meta.get('_dd.appsec.json') != null, '_dd.appsec.json is not set'
final blockedSpans = this.rootSpans.findAll {
it.meta['_dd.appsec.json'] != null
}
assert !blockedSpans.empty, 'appsec.blocked is not set'
def trigger = null
for (t in rootSpan.triggers) {
for (t in blockedSpans.triggers.flatten()) {
if (t['rule']['id'] == '__test_session_id_block') {
trigger = t
break
}
}
assert trigger != null, 'test trigger not found'
assert trigger != null, 'session_id block trigger not found'
}

void 'rasp blocks on CMDI'() {
Expand Down

0 comments on commit 6cd2d89

Please sign in to comment.