@@ -64,21 +64,24 @@ subprojects {
6464 testCompileOnly(libs. lombok)
6565 testAnnotationProcessor(libs. lombok)
6666
67- // Security constraints
68- constraints {
69- implementation(" ch.qos.logback:logback-core:1.5.15" ) {
70- because(" versions below 1.5.15 have security vulnerabilities - see dependabot #7, #6" )
71- }
72- implementation(" ch.qos.logback:logback-classic:1.5.15" ) {
73- because(" versions below 1.5.15 have security vulnerabilities - see dependabot #7, #6" )
74- }
75- implementation(" org.springframework:spring-web:6.2.8" ) {
76- because(" versions below 6.2.8 have security vulnerabilities including CVE-2024-38820 - see dependabot #12" )
77- }
78- implementation(" org.apache.tomcat.embed:tomcat-embed-core:10.1.42" ) {
79- because(" versions below 10.1.42 have security vulnerabilities including CVE-2024-56337 - see dependabot #13" )
67+ // Security constraints - force minimum versions for vulnerable dependencies
68+ def enforceMinVersion = { groupId , artifactId , minVersion , reason ->
69+ return { details ->
70+ if (details. requested. group == groupId && details. requested. name == artifactId) {
71+ def parse = { String v -> v. tokenize(' .' ). collect { it. padLeft(3 , ' 0' ) }. join() }
72+ def current = parse(details. requested. version)
73+ def minimum = parse(minVersion)
74+ if (current < minimum) {
75+ details. useVersion minVersion
76+ details. because reason
77+ }
78+ }
8079 }
8180 }
81+ configurations. configureEach {
82+ resolutionStrategy. eachDependency enforceMinVersion(' org.springframework' , ' spring-web' , ' 6.2.8' , ' versions below 6.2.8 have security vulnerabilities including CVE-2024-38820 - see dependabot #12' )
83+ resolutionStrategy. eachDependency enforceMinVersion(' org.apache.tomcat.embed' , ' tomcat-embed-core' , ' 10.1.42' , ' versions below 10.1.42 have security vulnerabilities including CVE-2024-56337 - see dependabot #13' )
84+ }
8285 }
8386
8487 checkstyle {
0 commit comments