Documentation
¶
Index ¶
- Constants
- Variables
- func CreateConfigPathStructure(configRoot string) error
- func CreateDefaultConfigIfMissing(path string) (bool, error)
- func GetConfigRoot(root string, homeDir string, appName string) string
- type Config
- type GlobalConfig
- type Messages
- type Providers
- type RatingConfig
- type Session
- type Stats
Constants ¶
View Source
const ( DefaultMaxReports = 5 DefaultConfigFileName = "config.yaml" )
Variables ¶
View Source
var ( ErrLoggerNotSet = errors.New("logger not set") ErrStatsNotSet = errors.New("stats not set") ErrCacheNotSet = errors.New("cache not set") )
View Source
var DefaultConfig string
Functions ¶
func CreateConfigPathStructure ¶
CreateConfigPathStructure creates all the necessary paths under session root if they don't exist and returns an error if it fails to create the directory, or the session root does not exist
func CreateDefaultConfigIfMissing ¶
CreateDefaultConfigIfMissing creates a default session configuration file if it does not exist and returns true if it was created, or false if it already exists
Types ¶
type Config ¶
type Config struct {
Global GlobalConfig `mapstructure:"global"`
Rating RatingConfig `mapstructure:"rating"`
}
type GlobalConfig ¶
type GlobalConfig struct {
LogLevel string `mapstructure:"log-level"`
Output string `mapstructure:"output"`
HomeDir string
IndentSpaces int `mapstructure:"indent-spaces"`
Ports []string `mapstructure:"ports"`
MaxValueChars int32 `mapstructure:"max-value-chars"`
MaxAge string `mapstructure:"max-age"`
MaxReports int `mapstructure:"max-reports"`
DisableCache bool `mapstructure:"disable-cache"`
Style string `mapstructure:"style"`
InitialiseCacheOnly bool
FilterProviders []string `mapstructure:"filter-providers"`
}
type Providers ¶
type Providers struct {
AbuseIPDB struct {
APIKey string
Enabled *bool `mapstructure:"enabled"`
ResultCacheTTL int64 `mapstructure:"result_cache_ttl"`
MaxAge int `mapstructure:"max-age"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"abuseipdb"`
Alibaba struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"alibaba"`
Annotated struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
Paths []string `mapstructure:"paths"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"annotated"`
AWS struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"aws"`
Azure struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"azure"`
AzureWAF struct {
Enabled *bool `mapstructure:"enabled"`
ResourceIDs []string `mapstructure:"resource_ids"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"azure"`
Bingbot struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"bingbot"`
CriminalIP struct {
APIKey string
ResultCacheTTL int64 `mapstructure:"result_cache_ttl"`
Enabled *bool `mapstructure:"enabled"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"criminalip"`
DigitalOcean struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"digitalocean"`
GCP struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"gcp"`
Google struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"google"`
Googlebot struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"googlebot"`
GoogleSC struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"googlesc"`
Hetzner struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"hetzner"`
ICloudPR struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"icloudpr"`
IPAPI struct {
APIKey string
Enabled *bool `mapstructure:"enabled"`
ResultCacheTTL int64 `mapstructure:"result_cache_ttl"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"ipapi"`
IPQS struct {
APIKey string
Enabled *bool `mapstructure:"enabled"`
ResultCacheTTL int64 `mapstructure:"result_cache_ttl"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"ipqs"`
IPURL struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URLs []string `mapstructure:"urls"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"ipurl"`
Linode struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"linode"`
M247 struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"m247"`
OVH struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"ovh"`
Scaleway struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"scaleway"`
Shodan struct {
APIKey string
ResultCacheTTL int64 `mapstructure:"result_cache_ttl"`
Enabled *bool `mapstructure:"enabled"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"shodan"`
PTR struct {
Enabled *bool `mapstructure:"enabled"`
ResultCacheTTL int64 `mapstructure:"result_cache_ttl"`
Nameservers []string `mapstructure:"nameservers"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"ptr"`
VirusTotal struct {
APIKey string
ResultCacheTTL int64 `mapstructure:"result_cache_ttl"`
ShowProviders *bool `mapstructure:"show_providers"`
ShowUnrated *bool `mapstructure:"show_unrated"`
ShowHarmless *bool `mapstructure:"show_harmless"`
ShowClean *bool `mapstructure:"show_clean"`
Enabled *bool `mapstructure:"enabled"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"virustotal"`
Vultr struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"vultr"`
Zscaler struct {
Enabled *bool `mapstructure:"enabled"`
DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"`
URL string `mapstructure:"url"`
OutputPriority *int32 `mapstructure:"output_priority"`
} `mapstructure:"zscaler"`
}
type RatingConfig ¶
type Session ¶
type Session struct {
App struct {
Version string
SemVer string
}
Logger *slog.Logger
Stats *Stats
Target *os.File
Output string
Messages *Messages
Cache *badger.DB
Config Config
HTTPClient *retryablehttp.Client
Host netip.Addr
Providers Providers `mapstructure:"providers"`
HideProgress bool `mapstructure:"hide-progress"`
UseTestData bool
}
Click to show internal directories.
Click to hide internal directories.