-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
New VersionDistance policy to check and report outdated components #2537
Conversation
src/main/java/org/dependencytrack/tasks/repositories/MavenMetaAnalyzer.java
Outdated
Show resolved
Hide resolved
🛠 Lift Auto-fixSome of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1 # Download the patch
curl https://lift.sonatype.com/api/patch/github.com/DependencyTrack/dependency-track/2537.diff -o lift-autofixes.diff
# Apply the patch with git
git apply lift-autofixes.diff
# Review the changes
git diff Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command: curl https://lift.sonatype.com/api/patch/github.com/DependencyTrack/dependency-track/2537.diff | git apply Once you're satisfied, commit and push your changes in your project. Footnotes |
d120b79
to
588931e
Compare
ce81753
to
49fabd1
Compare
src/main/java/org/dependencytrack/persistence/FindingsQueryManager.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/persistence/FindingsQueryManager.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/resources/v1/FindingResource.java
Outdated
Show resolved
Hide resolved
49fabd1
to
84d59b3
Compare
c46b57d
to
0d77fdf
Compare
0d77fdf
to
87b0b02
Compare
a0ceff7
to
18b2310
Compare
bec10e5
to
477ef1e
Compare
src/main/java/org/dependencytrack/persistence/ComponentQueryManager.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/persistence/ComponentQueryManager.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/persistence/ComponentQueryManager.java
Outdated
Show resolved
Hide resolved
src/main/java/org/dependencytrack/resources/v1/ComponentResource.java
Outdated
Show resolved
Hide resolved
1cae90c
to
280aebe
Compare
280aebe
to
c0050b7
Compare
c0050b7
to
03bb1c4
Compare
03bb1c4
to
1c79eac
Compare
595d791
to
30ec3b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@walterdeboer super excited to see this come to life! Been wanting to see how backlevel (versus just an amber).
I do have a question. What happens when the versions have letters in them?? I may not be seeing the code properly, but I'm not seeing anything handling that use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now this works best on SemVer I guess. There is no strict defined math for version numbers, especially when something else than SemVer is used. So it's all best effort here... But I hope this will help al lot for the 95% where decent version numbering is used :-) The first three numbers will be most significant in almost every case. More logic might be added to handle letters but for now I don't feel the urge. Maybe someone else will :-)
@walterdeboer There seems to be a mismatch on the policy condition value, between what the frontend sends and what the evaluator in the API server expects. I have the following condition configured: When this is evaluated, I'm getting these errors logged:
It seems to me that the evaluator is expecting a simple string, but it's getting a JSON object instead. |
Signed-off-by: Walter de Boer <[email protected]>
66f8f34
to
d36f0ce
Compare
@nscuro please try again |
Description
Dependenct Track now supports a Component Age policy and a Component Version policy, but both are unsuitable to detect outdated components. For this the distance between the current component version and it's latest version needs to be analysed.
The VersionDistancePolicyEvaluator evaluates the VersionDistance between a Component's current and it's latest version. The policy "greater than 0:1.?.?" for example, means a difference of only one between the curren version's major number and the latest version's major number is allowed.
Combining VersionDistances is also supported: "greater than 1:1.?.?". This way multiple parts (epoch or major) number can be considered in one go, combining them with a Boolean OR. Not sure yet if this will be supported in the UI...
Addressed Issue
closes #2528, addresses #208, #257
Additional Details
Together with the Age Policy and the Version Policy this would enable advanced policies like "no outdated versions (one major difference), but only if the minor version is at least exactly 1 and when it is older than 21 days. (3.0.0 is to early, but 3.1.0 is considered safe, when it's older than three weeks without a patch release)"
Accompanying PR for the frontend DependencyTrack/frontend#432
Checklist
and I have updated the documentation accordingly