diff --git a/apps/cnspec/cmd/scan.go b/apps/cnspec/cmd/scan.go index 677807eb..c8a26458 100644 --- a/apps/cnspec/cmd/scan.go +++ b/apps/cnspec/cmd/scan.go @@ -324,6 +324,8 @@ func (c *scanConfig) loadPolicies() error { return err } + bundle.ConvertQuerypacks() + _, err = bundle.CompileExt(context.Background(), policy.BundleCompileConf{ Schema: c.runtime.Schema(), // We don't care about failing queries for local runs. We may only diff --git a/policy/bundle.go b/policy/bundle.go index 684a8163..ca49637b 100644 --- a/policy/bundle.go +++ b/policy/bundle.go @@ -148,6 +148,7 @@ func aggregateBundles(a *Bundle, b *Bundle) *Bundle { // merge in a res.Policies = append(res.Policies, a.Policies...) + res.Packs = append(res.Packs, a.Packs...) res.Props = append(res.Props, a.Props...) res.Queries = append(res.Queries, a.Queries...) res.Frameworks = append(res.Frameworks, a.Frameworks...) @@ -155,6 +156,7 @@ func aggregateBundles(a *Bundle, b *Bundle) *Bundle { // merge in b res.Policies = append(res.Policies, b.Policies...) + res.Packs = append(res.Packs, b.Packs...) res.Props = append(res.Props, b.Props...) res.Queries = append(res.Queries, b.Queries...) res.Frameworks = append(res.Frameworks, b.Frameworks...) @@ -181,6 +183,10 @@ func (p *Bundle) ConvertQuerypacks() { for i := range p.Packs { pack := p.Packs[i] + // Remove this once we reach v10 vv + pack.DeprecatedV9_ensureUIDs() + // ^^ + policy := Policy{ Mrn: pack.Mrn, Uid: pack.Uid,