Skip to content

Commit

Permalink
Update libsqreen library to 11.0.1 fixing fingerprint generation
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-alvarez-alvarez committed Sep 20, 2024
1 parent 5867971 commit c2cd812
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dd-java-agent/appsec/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
implementation project(':internal-api')
implementation project(':communication')
implementation project(':telemetry')
implementation group: 'io.sqreen', name: 'libsqreen', version: '11.0.0'
implementation group: 'io.sqreen', name: 'libsqreen', version: '11.0.1'
implementation libs.moshi

testImplementation libs.bytebuddy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,7 @@ class PowerWAFModuleSpecification extends DDSpecification {
void 'http endpoint fingerprint support'() {
given:
final flow = Mock(ChangeableFlow)
final fingerprint = '_dd.appsec.fp.http.endpoint'
setupWithStubConfigService 'fingerprint_config.json'
dataListener = pwafModule.dataSubscriptions.first()
ctx.closeAdditive()
Expand All @@ -1508,12 +1509,15 @@ class PowerWAFModuleSpecification extends DDSpecification {

then:
1 * flow.setAction({ it.blocking })
ctx.derivativeKeys.contains('_dd.appsec.fp.http.endpoint')
1 * ctx.reportDerivatives({ Map<String, String> map ->
map.containsKey(fingerprint) && map.get(fingerprint).matches('http-get-.*')
})
}

void 'http session fingerprint support'() {
given:
final flow = Mock(ChangeableFlow)
final fingerprint = '_dd.appsec.fp.session'
final sessionId = UUID.randomUUID().toString()
setupWithStubConfigService 'fingerprint_config.json'
dataListener = pwafModule.dataSubscriptions.first()
Expand All @@ -1530,7 +1534,9 @@ class PowerWAFModuleSpecification extends DDSpecification {
ctx.closeAdditive()

then:
ctx.derivativeKeys.contains('_dd.appsec.fp.session')
1 * ctx.reportDerivatives({ Map<String, String> map ->
map.containsKey(fingerprint) && map.get(fingerprint).matches('ssn-.*')
})
}

private Map<String, Object> getDefaultConfig() {
Expand Down

0 comments on commit c2cd812

Please sign in to comment.