Documentation ¶
Index ¶
- Variables
- func JSONDir(resultsDir string, args []string) (path string, err error)
- func ListValidJSONDirs(resultsDir string) (dirs []string, err error)
- func LoadScanResults(jsonDir string) (results models.ScanResults, err error)
- func OverwriteJSONFile(dir string, r models.ScanResult) error
- type AzureBlobWriter
- type ChatWorkWriter
- type EMailSender
- type EMailWriter
- type GoogleChatWriter
- type HTTPRequestWriter
- type HTTPResponseWriter
- type LocalFileWriter
- type ResultWriter
- type S3Writer
- type SlackWriter
- type StdoutWriter
- type SyslogWriter
- type TelegramWriter
Constants ¶
This section is empty.
Variables ¶
var ErrBucketExistCheck = xerrors.New("bucket existence cannot be checked because s3:ListBucket or s3:ListAllMyBuckets is not allowed")
ErrBucketExistCheck : bucket existence cannot be checked because s3:ListBucket or s3:ListAllMyBuckets is not allowed
Functions ¶
func JSONDir ¶
JSONDir returns If there is args, check if it is a valid format and return the corresponding path under results. If arg passed via PIPE (such as history subcommand), return that path. Otherwise, returns the path of the latest directory
func ListValidJSONDirs ¶
ListValidJSONDirs returns valid json directory as array Returned array is sorted so that recent directories are at the head
func LoadScanResults ¶
func LoadScanResults(jsonDir string) (results models.ScanResults, err error)
LoadScanResults read JSON data
func OverwriteJSONFile ¶
func OverwriteJSONFile(dir string, r models.ScanResult) error
OverwriteJSONFile overwrites scanresults JSON in the dir
Types ¶
type AzureBlobWriter ¶
type AzureBlobWriter struct { FormatJSON bool FormatFullText bool FormatOneLineText bool FormatList bool Gzip bool config.AzureConf }
AzureBlobWriter writes results to AzureBlob
func (AzureBlobWriter) Validate ¶
func (w AzureBlobWriter) Validate() error
Validate check the existence of Azure storage container
func (AzureBlobWriter) Write ¶
func (w AzureBlobWriter) Write(rs ...models.ScanResult) (err error)
Write results to Azure Blob storage
type ChatWorkWriter ¶
type ChatWorkWriter struct { Cnf config.ChatWorkConf Proxy string }
ChatWorkWriter send report to ChatWork
func (ChatWorkWriter) Write ¶
func (w ChatWorkWriter) Write(rs ...models.ScanResult) (err error)
Write results to ChatWork
type EMailSender ¶
EMailSender is interface of sending e-mail
func NewEMailSender ¶
func NewEMailSender(cnf config.SMTPConf) EMailSender
NewEMailSender creates emailSender
type EMailWriter ¶
type EMailWriter struct { FormatOneEMail bool FormatOneLineText bool FormatList bool Cnf config.SMTPConf }
EMailWriter send mail
func (EMailWriter) Write ¶
func (w EMailWriter) Write(rs ...models.ScanResult) (err error)
Write results to Email
type GoogleChatWriter ¶ added in v0.15.13
type GoogleChatWriter struct { Cnf config.GoogleChatConf Proxy string }
GoogleChatWriter send report to GoogleChat
func (GoogleChatWriter) Write ¶ added in v0.15.13
func (w GoogleChatWriter) Write(rs ...models.ScanResult) (err error)
Write results to Google Chat
type HTTPRequestWriter ¶
type HTTPRequestWriter struct {
URL string
}
HTTPRequestWriter writes results to HTTP request
func (HTTPRequestWriter) Write ¶
func (w HTTPRequestWriter) Write(rs ...models.ScanResult) (err error)
Write sends results as HTTP response
type HTTPResponseWriter ¶
type HTTPResponseWriter struct {
Writer http.ResponseWriter
}
HTTPResponseWriter writes results to HTTP response
func (HTTPResponseWriter) Write ¶
func (w HTTPResponseWriter) Write(rs ...models.ScanResult) (err error)
Write sends results as HTTP response
type LocalFileWriter ¶
type LocalFileWriter struct { CurrentDir string DiffPlus bool DiffMinus bool FormatJSON bool FormatCsv bool FormatFullText bool FormatOneLineText bool FormatList bool FormatCycloneDXJSON bool FormatCycloneDXXML bool Gzip bool }
LocalFileWriter writes results to a local file.
func (LocalFileWriter) Write ¶
func (w LocalFileWriter) Write(rs ...models.ScanResult) (err error)
Write results to Local File
type ResultWriter ¶
type ResultWriter interface {
Write(...models.ScanResult) error
}
ResultWriter Interface
type S3Writer ¶
type S3Writer struct { FormatJSON bool FormatFullText bool FormatOneLineText bool FormatList bool Gzip bool config.AWSConf }
S3Writer writes results to S3
func (S3Writer) Write ¶
func (w S3Writer) Write(rs ...models.ScanResult) (err error)
Write results to S3 https://docs.aws.amazon.com/en_us/code-library/latest/ug/go_2_s3_code_examples.html
type SlackWriter ¶
type SlackWriter struct { FormatOneLineText bool Cnf config.SlackConf Proxy string // contains filtered or unexported fields }
SlackWriter send report to slack
func (SlackWriter) Write ¶
func (w SlackWriter) Write(rs ...models.ScanResult) (err error)
Write results to Slack
type StdoutWriter ¶
StdoutWriter write to stdout
func (StdoutWriter) Write ¶
func (w StdoutWriter) Write(rs ...models.ScanResult) error
Write results to stdout
func (StdoutWriter) WriteScanSummary ¶
func (w StdoutWriter) WriteScanSummary(rs ...models.ScanResult)
WriteScanSummary prints Scan summary at the end of scan
type SyslogWriter ¶
type SyslogWriter struct {
Cnf syslogConf.Conf
}
SyslogWriter send report to syslog
func (SyslogWriter) Write ¶
func (w SyslogWriter) Write(rs ...models.ScanResult) (err error)
Write results to syslog
type TelegramWriter ¶
type TelegramWriter struct { Cnf config.TelegramConf Proxy string }
TelegramWriter sends report to Telegram
func (TelegramWriter) Write ¶
func (w TelegramWriter) Write(rs ...models.ScanResult) (err error)
Write results to Telegram