creds

package
v0.0.0-...-0e5b682 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AwsAccessKeyId     = "AWS_ACCESS_KEY_ID"
	AwsSecretAccessKey = "AWS_SECRET_ACCESS_KEY"
	AwsDefaultRegion   = "AWS_DEFAULT_REGION"
	EcrSaSecretName    = "ecr-sa"
)
View Source
const (
	BasicRegCredSecretName = "basic-regcred"
)
View Source
const (
	GcrSaSecretName = "gcr-sa"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicRegCred

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

func CreateBasicRegCred

func CreateBasicRegCred(clientset kubernetes.Interface, secretNamespace string) *BasicRegCred

func (*BasicRegCred) Add

func (u *BasicRegCred) Add(job *batchv1.Job)

func (*BasicRegCred) ShouldAdd

func (u *BasicRegCred) ShouldAdd() bool

type CredentialAdder

type CredentialAdder interface {
	// Returns true if credentials should be added to a scanner job
	ShouldAdd() bool
	// Adds credentials to a scanner job
	Add(job *batchv1.Job)
}

type ECR

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

func CreateECR

func CreateECR(clientset kubernetes.Interface, secretNamespace string) *ECR

func (*ECR) Add

func (e *ECR) Add(job *batchv1.Job)

Klar is using google SDK to pull the user name ans password required to pull the image. We need to set the following env variables from the `EcrSaSecretName` secret: 1. AWS_ACCESS_KEY_ID 2. AWS_SECRET_ACCESS_KEY 3. AWS_DEFAULT_REGION

func (*ECR) ShouldAdd

func (e *ECR) ShouldAdd() bool

type GCR

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

func CreateGCR

func CreateGCR(clientset kubernetes.Interface, secretNamespace string) *GCR

func (*GCR) Add

func (g *GCR) Add(job *batchv1.Job)

Klar is using google SDK to pull the user name and password required to pull the image. We need to do the following: 1. Create a volume that holds the `gcrSaSecretFileName` data 2. Mount the volume into each container to a specific path (`gcrVolumeMountPath`/`gcrSaSecretFileName`) 3. Set `GOOGLE_APPLICATION_CREDENTIALS` to point to the mounted file

func (*GCR) ShouldAdd

func (g *GCR) ShouldAdd() bool

Jump to

Keyboard shortcuts

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