mondoohq / cnquery

open source, cloud-native, graph-based asset inventory

Home Page:https://cnquery.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

props in cnquery packs not working (go panic)

atomic111 opened this issue · comments

i have created the following query pack with a prop:

packs:
  - uid: testing
    name: Testing props
    filters:
      - asset.family.contains("unix")
    queries:
      - uid: testing-1
        title: get open ports
        props:
          - uid: testingProp
            title: get all shodan results
            query: |
              command("ls").stdout
        mql: |
         props.testingProp

the cnquery run fails with a go panic:

cnquery scan -f example-pack.mql.yaml
→ no provider specified, defaulting to local. Use --help to see all providers.
→ found a new version for 'os' provider installed=10.2.0 latest=10.2.1
→ successfully installed os provider path=/Users/atomic111/.config/mondoo/providers/os version=10.2.1
→ loaded configuration from /Users/atomic111/.config/mondoo/mondoo.yml using source default
→ using service account credentials
! Scanning with local bundles will switch into --incognito mode by default. Your results will not be sent upstream.
→ discover related assets for 1 asset(s)
panic: no callback points

goroutine 93 [running]:
go.mondoo.com/cnquery/v10/llx.(*MQLExecutorV2)._newBlockExecutor(0x140000af7a0, 0x100000000, 0x1400547eb30, 0x0)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/llx/llx.go:230 +0x680
go.mondoo.com/cnquery/v10/llx.NewExecutorV2(0x14005468c60, {0x103523078, 0x1400099c700}, 0x0, 0x1400547eb30)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/llx/llx.go:169 +0x148
go.mondoo.com/cnquery/v10/explorer/executor.(*instance).runQuery(0x140054a2320, 0x140054a20a0, 0x0)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/executor/executor.go:206 +0x80
go.mondoo.com/cnquery/v10/explorer/executor.(*instance).runCode(0x140054a2320, 0x1400546f410, 0x103521858?)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/executor/executor.go:150 +0x430
go.mondoo.com/cnquery/v10/explorer/executor.RunExecutionJob({0x103523078?, 0x1400099c700?}, {0x103521768, 0x14005235b00}, {0x14000a1e4c0, 0x3c}, 0x1400546ac30, {0x1?, 0x14000557498?, 0x102271cac?}, ...)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/executor/executor.go:34 +0xdc
go.mondoo.com/cnquery/v10/explorer/scan.(*localAssetScanner).runQueryPack(0x1400525fda8)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/scan/local_scanner.go:600 +0x41c
go.mondoo.com/cnquery/v10/explorer/scan.(*localAssetScanner).run(0x1400525fda8)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/scan/local_scanner.go:427 +0x2c
go.mondoo.com/cnquery/v10/explorer/scan.(*LocalScanner).runMotorizedAsset.func1(0x103523078?, 0x1400099c700?)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/scan/local_scanner.go:402 +0x194
go.mondoo.com/cnquery/v10/internal/datalakes/inmemory.WithDb({0x103523078?, 0x1400099c700?}, 0x14000091e60)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/internal/datalakes/inmemory/inmemory.go:45 +0x4c
go.mondoo.com/cnquery/v10/explorer/scan.(*LocalScanner).runMotorizedAsset(0x140007b2360?, 0x102f48a85?)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/scan/local_scanner.go:380 +0x64
go.mondoo.com/cnquery/v10/explorer/scan.(*LocalScanner).RunAssetJob(0x14005081b30, 0x140000ad700)
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/scan/local_scanner.go:359 +0x90
go.mondoo.com/cnquery/v10/explorer/scan.(*LocalScanner).distributeJob.func3()
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/scan/local_scanner.go:334 +0xf8
created by go.mondoo.com/cnquery/v10/explorer/scan.(*LocalScanner).distributeJob in goroutine 1
	/Users/atomic111/go/src/go.mondoo.com/cnquery/explorer/scan/local_scanner.go:316 +0x620