scan

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout = time.Second

Functions

This section is empty.

Types

type AXFRScanner

type AXFRScanner struct {
	DNSServer string
	Domain    string

	Ports       []int16
	Scans       []ConnScanner
	Concurrency int
	// contains filtered or unexported fields
}

AXFRScanner will query DNS records via AXFR and aggregate the results of each IP (and theirrelated DNS records) represented in the set of DNS records.

func (AXFRScanner) Scan

func (a AXFRScanner) Scan(ctx context.Context) (Certer, error)

type Certer

type Certer interface {
	Read(context.Context, chan<- *x509.Certificate, chan<- error)
}

type ChanCerter

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

func NewChanCerter

func NewChanCerter() ChanCerter

NewChanCerter returns a new ChanCerter

func (ChanCerter) Close

func (cc ChanCerter) Close() error

Close closes the underlying channels

func (ChanCerter) Read

func (cc ChanCerter) Read(ctx context.Context, cout chan<- *x509.Certificate, eout chan<- error)

type ConnScanFunc

type ConnScanFunc func(context.Context, net.Conn) ([]*x509.Certificate, error)

func (ConnScanFunc) ScanConn

func (csf ConnScanFunc) ScanConn(ctx context.Context, conn net.Conn) (Certer, error)

type ConnScanner

type ConnScanner interface {
	ScanConn(context.Context, net.Conn) (Certer, error)
}

type HandshakeScanner

type HandshakeScanner struct {
	Configs []*tls.Config
}

A HandshakeScanner can scan a connection with multiple DNSNames

func (HandshakeScanner) ScanConn

func (hs HandshakeScanner) ScanConn(ctx context.Context, conn net.Conn) (Certer, error)

ScanConn scans a net.Conn for TLS certificates by attempting a direct TLS handshake.

type IPScanner

type IPScanner struct {
	IP      net.IP
	Ports   []int16
	Scans   []ConnScanner
	Timeout time.Duration
}

An IPScanner can scan a single IP

func (IPScanner) Scan

func (is IPScanner) Scan(ctx context.Context) (Certer, error)

type KubeSecretScanner

type KubeSecretScanner struct {
	KubeConfig *rest.Config
	// Any extra ways of extracting data from secrets files
	Extra []func(v1.Secret) ([]*x509.Certificate, error)
}

A KubeSecretScanner can scan kubernetes secrets from inside the cluster.

func (*KubeSecretScanner) Read

func (s *KubeSecretScanner) Read(ctx context.Context, certs chan<- *x509.Certificate, errs chan<- error)

Read implements Certer

func (*KubeSecretScanner) Scan

Scan implements Scanner :sob:

type MultiScanner

type MultiScanner struct {
	Scanners    []Scanner
	Concurrency int
}

MultiScanner can aggregate multiple scanners concurrently

func (MultiScanner) Scan

func (mc MultiScanner) Scan(ctx context.Context) (Certer, error)

Scan implements Scan for multiple Scanners concurrently

type Scanner

type Scanner interface {
	Scan(context.Context) (Certer, error)
}

A Scanner implementation can return a stream of certificates, but may error

type SecretDataError

type SecretDataError struct {
	Namespace, SecretName, Path string
	Cause                       error
}

SecretDataError describes secrets that were invalid, and the secret key.

func (*SecretDataError) Error

func (k *SecretDataError) Error() string

type SliceCerter

type SliceCerter []*x509.Certificate

func (SliceCerter) Read

func (sc SliceCerter) Read(ctx context.Context, cout chan<- *x509.Certificate, eout chan<- error)

Jump to

Keyboard shortcuts

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