diff --git a/apps/cnquery/cmd/plugin.go b/apps/cnquery/cmd/plugin.go index 9cc32821da..289a529e12 100644 --- a/apps/cnquery/cmd/plugin.go +++ b/apps/cnquery/cmd/plugin.go @@ -119,6 +119,9 @@ func (c *cnqueryPlugin) RunQuery(conf *run.RunQueryConfig, runtime *providers.Ru for i := range filteredAssets { connectAsset := filteredAssets[i] + if err := runtime.DetectProvider(connectAsset); err != nil { + return err + } err := runtime.Connect(&pp.ConnectReq{ Features: config.Features, Asset: connectAsset, diff --git a/go.mod b/go.mod index 6a87a30469..1f0d752328 100644 --- a/go.mod +++ b/go.mod @@ -344,7 +344,7 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect + golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/mod v0.10.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect diff --git a/providers-sdk/v1/plugin/start.go b/providers-sdk/v1/plugin/start.go index 4ea4da04b7..b63c4ef16d 100644 --- a/providers-sdk/v1/plugin/start.go +++ b/providers-sdk/v1/plugin/start.go @@ -13,10 +13,11 @@ import ( ) type Provider struct { - Name string - ID string - Version string - Connectors []Connector + Name string + ID string + Version string + ConnectionTypes []string + Connectors []Connector } type Connector struct { diff --git a/providers/arista/config/config.go b/providers/arista/config/config.go index fd7cfa4068..8e4dbf0d45 100644 --- a/providers/arista/config/config.go +++ b/providers/arista/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/arista/provider" +) var Config = plugin.Provider{ - Name: "arista", - ID: "go.mondoo.com/cnquery/providers/arista", - Version: "9.0.0", + Name: "arista", + ID: "go.mondoo.com/cnquery/providers/arista", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "arista", diff --git a/providers/arista/provider/provider.go b/providers/arista/provider/provider.go index 5c3dfc2bdf..109a0eb566 100644 --- a/providers/arista/provider/provider.go +++ b/providers/arista/provider/provider.go @@ -18,6 +18,10 @@ import ( "go.mondoo.com/cnquery/providers/arista/resources" ) +const ( + ConnectionType = "arista" +) + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/azure/config/config.go b/providers/azure/config/config.go index 67b319c27c..dfab3d09b9 100644 --- a/providers/azure/config/config.go +++ b/providers/azure/config/config.go @@ -5,13 +5,15 @@ package config import ( "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/azure/provider" "go.mondoo.com/cnquery/providers/azure/resources" ) var Config = plugin.Provider{ - Name: "azure", - ID: "go.mondoo.com/cnquery/providers/azure", - Version: "9.0.0", + Name: "azure", + ID: "go.mondoo.com/cnquery/providers/azure", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "azure", diff --git a/providers/azure/provider/provider.go b/providers/azure/provider/provider.go index b0569550a1..c9ef0d7d77 100644 --- a/providers/azure/provider/provider.go +++ b/providers/azure/provider/provider.go @@ -17,7 +17,10 @@ import ( "go.mondoo.com/cnquery/providers/azure/resources" ) -const defaultConnection uint32 = 1 +const ( + defaultConnection uint32 = 1 + ConnectionType = "azure" +) type Service struct { runtimes map[uint32]*plugin.Runtime diff --git a/providers/equinix/config/config.go b/providers/equinix/config/config.go index 988bdea988..d739ab752d 100644 --- a/providers/equinix/config/config.go +++ b/providers/equinix/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/equinix/provider" +) var Config = plugin.Provider{ - Name: "equinix", - ID: "go.mondoo.com/cnquery/providers/equinix", - Version: "9.0.0", + Name: "equinix", + ID: "go.mondoo.com/cnquery/providers/equinix", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "equinix", diff --git a/providers/equinix/provider/provider.go b/providers/equinix/provider/provider.go index 869f1c5840..68db0ceaef 100644 --- a/providers/equinix/provider/provider.go +++ b/providers/equinix/provider/provider.go @@ -18,6 +18,8 @@ import ( "go.mondoo.com/cnquery/providers/equinix/resources" ) +const ConnectionType = "equinix" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/gcp/config/config.go b/providers/gcp/config/config.go index 640dcae78d..da82096d70 100644 --- a/providers/gcp/config/config.go +++ b/providers/gcp/config/config.go @@ -5,13 +5,15 @@ package config import ( "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/gcp/provider" "go.mondoo.com/cnquery/providers/gcp/resources" ) var Config = plugin.Provider{ - Name: "gcp", - ID: "go.mondoo.com/cnquery/providers/gcp", - Version: "9.0.0", + Name: "gcp", + ID: "go.mondoo.com/cnquery/providers/gcp", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "gcp", diff --git a/providers/gcp/provider/provider.go b/providers/gcp/provider/provider.go index b1cbb49394..218a92f1c3 100644 --- a/providers/gcp/provider/provider.go +++ b/providers/gcp/provider/provider.go @@ -19,6 +19,8 @@ import ( "go.mondoo.com/cnquery/providers/gcp/resources" ) +const ConnectionType = "gcp" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/github/config/config.go b/providers/github/config/config.go index 32a40805ca..00d46603a8 100644 --- a/providers/github/config/config.go +++ b/providers/github/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/github/provider" +) var Config = plugin.Provider{ - Name: "github", - ID: "go.mondoo.com/cnquery/providers/github", - Version: "9.0.0", + Name: "github", + ID: "go.mondoo.com/cnquery/providers/github", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "github", diff --git a/providers/github/go.mod b/providers/github/go.mod index a90e3d75f6..0f99aedf05 100644 --- a/providers/github/go.mod +++ b/providers/github/go.mod @@ -139,6 +139,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/hexops/gotextdiff v1.0.3 // indirect + github.com/hnakamur/go-scp v1.0.2 // indirect github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jgautheron/goconst v1.5.1 // indirect diff --git a/providers/github/go.sum b/providers/github/go.sum index c4a712b65b..daab66a9aa 100644 --- a/providers/github/go.sum +++ b/providers/github/go.sum @@ -201,7 +201,9 @@ github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/daixiang0/gci v0.10.1 h1:eheNA3ljF6SxnPD/vE4lCBusVHmV3Rs3dkKvFrJ7MR0= @@ -460,6 +462,10 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1 github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/hnakamur/go-scp v1.0.2 h1:i2I0O0pjAaX4BXJFrp1blsIdjOBekc5QOaB0AbdO1d0= +github.com/hnakamur/go-scp v1.0.2/go.mod h1:Dh9GtPFBkiDI1KY1nmf+W7eVCWWmRjJitkCYgvWv+Zc= +github.com/hnakamur/go-sshd v0.0.0-20170228152141-dccc3399d26a h1:p8dbHRhXhPSwVZqk76FguLzyeCZuvCqFlaYSqXOzbyI= +github.com/hnakamur/go-sshd v0.0.0-20170228152141-dccc3399d26a/go.mod h1:R+6I3EdoV6ofbNqJsArhT9+Pnu57DxtmDJAQfxkCbGo= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f h1:7LYC+Yfkj3CTRcShK0KOL/w6iTiKyqqBA9a41Wnggw8= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -536,6 +542,8 @@ github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NB github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -909,6 +917,7 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -1083,6 +1092,7 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200828081204-131dc92a58d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/providers/github/provider/provider.go b/providers/github/provider/provider.go index 31dcf44093..add03755f9 100644 --- a/providers/github/provider/provider.go +++ b/providers/github/provider/provider.go @@ -18,6 +18,8 @@ import ( "go.mondoo.com/cnquery/providers/github/resources" ) +const ConnectionType = "github" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/gitlab/config/config.go b/providers/gitlab/config/config.go index 7fb619a67f..9e50fb4074 100644 --- a/providers/gitlab/config/config.go +++ b/providers/gitlab/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/gitlab/provider" +) var Config = plugin.Provider{ - Name: "gitlab", - ID: "go.mondoo.com/cnquery/providers/gitlab", - Version: "9.0.0", + Name: "gitlab", + ID: "go.mondoo.com/cnquery/providers/gitlab", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "gitlab", diff --git a/providers/gitlab/provider/provider.go b/providers/gitlab/provider/provider.go index 384ebdfd2a..68a0066e59 100644 --- a/providers/gitlab/provider/provider.go +++ b/providers/gitlab/provider/provider.go @@ -18,6 +18,8 @@ import ( "go.mondoo.com/cnquery/providers/gitlab/resources" ) +const ConnectionType = "gitlab" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/google-workspace/config/config.go b/providers/google-workspace/config/config.go index 2a7e217ccd..3c2dc1104f 100644 --- a/providers/google-workspace/config/config.go +++ b/providers/google-workspace/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/google-workspace/provider" +) var Config = plugin.Provider{ - Name: "google-workspace", - ID: "go.mondoo.com/cnquery/providers/google-workspace", - Version: "9.0.0", + Name: "google-workspace", + ID: "go.mondoo.com/cnquery/providers/google-workspace", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "google-workspace", diff --git a/providers/google-workspace/go.mod b/providers/google-workspace/go.mod index 1d729f5693..881d6dbc97 100644 --- a/providers/google-workspace/go.mod +++ b/providers/google-workspace/go.mod @@ -143,6 +143,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/hexops/gotextdiff v1.0.3 // indirect + github.com/hnakamur/go-scp v1.0.2 // indirect github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jgautheron/goconst v1.5.1 // indirect diff --git a/providers/google-workspace/go.sum b/providers/google-workspace/go.sum index 98cb0f83d5..37fae12259 100644 --- a/providers/google-workspace/go.sum +++ b/providers/google-workspace/go.sum @@ -213,7 +213,10 @@ github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/daixiang0/gci v0.10.1 h1:eheNA3ljF6SxnPD/vE4lCBusVHmV3Rs3dkKvFrJ7MR0= @@ -488,6 +491,10 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1 github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/hnakamur/go-scp v1.0.2 h1:i2I0O0pjAaX4BXJFrp1blsIdjOBekc5QOaB0AbdO1d0= +github.com/hnakamur/go-scp v1.0.2/go.mod h1:Dh9GtPFBkiDI1KY1nmf+W7eVCWWmRjJitkCYgvWv+Zc= +github.com/hnakamur/go-sshd v0.0.0-20170228152141-dccc3399d26a h1:p8dbHRhXhPSwVZqk76FguLzyeCZuvCqFlaYSqXOzbyI= +github.com/hnakamur/go-sshd v0.0.0-20170228152141-dccc3399d26a/go.mod h1:R+6I3EdoV6ofbNqJsArhT9+Pnu57DxtmDJAQfxkCbGo= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f h1:7LYC+Yfkj3CTRcShK0KOL/w6iTiKyqqBA9a41Wnggw8= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -565,6 +572,8 @@ github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NB github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -951,6 +960,7 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -1127,6 +1137,7 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200828081204-131dc92a58d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/providers/google-workspace/provider/provider.go b/providers/google-workspace/provider/provider.go index 0df85f8811..fd1137c467 100644 --- a/providers/google-workspace/provider/provider.go +++ b/providers/google-workspace/provider/provider.go @@ -19,6 +19,8 @@ import ( "go.mondoo.com/cnquery/providers/google-workspace/resources" ) +const ConnectionType = "google-workspace" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/ipmi/config/config.go b/providers/ipmi/config/config.go index 9383605b4f..5b3160eda6 100644 --- a/providers/ipmi/config/config.go +++ b/providers/ipmi/config/config.go @@ -3,18 +3,22 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/ipmi/provider" +) var Config = plugin.Provider{ - Name: "ipmi", - ID: "go.mondoo.com/cnquery/providers/ipmi", - Version: "9.0.0", + Name: "ipmi", + ID: "go.mondoo.com/cnquery/providers/ipmi", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "ipmi", Use: "ipmi", Short: "Ipmi", - Discovery: []string{}, + Discovery: []string{provider.ConnectionType}, Flags: []plugin.Flag{ { Long: "ask-pass", diff --git a/providers/ipmi/provider/provider.go b/providers/ipmi/provider/provider.go index 81ecb9fe72..bfdf603e91 100644 --- a/providers/ipmi/provider/provider.go +++ b/providers/ipmi/provider/provider.go @@ -19,6 +19,8 @@ import ( "go.mondoo.com/cnquery/providers/ipmi/resources" ) +const ConnectionType = "ipmi" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/k8s/config/config.go b/providers/k8s/config/config.go index b4df450ed5..7d422b5df8 100644 --- a/providers/k8s/config/config.go +++ b/providers/k8s/config/config.go @@ -5,13 +5,15 @@ package config import ( "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/k8s/provider" "go.mondoo.com/cnquery/providers/k8s/resources" ) var Config = plugin.Provider{ - Name: "k8s", - ID: "go.mondoo.com/cnquery/providers/k8s", - Version: "9.0.0", + Name: "k8s", + ID: "go.mondoo.com/cnquery/providers/k8s", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "k8s", diff --git a/providers/k8s/provider/provider.go b/providers/k8s/provider/provider.go index 00ca9fa6b9..ae27ef41dd 100644 --- a/providers/k8s/provider/provider.go +++ b/providers/k8s/provider/provider.go @@ -19,6 +19,8 @@ import ( "go.mondoo.com/cnquery/providers/k8s/resources" ) +const ConnectionType = "k8s" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/ms365/config/config.go b/providers/ms365/config/config.go index bc579db473..7bce9f1679 100644 --- a/providers/ms365/config/config.go +++ b/providers/ms365/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/ms365/provider" +) var Config = plugin.Provider{ - Name: "ms365", - ID: "go.mondoo.com/cnquery/providers/ms365", - Version: "9.0.0", + Name: "ms365", + ID: "go.mondoo.com/cnquery/providers/ms365", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "ms365", diff --git a/providers/ms365/provider/provider.go b/providers/ms365/provider/provider.go index e01243e8d5..02adfff4da 100644 --- a/providers/ms365/provider/provider.go +++ b/providers/ms365/provider/provider.go @@ -16,7 +16,10 @@ import ( "go.mondoo.com/cnquery/providers/ms365/resources" ) -const defaultConnection uint32 = 1 +const ( + defaultConnection uint32 = 1 + ConnectionType = "ms365" +) type Service struct { runtimes map[uint32]*plugin.Runtime @@ -125,7 +128,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba asset.Connections[0].Id = conn.ID() s.runtimes[conn.ID()] = &plugin.Runtime{ Connection: conn, - Resources: map[string]plugin.Resource{}, + Resources: syncx.Map[string]plugin.Resource{}, Callback: callback, HasRecording: req.HasRecording, CreateResource: resources.CreateResource, diff --git a/providers/network/config/config.go b/providers/network/config/config.go index 3054ed1147..1fc32d4ce9 100644 --- a/providers/network/config/config.go +++ b/providers/network/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/network/provider" +) var Config = plugin.Provider{ - Name: "network", - ID: "go.mondoo.com/cnquery/providers/network", - Version: "9.0.0", + Name: "network", + ID: "go.mondoo.com/cnquery/providers/network", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "host", diff --git a/providers/network/provider/provider.go b/providers/network/provider/provider.go index 62f0dc3dbd..5660df46d5 100644 --- a/providers/network/provider/provider.go +++ b/providers/network/provider/provider.go @@ -18,7 +18,10 @@ import ( "go.mondoo.com/cnquery/providers/network/resources/domain" ) -const defaultConnection uint32 = 1 +const ( + defaultConnection uint32 = 1 + ConnectionType = "host" +) // This is a small selection of common ports that are supported. // Outside of this range, users will have to specify ports explicitly. diff --git a/providers/oci/config/config.go b/providers/oci/config/config.go index 5a4184b81b..89fa0b3c9f 100644 --- a/providers/oci/config/config.go +++ b/providers/oci/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/oci/provider" +) var Config = plugin.Provider{ - Name: "oci", - ID: "go.mondoo.com/cnquery/providers/oci", - Version: "9.0.0", + Name: "oci", + ID: "go.mondoo.com/cnquery/providers/oci", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "oci", diff --git a/providers/oci/provider/provider.go b/providers/oci/provider/provider.go index 75595cada2..89909088c7 100644 --- a/providers/oci/provider/provider.go +++ b/providers/oci/provider/provider.go @@ -20,6 +20,8 @@ import ( "go.mondoo.com/cnquery/providers/oci/resources" ) +const ConnectionType = "oci" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/okta/config/config.go b/providers/okta/config/config.go index 13d21afd06..1cab2bccea 100644 --- a/providers/okta/config/config.go +++ b/providers/okta/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/okta/provider" +) var Config = plugin.Provider{ - Name: "okta", - ID: "go.mondoo.com/cnquery/providers/okta", - Version: "9.0.0", + Name: "okta", + ID: "go.mondoo.com/cnquery/providers/okta", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "okta", diff --git a/providers/okta/provider/provider.go b/providers/okta/provider/provider.go index 4e89d6e8b1..a075f17e9b 100644 --- a/providers/okta/provider/provider.go +++ b/providers/okta/provider/provider.go @@ -18,6 +18,8 @@ import ( "go.mondoo.com/cnquery/providers/okta/resources" ) +const ConnectionType = "okta" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/opcua/config/config.go b/providers/opcua/config/config.go index 97a93578c4..588bb91b57 100644 --- a/providers/opcua/config/config.go +++ b/providers/opcua/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/opcua/provider" +) var Config = plugin.Provider{ - Name: "opcua", - ID: "go.mondoo.com/cnquery/providers/opcua", - Version: "9.0.0", + Name: "opcua", + ID: "go.mondoo.com/cnquery/providers/opcua", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "opcua", diff --git a/providers/opcua/provider/provider.go b/providers/opcua/provider/provider.go index 05e7b11624..eb9e044d2d 100644 --- a/providers/opcua/provider/provider.go +++ b/providers/opcua/provider/provider.go @@ -18,6 +18,8 @@ import ( "go.mondoo.com/cnquery/providers/opcua/resources" ) +const ConnectionType = "opcua" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/os/config/config.go b/providers/os/config/config.go index 7dc1f9404d..f1680f74fb 100644 --- a/providers/os/config/config.go +++ b/providers/os/config/config.go @@ -3,12 +3,29 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/os/provider" +) var Config = plugin.Provider{ Name: "os", ID: "go.mondoo.com/cnquery/providers/os", Version: "9.0.0", + ConnectionTypes: []string{ + provider.LocalConnectionType, + provider.SshConnectionType, + provider.MockConnectionType, + provider.TarConnectionType, + provider.DockerSnapshotConnectionType, + provider.VagrantConnectionType, + provider.DockerImageConnectionType, + provider.DockerContainerConnectionType, + provider.DockerRegistryConnectionType, + provider.ContainerRegistryConnectionType, + provider.RegistryImageConnectionType, + provider.FilesystemConnectionType, + }, Connectors: []plugin.Connector{ { Name: "local", diff --git a/providers/os/provider/provider.go b/providers/os/provider/provider.go index 4c04a8fc37..967036f9be 100644 --- a/providers/os/provider/provider.go +++ b/providers/os/provider/provider.go @@ -22,6 +22,21 @@ import ( "go.mondoo.com/cnquery/providers/os/resources/discovery/container_registry" ) +const ( + LocalConnectionType = "local" + SshConnectionType = "ssh" + MockConnectionType = "mock" + TarConnectionType = "tar" + DockerSnapshotConnectionType = "docker-snapshot" + VagrantConnectionType = "vagrant" + DockerImageConnectionType = "docker-image" + DockerContainerConnectionType = "docker-container" + DockerRegistryConnectionType = "docker-registry" + ContainerRegistryConnectionType = "container-registry" + RegistryImageConnectionType = "registry-image" + FilesystemConnectionType = "filesystem" +) + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 @@ -218,27 +233,27 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba var err error switch conf.Type { - case "local": + case LocalConnectionType: s.lastConnectionID++ conn = connection.NewLocalConnection(s.lastConnectionID, conf, asset) - case "ssh": + case SshConnectionType: s.lastConnectionID++ conn, err = connection.NewSshConnection(s.lastConnectionID, conf, asset) - case "mock": + case MockConnectionType: s.lastConnectionID++ conn, err = mock.New("", asset) - case "tar": + case TarConnectionType: s.lastConnectionID++ conn, err = connection.NewTarConnection(s.lastConnectionID, conf, asset) - case "docker-snapshot": + case DockerSnapshotConnectionType: s.lastConnectionID++ conn, err = connection.NewDockerSnapshotConnection(s.lastConnectionID, conf, asset) - case "vagrant": + case VagrantConnectionType: s.lastConnectionID++ conn, err = connection.NewVagrantConnection(s.lastConnectionID, conf, asset) if err != nil { @@ -251,23 +266,23 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba return nil, err } - case "docker-image": + case DockerImageConnectionType: s.lastConnectionID++ conn, err = connection.NewDockerContainerImageConnection(s.lastConnectionID, conf, asset) - case "docker-container": + case DockerContainerConnectionType: s.lastConnectionID++ conn, err = connection.NewDockerEngineContainer(s.lastConnectionID, conf, asset) - case "docker-registry", "container-registry": + case DockerRegistryConnectionType, ContainerRegistryConnectionType: s.lastConnectionID++ conn, err = connection.NewContainerRegistryImage(s.lastConnectionID, conf, asset) - case "registry-image": + case RegistryImageConnectionType: s.lastConnectionID++ conn, err = connection.NewContainerRegistryImage(s.lastConnectionID, conf, asset) - case "filesystem": + case FilesystemConnectionType: s.lastConnectionID++ conn, err = connection.NewFileSystemConnection(s.lastConnectionID, conf, asset) diff --git a/providers/providers.go b/providers/providers.go index 7d090c9b0a..61c49e8677 100644 --- a/providers/providers.go +++ b/providers/providers.go @@ -21,6 +21,7 @@ import ( "go.mondoo.com/cnquery/cli/config" "go.mondoo.com/cnquery/providers-sdk/v1/plugin" "go.mondoo.com/cnquery/providers-sdk/v1/resources" + "golang.org/x/exp/slices" ) var ( @@ -531,11 +532,8 @@ func (p *Provider) binPath() string { func (p Providers) ForConnection(name string) *Provider { for _, provider := range p { - for i := range provider.Connectors { - connector := provider.Connectors[i] - if connector.Name == name { - return provider - } + if slices.Contains(provider.ConnectionTypes, name) { + return provider } } diff --git a/providers/slack/config/config.go b/providers/slack/config/config.go index fc8f936852..158d569c01 100644 --- a/providers/slack/config/config.go +++ b/providers/slack/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/slack/provider" +) var Config = plugin.Provider{ - Name: "slack", - ID: "go.mondoo.com/cnquery/providers/slack", - Version: "9.0.0", + Name: "slack", + ID: "go.mondoo.com/cnquery/providers/slack", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "slack", diff --git a/providers/slack/provider/provider.go b/providers/slack/provider/provider.go index c1dea15a4f..b27eb7a615 100644 --- a/providers/slack/provider/provider.go +++ b/providers/slack/provider/provider.go @@ -18,6 +18,8 @@ import ( "go.mondoo.com/cnquery/providers/slack/resources" ) +const ConnectionType = "slack" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/terraform/config/config.go b/providers/terraform/config/config.go index 9ea2fc3187..8dc3ee7526 100644 --- a/providers/terraform/config/config.go +++ b/providers/terraform/config/config.go @@ -3,12 +3,20 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/terraform/provider" +) var Config = plugin.Provider{ Name: "terraform", ID: "go.mondoo.com/cnquery/providers/terraform", Version: "9.0.0", + ConnectionTypes: []string{ + provider.StateConnectionType, + provider.PlanConnectionType, + provider.HclConnectionType, + }, Connectors: []plugin.Connector{ { Name: "terraform", diff --git a/providers/terraform/provider/provider.go b/providers/terraform/provider/provider.go index b96f523d83..b31aa0063c 100644 --- a/providers/terraform/provider/provider.go +++ b/providers/terraform/provider/provider.go @@ -16,6 +16,12 @@ import ( "go.mondoo.com/cnquery/providers/terraform/resources" ) +const ( + StateConnectionType = "state" + PlanConnectionType = "plan" + HclConnectionType = "hcl" +) + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 @@ -121,20 +127,20 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba var err error switch conf.Type { - case "hcl": + case HclConnectionType: s.lastConnectionID++ conn, err = connection.NewHclConnection(s.lastConnectionID, asset) if err != nil { return nil, err } - case "state": + case StateConnectionType: s.lastConnectionID++ conn, err = connection.NewStateConnection(s.lastConnectionID, asset) if err != nil { return nil, err } - case "plan": + case PlanConnectionType: s.lastConnectionID++ conn, err = connection.NewPlanConnection(s.lastConnectionID, asset) if err != nil { diff --git a/providers/vcd/config/config.go b/providers/vcd/config/config.go index 674b61cda1..20603d0fea 100644 --- a/providers/vcd/config/config.go +++ b/providers/vcd/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/vcd/provider" +) var Config = plugin.Provider{ - Name: "vcd", - ID: "go.mondoo.com/cnquery/providers/vcd", - Version: "9.0.0", + Name: "vcd", + ID: "go.mondoo.com/cnquery/providers/vcd", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "vcd", diff --git a/providers/vcd/provider/provider.go b/providers/vcd/provider/provider.go index f97d77c7d9..7815572821 100644 --- a/providers/vcd/provider/provider.go +++ b/providers/vcd/provider/provider.go @@ -18,6 +18,8 @@ import ( "go.mondoo.com/cnquery/providers/vcd/resources" ) +const ConnectionType = "vcd" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32 diff --git a/providers/vsphere/config/config.go b/providers/vsphere/config/config.go index e8ad08bea3..ac8d71d3ac 100644 --- a/providers/vsphere/config/config.go +++ b/providers/vsphere/config/config.go @@ -3,12 +3,16 @@ package config -import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/vsphere/provider" +) var Config = plugin.Provider{ - Name: "vsphere", - ID: "go.mondoo.com/cnquery/providers/vsphere", - Version: "9.0.0", + Name: "vsphere", + ID: "go.mondoo.com/cnquery/providers/vsphere", + Version: "9.0.0", + ConnectionTypes: []string{provider.ConnectionType}, Connectors: []plugin.Connector{ { Name: "vsphere", diff --git a/providers/vsphere/provider/provider.go b/providers/vsphere/provider/provider.go index e7da13f4fd..f15328ac2c 100644 --- a/providers/vsphere/provider/provider.go +++ b/providers/vsphere/provider/provider.go @@ -19,6 +19,8 @@ import ( "go.mondoo.com/cnquery/providers/vsphere/resources" ) +const ConnectionType = "vsphere" + type Service struct { runtimes map[uint32]*plugin.Runtime lastConnectionID uint32