Documentation
¶
Index ¶
Constants ¶
const ( // RedHat is RedHat = "redhat" // Debian is Debian = "debian" // Ubuntu is Ubuntu = "ubuntu" // CentOS is CentOS = "centos" // Fedora is Fedora = "fedora" // Amazon is Amazon = "amazon" // Oracle is Oracle = "oracle" // FreeBSD is FreeBSD = "freebsd" // Raspbian is Raspbian = "raspbian" // Windows is Windows = "windows" // OpenSUSE is OpenSUSE = "opensuse" // OpenSUSELeap is OpenSUSELeap = "opensuse.leap" // SUSEEnterpriseServer is SUSEEnterpriseServer = "suse.linux.enterprise.server" // SUSEEnterpriseDesktop is SUSEEnterpriseDesktop = "suse.linux.enterprise.desktop" // SUSEOpenstackCloud is SUSEOpenstackCloud = "suse.openstack.cloud" // Alpine is Alpine = "alpine" )
const (
// ServerTypePseudo is used for ServerInfo.Type
ServerTypePseudo = "pseudo"
)
Variables ¶
var ( // Colors has ansi color list Colors = []string{ "\033[32m", "\033[33m", "\033[36m", "\033[35m", "\033[31m", "\033[34m", } // ResetColor is reset color ResetColor = "\033[0m" )
var Revision string
Revision of Git
var Version = "0.5.0"
Version of Vuls
Functions ¶
Types ¶
type Config ¶
type Config struct {
Debug bool
DebugSQL bool
Lang string
EMail SMTPConf
Slack SlackConf
Default ServerInfo
Servers map[string]ServerInfo
CvssScoreOver float64
IgnoreUnscoredCves bool
IgnoreUnfixed bool
SSHNative bool
ContainersOnly bool
Deep bool
SkipBroken bool
HTTPProxy string `valid:"url"`
LogDir string
ResultsDir string
CveDBType string
CveDBPath string
CveDBURL string
OvalDBType string
OvalDBPath string
OvalDBURL string
CacheDBPath string
RefreshCve bool
FormatXML bool
FormatJSON bool
FormatOneEMail bool
FormatOneLineText bool
FormatShortText bool
FormatFullText bool
GZIP bool
AwsProfile string
AwsRegion string
S3Bucket string
S3ResultsDir string
AzureAccount string
AzureKey string `json:"-"`
AzureContainer string
Pipe bool
Diff bool
UUID bool
}
Config is struct of Configuration
var Conf Config
Conf has Configuration
func (Config) ValidateOnConfigtest ¶ added in v0.2.0
ValidateOnConfigtest validates
func (Config) ValidateOnPrepare ¶ added in v0.2.0
ValidateOnPrepare validates configuration
func (Config) ValidateOnReport ¶ added in v0.2.0
ValidateOnReport validates configuration
func (Config) ValidateOnScan ¶ added in v0.2.0
ValidateOnScan validates configuration
func (Config) ValidateOnTui ¶ added in v0.2.0
ValidateOnTui validates configuration
type Containers ¶ added in v0.3.0
type Containers struct {
Type string `toml:"type,omitempty"`
Includes []string `toml:"includes,omitempty"`
Excludes []string `toml:"excludes,omitempty"`
}
Containers has Containers information.
type Distro ¶ added in v0.1.6
Distro has distribution info
func (Distro) MajorVersion ¶ added in v0.3.0
MajorVersion returns Major version
type JSONLoader ¶
type JSONLoader struct {
}
JSONLoader loads configuration
func (JSONLoader) Load ¶
func (c JSONLoader) Load(path, sudoPass, keyPass string) (err error)
Load load the configuration JSON file specified by path arg.
type SMTPConf ¶ added in v0.3.0
type SMTPConf struct {
SMTPAddr string `toml:"smtpAddr,omitempty"`
SMTPPort string `toml:"smtpPort,omitempty" valid:"port"`
User string `toml:"user,omitempty"`
Password string `toml:"password,omitempty" json:"-"`
From string `toml:"from,omitempty"`
To []string `toml:"to,omitempty"`
Cc []string `toml:"cc,omitempty"`
SubjectPrefix string `toml:"subjectPrefix,omitempty"`
}
SMTPConf is smtp config
type ServerInfo ¶
type ServerInfo struct {
ServerName string `toml:"-"`
User string `toml:"user,omitempty"`
Host string `toml:"host,omitempty"`
Port string `toml:"port,omitempty"`
KeyPath string `toml:"keyPath,omitempty"`
KeyPassword string `json:"-" toml:"-"`
CpeNames []string `toml:"cpeNames,omitempty"`
DependencyCheckXMLPath string `toml:"dependencyCheckXMLPath,omitempty"`
IgnoreCves []string `toml:"ignoreCves,omitempty"`
Containers *Containers `toml:"containers,omitempty"`
UUIDs map[string]string `toml:"uuids,omitempty"`
Memo string `toml:"memo,omitempty"`
// For CentOS, RHEL, Amazon
Enablerepo []string `toml:",omitempty"`
// Optional key-value set that will be outputted to JSON
Optional map[string]interface{} `toml:",omitempty"`
// "pseudo" or ""
Type string
// used internal
LogMsgAnsiColor string `toml:"-"` // DebugLog Color
Container Container `toml:"-"`
Distro Distro `toml:"-"`
}
ServerInfo has SSH Info, additional CPE packages to scan.
func (ServerInfo) GetServerName ¶ added in v0.1.7
func (s ServerInfo) GetServerName() string
GetServerName returns ServerName if this serverInfo is about host. If this serverInfo is abount a container, returns containerID@ServerName
func (ServerInfo) IsContainer ¶ added in v0.1.4
func (s ServerInfo) IsContainer() bool
IsContainer returns whether this ServerInfo is about container
func (*ServerInfo) SetContainer ¶ added in v0.1.4
func (s *ServerInfo) SetContainer(d Container)
SetContainer set container
type SlackConf ¶
type SlackConf struct {
HookURL string `valid:"url" json:"-" toml:"hookURL,omitempty"`
LegacyToken string `json:"token" toml:"legacyToken,omitempty"`
Channel string `json:"channel" toml:"channel,omitempty"`
IconEmoji string `json:"icon_emoji" toml:"iconEmoji,omitempty"`
AuthUser string `json:"username" toml:"authUser,omitempty"`
NotifyUsers []string `toml:"notifyUsers,omitempty"`
Text string `json:"text"`
}
SlackConf is slack config
type TOMLLoader ¶
type TOMLLoader struct {
}
TOMLLoader loads config
func (TOMLLoader) Load ¶
func (c TOMLLoader) Load(pathToToml, keyPass string) error
Load load the configuraiton TOML file specified by path arg.