types

package
v0.94.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 7 Imported by: 71

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFSKey

func CreateFSKey(filesystem fs.FS) string

Types

type BaseAttribute

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

func (BaseAttribute) GetMetadata

func (b BaseAttribute) GetMetadata() Metadata

type BoolValue

type BoolValue struct {
	BaseAttribute
	// contains filtered or unexported fields
}

func Bool

func Bool(value bool, metadata Metadata) BoolValue

func BoolDefault

func BoolDefault(value bool, metadata Metadata) BoolValue

func BoolExplicit

func BoolExplicit(value bool, metadata Metadata) BoolValue

func BoolUnresolvable

func BoolUnresolvable(m Metadata) BoolValue

func (BoolValue) GetRawValue added in v0.77.0

func (b BoolValue) GetRawValue() interface{}

func (BoolValue) IsFalse

func (b BoolValue) IsFalse() bool

func (BoolValue) IsTrue

func (b BoolValue) IsTrue() bool

func (BoolValue) MarshalJSON added in v0.77.0

func (b BoolValue) MarshalJSON() ([]byte, error)

func (BoolValue) ToRego added in v0.77.0

func (s BoolValue) ToRego() interface{}

func (*BoolValue) UnmarshalJSON added in v0.77.0

func (b *BoolValue) UnmarshalJSON(data []byte) error

func (BoolValue) Value

func (b BoolValue) Value() bool

type BytesValue

type BytesValue struct {
	BaseAttribute
	// contains filtered or unexported fields
}

func Bytes

func Bytes(value []byte, m Metadata) BytesValue

func BytesDefault

func BytesDefault(value []byte, m Metadata) BytesValue

func BytesExplicit

func BytesExplicit(value []byte, m Metadata) BytesValue

func BytesUnresolvable

func BytesUnresolvable(m Metadata) BytesValue

func (BytesValue) GetMetadata added in v0.77.0

func (b BytesValue) GetMetadata() Metadata

func (BytesValue) GetRawValue added in v0.77.0

func (b BytesValue) GetRawValue() interface{}

func (BytesValue) Len

func (b BytesValue) Len() int

func (BytesValue) MarshalJSON added in v0.77.0

func (b BytesValue) MarshalJSON() ([]byte, error)

func (BytesValue) ToRego added in v0.77.0

func (s BytesValue) ToRego() interface{}

func (*BytesValue) UnmarshalJSON added in v0.77.0

func (b *BytesValue) UnmarshalJSON(data []byte) error

func (BytesValue) Value

func (b BytesValue) Value() []byte

type ComplianceSpec added in v0.84.1

type ComplianceSpec struct {
	Spec Spec `yaml:"spec"`
}

ComplianceSpec represent the compliance specification

type Control added in v0.84.1

type Control struct {
	ID            string        `yaml:"id"`
	Name          string        `yaml:"name"`
	Description   string        `yaml:"description,omitempty"`
	Checks        []SpecCheck   `yaml:"checks"`
	Severity      Severity      `yaml:"severity"`
	DefaultStatus ControlStatus `yaml:"defaultStatus,omitempty"`
}

Control represent the cps controls data and mapping checks

type ControlStatus added in v0.84.1

type ControlStatus string

type IntValue

type IntValue struct {
	BaseAttribute
	// contains filtered or unexported fields
}

func Int

func Int(value int, m Metadata) IntValue

func IntDefault

func IntDefault(value int, m Metadata) IntValue

func IntExplicit

func IntExplicit(value int, m Metadata) IntValue

func IntFromInt32

func IntFromInt32(value int32, m Metadata) IntValue

func IntUnresolvable

func IntUnresolvable(m Metadata) IntValue

func (IntValue) EqualTo

func (b IntValue) EqualTo(i int) bool

func (IntValue) GetMetadata added in v0.77.0

func (b IntValue) GetMetadata() Metadata

func (IntValue) GetRawValue added in v0.77.0

func (b IntValue) GetRawValue() interface{}

func (IntValue) GreaterThan

func (b IntValue) GreaterThan(i int) bool

func (IntValue) LessThan

func (b IntValue) LessThan(i int) bool

func (IntValue) MarshalJSON added in v0.77.0

func (b IntValue) MarshalJSON() ([]byte, error)

func (IntValue) NotEqualTo

func (b IntValue) NotEqualTo(i int) bool

func (IntValue) ToRego added in v0.77.0

func (s IntValue) ToRego() interface{}

func (*IntValue) UnmarshalJSON added in v0.77.0

func (b *IntValue) UnmarshalJSON(data []byte) error

func (IntValue) Value

func (b IntValue) Value() int

type MapValue

