File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ #  the benefit of this over renovate is that this also analyzes transitive dependencies
2+ #  while renovate (at least currently) only analyzes top-level dependencies
3+ name : OWASP dependency check (daily) 
4+ 
5+ on :
6+   schedule :
7+     #  daily at 1:30 UTC
8+     - cron : " 30 1 * * *" 
9+   workflow_dispatch :
10+ 
11+ permissions :
12+   contents : read 
13+ 
14+ jobs :
15+   analyze :
16+     runs-on : ubuntu-latest 
17+     steps :
18+       - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  #  v4.2.2
19+ 
20+       - name : Set up JDK for running Gradle 
21+         uses : actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12  #  v4.7.0
22+         with :
23+           distribution : temurin 
24+           java-version : 17 
25+ 
26+       - name : Increase gradle daemon heap size 
27+         run : | 
28+           sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties 
29+ 
30+ uses : gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b  #  v4.3.0
31+ 
32+       - run : ./gradlew dependencyCheckAnalyze 
33+         env :
34+           NVD_API_KEY : ${{ secrets.NVD_API_KEY }} 
35+ 
36+       - name : Upload report 
37+         if : always() 
38+         uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08  #  v4.6.0
39+         with :
40+           path : " **/build/reports" 
41+ 
42+   workflow-notification :
43+     needs :
44+       - analyze 
45+     if : always() 
46+     uses : ./.github/workflows/reusable-workflow-notification.yml 
47+     with :
48+       success : ${{ needs.analyze.result == 'success' }} 
Original file line number Diff line number Diff line change @@ -58,3 +58,7 @@ afterEvaluate {
5858    }
5959  }
6060}
61+ 
62+ dependencyCheck {
63+   skip =  true 
64+ }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ dependencies {
1515  implementation(" com.diffplug.spotless:spotless-plugin-gradle:7.0.2" 
1616  implementation(" net.ltgt.gradle:gradle-errorprone-plugin:4.1.0" 
1717  implementation(" net.ltgt.gradle:gradle-nullaway-plugin:2.2.0" 
18+   implementation(" org.owasp:dependency-check-gradle:12.0.2" 
1819}
1920
2021spotless {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ plugins {
77
88  id(" otel.errorprone-conventions" 
99  id(" otel.spotless-conventions" 
10+   id(" org.owasp.dependencycheck" 
1011}
1112
1213val  otelJava =  extensions.create<OtelJavaExtension >(" otelJava" 
@@ -188,3 +189,10 @@ afterEvaluate {
188189    }
189190  }
190191}
192+ 
193+ dependencyCheck {
194+   scanConfigurations =  mutableListOf (" runtimeClasspath" 
195+   failBuildOnCVSS =  7.0f  //  fail on high or critical CVE
196+   nvd.apiKey =  System .getenv(" NVD_API_KEY" 
197+   nvd.delay =  3500  //  until next dependency check release (https://github.com/jeremylong/DependencyCheck/pull/6333)
198+ }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments