core

package
v4.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EarlybirdCfg

type EarlybirdCfg struct {
	Config cfgReader.EarlybirdConfig
}

EarlybirdCfg is the global Earlybird configuration

func (*EarlybirdCfg) ConfigInit

func (eb *EarlybirdCfg) ConfigInit()

ConfigInit loads in the earlybird configuration and CLI flags

func (*EarlybirdCfg) FileContext

func (eb *EarlybirdCfg) FileContext() (fileContext file.Context, err error)

FileContext provides an inclusive file system context of our scan

func (*EarlybirdCfg) GetRuleModulesMap

func (eb *EarlybirdCfg) GetRuleModulesMap() (err error)

GetRuleModulesMap walks the `rules` directory and creates a hash map of module name to the filename for example { content: 'content.json', ccnumber: 'ccnumber.json' }, and generates a list of the available modules in the `rules` directory

func (*EarlybirdCfg) GitClone

func (eb *EarlybirdCfg) GitClone(ptr PTRGitConfig)

GitClone clones git repositories into a temporary directory

func (*EarlybirdCfg) LoadModuleConfig

func (eb *EarlybirdCfg) LoadModuleConfig(moduleConfigFilePath string)

Load module config if user has passed a config file for individual modules with -module-config-file flag

func (*EarlybirdCfg) Scan

func (eb *EarlybirdCfg) Scan()

Scan Runs the scan by kicking off the different modules as go routines

func (*EarlybirdCfg) StartHTTP

func (eb *EarlybirdCfg) StartHTTP(ptr PTRHTTPConfig)

StartHTTP spins up the Earlybird REST API server

func (*EarlybirdCfg) WriteResults

func (eb *EarlybirdCfg) WriteResults(start time.Time, HitChannel chan scan.Hit, fileContext file.Context)

WriteResults reads hits from the channel to the console or target file

type EarlybirdCore

type EarlybirdCore interface {
	ConfigInit() cfgReader.EarlybirdConfig
	StartHTTP()
	Scan()
}

EarlybirdCore is the main interface for interacting with Earlybird as a package

type PTRGitConfig

type PTRGitConfig struct {
	Repo       *string
	RepoUser   *string
	RepoBranch *string
	Project    *string
}

PTRGitConfig is the configuration definition for Earlybird git scans

type PTRHTTPConfig

type PTRHTTPConfig struct {
	HTTP       *string
	HTTPConfig *string
	HTTPS      *string
	HTTPSCert  *string
	HTTPSKey   *string
}

PTRHTTPConfig is the configuration for the Earlybird REST API

Jump to

Keyboard shortcuts

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