anchore

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEcrRegistry

func IsEcrRegistry(registry string) bool

Types

type AnchoreClient

type AnchoreClient interface {
	UserManagementClient
	PolicyClient
	RegistryClient
}

AnchoreClient "facade" for supported Anchore operations, decouples anchore specifics from the application

func NewAnchoreClient

func NewAnchoreClient(userName string, password string, endpoint string, insecure bool, logger common.Logger) AnchoreClient

type AnchoreUserService

type AnchoreUserService interface {
	EnsureUser(ctx context.Context, orgID uint, clusterID uint) (string, error)
	RemoveUser(ctx context.Context, orgID uint, clusterID uint) error
}

AnchoreUserService service interface for Anchore related operations

func MakeAnchoreUserService

func MakeAnchoreUserService(
	configProvider anchore.ConfigProvider,
	userNameService UserNameService,
	secretStore common.SecretStore,

	logger common.Logger,
) AnchoreUserService

type Cluster

type Cluster interface {
	GetK8sConfig() ([]byte, error)
	GetID() uint
}

Cluster defines operations that can be performed on a k8s cluster

type PolicyClient

type PolicyClient interface {
	ActivatePolicy(ctx context.Context, policyID string) error
	CreatePolicy(ctx context.Context, policyRaw map[string]interface{}) (string, error)
}

type Registry

type Registry struct {
	Username string
	Password string
	Type     string
	Registry string
	Verify   bool
}

type RegistryClient

type RegistryClient interface {
	AddRegistry(ctx context.Context, registry Registry) error
	GetRegistry(ctx context.Context, registryName string) ([]anchore.RegistryConfiguration, error)
	UpdateRegistry(ctx context.Context, registry Registry) error
	DeleteRegistry(ctx context.Context, registry Registry) error
}

type ScanlogService

type ScanlogService interface {
	ListScanLogs(ctx context.Context, cluster Cluster) (interface{}, error)
	GetScanLogs(ctx context.Context, cluster Cluster, releaseName string) (interface{}, error)
}

type SecurityResourceService

type SecurityResourceService interface {
	WhitelistService
	ScanlogService
}

SecurityResourceService gathers operations for managing security (anchore) related resources

func NewSecurityResourceService

func NewSecurityResourceService(logger common.Logger) SecurityResourceService

type UserManagementClient

type UserManagementClient interface {
	CreateAccount(ctx context.Context, accountName string, email string) error
	DeleteAccount(ctx context.Context, accountName string) error
	GetAccount(ctx context.Context, accountName string) (string, error)
	CreateUser(ctx context.Context, accountName string, userName string, password string) error
	DeleteUser(ctx context.Context, accountName string, userName string) error
	GetUser(ctx context.Context, userName string) (interface{}, error)
	GetUserCredentials(ctx context.Context, userName string) (string, error)
}

type UserNameService

type UserNameService interface {
	GenerateUsername(ctx context.Context, clusterID uint) (string, error)
}

UserNameService defines operations for generating unique names using cluster data

type WhitelistService

type WhitelistService interface {
	GetWhitelists(ctx context.Context, cluster Cluster) ([]securityV1Alpha.WhiteListItem, error)
	CreateWhitelist(ctx context.Context, cluster Cluster, whitelistItem security.ReleaseWhiteListItem) (interface{}, error)
	DeleteWhitelist(ctx context.Context, cluster Cluster, whitelistItemName string) error
}

WhitelistService whitelist management operations

Jump to

Keyboard shortcuts

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