Open ondrejfuhrer opened 2 months ago
In the original implementation, we attempted to attribute each dependency to the source file where it was declared. This turned out to be impractical. https://github.com/gradle/actions/blob/main/docs/dependency-submission-faq.md#why-arent-dependencies-be-linked-to-the-source-file-where-they-are-declared
We also tried creating a separate dependency graph for each subproject, but this was also problematic. Many dependencies are resolved in many different projects, and GitHub would treat each of these as a separate dependency usage. This would result in many duplicate security alerts being created. (Imagine a 100 project build where every project used dependency X: then 100 dependency alerts would be created).
We are working with GitHub to come up with a Dependency Graph model that is more suitable for Gradle. In the meantime, feel free to experiment with the Dependency Graph Plugin and see what can be generated.
I understand it's not ideal, but these docs demonstrate the current best practise for determining the underlying cause of a dependency alert: https://github.com/gradle/actions/blob/main/docs/dependency-submission.md#resolving-a-dependency-vulnerability
Thx for the explanation @bigdaz , I appreciate that. I was just thinking, that in the meanwhile if we enable that simply through "manual" setting from whoever is running the job (instead of hardcoded settings.gradle
), might help in the meanwhile and doesn't sound like a big change π€ But it's not ideal at all, that I agree π
Description & Problem statement
Right now, it seems that the source file reported to the dependency submission API is
settings.gradle
(orbuild.gradle
if that doesn't exist). It would be actually great if we can somehow make that more specific for multi-project setups. In cases where we have many projects defined which are included as Java libraries in different projects, it's actually quite hard to figure out from the security alert, which application / library is affected by an alert.Possible solutions
Manual
One solution could be to manually set the resolved file location as a parameter, which would mean we have to run separately the submission job for each project (and only include that project in the report)
Pros:
Cons:
Automated through
project
resolutionThe
dependencies
task returns project dependencies as well (that are labeled asproject :xyz
). This can be used to determine thebuild.gradle
file that is used to define that dependency. That could be used to map out all the projects that live in the particular repository and submit the report with more explicit file source.Pros:
Cons:
If there are any other options / solutions, I'm all ears π
Goal
The goal here is to be able to easily find projects in multi-project gradle setups that have a certain dependency / security vulnerability.