fetchers

package
v0.0.0-...-fb54fd9 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PrivateRepoRegexTemplate should identify images with an ecr regex template
	// <account-id>.dkr.ecr.<region>.amazonaws.com/<repository-name>
	PrivateRepoRegexTemplate = "^%s\\.dkr\\.ecr\\.([-\\w]+)\\.amazonaws\\.com\\/([-\\w\\.\\/]+)[:,@]?"
	EcrRegionRegexGroup      = 1
	EcrImageRegexGroup       = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLFetcherConfig

type ACLFetcherConfig struct {
	fetching.AwsBaseFetcherConfig `config:",inline"`
}

type ConfigResource

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

func (ConfigResource) GetData

func (c ConfigResource) GetData() any

func (ConfigResource) GetElasticCommonData

func (c ConfigResource) GetElasticCommonData() (map[string]any, error)

func (ConfigResource) GetMetadata

func (c ConfigResource) GetMetadata() (fetching.ResourceMetadata, error)

type EcrFetcher

type EcrFetcher struct {
	PodDescriber PodDescriber
	// contains filtered or unexported fields
}

func NewEcrFetcher

func NewEcrFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, kubeProvider k8s.Interface, podDescriber PodDescriber) *EcrFetcher

func (*EcrFetcher) Fetch

func (f *EcrFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*EcrFetcher) Stop

func (f *EcrFetcher) Stop()

type EcrResource

type EcrResource struct {
	ecr.Repository
}

func (EcrResource) GetData

func (res EcrResource) GetData() any

func (EcrResource) GetElasticCommonData

func (res EcrResource) GetElasticCommonData() (map[string]any, error)

func (EcrResource) GetMetadata

func (res EcrResource) GetMetadata() (fetching.ResourceMetadata, error)

type ElbFetcher

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

func NewElbFetcher

func NewElbFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, kubeProvider k8s.Interface, provider elb.LoadBalancerDescriber, identity *cloud.Identity, matchers string) *ElbFetcher

func (*ElbFetcher) Fetch

func (f *ElbFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*ElbFetcher) GetLoadBalancers

func (f *ElbFetcher) GetLoadBalancers(ctx context.Context) ([]string, error)

func (*ElbFetcher) Stop

func (f *ElbFetcher) Stop()

type ElbResource

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

func (ElbResource) GetData

func (r ElbResource) GetData() any

func (ElbResource) GetElasticCommonData

func (ElbResource) GetElasticCommonData() (map[string]any, error)

func (ElbResource) GetMetadata

func (r ElbResource) GetMetadata() (fetching.ResourceMetadata, error)

type IAMFetcher

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

func NewIAMFetcher

func NewIAMFetcher(log *logp.Logger, provider iam.AccessManagement, ch chan fetching.ResourceInfo, identity *cloud.Identity) *IAMFetcher

func (IAMFetcher) Fetch

func (f IAMFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

Fetch collects IAM resources, such as password-policy and IAM users. The resources are enriched by the provider and being send to evaluation.

func (IAMFetcher) Stop

func (f IAMFetcher) Stop()

type IAMFetcherConfig

type IAMFetcherConfig struct {
	fetching.AwsBaseFetcherConfig `config:",inline"`
}

type IAMResource

type IAMResource struct {
	awslib.AwsResource
	// contains filtered or unexported fields
}

func (IAMResource) GetData

func (r IAMResource) GetData() any

func (IAMResource) GetElasticCommonData

func (r IAMResource) GetElasticCommonData() (map[string]any, error)

func (IAMResource) GetMetadata

func (r IAMResource) GetMetadata() (fetching.ResourceMetadata, error)

type KmsFetcher

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

func NewKMSFetcher

func NewKMSFetcher(log *logp.Logger, provider kms.KMS, ch chan fetching.ResourceInfo) *KmsFetcher

func (*KmsFetcher) Fetch

func (f *KmsFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*KmsFetcher) Stop

func (f *KmsFetcher) Stop()

type KmsResource

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

func (KmsResource) GetData

func (r KmsResource) GetData() any

func (KmsResource) GetElasticCommonData

func (r KmsResource) GetElasticCommonData() (map[string]any, error)

func (KmsResource) GetMetadata

func (r KmsResource) GetMetadata() (fetching.ResourceMetadata, error)

type LoggingFetcher

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

func NewLoggingFetcher

func NewLoggingFetcher(
	log *logp.Logger,
	loggingProvider logging.Client,
	configserviceProvider configservice.ConfigService,
	ch chan fetching.ResourceInfo,
	identity *cloud.Identity,
) *LoggingFetcher

func (LoggingFetcher) Fetch

func (f LoggingFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (LoggingFetcher) Stop

func (f LoggingFetcher) Stop()

type LoggingResource

type LoggingResource struct {
	awslib.AwsResource
}

func (LoggingResource) GetData

func (r LoggingResource) GetData() any

func (LoggingResource) GetElasticCommonData

func (r LoggingResource) GetElasticCommonData() (map[string]any, error)

func (LoggingResource) GetMetadata

func (r LoggingResource) GetMetadata() (fetching.ResourceMetadata, error)

type MonitoringFetcher

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

func NewMonitoringFetcher

func NewMonitoringFetcher(log *logp.Logger, provider monitoring.Client, securityHubProvider securityhub.Service, ch chan fetching.ResourceInfo, identity *cloud.Identity) *MonitoringFetcher

func (MonitoringFetcher) Fetch

func (m MonitoringFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (MonitoringFetcher) Stop

func (m MonitoringFetcher) Stop()

type MonitoringResource

type MonitoringResource struct {
	monitoring.Resource
	// contains filtered or unexported fields
}

func (MonitoringResource) GetData

func (r MonitoringResource) GetData() any

func (MonitoringResource) GetElasticCommonData

func (r MonitoringResource) GetElasticCommonData() (map[string]any, error)

func (MonitoringResource) GetMetadata

type NetworkFetcher

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

func NewNetworkFetcher

func NewNetworkFetcher(log *logp.Logger, ec2Client ec2.ElasticCompute, ch chan fetching.ResourceInfo) *NetworkFetcher

func (NetworkFetcher) Fetch

func (f NetworkFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

Fetch collects network resource such as network acl and security groups

func (NetworkFetcher) Stop

func (f NetworkFetcher) Stop()

type NetworkResource

type NetworkResource struct {
	awslib.AwsResource
}

func (NetworkResource) GetData

func (r NetworkResource) GetData() any

func (NetworkResource) GetElasticCommonData

func (r NetworkResource) GetElasticCommonData() (map[string]any, error)

func (NetworkResource) GetMetadata

func (r NetworkResource) GetMetadata() (fetching.ResourceMetadata, error)

type PodDescriber

type PodDescriber struct {
	FilterRegex *regexp.Regexp
	Provider    ecr.RepositoryDescriber
}

type RdsFetcher

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

func NewRdsFetcher

func NewRdsFetcher(log *logp.Logger, provider rds.Rds, ch chan fetching.ResourceInfo) *RdsFetcher

func (*RdsFetcher) Fetch

func (f *RdsFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*RdsFetcher) Stop

func (f *RdsFetcher) Stop()

type RdsFetcherConfig

type RdsFetcherConfig struct {
	fetching.AwsBaseFetcherConfig `config:",inline"`
}

type RdsResource

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

func (RdsResource) GetData

func (r RdsResource) GetData() any

func (RdsResource) GetElasticCommonData

func (r RdsResource) GetElasticCommonData() (map[string]any, error)

func (RdsResource) GetMetadata

func (r RdsResource) GetMetadata() (fetching.ResourceMetadata, error)

type S3Fetcher

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

func NewS3Fetcher

func NewS3Fetcher(log *logp.Logger, s3 s3.S3, ch chan fetching.ResourceInfo) *S3Fetcher

func (*S3Fetcher) Fetch

func (f *S3Fetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*S3Fetcher) Stop

func (f *S3Fetcher) Stop()

type S3Resource

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

func (S3Resource) GetData

func (r S3Resource) GetData() any

func (S3Resource) GetElasticCommonData

func (r S3Resource) GetElasticCommonData() (map[string]any, error)

func (S3Resource) GetMetadata

func (r S3Resource) GetMetadata() (fetching.ResourceMetadata, error)

type SecurityHubResource

type SecurityHubResource struct {
	securityhub.SecurityHub
}

func (SecurityHubResource) GetData

func (s SecurityHubResource) GetData() any

func (SecurityHubResource) GetElasticCommonData

func (s SecurityHubResource) GetElasticCommonData() (map[string]any, error)

func (SecurityHubResource) GetMetadata

Jump to

Keyboard shortcuts

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