discoverers

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 31 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.

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 WithAwsEcsDiscovererExclusionClusterTags added in v0.1.7

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

WithAwsEcsDiscovererExclusionClusterTags is the AwsEcsDiscovererOption to set the inclusion tags filter for clusters 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 WithAwsEcsDiscovererIncludedClusterStatuses added in v0.1.7

func WithAwsEcsDiscovererIncludedClusterStatuses(statuses ...string) AwsEcsDiscovererOption

WithAwsEcsDiscovererIncludedClusterStatuses is the AwsEcsDiscovererOption to set a non default list of statuses for clusters to include in results.

func WithAwsEcsDiscovererInclusionClusterTags added in v0.1.7

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

WithAwsEcsDiscovererInclusionClusterTags is the AwsEcsDiscovererOption to set the inclusion tags filter for clusters to include in results.

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.

type AwsSsmDiscoverer added in v0.1.3

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

AwsSsmDiscoverer represents a discoverer for AWS SSM resources.

func NewAwsSsmDiscoverer added in v0.1.3

func NewAwsSsmDiscoverer(cfg aws.Config, opts ...AwsSsmDiscovererOption) *AwsSsmDiscoverer

NewAwsSsmDiscoverer returns a new AwsSsmDiscoverer, initialized with the given options.

func (*AwsSsmDiscoverer) Discover added in v0.1.3

func (ssmd *AwsSsmDiscoverer) Discover(ctx context.Context) *discovery.Result

Discover runs the AwsSsmDiscoverer.

type AwsSsmDiscovererOption added in v0.1.3

type AwsSsmDiscovererOption func(*AwsSsmDiscoverer)

AwsSsmDiscovererOption represents a configuration option for an AwsSsmDiscoverer.

func WithAwsSsmDiscovererDiscovererId added in v0.1.3

func WithAwsSsmDiscovererDiscovererId(discovererId string) AwsSsmDiscovererOption

WithAwsSsmDiscovererDiscovererId is the AwsSsmDiscovererOption to set a non default discoverer id.

func WithAwsSsmDiscovererGetAccountIdTimeout added in v0.1.3

func WithAwsSsmDiscovererGetAccountIdTimeout(timeout time.Duration) AwsSsmDiscovererOption

WithAwsSsmDiscovererGetAccountIdTimeout is the AwsSsmDiscovererOption to set a non default timeout for getting the aws account id.

func WithAwsSsmDiscovererIncludedInstancePingStatuses added in v0.1.7

func WithAwsSsmDiscovererIncludedInstancePingStatuses(statuses ...types.PingStatus) AwsSsmDiscovererOption

WithAwsSsmDiscovererIncludedInstancePingStatuses is the AwsSsmDiscovererOption to set a non default list of ping statuses for instances to include in results.

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 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 NaiveNetworkDiscoverer added in v0.1.4

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

NaiveNetworkDiscoverer 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 NewNaiveNetworkDiscoverer added in v0.1.4

func NewNaiveNetworkDiscoverer(opts ...NaiveNetworkDiscovererOption) *NaiveNetworkDiscoverer

NewNaiveNetworkDiscoverer returns a new NaiveNetworkDiscoverer, initialized with the given options.

func (*NaiveNetworkDiscoverer) Discover added in v0.1.4

Discover runs the NaiveNetworkDiscoverer.

type NaiveNetworkDiscovererOption added in v0.1.4

type NaiveNetworkDiscovererOption func(*NaiveNetworkDiscoverer)

NaiveNetworkDiscovererOption represents a configuration option for a NaiveNetworkDiscoverer.

func WithNaiveNetworkDiscovererDiscovererId added in v0.1.4

func WithNaiveNetworkDiscovererDiscovererId(discovererId string) NaiveNetworkDiscovererOption

WithNaiveNetworkDiscovererDiscovererId is the NaiveNetworkDiscovererOption to set a non default discoverer id.

func WithNaiveNetworkDiscovererPorts added in v0.1.4

func WithNaiveNetworkDiscovererPorts(ports ...string) NaiveNetworkDiscovererOption

WithNaiveNetworkDiscovererPorts is the NaiveNetworkDiscovererOption to set non default target ports for discovery.

func WithNaiveNetworkDiscovererScanTimeout added in v0.1.4

func WithNaiveNetworkDiscovererScanTimeout(timeout time.Duration) NaiveNetworkDiscovererOption

WithNaiveNetworkDiscovererScanTimeout is the NaiveNetworkDiscovererOption to set a non default timeout for scanning the network.

func WithNaiveNetworkDiscovererTargets added in v0.1.4

func WithNaiveNetworkDiscovererTargets(targets ...string) NaiveNetworkDiscovererOption

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

type NmapNetworkDiscoverer added in v0.1.4

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

NmapNetworkDiscoverer represents a discoverer for network-reachable resources using a library that relies on the nmap binary being present. Note that running the NmapNetworkDiscoverer without the nmap binary being available will result in failure to discover resources with this Discoverer.

func NewNmapNetworkDiscoverer added in v0.1.4

func NewNmapNetworkDiscoverer(opts ...NmapNetworkDiscovererOption) *NmapNetworkDiscoverer

NewNmapNetworkDiscoverer returns a new NmapNetworkDiscoverer, initialized with the given options.

func (*NmapNetworkDiscoverer) Discover added in v0.1.4

Discover runs the NmapNetworkDiscoverer.

type NmapNetworkDiscovererOption added in v0.1.4

type NmapNetworkDiscovererOption func(*NmapNetworkDiscoverer)

NmapNetworkDiscovererOption represents a configuration option for an NmapNetworkDiscoverer.

func WithNmapNetworkDiscovererDiscovererId added in v0.1.4

func WithNmapNetworkDiscovererDiscovererId(discovererId string) NmapNetworkDiscovererOption

WithNmapNetworkDiscovererDiscovererId is the NmapNetworkDiscovererOption to set a non default discoverer id.

func WithNmapNetworkDiscovererMaxScanDelay added in v0.1.4

func WithNmapNetworkDiscovererMaxScanDelay(delay time.Duration) NmapNetworkDiscovererOption

WithNmapNetworkDiscovererMaxScanDelay is the NmapNetworkDiscovererOption to set non default max delay for discovery (time between probes).

func WithNmapNetworkDiscovererMaxScanRate added in v0.1.4

func WithNmapNetworkDiscovererMaxScanRate(packetsPerSecond int) NmapNetworkDiscovererOption

WithNmapNetworkDiscovererMaxScanRate is the NmapNetworkDiscovererOption to set non default max rate for discovery (packets per second).

func WithNmapNetworkDiscovererMinScanDelay added in v0.1.4

func WithNmapNetworkDiscovererMinScanDelay(delay time.Duration) NmapNetworkDiscovererOption

WithNmapNetworkDiscovererMinScanDelay is the NmapNetworkDiscovererOption to set non default min delay for discovery (time between probes).

func WithNmapNetworkDiscovererMinScanRate added in v0.1.4

func WithNmapNetworkDiscovererMinScanRate(packetsPerSecond int) NmapNetworkDiscovererOption

WithNmapNetworkDiscovererMinScanRate is the NmapNetworkDiscovererOption to set non default min rate for discovery (packets per second).

func WithNmapNetworkDiscovererPorts added in v0.1.4

func WithNmapNetworkDiscovererPorts(ports ...string) NmapNetworkDiscovererOption

WithNmapNetworkDiscovererPorts is the NmapNetworkDiscovererOption to set non default target ports for discovery.

func WithNmapNetworkDiscovererScanTimeout added in v0.1.4

func WithNmapNetworkDiscovererScanTimeout(timeout time.Duration) NmapNetworkDiscovererOption

WithNmapNetworkDiscovererScanTimeout is the NmapNetworkDiscovererOption to set a non default timeout for scanning the network.

func WithNmapNetworkDiscovererTargets added in v0.1.4

func WithNmapNetworkDiscovererTargets(targets ...string) NmapNetworkDiscovererOption

WithNmapNetworkDiscovererTargets is the NmapNetworkDiscovererOption 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