@@ -54,119 +54,3 @@ jobs:
5454 category : " /language:${{matrix.language}}"
5555 upload : false # Don't upload to avoid conflict with default setup
5656
57- dependency-scan :
58- name : Java Dependency Scan
59- runs-on : ubuntu-latest
60- timeout-minutes : 30
61-
62- steps :
63- - name : Checkout repository
64- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
65-
66- - name : Set up JDK 11
67- uses : actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
68- with :
69- java-version : ' 11'
70- distribution : ' temurin'
71-
72- - name : Setup Gradle
73- uses : gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
74-
75- - name : Run OWASP Dependency Check
76- continue-on-error : true
77- run : |
78- # Download and run OWASP Dependency Check
79- curl -L -o dependency-check-11.1.0-release.zip https://github.com/jeremylong/DependencyCheck/releases/download/v11.1.0/dependency-check-11.1.0-release.zip
80- unzip -q dependency-check-11.1.0-release.zip
81- ./dependency-check/bin/dependency-check.sh \
82- --project "aws-xray-sdk-java" \
83- --scan . \
84- --format SARIF \
85- --out dependency-check-results.sarif \
86- --suppression dependency-check-suppressions.xml \
87- --failOnCVSS 7 \
88- --enableRetired || echo "Dependency check completed"
89-
90- - name : Upload OWASP Dependency Check results to GitHub Security tab
91- uses : github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
92- if : always()
93- with :
94- sarif_file : dependency-check-results.sarif
95- category : ' dependency-check'
96-
97- - name : Run Gradle dependency vulnerability check
98- run : |
99- # Use Gradle's built-in dependency insight
100- ./gradlew dependencyInsight --dependency org.apache.logging.log4j || true
101- ./gradlew dependencies --configuration runtimeClasspath > gradle-dependencies.txt
102-
103- - name : Upload dependency report
104- uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
105- if : always()
106- with :
107- name : dependency-reports
108- path : |
109- dependency-check-results.sarif
110- gradle-dependencies.txt
111-
112- security-scan :
113- name : Java Security Scan
114- runs-on : ubuntu-latest
115- timeout-minutes : 30
116-
117- steps :
118- - name : Checkout repository
119- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
120-
121- - name : Set up JDK 11
122- uses : actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
123- with :
124- java-version : ' 11'
125- distribution : ' temurin'
126-
127- - name : Setup Gradle
128- uses : gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
129-
130- - name : Run SpotBugs security analysis
131- continue-on-error : true
132- run : |
133- # Build the project first (skip tests for faster execution)
134- ./gradlew build -x test --no-daemon || echo "Build completed with warnings"
135-
136- # Download SpotBugs with security plugin
137- curl -L -o spotbugs-4.8.6.tgz https://github.com/spotbugs/spotbugs/releases/download/4.8.6/spotbugs-4.8.6.tgz
138- tar -xzf spotbugs-4.8.6.tgz
139-
140- # Download security plugin
141- curl -L -o findsecbugs-plugin-1.13.0.jar https://github.com/find-sec-bugs/find-sec-bugs/releases/download/version-1.13.0/findsecbugs-plugin-1.13.0.jar
142-
143- # Initialize empty SARIF file
144- echo '{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"SpotBugs","version":"4.8.6"}},"results":[]}]}' > spotbugs-results.sarif
145-
146- # Find and scan JAR files
147- JAR_COUNT=0
148- find . -name "*.jar" -path "*/build/libs/*" -not -path "*/test*" | head -5 | while read jar; do
149- if [ -f "$jar" ]; then
150- echo "Scanning $jar"
151- JAR_COUNT=$((JAR_COUNT + 1))
152- ./spotbugs-4.8.6/bin/spotbugs -textui -effort:max -low -sarif \
153- -pluginList findsecbugs-plugin-1.13.0.jar \
154- -output "spotbugs-${JAR_COUNT}.sarif" \
155- "$jar" || echo "SpotBugs scan completed for $jar"
156- fi
157- done
158-
159- # Merge SARIF files if any were created
160- if ls spotbugs-*.sarif 1> /dev/null 2>&1; then
161- # Simple merge - just use the first one for now
162- cp spotbugs-1.sarif spotbugs-results.sarif 2>/dev/null || echo "Using empty SARIF"
163- fi
164-
165- echo "SpotBugs analysis completed"
166-
167- - name : Upload SpotBugs results to GitHub Security tab
168- uses : github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
169- if : always() && hashFiles('spotbugs-results.sarif') != ''
170- with :
171- sarif_file : spotbugs-results.sarif
172- category : ' spotbugs-security'
0 commit comments