Documentation
¶
Index ¶
- Constants
- type AuthInfo
- type CVSS
- type CloudSection
- type DataSource
- type Enricher
- type EventsCreator
- type HostSection
- type Instance
- type Machine
- type MockEnricher
- type MockEnricher_EnrichEvent_Call
- func (_c *MockEnricher_EnrichEvent_Call) Return(_a0 error) *MockEnricher_EnrichEvent_Call
- func (_c *MockEnricher_EnrichEvent_Call) Run(run func(event *beat.Event)) *MockEnricher_EnrichEvent_Call
- func (_c *MockEnricher_EnrichEvent_Call) RunAndReturn(run func(*beat.Event) error) *MockEnricher_EnrichEvent_Call
- type MockEnricher_Expecter
- type NetworkSection
- type Os
- type Package
- type Resource
- type Result
- type Scanner
- type Score
- type Security
- type Service
- type SnapshotManager
- func (s *SnapshotManager) Cleanup(ctx context.Context)
- func (s *SnapshotManager) CreateSnapshots(ctx context.Context, ins *ec2.Ec2Instance) ([]ec2.EBSSnapshot, error)
- func (s *SnapshotManager) DeleteOldSnapshots(ctx context.Context)
- func (s *SnapshotManager) DeleteSnapshot(ctx context.Context, snapshot ec2.EBSSnapshot)
- type VendorCVSS
- type Vulnerability
- type VulnerabilityFetcher
- type VulnerabilityReplicator
- type VulnerabilityRunner
- type VulnerabilityScanner
- type VulnerabilityVerifier
- type VulnerabilityWorker
Constants ¶
const NVDVulnDetailBaseURL = "https://nvd.nist.gov/vuln/detail/"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudSection ¶
type CloudSection struct { Service Service `json:"service,omitempty"` Machine Machine `json:"machine,omitempty"` Tags map[string]string `json:"Tags,omitempty"` AvailabilityZone *string `json:"availability_zone,omitempty"` Region string `json:"region,omitempty"` Instance Instance `json:"instance,omitempty"` Security Security `json:"Security,omitempty"` }
We aren't using the cloud processor here because we want to assign information regarding the scanned resource and not the scanner
type DataSource ¶
type EventsCreator ¶
type EventsCreator struct {
// contains filtered or unexported fields
}
func NewEventsCreator ¶
func NewEventsCreator(log *clog.Logger, cfg *config.Config, bdp dataprovider.CommonDataProvider, cdp dataprovider.ElasticCommonDataProvider) EventsCreator
func (EventsCreator) CreateEvents ¶
func (e EventsCreator) CreateEvents(ctx context.Context, scanResults chan []Result)
TODO: Replace sequence with more generic approach
func (EventsCreator) GetChan ¶
func (e EventsCreator) GetChan() chan []beat.Event
type HostSection ¶
type HostSection struct { Architecture string `json:"architecture,omitempty"` Os Os `json:"os,omitempty"` Name string `json:"name,omitempty"` }
We aren't using the cloud processor here because we want to assign information regarding the scanned resource and not the scanner
type MockEnricher ¶
MockEnricher is an autogenerated mock type for the Enricher type
func NewMockEnricher ¶
func NewMockEnricher(t interface { mock.TestingT Cleanup(func()) }) *MockEnricher
NewMockEnricher creates a new instance of MockEnricher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockEnricher) EXPECT ¶
func (_m *MockEnricher) EXPECT() *MockEnricher_Expecter
func (*MockEnricher) EnrichEvent ¶
func (_m *MockEnricher) EnrichEvent(event *beat.Event) error
EnrichEvent provides a mock function with given fields: event
type MockEnricher_EnrichEvent_Call ¶
MockEnricher_EnrichEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnrichEvent'
func (*MockEnricher_EnrichEvent_Call) Return ¶
func (_c *MockEnricher_EnrichEvent_Call) Return(_a0 error) *MockEnricher_EnrichEvent_Call
func (*MockEnricher_EnrichEvent_Call) Run ¶
func (_c *MockEnricher_EnrichEvent_Call) Run(run func(event *beat.Event)) *MockEnricher_EnrichEvent_Call
func (*MockEnricher_EnrichEvent_Call) RunAndReturn ¶
func (_c *MockEnricher_EnrichEvent_Call) RunAndReturn(run func(*beat.Event) error) *MockEnricher_EnrichEvent_Call
type MockEnricher_Expecter ¶
type MockEnricher_Expecter struct {
// contains filtered or unexported fields
}
func (*MockEnricher_Expecter) EnrichEvent ¶
func (_e *MockEnricher_Expecter) EnrichEvent(event interface{}) *MockEnricher_EnrichEvent_Call
EnrichEvent is a helper method to define mock.On call
- event *beat.Event
type NetworkSection ¶
type Security ¶
type Security struct {
SecurityGroups []ec2.SecurityGroupInfo `json:"security_groups,omitempty"`
}
type SnapshotManager ¶
type SnapshotManager struct {
// contains filtered or unexported fields
}
func NewSnapshotManager ¶
func NewSnapshotManager(logger *clog.Logger, provider snapshotCreatorDeleter) *SnapshotManager
func (*SnapshotManager) Cleanup ¶
func (s *SnapshotManager) Cleanup(ctx context.Context)
func (*SnapshotManager) CreateSnapshots ¶
func (s *SnapshotManager) CreateSnapshots(ctx context.Context, ins *ec2.Ec2Instance) ([]ec2.EBSSnapshot, error)
func (*SnapshotManager) DeleteOldSnapshots ¶
func (s *SnapshotManager) DeleteOldSnapshots(ctx context.Context)
func (*SnapshotManager) DeleteSnapshot ¶
func (s *SnapshotManager) DeleteSnapshot(ctx context.Context, snapshot ec2.EBSSnapshot)
type VendorCVSS ¶
type Vulnerability ¶
type Vulnerability struct { Cvss VendorCVSS `json:"cvss,omitempty"` DataSource *DataSource `json:"data_source,omitempty"` Scanner Scanner `json:"scanner,omitempty"` Score Score `json:"score,omitempty"` Package Package `json:"package,omitempty"` Cwe []string `json:"cwe,omitempty"` ID string `json:"id,omitempty"` Title string `json:"title,omitempty"` Enumeration string `json:"enumeration,omitempty"` Reference string `json:"reference,omitempty"` Description string `json:"description,omitempty"` Severity string `json:"severity,omitempty"` Classification string `json:"classification,omitempty"` PublishedDate *time.Time `json:"published_date,omitempty"` ReportId int64 `json:"report_id,omitempty"` // Deprecated field Class renamed to Category Class trivyTypes.ResultClass `json:"class,omitempty"` Category trivyTypes.ResultClass `json:"category,omitempty"` }
type VulnerabilityFetcher ¶
type VulnerabilityFetcher struct {
// contains filtered or unexported fields
}
func NewVulnerabilityFetcher ¶
func NewVulnerabilityFetcher(log *clog.Logger, provider instancesProvider) VulnerabilityFetcher
func (VulnerabilityFetcher) FetchInstances ¶
func (f VulnerabilityFetcher) FetchInstances(ctx context.Context) error
func (VulnerabilityFetcher) GetChan ¶
func (f VulnerabilityFetcher) GetChan() chan *ec2.Ec2Instance
type VulnerabilityReplicator ¶
type VulnerabilityReplicator struct {
// contains filtered or unexported fields
}
func NewVulnerabilityReplicator ¶
func NewVulnerabilityReplicator(log *clog.Logger, manager *SnapshotManager) VulnerabilityReplicator
func (VulnerabilityReplicator) GetChan ¶
func (f VulnerabilityReplicator) GetChan() chan ec2.EBSSnapshot
func (VulnerabilityReplicator) SnapshotInstance ¶
func (f VulnerabilityReplicator) SnapshotInstance(ctx context.Context, insCh chan *ec2.Ec2Instance)
type VulnerabilityRunner ¶
func NewVulnerabilityRunner ¶
type VulnerabilityScanner ¶
type VulnerabilityScanner struct {
// contains filtered or unexported fields
}
func NewVulnerabilityScanner ¶
func NewVulnerabilityScanner(log *clog.Logger, runner runnerInterface, manager *SnapshotManager, c *cb_config.Config, seq time.Time) (VulnerabilityScanner, error)
TODO: Replace sequence with more generic approach
func (VulnerabilityScanner) GetChan ¶
func (f VulnerabilityScanner) GetChan() chan []Result
func (VulnerabilityScanner) ScanSnapshot ¶
func (f VulnerabilityScanner) ScanSnapshot(ctx context.Context, snapCh chan ec2.EBSSnapshot)
type VulnerabilityVerifier ¶
type VulnerabilityVerifier struct {
// contains filtered or unexported fields
}
func NewVulnerabilityVerifier ¶
func NewVulnerabilityVerifier(log *clog.Logger, provider snapshotDescriber) VulnerabilityVerifier
func (VulnerabilityVerifier) GetChan ¶
func (f VulnerabilityVerifier) GetChan() chan ec2.EBSSnapshot
func (VulnerabilityVerifier) VerifySnapshot ¶
func (f VulnerabilityVerifier) VerifySnapshot(ctx context.Context, snapCh chan ec2.EBSSnapshot)
TODO: Maybe verify more than one snapshot
type VulnerabilityWorker ¶
type VulnerabilityWorker struct {
// contains filtered or unexported fields
}
func NewVulnerabilityWorker ¶
func NewVulnerabilityWorker(ctx context.Context, log *clog.Logger, c *config.Config, bdp dataprovider.CommonDataProvider, cdp dataprovider.ElasticCommonDataProvider) (*VulnerabilityWorker, error)
func (*VulnerabilityWorker) GetChan ¶
func (f *VulnerabilityWorker) GetChan() chan []beat.Event
func (*VulnerabilityWorker) Run ¶
func (f *VulnerabilityWorker) Run(ctx context.Context)