Documentation ¶
Overview ¶
Package scanner scans targets
Package scanner scans targets ¶
Package scanner scans targets ¶
Package scanner scans targets ¶
Package scanner scans targets ¶
Package scanner scans targets ¶
Package scanner scans targets ¶
Package scanner scans targets
Index ¶
- type AWSEC2
- type AWSECR
- type AWSRDS
- type AWSS3
- type AWSS3Client
- type Dependencies
- type Ec2Client
- type EcrClient
- type Factory
- type FieldMapper
- type File
- type FsScanner
- type GitHubClient
- type GitHubRepositoryClient
- type GitHubRepositoryScanner
- func (r *GitHubRepositoryScanner) GetKind() string
- func (r *GitHubRepositoryScanner) GetName() string
- func (r *GitHubRepositoryScanner) GetSchedule() string
- func (r *GitHubRepositoryScanner) Scan(resourceChannel chan resource.Resource) error
- func (r *GitHubRepositoryScanner) Setup(name string, cfg config.Source, dependencies *Dependencies) error
- type MetaDataMapper
- type Mock
- type RdsClient
- type ResourceTag
- type Scanner
- type Scanners
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSEC2 ¶
type AWSEC2 struct { SourceName string Ec2Client Ec2Client Region string AccountID string Fields []string // contains filtered or unexported fields }
AWSEC2 AWS Ec2 source
type AWSECR ¶
type AWSECR struct { SourceName string ECRClient EcrClient Region string AccountID string ResourceTaggingService util.ResourceTaggingServiceClient Fields []string // contains filtered or unexported fields }
AWSECR AWS ECR source
type AWSRDS ¶
type AWSRDS struct { SourceName string RdsClient RdsClient Region string AccountID string Fields []string // contains filtered or unexported fields }
AWSRDS AWS S3 source
type AWSS3 ¶
type AWSS3 struct { SourceName string S3Client AWSS3Client Region string Fields []string // contains filtered or unexported fields }
AWSS3 AWS S3 source
type AWSS3Client ¶
type AWSS3Client interface { ListBuckets(ctx context.Context, params *s3.ListBucketsInput, optFns ...func(*s3.Options)) (*s3.ListBucketsOutput, error) GetBucketTagging(ctx context.Context, params *s3.GetBucketTaggingInput, optFns ...func(*s3.Options)) (*s3.GetBucketTaggingOutput, error) }
AWSS3Client build aws client
type Dependencies ¶
type Dependencies struct {
// contains filtered or unexported fields
}
Dependencies scanner dependencies
func NewScannerDependencies ¶
func NewScannerDependencies(scheduler scheduler.Scheduler, storage storage.Storage, logger *logrus.Logger, metricsCollector *metrics.Collector) *Dependencies
NewScannerDependencies construct new scanner dependencies
func (*Dependencies) GetLogger ¶
func (d *Dependencies) GetLogger() *logrus.Logger
GetLogger return logger
func (*Dependencies) GetMetrics ¶
func (d *Dependencies) GetMetrics() *metrics.Collector
GetMetrics return metrics
func (*Dependencies) GetScheduler ¶
func (d *Dependencies) GetScheduler() scheduler.Scheduler
GetScheduler return scheduler
func (*Dependencies) GetStorage ¶
func (d *Dependencies) GetStorage() storage.Storage
GetStorage return storage
type Ec2Client ¶
type Ec2Client interface {
DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)
}
Ec2Client build aws client
type EcrClient ¶
type EcrClient interface { DescribeRepositories(context.Context, *ecr.DescribeRepositoriesInput, ...func(options *ecr.Options)) (*ecr.DescribeRepositoriesOutput, error) GetRepositoryPolicy(ctx context.Context, params *ecr.GetRepositoryPolicyInput, optFns ...func(*ecr.Options)) (*ecr.GetRepositoryPolicyOutput, error) DescribeImages(context.Context, *ecr.DescribeImagesInput, ...func(*ecr.Options)) (*ecr.DescribeImagesOutput, error) }
EcrClient build aws client
type Factory ¶
type Factory func() Scanner
Factory is a function that returns a new instance of a Scanner.
type FieldMapper ¶
type FieldMapper struct {
// contains filtered or unexported fields
}
FieldMapper is a structure that helps in mapping various fields and tags to resource.MetaData structures.
func NewFieldMapper ¶
func NewFieldMapper(mappings map[string]func() string, tags func() []ResourceTag, fields []string) *FieldMapper
NewFieldMapper initializes and returns a new instance of FieldMapper.
type FsScanner ¶
type FsScanner struct {
// contains filtered or unexported fields
}
FsScanner store configuration for file system scanner
func (*FsScanner) GetSchedule ¶
GetSchedule return schedule
type GitHubClient ¶
type GitHubClient interface {
ListRepositories(ctx context.Context, user string, opts *github.RepositoryListOptions) ([]*github.Repository, error)
}
GitHubClient present interface to build GitHub client
type GitHubRepositoryClient ¶
type GitHubRepositoryClient struct {
// contains filtered or unexported fields
}
GitHubRepositoryClient GitHub repository client
func NewGitHubRepositoryClient ¶
func NewGitHubRepositoryClient(client *github.Client, logger *logrus.Logger) *GitHubRepositoryClient
NewGitHubRepositoryClient construct new GitHub repository client
func (*GitHubRepositoryClient) ListRepositories ¶
func (c *GitHubRepositoryClient) ListRepositories(ctx context.Context, user string, opts *github.RepositoryListOptions) ([]*github.Repository, error)
ListRepositories provide list of repositories from GitHub
type GitHubRepositoryScanner ¶
type GitHubRepositoryScanner struct {
// contains filtered or unexported fields
}
GitHubRepositoryScanner GitHub repository scanner
func (*GitHubRepositoryScanner) GetKind ¶
func (r *GitHubRepositoryScanner) GetKind() string
GetKind return resource kind
func (*GitHubRepositoryScanner) GetName ¶
func (r *GitHubRepositoryScanner) GetName() string
GetName return name
func (*GitHubRepositoryScanner) GetSchedule ¶
func (r *GitHubRepositoryScanner) GetSchedule() string
GetSchedule return schedule
func (*GitHubRepositoryScanner) Scan ¶
func (r *GitHubRepositoryScanner) Scan(resourceChannel chan resource.Resource) error
Scan scans GitHub to get the list of repositories as resources
func (*GitHubRepositoryScanner) Setup ¶
func (r *GitHubRepositoryScanner) Setup(name string, cfg config.Source, dependencies *Dependencies) error
Setup GitHub repository scanner
type MetaDataMapper ¶
type MetaDataMapper struct {
// contains filtered or unexported fields
}
MetaDataMapper map the fields
type Mock ¶
Mock is an autogenerated mock type for the ScannerMock type
func (*Mock) GetSchedule ¶
GetSchedule provides a mock function with given fields:
type RdsClient ¶
type RdsClient interface {
DescribeDBInstances(context.Context, *rds.DescribeDBInstancesInput, ...func(*rds.Options)) (*rds.DescribeDBInstancesOutput, error)
}
RdsClient build aws client
type ResourceTag ¶
ResourceTag represents a tag on any resource.
type Scanner ¶
type Scanner interface { Setup(name string, cfg config.Source, dependencies *Dependencies) error Scan(resourceChannel chan resource.Resource) error GetName() string GetKind() string GetSchedule() string }
Scanner interface to build different scanner
func BuildScanners ¶
func BuildScanners(sources map[string]config.Source, dependencies *Dependencies) []Scanner
BuildScanners build source based on configuration