discoverers

package
v0.1.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsEc2Discoverer

type AwsEc2Discoverer struct {
	// contains filtered or unexported fields
}

AwsEc2Discoverer represents a discoverer for AWS EC2 resources.

func NewAwsEc2Discoverer

func NewAwsEc2Discoverer(cfg aws.Config, opts ...AwsEc2DiscovererOption) *AwsEc2Discoverer

NewEngine returns a new AwsEc2Discoverer, initialized with the given options.

func (*AwsEc2Discoverer) Discover

func (ec2d *AwsEc2Discoverer) Discover(ctx context.Context) *discovery.Result

Discover runs the AwsEc2Discoverer.

type AwsEc2DiscovererOption

type AwsEc2DiscovererOption func(*AwsEc2Discoverer)

AwsEc2DiscovererOption represents a configuration option for an AwsEc2Discoverer.

func WithAwsEc2DiscovererDescribeInstancesTimeout added in v0.1.7

func WithAwsEc2DiscovererDescribeInstancesTimeout(timeout time.Duration) AwsEc2DiscovererOption

WithAwsEc2DiscovererDescribeInstancesTimeout is the AwsEc2DiscovererOption to set a non default timeout for the describe instnaces api call.

func WithAwsEc2DiscovererDiscovererId added in v0.1.3

func WithAwsEc2DiscovererDiscovererId(discovererId string) AwsEc2DiscovererOption

WithAwsEc2DiscovererDiscovererId is the AwsEc2DiscovererOption to set a non default discoverer id.

func WithAwsEc2DiscovererExclusionInstanceTags added in v0.1.7

func WithAwsEc2DiscovererExclusionInstanceTags(tags map[string][]string) AwsEc2DiscovererOption

WithAwsEc2DiscovererExclusionInstanceTags is the AwsEc2DiscovererOption to set the exclusion tags filter for instances to exclude in results.

func WithAwsEc2DiscovererGetAccountIdTimeout added in v0.1.3

func WithAwsEc2DiscovererGetAccountIdTimeout(timeout time.Duration) AwsEc2DiscovererOption

WithAwsEc2DiscovererDiscovererId is the AwsEc2DiscovererOption to set a non default timeout for getting the aws account id.

func WithAwsEc2DiscovererIncludedInstanceStates added in v0.1.7

func WithAwsEc2DiscovererIncludedInstanceStates(states ...types.InstanceStateName) AwsEc2DiscovererOption

WithAwsEc2DiscovererIncludedInstanceStates is the AwsEc2DiscovererOption to set a non default list of states for instances to include in results.

func WithAwsEc2DiscovererInclusionInstanceTags added in v0.1.7

func WithAwsEc2DiscovererInclusionInstanceTags(tags map[string][]string) AwsEc2DiscovererOption

WithAwsEc2DiscovererInclusionInstanceTags is the AwsEc2DiscovererOption to set the inclusion tags filter for instances to include in results.

func WithAwsEc2DiscovererNetworkReachabilityCheck added in v0.1.19

func WithAwsEc2DiscovererNetworkReachabilityCheck(enabled bool) AwsEc2DiscovererOption

WithAwsEc2DiscovererReachabilityCheck is the AwsEc2DiscovererOption to enable/disable checking instances' reachability via the network.

func WithAwsEc2DiscovererNetworkReachabilityCheckCache added in v0.1.20

func WithAwsEc2DiscovererNetworkReachabilityCheckCache(cache *cache.Cache[string, bool], itemOpts ...cache.ItemOption) AwsEc2DiscovererOption

WithAwsEc2DiscovererNetworkReachabilityCheckCache is the AwsEc2DiscovererOption to set the network reachability check cache and new item options.

func WithAwsEc2DiscovererReachabilityRequired added in v0.1.19

func WithAwsEc2DiscovererReachabilityRequired(required bool) AwsEc2DiscovererOption

WithAwsEc2DiscovererReachabilityRequired is the AwsEc2DiscovererOption to exclude instances that are not reachable through any means from results. If required is true, enabled is automatically set to true.

func WithAwsEc2DiscovererSsmStatusCheck added in v0.1.15

