posture

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoTimeout         = int64(-1)
	PromptGracePeriod = 5 * time.Minute
)

Variables

View Source
var NilStateError = errors.New("posture state was nil")
View Source
var NotEqualError = errors.New("the values were not equal")

Functions

func HasAccess

func HasAccess(rdm *common.RouterDataModel, identityId string, serviceId string, cache *Cache, policyType edge_ctrl_pb.PolicyType) (*edge_ctrl_pb.DataState_ServicePolicy, error)

Types

type AllInListError

type AllInListError[V fmt.Stringer] struct {
	FailedValues []FailedValueError[V]
	GivenValues  []V
}

AllInListError indicates that a given array of expected values had one or more values that did not match/pass. GivenValues represents all values supplied to match the expected values. FailedValues represents all the expected values that did not pass.

func (*AllInListError[V]) Error

func (e *AllInListError[V]) Error() string

type AnyInListError

type AnyInListError[V fmt.Stringer] struct {
	FailedValues []FailedValueError[V]
	GivenValues  []V
}

AnyInListError represents the fact that zero expected values did not match/pass where at least one was required. GivenValues represents all values supplied to match the expected values. FailedValues represents all the expected values that did not pass.

func (*AnyInListError[V]) Error

func (e *AnyInListError[V]) Error() string

type Check

type Check interface {
	Evaluate(state *Cache) *CheckError
}

func CtrlCheckToLogic

func CtrlCheckToLogic(postureCheck *edge_ctrl_pb.DataState_PostureCheck) Check

type CheckError

type CheckError struct {
	Id    string
	Name  string
	Cause error
}

func EvaluatePostureCheck

func EvaluatePostureCheck(postureCheck *edge_ctrl_pb.DataState_PostureCheck, cache *Cache) *CheckError

func (*CheckError) Error

func (p *CheckError) Error() string

type DomainCheck

func (*DomainCheck) Evaluate

func (m *DomainCheck) Evaluate(state *Cache) *CheckError

type FailedValueError

type FailedValueError[V fmt.Stringer] struct {
	ExpectedValue V
	GivenValue    V
	Reason        error
}

FailedValueError represents a complex object comparison that failed. If a simple comparison failure is needed (i.e. bool != bool, string != string) use an `error` instead.

func (*FailedValueError[V]) Error

func (v *FailedValueError[V]) Error() string

func (*FailedValueError[V]) String

func (v *FailedValueError[V]) String() string

type MacCheck

func (MacCheck) Evaluate

func (m MacCheck) Evaluate(state *Cache) *CheckError

type MfaCheck

func (*MfaCheck) Evaluate

func (m *MfaCheck) Evaluate(state *Cache) *CheckError

type NoPoliciesError

type NoPoliciesError struct {
}

func (*NoPoliciesError) Error

func (e *NoPoliciesError) Error() string

type OneInListError

type OneInListError[V fmt.Stringer] struct {
	ValidValues []V
	GivenValues []V
}

OneInListError represents two arrays of values where one of the supplied GivenValues must be in the ValidValues. Used when a large cross join of values (i.e. mac address approve/deny lists) would be reported for every comparison.

func (*OneInListError[V]) Error

func (e *OneInListError[V]) Error() string

type OsCheck

func (*OsCheck) Evaluate

func (m *OsCheck) Evaluate(state *Cache) *CheckError

type PolicyAccessError

type PolicyAccessError struct {
	Id     string
	Name   string
	Errors []error
}

func (*PolicyAccessError) Error

func (p *PolicyAccessError) Error() string

type PolicyAccessErrors

type PolicyAccessErrors []*PolicyAccessError

func (*PolicyAccessErrors) Error

func (pae *PolicyAccessErrors) Error() string

type ProcessCheck

func (*ProcessCheck) Evaluate

func (p *ProcessCheck) Evaluate(cache *Cache) *CheckError

type Str

type Str string

func (Str) String

func (s Str) String() string

Jump to

Keyboard shortcuts

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