Skip to content
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

Data Folder Location #158

Closed
T1mey opened this issue Apr 8, 2024 · 15 comments
Closed

Data Folder Location #158

T1mey opened this issue Apr 8, 2024 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@T1mey
Copy link

T1mey commented Apr 8, 2024

Hello,

it seems that the folder of the cache data was moved with version 6.2.0.

From
$(Agent.WorkFolder)_tasks\dependency-check-build-task**..\dependency-check\data

to

/home/vsts/work/1/s/dependency-check/data

As we can't download all definitions during each pipeline run we need to cache the data dir upfront and restore it once a owasp scan is executed. We're wondering why this is now located in the work dir?

As well if this is right how can we construct the path of the cache dir using variables before OWASP runs?

@T1mey T1mey added the bug Something isn't working label Apr 8, 2024
@pippolino pippolino self-assigned this Apr 8, 2024
@mobijmartinez
Copy link

Hi, this move has also affected the detection as now Dependency Check includes its own dependencies in the scan, and has found some high ones (in our case failing the pull request pipelines in the process).

image

@pippolino
Copy link
Collaborator

Hi @T1mey, since version v6.2.0 the plugin structure has changed, however you can set the location of the data directory used to store persistent data via additionalArguments by setting --data or -d, see parameters at DependencyCheck Command Line Arguments

@pippolino
Copy link
Collaborator

Hi @mobijmartinez, the dependencies of the Dependency Check tool do not depend from the Azure DevOps plugin.

@mobijmartinez
Copy link

Hi @pippolino , thanks for your answer.

The issue is that the tool is downloaded into the /home/vsts/work/1/s/ directory now, which is also the directory where the default repository is downloaded (the Build.SourcesDirectory variable). When performing a scan on this directory the scan also includes the /home/vsts/work/1/s/dependency-check/lib directory and fails the build as there are vulnerable dependencies within.

From the task, unless I download and install manually Dependency Check, I have no way (afaik) of customizing the install directory of the tool.

@T1mey
Copy link
Author

T1mey commented Apr 8, 2024

ed (the Build.SourcesDirectory variable). When performing a s

Yes this was as well our assumption this morning... As the folder is now in the same checkout dir as our repo.

@pippolino
Copy link
Collaborator

pippolino commented Apr 8, 2024

Hi @mobijmartinez @T1mey, this hasn't changed from the previous version. Let's check this point further, I'll check the code, it might have been something unwanted.

@mobijmartinez
Copy link

mobijmartinez commented Apr 8, 2024

From our side the issue has resolved on its own. PRs started to work again 🤔

Nope, issue still there

@lennartb-
Copy link

lennartb- commented Apr 9, 2024

We have the same issue. I'm not super deep into our pipeline, but previously we downloaded the database once, and it was placed inside the directory of the task itself, for example, C:\agent\_work\_tasks\dependency-check-build-task_47ea1f4a-57ba-414a-b12e-c44f42765e72\6.1.3\dependency-check\data. The pipelines that perform the check took the database from that directory automatically (?, we don't seem to have configured the location of the database manually). This now fails, as the default data directory seems to be inside the work folder for our initial download task. Unless the behavior is reverted, I guess we'd have to point data.directory to an explicit directory, shared by all pipelines?

@T1mey
Copy link
Author

T1mey commented Apr 9, 2024

he previous version. Let's check this point further, I'll check the code, it might have been something unwanted.

From our experience the folder locations seems to be changed.

As outlined by @mobijmartinez the main problem is that the azure devops extension positions the owasp binaries in the work folder. As a result of that an owasp scan will scan it's own libs.

Before the change the binaries were located in _tasks folder.

@pippolino
Copy link
Collaborator

Hi @T1mey, I found a possible cause. I'm working on restoring functionality

pippolino added a commit that referenced this issue Apr 10, 2024
@T1mey
Copy link
Author

T1mey commented Apr 10, 2024

@pippolino Did you break smth. else?
image

@tegidi
Copy link

tegidi commented Apr 10, 2024

Looks like the creation of the directory - when not available - was removed: #159 (comment)

@Wes-Love
Copy link

This has broken all my builds. New Issue raised #161

@pippolino
Copy link
Collaborator

pippolino commented Apr 10, 2024

The version 6.2.3 has been released with a fix.

@lennartb-
Copy link

Can confirm that 6.2.3 works as expected for us, no manual changes necessary 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants