hooks

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InternalFatalError is a error, which will not be retried
	InternalFatalError = -1
	// InternalError is a error, which will  be retried
	InternalError = 0
	// InternalSuccess signals that a scan was successful
	InternalSuccess = 1
	// InternalNew defines a new scan
	InternalNew = 2
)
View Source
const (
	ReachableNot  = 0
	ReachableHTTP = 1
	ReachableSSL  = 2
	ReachableBoth = 3
)

reachable

View Source
const (
	ScanOnlySSL       = 1
	ScanOnlyHTTP      = 2
	ScanBoth          = 3
	ScanOnePreferSSL  = 4
	ScanOnePreferHTTP = 5
)

scanTypes

View Source
const (
	StatusError   = 255
	StatusPending = 0
	StatusDone    = 1
	StatusIgnored = 2
)

StatusValues for the SQL-Table

Variables

View Source
var ConfigureSetUp map[string]func(*ScanRow, chan ScanStatusMessage, interface{}) bool

ConfigureSetUp contains all the API-hooks for configuring the apis based on the commandline flags

View Source
var ContinueScan map[string]func(ScanRow) bool

ContinueScan contains all the API-hooks to check if the referenced api-version of the scan to be continued is up to date

View Source
var FlagSetUp map[string]func()

FlagSetUp contains all the API-hooks for adding and parsing flag values

View Source
var Logger *logrus.Entry

Logging

View Source
var ManagerHandleResults map[string]func(InternalMessage)

ManagerHandleResults contains all the API-hooks to the individual functions processing the incoming results

View Source
var ManagerHandleScan map[string]func([]DomainsReachable, chan InternalMessage) []DomainsReachable

ManagerHandleScan contains all the API-hooks to the individual functions needed to start the scans

View Source
var ManagerMap map[string]*Manager

ManagerMap is a map of all Managers that can be used

View Source
var ManagerParseConfig map[string]func(interface{})

ManagerParseConfig sets the given configuration

View Source
var ManagerSetUp map[string]func()

ManagerSetUp contains all the API-hooks to their individual SetUp-Functions

Functions

func Truncate

func Truncate(str string, trLen int) string

Types

type CertificateChainRow

type CertificateChainRow struct {
	ThumbprintSHA256     string
	NextThumbprintSHA256 string
	CreatedAt            string
	UpdatedAt            string
}

type CertificateRow

type CertificateRow struct {
	ThumbprintSHA256 string
	ThumbprintSHA1   string
	SerialNumber     string
	Subject          string
	IssuerSubject    string
	SigAlg           string
	RevocationStatus uint8
	Issues           int16
	KeyStrength      int16
	DebianInsecure   bool
	ValidFrom        string
	ValidTo          string
	CommonNames      string
	AltNames         string
	CreatedAt        string
	UpdatedAt        string
}

CertificateRow contins all the stored information of an entry in the Certificates-Table

type DomainsReachable

type DomainsReachable struct {
	DomainID        int
	DomainName      string
	DomainReachable int
	TestWithSSL     bool
}

DomainsReachable is the base type for receiving the domains which should be scanned

type DomainsRow

type DomainsRow struct {
	DomainID   int
	DomainName string
}

DomainsRow represents a row of the domains Table

type DomainsRowMetaInfo

type DomainsRowMetaInfo struct {
	DomainID   int
	DomainName string
	ListID     sql.NullString
	IsActive   bool
	NextScan   bool
}

type InternalMessage

type InternalMessage struct {
	Domain     DomainsReachable
	Results    interface{}
	Retries    int
	StatusCode int
}

InternalMessage is a struct used by all scan-apis to communicate in one scan-api

type Manager

type Manager struct {
	MaxRetries       int
	MaxParallelScans int
	Version          string
	Table            string
	ScanType         int
	OutputChannel    chan ScanStatusMessage
	Status           ScanStatus
	FinishError      int
	ScanID           int
	Errors           []InternalMessage
	FirstScan        bool
	Logger           *logrus.Entry
	LoggingTag       string
}

Manager is a struct which combines values and functions needed by all scans individually

func (*Manager) CheckDoError

func (manager *Manager) CheckDoError() bool

CheckDoError returns true if an error should be retried next

func (*Manager) GetTableName

func (manager *Manager) GetTableName() string

type ScanData

type ScanData struct {
	ScanID          int
	DomainID        int
	DomainReachable uint8
}

ScanData contains all the fields needed to create entries in the Scan-Tables

type ScanRow

type ScanRow struct {
	ScanID                 int
	SSLLabs                bool
	SSLLabsVersion         string
	Observatory            bool
	ObservatoryVersion     string
	SecurityHeaders        bool
	SecurityHeadersVersion string
	Crawler                bool
	CrawlerVersion         string
	Config                 sql.NullString
	Unreachable            int
	Total                  int
	Done                   bool
}

ScanRow represents a row of the ScanTable

type ScanStatus

type ScanStatus struct {
	CurrentScans    int32
	TotalScans      int32
	ErrorScans      int32
	FatalErrorScans int32
	FinishedScans   int32
}

ScanStatus with atomic access

func (*ScanStatus) AddCurrentScans

func (status *ScanStatus) AddCurrentScans(val int32)

func (*ScanStatus) AddErrorScans

func (status *ScanStatus) AddErrorScans(val int32)

func (*ScanStatus) AddFatalErrorScans

func (status *ScanStatus) AddFatalErrorScans(val int32)

func (*ScanStatus) AddFinishedScans

func (status *ScanStatus) AddFinishedScans(val int32)

func (*ScanStatus) GetCurrentScans

func (status *ScanStatus) GetCurrentScans() int32

func (*ScanStatus) GetErrorScans

func (status *ScanStatus) GetErrorScans() int32

func (*ScanStatus) GetFatalErrorScans

func (status *ScanStatus) GetFatalErrorScans() int32

func (*ScanStatus) GetFinishedScans

func (status *ScanStatus) GetFinishedScans() int32

func (*ScanStatus) GetRemainingScans

func (status *ScanStatus) GetRemainingScans() int32

func (*ScanStatus) GetTotalScans

func (status *ScanStatus) GetTotalScans() int32

func (*ScanStatus) SetTotalScans

func (status *ScanStatus) SetTotalScans(val int32)

type ScanStatusMessage

type ScanStatusMessage struct {
	Status *ScanStatus
	Sender string
}

ScanStatusMessage with atomic access

type ScanWhereCond

type ScanWhereCond struct {
	DomainID    int
	ScanID      int
	TestWithSSL bool
}

ScanWhereCond includes all fields needed to specify a particular entry in the Table

Jump to

Keyboard shortcuts

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