diff --git a/pkg/policies/policy_groups.go b/pkg/policies/policy_groups.go index 6822db3d6..85360624d 100644 --- a/pkg/policies/policy_groups.go +++ b/pkg/policies/policy_groups.go @@ -77,6 +77,11 @@ func (pgv *PolicyGroupVerifier) VerifyMaterial(ctx context.Context, material *ap return nil, NewPolicyError(err) } + // Skip loading content if no policies apply to this material + if len(policyAtts) == 0 { + continue + } + // Load material content once for all policies in this group subject, err := material.GetEvaluableContent(path) if err != nil {