scanner

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 17 Imported by: 0

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

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
}

AWSEC2 AWS Ec2 source

func NewAWSEC2

func NewAWSEC2(sourceName string, region string, accountID string, ec2Client Ec2Client) *AWSEC2

NewAWSEC2 construct AWS EC2 source

func (*AWSEC2) Scan

func (a *AWSEC2) Scan(resourceChannel chan resource.Resource) error

Scan discover resource and send to resource channel

type AWSECR

type AWSECR struct {
	SourceName             string
	ECRClient              EcrClient
	Region                 string
	AccountID              string
	ResourceTaggingService util.ResourceTaggingServiceClient
}

AWSECR AWS ECR source

func NewAWSECR

func NewAWSECR(sourceName string, region string, accountID string, ecrClient EcrClient, resourceTaggingService util.ResourceTaggingServiceClient) *AWSECR

NewAWSECR construct AWS ECR source

func (*AWSECR) Scan

func (a *AWSECR) Scan(resourceChannel chan resource.Resource) error

Scan discover resource and send to resource channel Scan discover resource and send to resource channel

type AWSRDS

type AWSRDS struct {
	SourceName string
	RdsClient  RdsClient
	Region     string
	AccountID  string
}

AWSRDS AWS S3 source

func NewAWSRDS

func NewAWSRDS(sourceName string, region string, accountID string, rdsClient RdsClient) *AWSRDS

NewAWSRDS construct AWS S3 source

func (*AWSRDS) Scan

func (a *AWSRDS) Scan(resourceChannel chan resource.Resource) error

Scan discover resource and send to resource channel

type AWSS3

type AWSS3 struct {
	SourceName string
	S3Client   AWSS3Client
	Region     string
}

AWSS3 AWS S3 source

func NewAWSS3

func NewAWSS3(sourceName string, region string, s3Client AWSS3Client) *AWSS3

NewAWSS3 construct AWS S3 source

func (*AWSS3) Scan

func (a *AWSS3) Scan(resourceChannel chan resource.Resource) error

Scan discover resource and send to resource channel

type AWSS3Client

type AWSS3Client interface {
	ListBuckets(listBucketInput *s3.ListBucketsInput) (*s3.ListBucketsOutput, error)
	GetBucketTagging(bucketTaggingInput *s3.GetBucketTaggingInput) (*s3.GetBucketTaggingOutput, error)
}

AWSS3Client build aws client

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 File

type File struct {
	Path string
}

File represent file information

type FsScanner

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

FsScanner store configuration for file system scanner

func NewFsScanner

func NewFsScanner(name, rootDirectory string, metaData map[string]string) FsScanner

NewFsScanner construct new file system scanner

func (*FsScanner) Scan

func (s *FsScanner) Scan(resourceChannel chan resource.Resource) error

Scan scans the file system

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) *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 NewGitHubRepositoryScanner

func NewGitHubRepositoryScanner(name string, ghClient GitHubClient, user string) *GitHubRepositoryScanner

NewGitHubRepositoryScanner construct a new GitHub repository scanner

func (*GitHubRepositoryScanner) Scan

func (r *GitHubRepositoryScanner) Scan(resourceChannel chan resource.Resource) error

Scan scans GitHub to get the list of repositories as resources

type Mock

type Mock struct {
	mock.Mock
}

Mock is an autogenerated mock type for the ScannerMock type

func (*Mock) Scan

func (_m *Mock) Scan(resourceChannel chan resource.Resource) error

Scan provides a mock function with given fields: resourceChannel

type RdsClient

type RdsClient interface {
	DescribeDBInstancesPages(*rds.DescribeDBInstancesInput, func(*rds.DescribeDBInstancesOutput, bool) bool) error
	ListTagsForResource(*rds.ListTagsForResourceInput) (*rds.ListTagsForResourceOutput, error)
}

RdsClient build aws client

type Scanner

type Scanner interface {
	Scan(resourceChannel chan resource.Resource) error
}

Scanner interface to build different scanner

Jump to

Keyboard shortcuts

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