polaris

package
v0.15.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package polaris provides primitives for working with Polaris.

Index

Constants

View Source
const (
	// DefaultConfigYAML the default Polaris config YAML as string literal.
	DefaultConfigYAML = `` /* 4093-byte string literal not displayed */

)
View Source
const (
	// Plugin the name of this plugin.
	Plugin = "Polaris"
)

Variables

This section is empty.

Functions

func NewPlugin

func NewPlugin(clock ext.Clock) configauditreport.Plugin

NewPlugin constructs a new configauditreport.Plugin, which is using an upstream Polaris container image to audit configuration of Kubernetes workloads.

Types

type Check

type Check struct {
	ID       string `json:"ID"`
	Message  string `json:"Message"`
	Success  bool   `json:"Success"`
	Severity string `json:"Severity"`
	Category string `json:"Category"`
}

type ClusterInfo

type ClusterInfo struct {
	Version     string `json:"Version"`
	Nodes       int    `json:"Nodes"`
	Pods        int    `json:"Pods"`
	Namespaces  int    `json:"Namespaces"`
	Controllers int    `json:"Controllers"`
}

type Config

type Config struct {
	starboard.PluginConfig
}

Config defines configuration params for this plugin.

func (Config) GetImageRef added in v0.11.0

func (c Config) GetImageRef() (string, error)

GetImageRef returns upstream Polaris container image reference.

func (Config) GetResourceRequirements added in v0.11.0

func (c Config) GetResourceRequirements() (corev1.ResourceRequirements, error)

GetResourceRequirements constructs ResourceRequirements from the Config.

type ContainerResult

type ContainerResult struct {
	Name    string           `json:"Name"`
	Results map[string]Check `json:"Results"`
}

type PodResult

type PodResult struct {
	Name             string            `json:"Name"`
	Results          map[string]Check  `json:"Results"`
	ContainerResults []ContainerResult `json:"ContainerResults"`
}

type Report

type Report struct {
	PolarisOutputVersion string       `json:"PolarisOutputVersion"`
	SourceType           string       `json:"SourceType"`
	SourceName           string       `json:"SourceName"`
	DisplayName          string       `json:"DisplayName"`
	ClusterInfo          *ClusterInfo `json:"ClusterInfo"`
	Results              []Result     `json:"Results"`
}

type Result

type Result struct {
	Name      string    `json:"Name"`
	Namespace string    `json:"Namespace"`
	Kind      string    `json:"Kind"`
	PodResult PodResult `json:"PodResult"`
}

Jump to

Keyboard shortcuts

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