Skip to content

Commit

Permalink
🔼 upgrade cnquery (#720)
Browse files Browse the repository at this point in the history
- plus: 🐛 the vscode launcher and simplify it (optionally, uncomment if
you want them)
- plus: 🟢 avoid having to update tests any time `asset` changes its
fields

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus authored Sep 13, 2023
1 parent 484a19a commit 278ba87
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
8 changes: 4 additions & 4 deletions policy/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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{
Expand All @@ -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)
})
Expand Down

0 comments on commit 278ba87

Please sign in to comment.