func WithAwsEc2DiscovererSsmStatusCheck(enabled, required bool) AwsEc2DiscovererOption

WithAwsEc2DiscovererSsmStatusCheck is the AwsEc2DiscovererOption to enable/disable checking instances' status with SSM. If required is true, enabled is automatically set to true.

type AwsEcsDiscoverer

type AwsEcsDiscoverer struct {
	// contains filtered or unexported fields
}

AwsEcsDiscoverer represents a discoverer for AWS ECS resources.

func NewAwsEcsDiscoverer

func NewAwsEcsDiscoverer(cfg aws.Config, opts ...AwsEcsDiscovererOption) *AwsEcsDiscoverer

NewAwsEcsDiscoverer returns a new AwsEcsDiscoverer.

func (*AwsEcsDiscoverer) Discover

func (ecsd *AwsEcsDiscoverer) Discover(ctx context.Context) *discovery.Result

Discover runs the AwsEcsDiscoverer and closes the channels after a single run.

type AwsEcsDiscovererOption

type AwsEcsDiscovererOption func(*AwsEcsDiscoverer)

AwsEcsDiscovererOption represents a configuration option for an AwsEcsDiscoverer.

func WithAwsEcsDiscovererDiscovererId added in v0.1.3

func WithAwsEcsDiscovererDiscovererId(discovererId string) AwsEcsDiscovererOption

WithAwsEcsDiscovererDiscovererId is the AwsEcsDiscovererOption to set a non default discoverer id.

func WithAwsEcsDiscovererExclusionServiceTags added in v0.1.16

func WithAwsEcsDiscovererExclusionServiceTags(tags map[string][]string) AwsEcsDiscovererOption

WithAwsEcsDiscovererExclusionServiceTags is the AwsEcsDiscovererOption to set the inclusion tags filter for services to exclude in results.

func WithAwsEcsDiscovererGetAccountIdTimeout added in v0.1.3

func WithAwsEcsDiscovererGetAccountIdTimeout(timeout time.Duration) AwsEcsDiscovererOption

WithAwsEcsDiscovererGetAccountIdTimeout is the AwsEcsDiscovererOption to set a non default timeout for getting the aws account id.

func WithAwsEcsDiscovererInclusionServiceTags added in v0.1.16

func WithAwsEcsDiscovererInclusionServiceTags(tags map[string][]string) AwsEcsDiscovererOption

WithAwsEcsDiscovererInclusionServiceTags is the AwsEcsDiscovererOption to set the inclusion tags filter for services to include in results.

type AwsEksDiscoverer added in v0.1.29

type AwsEksDiscoverer struct {
	// contains filtered or unexported fields
}

AwsEksDiscoverer represents a discoverer for AWS EKS resources.

func NewAwsEksDiscoverer added in v0.1.29

func NewAwsEksDiscoverer(cfg aws.Config, opts ...AwsEksDiscovererOption) *AwsEksDiscoverer

NewAwsEksDiscoverer returns a new AwsEksDiscoverer.

func (*AwsEksDiscoverer) Discover added in v0.1.29

func (eksd *AwsEksDiscoverer) Discover(ctx context.Context) *discovery.Result

Discover runs the AwsEksDiscoverer and closes the channels after a single run.

type AwsEksDiscovererOption added in v0.1.29

type AwsEksDiscovererOption func(*AwsEksDiscoverer)

AwsEksDiscovererOption represents a configuration option for an AwsEksDiscoverer.

func WithAwsEksDiscovererDiscovererId added in v0.1.29

func WithAwsEksDiscovererDiscovererId(discovererId string) AwsEksDiscovererOption

WithAwsEksDiscovererDiscovererId is the AwsEksDiscovererOption to set a non default discoverer id.

func WithAwsEksDiscovererExclusionServiceTags added in v0.1.29

func WithAwsEksDiscovererExclusionServiceTags(tags map[string][]string) AwsEksDiscovererOption

WithAwsEksDiscovererExclusionServiceTags is the AwsEksDiscovererOption to set the inclusion tags filter for clusters to exclude in results.

func WithAwsEksDiscovererGetAccountIdTimeout added in v0.1.29

func WithAwsEksDiscovererGetAccountIdTimeout(timeout time.Duration) AwsEksDiscovererOption

WithAwsEksDiscovererGetAccountIdTimeout is the AwsEksDiscovererOption to set a non default timeout for getting the aws account id.

func WithAwsEksDiscovererInclusionServiceTags added in v0.1.29

func WithAwsEksDiscovererInclusionServiceTags(tags map[string][]string) AwsEksDiscovererOption

WithAwsEksDiscovererInclusionServiceTags is the AwsEksDiscovererOption to set the inclusion tags filter for clusters to include in results.

func WithAwsEksDiscovererNetworkReachabilityCheck added in v0.1.29

func WithAwsEksDiscovererNetworkReachabilityCheck(enabled bool) AwsEksDiscovererOption

WithAwsEksDiscovererNetworkReachabilityCheck is the AwsEksDiscovererOption to enable/disable checking cluster endpoint reachability via the network.

func WithAwsEksDiscovererReachabilityRequired added in v0.1.29

func WithAwsEksDiscovererReachabilityRequired(required bool) AwsEksDiscovererOption

WithAwsEksDiscovererReachabilityRequired is the AwsEksDiscovererOption to exclude clusters that are not reachable through any means from results. If required is true, enabled is automatically set to true.

type AwsRdsDiscoverer

type AwsRdsDiscoverer struct {
	// contains filtered or unexported fields
}

AwsRdsDiscoverer represents a discoverer for AWS RDS resources.

func NewAwsRdsDiscoverer

func NewAwsRdsDiscoverer(cfg aws.Config, opts ...AwsRdsDiscovererOption) *AwsRdsDiscoverer

NewAwsRdsDiscoverer returns a new AwsRdsDiscoverer, initialized with the given options.

func (*AwsRdsDiscoverer) Discover

func (rdsd *AwsRdsDiscoverer) Discover(ctx context.Context) *discovery.Result

Discover runs the AwsRdsDiscoverer.

type AwsRdsDiscovererOption

type AwsRdsDiscovererOption func(*AwsRdsDiscoverer)

AwsRdsDiscovererOption represents a configuration option for an AwsRdsDiscoverer.

func WithAwsRdsDiscovererDiscovererId added in v0.1.3

func WithAwsRdsDiscovererDiscovererId(discovererId string) AwsRdsDiscovererOption

WithAwsEcsDiscovererDiscovererId is the AwsRdsDiscovererOption to set a non default discoverer id.

func WithAwsRdsDiscovererExclusionInstanceTags added in v0.1.7

func WithAwsRdsDiscovererExclusionInstanceTags(tags map[string][]string) AwsRdsDiscovererOption

WithAwsRdsDiscovererExclusionInstanceTags is the AwsRdsDiscovererOption to set the exclusion tags filter for instances to exclude in results.

func WithAwsRdsDiscovererGetAccountIdTimeout added in v0.1.3

func WithAwsRdsDiscovererGetAccountIdTimeout(timeout time.Duration) AwsRdsDiscovererOption

WithAwsRdsDiscovererGetAccountIdTimeout is the AwsRdsDiscovererOption to set a non default timeout for getting the aws account id.

func WithAwsRdsDiscovererIncludedInstanceStatuses added in v0.1.8

func WithAwsRdsDiscovererIncludedInstanceStatuses(statuses ...string) AwsRdsDiscovererOption

WithAwsRdsDiscovererIncludedInstanceStatuses is the AwsRdsDiscovererOption to set a non default list of statuses for instances to include in results.

func WithAwsRdsDiscovererInclusionInstanceTags added in v0.1.7

func WithAwsRdsDiscovererInclusionInstanceTags(tags map[string][]string) AwsRdsDiscovererOption

WithAwsRdsDiscovererInclusionInstanceTags is the AwsRdsDiscovererOption to set the inclusion tags filter for instances to include in results.

func WithAwsRdsDiscovererNetworkReachabilityCheck added in v0.1.28

func WithAwsRdsDiscovererNetworkReachabilityCheck(enabled bool) AwsRdsDiscovererOption

WithAwsRdsDiscovererReachabilityCheck is the AwsRdsDiscovererOption to enable/disable checking instances' reachability via the network.

func WithAwsRdsDiscovererNetworkReachabilityCheckCache added in v0.1.28

func WithAwsRdsDiscovererNetworkReachabilityCheckCache(cache *cache.Cache[string, bool], itemOpts ...cache.ItemOption) AwsRdsDiscovererOption

WithAwsRdsDiscovererNetworkReachabilityCheckCache is the AwsRdsDiscovererOption to set the network reachability check cache and new item options.

func WithAwsRdsDiscovererReachabilityRequired added in v0.1.28

func WithAwsRdsDiscovererReachabilityRequired(required bool) AwsRdsDiscovererOption

WithAwsRdsDiscovererReachabilityRequired is the AwsRdsDiscovererOption to exclude instances that are not reachable through any means from results. If required is true, enabled is automatically set to true.

type DockerDiscoverer added in v0.1.5

type DockerDiscoverer struct {
	// contains filtered or unexported fields
}

DockerDiscoverer represents a discoverer for containers managed by the Docker daemon.

func NewDockerDiscoverer added in v0.1.5

func NewDockerDiscoverer(opts ...DockerDiscovererOption) *DockerDiscoverer

NewDockerDiscoverer returns a new DockerDiscoverer, initialized with the given options.

func (*DockerDiscoverer) Discover added in v0.1.5

func (dd *DockerDiscoverer) Discover(ctx context.Context) *discovery.Result

Discover runs the DockerDiscoverer.

type DockerDiscovererOption added in v0.1.5

type DockerDiscovererOption func(*DockerDiscoverer)

DockerDiscovererOption represents a configuration option for an DockerDiscoverer.

func WithDockerDiscovererDiscovererId added in v0.1.5

func WithDockerDiscovererDiscovererId(discovererId string) DockerDiscovererOption

WithDockerDiscovererDiscovererId is the DockerDiscovererOption to set a non default discoverer id.

func WithDockerDiscovererExclusionContainerLabels added in v0.1.12

func WithDockerDiscovererExclusionContainerLabels(labels map[string][]string) DockerDiscovererOption

WithDockerDiscovererExclusionContainerLabels is the DockerDiscovererOption to set the exclusion labels filter for containers to exclude in results.

func WithDockerDiscovererInclusionContainerLabels added in v0.1.13

func WithDockerDiscovererInclusionContainerLabels(labels map[string][]string) DockerDiscovererOption

WithDockerDiscovererInclusionContainerLabels is the DockerDiscovererOption to set the inclusion labels filter for containers to include in results.

func WithDockerDiscovererListContainersTimeout added in v0.1.5

func WithDockerDiscovererListContainersTimeout(timeout time.Duration) DockerDiscovererOption

WithDockerDiscovererListContainersTimeout is the DockerDiscovererOption to set a non default timeout for listing containers with the docker daemon.

type KubernetesDiscoverer added in v0.1.5

type KubernetesDiscoverer struct {
	// contains filtered or unexported fields
}

KubernetesDiscoverer represents a discoverer for Kubernetes pods.

func NewKubernetesDiscoverer added in v0.1.5

func NewKubernetesDiscoverer(opts ...KubernetesDiscovererOption) *KubernetesDiscoverer

NewKubernetesDiscoverer returns a new KubernetesDiscoverer, initialized with the given options.

func (*KubernetesDiscoverer) Discover added in v0.1.5

func (k8d *KubernetesDiscoverer) Discover(ctx context.Context) *discovery.Result

Discover runs the KubernetesDiscoverer.

type KubernetesDiscovererOption added in v0.1.5

type KubernetesDiscovererOption func(*KubernetesDiscoverer)

KubernetesDiscovererOption represents a configuration option for an KubernetesDiscoverer.

func WithKubernetesDiscovererDiscovererId added in v0.1.5

func WithKubernetesDiscovererDiscovererId(discovererId string) KubernetesDiscovererOption

WithKubernetesDiscovererDiscovererId is the KubernetesDiscovererOption to set a non default discoverer id.

func WithKubernetesDiscovererExclusionServiceLabels added in v0.1.11

func WithKubernetesDiscovererExclusionServiceLabels(labels map[string][]string) KubernetesDiscovererOption

WithKubernetesDiscovererExclusionServiceLabels is the KubernetesDiscovererOption to set the exclusion labels filter for services to exclude in results.

func WithKubernetesDiscovererInclusionServiceLabels added in v0.1.11

func WithKubernetesDiscovererInclusionServiceLabels(labels map[string][]string) KubernetesDiscovererOption

WithKubernetesDiscovererInclusionServiceLabels is the KubernetesDiscovererOption to set the inclusion labels filter for services to include in results.

func WithKubernetesDiscovererKubeconfigPath added in v0.1.5

func WithKubernetesDiscovererKubeconfigPath(kubeconfigPath string) KubernetesDiscovererOption

WithKubernetesDiscovererKubeconfigPath is the KubernetesDiscovererOption to run the discovery against a remote kubernetes cluster with a given kubeconfig.

func WithKubernetesDiscovererMasterUrl added in v0.1.5

func WithKubernetesDiscovererMasterUrl(masterUrl string) KubernetesDiscovererOption

WithKubernetesDiscovererMasterUrl is the KubernetesDiscovererOption to run the discovery against a remote kubernetes cluster with a given master URL.

func WithKubernetesDiscovererNamespace added in v0.1.5

func WithKubernetesDiscovererNamespace(namespace string) KubernetesDiscovererOption

WithKubernetesDiscovererNamespace is the KubernetesDiscovererOption to run the discovery against a given kubernetes resources namespace.

type NetworkDiscoverer added in v0.1.17

type NetworkDiscoverer struct {
	// contains filtered or unexported fields
}

NetworkDiscoverer represents a discoverer for network-reachable resources with a very rudimentary check using TCP probes. This check can (and will) give false positives or negatives. For a more thorough service detection, you would need a more comprehensive set of checks. Nmap for example uses a combination of probes and a large database of well known service banners to identify the service running on a particular port.

func NewNetworkDiscoverer added in v0.1.17

func NewNetworkDiscoverer(opts ...NetworkDiscovererOption) *NetworkDiscoverer

NewNetworkDiscoverer returns a new NetworkDiscoverer, initialized with the given options.

func (*NetworkDiscoverer) Discover added in v0.1.17

func (nd *NetworkDiscoverer) Discover(ctx context.Context) *discovery.Result

Discover runs the NetworkDiscoverer.

type NetworkDiscovererOption added in v0.1.17

type NetworkDiscovererOption func(*NetworkDiscoverer)

NetworkDiscovererOption represents a configuration option for a NetworkDiscoverer.

func WithNetworkDiscovererDiscovererId added in v0.1.17

func WithNetworkDiscovererDiscovererId(discovererId string) NetworkDiscovererOption

WithNetworkDiscovererDiscovererId is the NetworkDiscovererOption to set a non default discoverer id.

func WithNetworkDiscovererMaxConcurrency added in v0.1.17

func WithNetworkDiscovererMaxConcurrency(concurrency int64) NetworkDiscovererOption

WithNetworkDiscovererMaxConcurrency is the NetworkDiscovererOption to set a non default value for the maximum concurrency (port scans in-flight).

func WithNetworkDiscovererPorts added in v0.1.17

func WithNetworkDiscovererPorts(ports ...string) NetworkDiscovererOption

WithNetworkDiscovererPorts is the NetworkDiscovererOption to set non default target ports for discovery.

func WithNetworkDiscovererScanTimeout added in v0.1.17

func WithNetworkDiscovererScanTimeout(timeout time.Duration) NetworkDiscovererOption

WithNetworkDiscovererScanTimeout is the NetworkDiscovererOption to set a non default timeout for scanning the network.

func WithNetworkDiscovererTargets added in v0.1.17

func WithNetworkDiscovererTargets(targets ...string) NetworkDiscovererOption

WithNetworkDiscovererTargets is the NetworkDiscovererOption to set non default targets (IPs or DNS names) for discovery.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL