diff --git a/cli/providers/providers.go b/cli/providers/providers.go index 5e93066ac6..019656e9cd 100644 --- a/cli/providers/providers.go +++ b/cli/providers/providers.go @@ -544,7 +544,6 @@ func setConnector(provider *plugin.Provider, connector *plugin.Connector, run fu for _, tmpFile := range temporaryFiles { _ = os.Remove(tmpFile) } - } attachFlags(cmd.Flags(), allFlags) diff --git a/providers/atlassian/config/config.go b/providers/atlassian/config/config.go index e22c375cfe..2bbef99d9d 100644 --- a/providers/atlassian/config/config.go +++ b/providers/atlassian/config/config.go @@ -6,6 +6,7 @@ package config import ( "go.mondoo.com/cnquery/v11/providers-sdk/v1/inventory" "go.mondoo.com/cnquery/v11/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/v11/providers/atlassian/connection" "go.mondoo.com/cnquery/v11/providers/atlassian/connection/confluence" "go.mondoo.com/cnquery/v11/providers/atlassian/provider" ) @@ -49,7 +50,7 @@ Notes: Atlassian provides these values when you set up an identity provider. `, MaxArgs: 2, - Discovery: []string{}, + Discovery: []string{connection.DiscoveryOrganization}, Flags: []plugin.Flag{ { Long: "admin-token", diff --git a/providers/atlassian/connection/connection.go b/providers/atlassian/connection/connection.go index d5fd522d72..c7cca79140 100644 --- a/providers/atlassian/connection/connection.go +++ b/providers/atlassian/connection/connection.go @@ -14,9 +14,6 @@ import ( ) const ( - // Discovery flags - DiscoveryAuto = "auto" - DiscoveryAll = "all" DiscoveryOrganization = "organization" ) diff --git a/providers/aws/config/config.go b/providers/aws/config/config.go index 328a2ac216..a8096408c2 100644 --- a/providers/aws/config/config.go +++ b/providers/aws/config/config.go @@ -56,16 +56,17 @@ Notes: MaxArgs: 4, Discovery: []string{ resources.DiscoveryAccounts, - resources.DiscoveryAll, - resources.DiscoveryAuto, resources.DiscoveryInstances, resources.DiscoveryEC2InstanceAPI, resources.DiscoverySSMInstances, resources.DiscoverySSMInstanceAPI, resources.DiscoveryECR, + resources.DiscoveryECRImageAPI, resources.DiscoveryECS, + resources.DiscoveryECSContainersAPI, + resources.DiscoveryOrg, resources.DiscoveryResources, resources.DiscoveryS3Buckets, resources.DiscoveryCloudtrailTrails, @@ -78,6 +79,7 @@ Notes: resources.DiscoveryCloudwatchLoggroups, resources.DiscoveryLambdaFunctions, resources.DiscoveryDynamoDBTables, + resources.DiscoveryDynamoDBGlobalTables, resources.DiscoveryRedshiftClusters, resources.DiscoveryVolumes, resources.DiscoverySnapshots, diff --git a/providers/azure/config/config.go b/providers/azure/config/config.go index 5f1295840b..9b41f77872 100644 --- a/providers/azure/config/config.go +++ b/providers/azure/config/config.go @@ -27,14 +27,14 @@ var Config = plugin.Provider{ MinArgs: 0, MaxArgs: 8, Discovery: []string{ - resources.DiscoveryAuto, - resources.DiscoveryAll, resources.DiscoverySubscriptions, resources.DiscoveryInstances, resources.DiscoveryInstancesApi, resources.DiscoverySqlServers, resources.DiscoveryPostgresServers, + resources.DiscoveryPostgresFlexibleServers, resources.DiscoveryMySqlServers, + resources.DiscoveryMySqlFlexibleServers, resources.DiscoveryMariaDbServers, resources.DiscoveryStorageAccounts, resources.DiscoveryStorageContainers, diff --git a/providers/gcp/config/config.go b/providers/gcp/config/config.go index 9e02ee0604..8ef7655174 100644 --- a/providers/gcp/config/config.go +++ b/providers/gcp/config/config.go @@ -26,8 +26,6 @@ var Config = plugin.Provider{ Short: "a Google Cloud project or folder", MaxArgs: 2, Discovery: []string{ - resources.DiscoveryAll, - resources.DiscoveryAuto, resources.DiscoveryOrganization, resources.DiscoveryFolders, resources.DiscoveryInstances, diff --git a/providers/github/config/config.go b/providers/github/config/config.go index 899dd42781..2609a6b6f1 100644 --- a/providers/github/config/config.go +++ b/providers/github/config/config.go @@ -44,6 +44,7 @@ Notes: Discovery: []string{ connection.DiscoveryRepos, connection.DiscoveryUsers, + connection.DiscoveryOrganization, connection.DiscoveryTerraform, connection.DiscoveryK8sManifests, }, diff --git a/providers/gitlab/config/config.go b/providers/gitlab/config/config.go index d6249b578b..680d05e50a 100644 --- a/providers/gitlab/config/config.go +++ b/providers/gitlab/config/config.go @@ -24,10 +24,10 @@ var Config = plugin.Provider{ Use: "gitlab", Short: "a GitLab group or project", Discovery: []string{ - provider.DiscoveryAuto, provider.DiscoveryGroup, provider.DiscoveryProject, provider.DiscoveryTerraform, + provider.DiscoveryK8sManifests, }, Flags: []plugin.Flag{ { diff --git a/providers/ipmi/config/config.go b/providers/ipmi/config/config.go index aca461fbf2..d001995e53 100644 --- a/providers/ipmi/config/config.go +++ b/providers/ipmi/config/config.go @@ -30,7 +30,7 @@ Examples: `, MinArgs: 1, MaxArgs: 1, - Discovery: []string{provider.ConnectionType}, + Discovery: []string{}, Flags: []plugin.Flag{ { Long: "ask-pass", diff --git a/providers/k8s/config/config.go b/providers/k8s/config/config.go index e28160bde9..2aa2a7416f 100644 --- a/providers/k8s/config/config.go +++ b/providers/k8s/config/config.go @@ -24,8 +24,6 @@ var Config = plugin.Provider{ MinArgs: 0, MaxArgs: 1, Discovery: []string{ - resources.DiscoveryAll, - resources.DiscoveryAuto, resources.DiscoveryAdmissionReviews, resources.DiscoveryClusters, resources.DiscoveryContainerImages, diff --git a/providers/os/resources/discovery/container_registry/resolver.go b/providers/os/resources/discovery/container_registry/resolver.go index 6cb923e52b..4c3b3498aa 100644 --- a/providers/os/resources/discovery/container_registry/resolver.go +++ b/providers/os/resources/discovery/container_registry/resolver.go @@ -21,14 +21,6 @@ type Resolver struct { NoStrictValidation bool } -func (r *Resolver) Name() string { - return "Container Registry Discover" -} - -func (r *Resolver) AvailableDiscoveryTargets() []string { - return []string{"auto", "all"} -} - func (r *Resolver) Resolve(ctx context.Context, root *inventory.Asset, conf *inventory.Config, credsResolver vault.Resolver) ([]*inventory.Asset, error) { resolved := []*inventory.Asset{} diff --git a/providers/os/resources/discovery/docker_engine/resolver.go b/providers/os/resources/discovery/docker_engine/resolver.go index 85da18d69c..44a9354f94 100644 --- a/providers/os/resources/discovery/docker_engine/resolver.go +++ b/providers/os/resources/discovery/docker_engine/resolver.go @@ -23,14 +23,6 @@ const ( type Resolver struct{} -func (r *Resolver) Name() string { - return "Docker Resolver" -} - -func (r *Resolver) AvailableDiscoveryTargets() []string { - return []string{"auto", "all", DiscoveryContainerRunning, DiscoveryContainerImages} -} - // func (r *Resolver) Resolve(ctx context.Context, root *inventory.Asset, conf *inventory.Config, credsResolver vault.Resolver, sfn common.QuerySecretFn, userIdDetectors ...providers.PlatformIdDetector) ([]*inventory.Asset, error) { func (r *Resolver) Resolve(ctx context.Context, root *inventory.Asset, conf *inventory.Config, credsResolver vault.Resolver) ([]*inventory.Asset, error) { if conf == nil { diff --git a/providers/shodan/config/config.go b/providers/shodan/config/config.go index 850a8124c6..ca72b05163 100644 --- a/providers/shodan/config/config.go +++ b/providers/shodan/config/config.go @@ -31,8 +31,6 @@ Examples: MinArgs: 0, MaxArgs: 2, Discovery: []string{ - connection.DiscoveryAll, - connection.DiscoveryAuto, connection.DiscoveryHosts, }, Flags: []plugin.Flag{