-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dependency-check-build-task@6 fails on windows-latest hosted agent since release of DependencyCheck 11.0.0 #169
Comments
I have a workaround for this issue, explicably set the JAVA version using the This is done using the following YAML - task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: dependency-check-build-task@6
displayName: Dependency Check
inputs:
projectName: 'My Project'
scanPath: 'src'
format: 'HTML,XML'
additionalArguments: '--nvdApiKey $(nvdapikey)' I think this is perfectly valid solution, but I wanted to log it as an issue so either
|
The joys of using latest - even when latest could have bumped a major version indicating breaking changes... semantic versioning ftw. |
It gets better... To speed up the running of this task we use a pipeline cache to pre-populate the vulnerabilities DB to save up to 15 min on a pipeline run
It seems with 11.0.0 the vulnerabilities DB format has changed.
The fix is simple, alter the key name of the cache so a new one is created. This is easier than trying to purge the old copy for any given branch. The cache is short lived and will be deleted in a 7 days, so there will be old data left around
But another change to be aware of |
I still get error for - task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: dependency-check-build-task@6
inputs:
projectName: 'DevSecOps'
scanPath: '**/*.js'
enableVerbose: true
additionalArguments: '--updateonly --data "$(Build.ArtifactStagingDirectory)/owaspdata"'
nvdApiKey: '$(NVDApiKey)'
displayName: OWASP Data Update Error :
|
The |
Can this task be updated to find an appropriate Java version automatically? So we don't have to change the default in every pipeline from 8 to 11? We run pipelines on the Microsoft image windows-2022 which comes with Java versions 8 (default), 11, 17, and 21, and each has an environment variable to find it as described here. |
I think the issues is this task downloads the 'current' version of the DependancyCheck tool. It does not know about any change in requirement for a new release of the tool, so automation of the correct version is non-trivial |
it was quite easy to fix for us: We added a step with --purge instead of update database. Store the database as pipeline artifact and usually just updates it. Added the purge step once, ran the pipeline and then disabled the purge step and everything just works fine. pool: steps:
And this is another pipeline that uses that pipelineartifact to run checks on a repo pool: steps:
|
I think it's out of scope for this task to install a fitting Java version, that's for another step in the pipeline to do. Regrading using the latest version that's a bit dangerous when there's breaking changes, but it's actually a setting for this task - maybe this is solved by making this setting a bit more explicit? |
I agree with Saturate from above. In my situation speed of getting back to deployment was more critical, so I took the path of pinning the dependency check CLI to the last working version, v10.0.4. See below for the line I added to the pipeline task inputs list: task: dependency-check-build-task@6
condition: succeeded()
displayName: Run Checks
inputs:
additionalArguments: >
--data $(nvdCacheDirectory)
--noupdate
dependencyCheckVersion: 10.0.4 <-- ADDED THIS LINE
failOnCVSS: $(FailOnCVSS)
format: HTML, JSON, JUNIT
scanPath: '**/*.csproj My pipeline was back up and running without issue. When I have more time I will dig into making the correct Java version available and purging the older NVD cache data. |
Describe the bug
My pipeline was working as expected this morning, but is not failing with the error shown below, I had made YAML edits
Looking at the DependencyCheck project site it seems version 11.0.0 was shipped around 11am this morning, around the time the error started to appear.
It seems 11.0.0 requires a newer version of JAVA than 10.x.x required, and though the
windows-latest
hosted build agents have various version of JAVA installed, the task is defaulting to use JDK 8 (52.0)To Reproduce
Steps to reproduce the behavior:
Expected behavior
Analysis should occur when the current V11.x.x of the underlying tool is automatically downloaded used.
The text was updated successfully, but these errors were encountered: