applicationscanning

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
}

func (Checker) ExternalDNS

func (c Checker) ExternalDNS(ctx context.Context, hostname string, externalDNS []string) error

ExternalDNS initiates the DNS resolution process by using an external DNS provider as the resolver.

func (Checker) HTTP

func (c Checker) HTTP(ctx context.Context, userAgent, hostname string, customHeaders map[string]string, openPorts []int) ([]string, error)

HTTP sends an HTTP request to the open ports found on your hostname and returns back a list of URLs. It might be that no URLs are to be returned - in that case an out-of-scope error might be returned, or a HTTP timeout warning. In the case the user agent provided resulted in the request being blocked, then a relevant error is returned.

func (Checker) NativeDNS

func (c Checker) NativeDNS(ctx context.Context, hostname string) (ips []string, err error)

NativeDNS initializes the DNS resolution process by using the cluster-internal DNS resolvers.

func (Checker) Ports

func (c Checker) Ports(ctx context.Context, ips []string, ports []int) (openPorts []int, err error)

Ports consumes a list of IPs discovered as well as ports and returns back a list of open ports accross them. It does that by looping (max 3 attempts) through the IPs discovered and consequently the ports provided, and executes a TCP-dial on each combination.

type Resolver

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

Resolver implements the Resolver interface and supports external DNS resolvers.

func NewResolver

func NewResolver(externalDNS []string) *Resolver

NewResolver generates and returns a Resolver pointer instance including any external DNS resolver configuration.

func NewResolverWithCheckers

func NewResolverWithCheckers(externalDNS []string, checker endpointresolver.Checker) *Resolver

NewResolverWithCheckers generates and returns a Resolver pointer instance including any external DNS resolver configuration as well as injects a Checker interface implementation.

func (*Resolver) Resolve

func (c *Resolver) Resolve(ctx context.Context, conf endpointresolver.ResolveConf) (urls []string, err error)

Resolve does a full resolution check by consequently executing open ports, DNS and HTTP checks. Returns back a list of valid URLs, or an error.

Jump to

Keyboard shortcuts

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