@@ -202,7 +202,7 @@ class AppSecConfigServiceImplSpecification extends DDSpecification {
202
202
then :
203
203
1 * config. isAppSecRaspEnabled() >> true
204
204
1 * config. getAppSecRulesFile() >> null
205
- 1 * config. getAppSecActivation() >> ProductActivation . ENABLED_INACTIVE
205
+ 2 * config. getAppSecActivation() >> ProductActivation . ENABLED_INACTIVE
206
206
1 * poller. addListener(Product . ASM_FEATURES , _, _) >> {
207
207
listeners. savedFeaturesDeserializer = it[1 ]
208
208
listeners. savedFeaturesListener = it[2 ]
@@ -239,7 +239,7 @@ class AppSecConfigServiceImplSpecification extends DDSpecification {
239
239
then :
240
240
1 * config. isAppSecRaspEnabled() >> true
241
241
1 * config. getAppSecRulesFile() >> null
242
- 1 * config. getAppSecActivation() >> ProductActivation . ENABLED_INACTIVE
242
+ 2 * config. getAppSecActivation() >> ProductActivation . ENABLED_INACTIVE
243
243
1 * poller. addListener(Product . ASM_DD , _, _) >> {
244
244
listeners. savedConfDeserializer = it[1 ]
245
245
listeners. savedConfChangesListener = it[2 ]
@@ -273,7 +273,6 @@ class AppSecConfigServiceImplSpecification extends DDSpecification {
273
273
| CAPABILITY_ASM_RASP_SSRF
274
274
| CAPABILITY_ASM_RASP_CMDI
275
275
| CAPABILITY_ASM_RASP_SHI
276
- | CAPABILITY_ASM_RASP_LFI
277
276
| CAPABILITY_ENDPOINT_FINGERPRINT
278
277
| CAPABILITY_ASM_SESSION_FINGERPRINT
279
278
| CAPABILITY_ASM_NETWORK_FINGERPRINT
@@ -393,7 +392,7 @@ class AppSecConfigServiceImplSpecification extends DDSpecification {
393
392
then :
394
393
1 * config. isAppSecRaspEnabled() >> true
395
394
1 * config. getAppSecRulesFile() >> null
396
- 1 * config. getAppSecActivation() >> ProductActivation . ENABLED_INACTIVE
395
+ 2 * config. getAppSecActivation() >> ProductActivation . ENABLED_INACTIVE
397
396
1 * poller. addListener(Product . ASM_DD , _, _) >> {
398
397
listeners. savedConfDeserializer = it[1 ]
399
398
listeners. savedConfChangesListener = it[2 ]
@@ -427,7 +426,6 @@ class AppSecConfigServiceImplSpecification extends DDSpecification {
427
426
| CAPABILITY_ASM_RASP_SSRF
428
427
| CAPABILITY_ASM_RASP_CMDI
429
428
| CAPABILITY_ASM_RASP_SHI
430
- | CAPABILITY_ASM_RASP_LFI
431
429
| CAPABILITY_ENDPOINT_FINGERPRINT
432
430
| CAPABILITY_ASM_SESSION_FINGERPRINT
433
431
| CAPABILITY_ASM_NETWORK_FINGERPRINT
@@ -564,6 +562,67 @@ class AppSecConfigServiceImplSpecification extends DDSpecification {
564
562
autoUserInstrum(' yolo' ) | DISABLED
565
563
}
566
564
565
+ void ' RASP capabilities for LFI is not sent when RASP is not fully enabled ' () {
566
+ AppSecModuleConfigurer.SubconfigListener subconfigListener = Mock ()
567
+ SavedListeners listeners = new SavedListeners ()
568
+ Optional<CurrentAppSecConfig > initialWafConfig
569
+
570
+ when :
571
+ AppSecSystem . active = false
572
+ appSecConfigService. init()
573
+ appSecConfigService. maybeSubscribeConfigPolling()
574
+ def configurer = appSecConfigService. createAppSecModuleConfigurer()
575
+ initialWafConfig = configurer. addSubConfigListener(" waf" , subconfigListener)
576
+ configurer. commit()
577
+
578
+ then :
579
+ 1 * config. isAppSecRaspEnabled() >> true
580
+ 1 * config. getAppSecRulesFile() >> null
581
+ 2 * config. getAppSecActivation() >> ProductActivation . FULLY_ENABLED
582
+ 1 * poller. addListener(Product . ASM_DD , _, _) >> {
583
+ listeners. savedConfDeserializer = it[1 ]
584
+ listeners. savedConfChangesListener = it[2 ]
585
+ }
586
+ 1 * poller. addListener(Product . ASM_DATA , _, _) >> {
587
+ listeners. savedWafDataDeserializer = it[1 ]
588
+ listeners. savedWafDataChangesListener = it[2 ]
589
+ }
590
+ 1 * poller. addListener(Product . ASM , _, _) >> {
591
+ listeners. savedWafRulesOverrideDeserializer = it[1 ]
592
+ listeners. savedWafRulesOverrideListener = it[2 ]
593
+ }
594
+ 1 * poller. addListener(Product . ASM_FEATURES , _, _) >> {
595
+ listeners. savedFeaturesDeserializer = it[1 ]
596
+ listeners. savedFeaturesListener = it[2 ]
597
+ }
598
+ 1 * poller. addConfigurationEndListener(_) >> { listeners. savedConfEndListener = it[0 ] }
599
+ 1 * poller. addCapabilities(CAPABILITY_ASM_API_SECURITY_SAMPLE_RATE )
600
+ 1 * poller. addCapabilities(CAPABILITY_ASM_AUTO_USER_INSTRUM_MODE )
601
+ 1 * poller. addCapabilities(CAPABILITY_ASM_DD_RULES
602
+ | CAPABILITY_ASM_IP_BLOCKING
603
+ | CAPABILITY_ASM_EXCLUSIONS
604
+ | CAPABILITY_ASM_EXCLUSION_DATA
605
+ | CAPABILITY_ASM_REQUEST_BLOCKING
606
+ | CAPABILITY_ASM_USER_BLOCKING
607
+ | CAPABILITY_ASM_CUSTOM_RULES
608
+ | CAPABILITY_ASM_CUSTOM_BLOCKING_RESPONSE
609
+ | CAPABILITY_ASM_TRUSTED_IPS
610
+ | CAPABILITY_ASM_RASP_SQLI
611
+ | CAPABILITY_ASM_RASP_SSRF
612
+ | CAPABILITY_ASM_RASP_CMDI
613
+ | CAPABILITY_ASM_RASP_SHI
614
+ | CAPABILITY_ASM_RASP_LFI
615
+ | CAPABILITY_ENDPOINT_FINGERPRINT
616
+ | CAPABILITY_ASM_SESSION_FINGERPRINT
617
+ | CAPABILITY_ASM_NETWORK_FINGERPRINT
618
+ | CAPABILITY_ASM_HEADER_FINGERPRINT )
619
+ 0 * _. _
620
+ initialWafConfig. get() != null
621
+
622
+ cleanup :
623
+ AppSecSystem . active = true
624
+ }
625
+
567
626
private static AppSecFeatures autoUserInstrum (String mode ) {
568
627
return new AppSecFeatures (). tap { features ->
569
628
features. autoUserInstrum = new AppSecFeatures.AutoUserInstrum (). tap { instrum ->
0 commit comments