check

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: Apache-2.0 Imports: 11 Imported by: 23

Documentation

Index

Constants

View Source
const (
	// PASS check passed.
	PASS State = "PASS"
	// FAIL check failed.
	FAIL = "FAIL"
	// WARN could not carry out check.
	WARN = "WARN"
	// INFO informational message
	INFO = "INFO"

	// MASTER a master node
	MASTER NodeType = "master"
	// NODE a node
	NODE NodeType = "node"
	// FEDERATED a federated deployment.
	FEDERATED NodeType = "federated"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	ID          string `yaml:"id" json:"id"`
	Text        string
	Audit       string      `json:"omit"`
	Type        string      `json:"type"`
	Commands    []*exec.Cmd `json:"omit"`
	Tests       *tests      `json:"omit"`
	Set         bool        `json:"omit"`
	Remediation string
	State
}

Check contains information about a recommendation in the CIS Kubernetes 1.6+ document.

func (*Check) Run

func (c *Check) Run()

Run executes the audit commands specified in a check and outputs the results.

type Controls

type Controls struct {
	ID     string `yaml:"id"`
	Text   string
	Type   NodeType
	Groups []*Group
	Summary
}

Controls holds all controls to check for master nodes.

func NewControls

func NewControls(t NodeType, in []byte) (*Controls, error)

NewControls instantiates a new master Controls object.

func (*Controls) JSON

func (controls *Controls) JSON() ([]byte, error)

JSON encodes the results of last run to JSON.

func (*Controls) RunChecks

func (controls *Controls) RunChecks(ids ...string) Summary

RunChecks runs the checks with the supplied IDs.

func (*Controls) RunGroup

func (controls *Controls) RunGroup(gids ...string) Summary

RunGroup runs all checks in a group.

type Group

type Group struct {
	ID     string `yaml:"id"`
	Text   string
	Checks []*Check
}

Group is a collection of similar checks.

type NodeType

type NodeType string

NodeType indicates the type of node (master, node, federated).

type State

type State string

State is the state of a control check.

type Summary

type Summary struct {
	Pass int
	Fail int
	Warn int
}

Summary is a summary of the results of control checks run.

Jump to

Keyboard shortcuts

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