type MapValue struct {
	BaseAttribute
	// contains filtered or unexported fields
}

func Map

func Map(value map[string]string, m Metadata) MapValue

func MapDefault

func MapDefault(value map[string]string, m Metadata) MapValue

func MapExplicit

func MapExplicit(value map[string]string, m Metadata) MapValue

func (MapValue) GetRawValue added in v0.77.0

func (b MapValue) GetRawValue() interface{}

func (MapValue) HasKey

func (b MapValue) HasKey(key string) bool

func (MapValue) Len

func (b MapValue) Len() int

func (MapValue) MarshalJSON added in v0.77.0

func (b MapValue) MarshalJSON() ([]byte, error)

func (MapValue) ToRego added in v0.77.0

func (s MapValue) ToRego() interface{}

func (*MapValue) UnmarshalJSON added in v0.77.0

func (b *MapValue) UnmarshalJSON(data []byte) error

func (MapValue) Value

func (b MapValue) Value() map[string]string

type Metadata

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

func NewApiMetadata

func NewApiMetadata(provider string, parts ...string) Metadata

func NewExplicitMetadata

func NewExplicitMetadata(r Range, ref string) Metadata

func NewMetadata

func NewMetadata(r Range, ref string) Metadata

func NewRemoteMetadata

func NewRemoteMetadata(id string) Metadata

func NewTestMetadata

func NewTestMetadata() Metadata

func NewUnmanagedMetadata

func NewUnmanagedMetadata() Metadata

func NewUnresolvableMetadata

func NewUnresolvableMetadata(r Range, ref string) Metadata

func (Metadata) GetMetadata

func (m Metadata) GetMetadata() Metadata

func (Metadata) GetRawValue

func (m Metadata) GetRawValue() interface{}

func (Metadata) Internal added in v0.77.0

func (m Metadata) Internal() interface{}

func (Metadata) IsDefault

func (m Metadata) IsDefault() bool

func (Metadata) IsExplicit

func (m Metadata) IsExplicit() bool

func (Metadata) IsManaged

func (m Metadata) IsManaged() bool

func (Metadata) IsMultiLine

func (m Metadata) IsMultiLine() bool

func (Metadata) IsResolvable

func (m Metadata) IsResolvable() bool

func (Metadata) IsUnmanaged

func (m Metadata) IsUnmanaged() bool

func (Metadata) MarshalJSON added in v0.77.0

func (m Metadata) MarshalJSON() ([]byte, error)

func (Metadata) Parent

func (m Metadata) Parent() *Metadata

func (Metadata) Range

func (m Metadata) Range() Range

func (Metadata) Reference

func (m Metadata) Reference() string

func (Metadata) Root added in v0.72.0

func (m Metadata) Root() Metadata

func (*Metadata) SetParentPtr added in v0.77.0

func (m *Metadata) SetParentPtr(p *Metadata)

func (*Metadata) SetRange added in v0.77.0

func (m *Metadata) SetRange(r Range)

func (*Metadata) SetReference added in v0.77.0

func (m *Metadata) SetReference(ref string)

func (Metadata) String

func (m Metadata) String() string

func (*Metadata) ToRego

func (m *Metadata) ToRego() interface{}

func (*Metadata) UnmarshalJSON added in v0.77.0

func (m *Metadata) UnmarshalJSON(data []byte) error

func (Metadata) WithInternal added in v0.77.0

func (m Metadata) WithInternal(internal interface{}) Metadata

func (Metadata) WithParent

func (m Metadata) WithParent(p Metadata) Metadata

type Range

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

func NewRange

func NewRange(filename string, startLine int, endLine int, sourcePrefix string, srcFS fs.FS) Range

func NewRangeWithFSKey

func NewRangeWithFSKey(filename string, startLine int, endLine int, sourcePrefix string, fsKey string, fs fs.FS) Range

func NewRangeWithLogicalSource

func NewRangeWithLogicalSource(filename string, startLine int, endLine int, sourcePrefix string,
	srcFS fs.FS) Range

func (Range) GetEndLine

func (r Range) GetEndLine() int

func (Range) GetFS

func (r Range) GetFS() fs.FS

func (Range) GetFSKey

func (r Range) GetFSKey() string

func (Range) GetFilename

func (r Range) GetFilename() string

func (Range) GetLocalFilename

func (r Range) GetLocalFilename() string

func (Range) GetSourcePrefix

func (r Range) GetSourcePrefix() string

func (Range) GetStartLine

func (r Range) GetStartLine() int

func (Range) IsMultiLine

func (r Range) IsMultiLine() bool

func (Range) LineCount

func (r Range) LineCount() int

func (Range) MarshalJSON added in v0.77.0

