validator

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package validator provides a library for validating sessions before they are trusted to run on physical machines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator struct {
	// ImageNamePrefix enforces that all container image names have its
	// prefix. If not specified, all container image names will be valid.
	//
	// On certain registries, requiring a prefix can make the cluster more
	// secure. For example, Google Container Registry scopes container
	// images by Google Cloud Project. It assigns all images a name like
	// `gcr.io/<project>/<image>`. To enforce that all images came from a
	// specific GCR project, we can set this value to `gcr.io/<project>/`.
	//
	// BE SURE TO INCLUDE THE FINAL SLASH, OTHERWISE THE PREFIX DOES NOT
	// ENFORCE IT CAME FROM A SPECIFIC GCP PROJECT. For example, specifying
	// `gcr.io/fake-project` as the prefix will allow an image named
	// `gcr.io/fake-project-different-owner/malware`.
	ImageNamePrefix string
}

Validator verifies that sessions conform to a list of requirements. Each of its fields can be used to enable, disable or adjust the requirements.

func (*Validator) Validate

func (v *Validator) Validate(session *types.Session) error

Validate checks that the session meets all requirements. If not, it returns an error with the first violation it encounters.

Jump to

Keyboard shortcuts

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