diff --git a/.vscode/launch.json b/.vscode/launch.json index cf34254d..01b2d09d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -21,17 +21,17 @@ "program": "${fileDirname}" }, { - "name": "Scan local bundle (incognito)", + "name": "Scan local bundle", "type": "go", "request": "launch", "program": "${workspaceRoot}/apps/cnspec/cnspec.go", "cwd": "${workspaceRoot}/", "args": [ "scan", - "local", - "--incognito", + // "local", + // "--incognito", "-f", - "policy/examples/example.yaml" + "examples/example.mql.yaml" ] }, { diff --git a/go.mod b/go.mod index ce748cf9..2318f893 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/spf13/pflag v1.0.6-0.20201009195203-85dd5c8bc61c github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 - go.mondoo.com/cnquery v0.0.0-20230911123022-e4bde714aeaa + go.mondoo.com/cnquery v0.0.0-20230913055208-5e5bbc8340f8 go.mondoo.com/ranger-rpc v0.5.1 go.opentelemetry.io/otel v1.16.0 golang.org/x/sync v0.3.0 // indirect diff --git a/go.sum b/go.sum index 8c6a2e85..0581fb3a 100644 --- a/go.sum +++ b/go.sum @@ -1053,10 +1053,8 @@ gitlab.com/bosi/decorder v0.4.1 h1:VdsdfxhstabyhZovHafFw+9eJ6eU0d2CkFNJcZz/NU4= gitlab.com/bosi/decorder v0.4.1/go.mod h1:jecSqWUew6Yle1pCr2eLWTensJMmsxHsBwt+PVbkAqA= go-simpler.org/assert v0.6.0 h1:QxSrXa4oRuo/1eHMXSBFHKvJIpWABayzKldqZyugG7E= go-simpler.org/assert v0.6.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= -go.mondoo.com/cnquery v0.0.0-20230911045628-392fb78e3a5b h1:CVA5KflTikF0PLQp5M23Qasvy/ePHVHvnw6HDUXbgnc= -go.mondoo.com/cnquery v0.0.0-20230911045628-392fb78e3a5b/go.mod h1:gnKfYkas9di8/5WNwHT1gtWKy9BTp9u531iXBihm+L0= -go.mondoo.com/cnquery v0.0.0-20230911123022-e4bde714aeaa h1:7t6xM2vgb+Hh1Vt8YMcuDMoqMJKAd7lstP75zdiGsmE= -go.mondoo.com/cnquery v0.0.0-20230911123022-e4bde714aeaa/go.mod h1:gnKfYkas9di8/5WNwHT1gtWKy9BTp9u531iXBihm+L0= +go.mondoo.com/cnquery v0.0.0-20230913055208-5e5bbc8340f8 h1:htbm7sdHQxzErfXnLBsqSLa/BJb46jTS/H0OaloSTZA= +go.mondoo.com/cnquery v0.0.0-20230913055208-5e5bbc8340f8/go.mod h1:gnKfYkas9di8/5WNwHT1gtWKy9BTp9u531iXBihm+L0= go.mondoo.com/ranger-rpc v0.5.1 h1:OaVQntDJWDRgbc9nXBP4wOCR9h9Bij8LgHHs86IguGk= go.mondoo.com/ranger-rpc v0.5.1/go.mod h1:3YKcqFrlPgaB4FZ4EoLgdmRtwMQdO7RoAkZYFn+F1eY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= diff --git a/policy/resolver_test.go b/policy/resolver_test.go index 6dae1c3b..7944f9fb 100644 --- a/policy/resolver_test.go +++ b/policy/resolver_test.go @@ -197,7 +197,7 @@ policies: mql: asset.name == "definitely not the asset name" queries: - uid: query1 - mql: asset{*} + mql: asset.arch - uid: policy-ignored owner_mrn: //test.sth groups: @@ -208,7 +208,7 @@ policies: mql: asset.name == "definitely not the asset name" queries: - uid: query1 - mql: asset{*} + mql: asset.arch `) srv := initResolver(t, []*testAsset{ @@ -223,9 +223,9 @@ policies: require.NoError(t, err) require.NotNil(t, rp) require.Len(t, rp.CollectorJob.ReportingJobs, 4) - ignoreJob := rp.CollectorJob.ReportingJobs["KA46R+nvZXs="] + ignoreJob := rp.CollectorJob.ReportingJobs["lTbmPQz/DwA="] require.NotNil(t, ignoreJob) - childJob := ignoreJob.ChildJobs["0yAvYregRkA="] + childJob := ignoreJob.ChildJobs["DmPNGpL6IXo="] require.NotNil(t, childJob) require.Equal(t, explorer.ScoringSystem_IGNORE_SCORE, childJob.Scoring) })