func (r Range) MarshalJSON() ([]byte, error)

func (Range) String

func (r Range) String() string

func (*Range) UnmarshalJSON added in v0.77.0

func (r *Range) UnmarshalJSON(data []byte) error

type Severity added in v0.84.1

type Severity string

type Source

type Source string
const (
	SourceDockerfile Source = "dockerfile"
	SourceKubernetes Source = "kubernetes"
	SourceRbac       Source = "rbac"   // deprecated - please use "kubernetes" instead
	SourceDefsec     Source = "defsec" // deprecated - please use "cloud" instead
	SourceCloud      Source = "cloud"
	SourceYAML       Source = "yaml"
	SourceJSON       Source = "json"
	SourceTOML       Source = "toml"
)

type Spec added in v0.84.1

type Spec struct {
	ID               string    `yaml:"id"`
	Title            string    `yaml:"title"`
	Description      string    `yaml:"description"`
	Version          string    `yaml:"version"`
	RelatedResources []string  `yaml:"relatedResources"`
	Controls         []Control `yaml:"controls"`
}

type SpecCheck added in v0.84.1

type SpecCheck struct {
	ID string `yaml:"id"`
}

SpecCheck represent the scanner who perform the control check

type StringEqualityOption

type StringEqualityOption int
const (
	IgnoreCase StringEqualityOption = iota
	IsPallindrome
	IgnoreWhitespace
)

type StringValue

type StringValue struct {
	BaseAttribute
	// contains filtered or unexported fields
}

func String

func String(str string, m Metadata) StringValue

func StringDefault

func StringDefault(value string, m Metadata) StringValue

func StringExplicit

func StringExplicit(value string, m Metadata) StringValue

func StringUnresolvable

func StringUnresolvable(m Metadata) StringValue

func (StringValue) Contains

func (s StringValue) Contains(value string, equalityOptions ...StringEqualityOption) bool

func (StringValue) EndsWith

func (s StringValue) EndsWith(suffix string, equalityOptions ...StringEqualityOption) bool

func (StringValue) EqualTo

func (s StringValue) EqualTo(value string, equalityOptions ...StringEqualityOption) bool

func (StringValue) GetMetadata added in v0.77.0

func (s StringValue) GetMetadata() Metadata

func (StringValue) GetRawValue added in v0.77.0

func (b StringValue) GetRawValue() interface{}

func (StringValue) IsEmpty

func (s StringValue) IsEmpty() bool

func (StringValue) IsNotEmpty

func (s StringValue) IsNotEmpty() bool

func (StringValue) IsOneOf

func (s StringValue) IsOneOf(values ...string) bool

func (StringValue) MarshalJSON added in v0.77.0

func (b StringValue) MarshalJSON() ([]byte, error)

func (StringValue) NotEqualTo

func (s StringValue) NotEqualTo(value string, equalityOptions ...StringEqualityOption) bool

func (StringValue) StartsWith

func (s StringValue) StartsWith(prefix string, equalityOptions ...StringEqualityOption) bool

func (StringValue) ToRego added in v0.77.0

func (s StringValue) ToRego() interface{}

func (*StringValue) UnmarshalJSON added in v0.77.0

func (b *StringValue) UnmarshalJSON(data []byte) error

func (StringValue) Value

func (s StringValue) Value() string

type StringValueList

type StringValueList []StringValue

func (StringValueList) AsStrings

func (l StringValueList) AsStrings() (output []string)

type TimeValue

type TimeValue struct {
	BaseAttribute
	// contains filtered or unexported fields
}

func Time

func Time(value time.Time, m Metadata) TimeValue

func TimeDefault

func TimeDefault(value time.Time, m Metadata) TimeValue

func TimeExplicit

func TimeExplicit(value time.Time, m Metadata) TimeValue

func TimeUnresolvable

func TimeUnresolvable(m Metadata) TimeValue

func (TimeValue) After

func (t TimeValue) After(i time.Time) bool

func (TimeValue) Before

func (t TimeValue) Before(i time.Time) bool

func (TimeValue) GetRawValue added in v0.77.0

func (t TimeValue) GetRawValue() interface{}

func (TimeValue) IsNever

func (t TimeValue) IsNever() bool

func (TimeValue) MarshalJSON added in v0.77.0

func (b TimeValue) MarshalJSON() ([]byte, error)

func (TimeValue) ToRego added in v0.77.0

func (t TimeValue) ToRego() interface{}

func (*TimeValue) UnmarshalJSON added in v0.77.0

func (b *TimeValue) UnmarshalJSON(data []byte) error

func (TimeValue) Value

func (t TimeValue) Value() time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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