reporting

package
v3.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 28 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReportingClientCreation = errors.New("could not create reporting client")
	ErrExportClientCreation    = errors.New("could not create exporting client")
)

Functions

func CreateConfigIfNotExists

func CreateConfigIfNotExists() error

CreateConfigIfNotExists creates report-config if it doesn't exist

Types

type Client

type Client interface {
	RegisterTracker(tracker Tracker)
	RegisterExporter(exporter Exporter)
	Close()
	Clear()
	CreateIssue(event *output.ResultEvent) error
	CloseIssue(event *output.ResultEvent) error
	GetReportingOptions() *Options
}

Client is a client for nuclei issue tracking module

func New

func New(options *Options, db string, doNotDedupe bool) (Client, error)

New creates a new nuclei issue tracker reporting client

type Exporter

type Exporter interface {
	// Close closes the exporter after operation
	Close() error
	// Export exports an issue to an exporter
	Export(event *output.ResultEvent) error
}

Exporter is an interface implemented by an issue exporter

type IssueTrackerStats added in v3.2.0

type IssueTrackerStats struct {
	Created atomic.Int32
	Failed  atomic.Int32
}

type Options

type Options struct {
	// AllowList contains a list of allowed events for reporting module
	AllowList *filters.Filter `yaml:"allow-list"`
	// DenyList contains a list of denied events for reporting module
	DenyList *filters.Filter `yaml:"deny-list"`
	// GitHub contains configuration options for GitHub Issue Tracker
	GitHub *github.Options `yaml:"github"`
	// GitLab contains configuration options for GitLab Issue Tracker
	GitLab *gitlab.Options `yaml:"gitlab"`
	// Gitea contains configuration options for Gitea Issue Tracker
	Gitea *gitea.Options `yaml:"gitea"`
	// Jira contains configuration options for Jira Issue Tracker
	Jira *jira.Options `yaml:"jira"`
	// Linear contains configuration options for Linear Issue Tracker
	Linear *linear.Options `yaml:"linear"`
	// MarkdownExporter contains configuration options for Markdown Exporter Module
	MarkdownExporter *markdown.Options `yaml:"markdown"`
	// SarifExporter contains configuration options for Sarif Exporter Module
	SarifExporter *sarif.Options `yaml:"sarif"`
	// ElasticsearchExporter contains configuration options for Elasticsearch Exporter Module
	ElasticsearchExporter *es.Options `yaml:"elasticsearch"`
	// SplunkExporter contains configuration options for splunkhec Exporter Module
	SplunkExporter *splunk.Options `yaml:"splunkhec"`
	// JSONExporter contains configuration options for JSON Exporter Module
	JSONExporter *jsonexporter.Options `yaml:"json"`
	// JSONLExporter contains configuration options for JSONL Exporter Module
	JSONLExporter *jsonl.Options `yaml:"jsonl"`
	// MongoDBExporter containers the configuration options for the MongoDB Exporter Module
	MongoDBExporter *mongo.Options `yaml:"mongodb"`

	HttpClient *retryablehttp.Client `yaml:"-"`
	OmitRaw    bool                  `yaml:"-"`
}

Options is a configuration file for nuclei reporting module

type ReportingClient

type ReportingClient struct {
	// contains filtered or unexported fields
}

ReportingClient is a client for nuclei issue tracking module

func (*ReportingClient) Clear

func (c *ReportingClient) Clear()

func (*ReportingClient) Close

func (c *ReportingClient) Close()

Close closes the issue tracker reporting client

func (*ReportingClient) CloseIssue added in v3.2.0

func (c *ReportingClient) CloseIssue(event *output.ResultEvent) error

CloseIssue closes an issue in the tracker

func (*ReportingClient) CreateIssue

func (c *ReportingClient) CreateIssue(event *output.ResultEvent) error

CreateIssue creates an issue in the tracker

func (*ReportingClient) GetReportingOptions

func (c *ReportingClient) GetReportingOptions() *Options

func (*ReportingClient) RegisterExporter

func (c *ReportingClient) RegisterExporter(exporter Exporter)

RegisterExporter registers a custom exporter to the reporter

func (*ReportingClient) RegisterTracker

func (c *ReportingClient) RegisterTracker(tracker Tracker)

RegisterTracker registers a custom tracker to the reporter

type Tracker

type Tracker interface {
	// Name returns the name of the tracker
	Name() string
	// CreateIssue creates an issue in the tracker
	CreateIssue(event *output.ResultEvent) (*filters.CreateIssueResponse, error)
	// CloseIssue closes an issue in the tracker
	CloseIssue(event *output.ResultEvent) error
	// ShouldFilter determines if the event should be filtered out
	ShouldFilter(event *output.ResultEvent) bool
}

Tracker is an interface implemented by an issue tracker

Directories

Path Synopsis
Package dedupe implements deduplication layer for nuclei-generated issues.
Package dedupe implements deduplication layer for nuclei-generated issues.
exporters
es
trackers
linear/jsonutil
Package jsonutil provides a function for decoding JSON into a GraphQL query data structure.
Package jsonutil provides a function for decoding JSON into a GraphQL query data structure.

Jump to

Keyboard shortcuts

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