Repository navigation
Policy filter "Limit to project versions marked as latest" has no effect in Policy Violation Audit #8013
|
Hi! The "Limit to project versions marked as latest" policy filter in the Policy Violation Audit view no longer appears to work in Dependency-Track after upgrading to version 5.2.1. When the filter is enabled on policys, policy violations associated with older project versions are still displayed. The filter does not appear to have any effect on the results. The issue seems to be specific to the Policy Violation Audit view. Expected outcome: The filter should consistently exclude policy violations associated with project versions that are not marked as latest. Policy violations associated with older project versions should therefore not be included in the results. Is this a known limitation, or could this be a bug in version 5.2.1? |
Replies: 1 comment 1 reply
|
It looks like a 5.x regression, not something on your side. In 5.2.1 the "Limit to project versions marked as latest" checkbox is saved on the policy, but the policy engine never reads it, so violations get created for every version, latest or not. In 4.x the evaluator skipped the policy for non-latest versions (PolicyEngine.java#L85-L87 at 4.14.6):
In 5.2.1 evaluation goes through the CEL engine, which loads policies with So the audit view is showing what the engine stored, and those violations on old versions are real rows, not a display filter failing. Until it's fixed, the only scoping that 5.2.1 honors is project assignment (with "include children") and tags, so you could tag the latest versions and limit the policy to that tag. I'd also open an issue so it gets tracked as a 4.x parity gap; I couldn't find an existing one. |
It looks like a 5.x regression, not something on your side. In 5.2.1 the "Limit to project versions marked as latest" checkbox is saved on the policy, but the policy engine never reads it, so violations get created for every version, latest or not.
In 4.x the evaluator skipped the policy for non-latest versions (PolicyEngine.java#L85-L87 at 4.14.6):
if (policy.isOnlyLatestProjectVersion() && Boolean.FALSE.equals(component.getProject().isLatest())) continue;In 5.2.1 evaluation goes through the CEL engine, which loads policies with
CelPolicyDao.getApplicablePolicies(called from CelPolicyEngine.java#L129). That query filters by global, assigned project/parents and tags, and has no conditio…