Documentation
¶
Index ¶
- func CreateFSKey(filesystem fs.FS) string
- type BaseValue
- type BoolValue
- func Bool(value bool, m Metadata) BoolValue
- func BoolDefault(value bool, m Metadata) BoolValue
- func BoolExplicit(value bool, m Metadata) BoolValue
- func BoolFromCtyValue(val cty.Value, metadata Metadata) (BoolValue, bool)
- func BoolTest(value bool) BoolValue
- func BoolUnresolvable(m Metadata) BoolValue
- type BytesValue
- type Command
- type ComplianceSpec
- type Control
- type ControlStatus
- type IntValue
- type MapValue
- type Metadata
- func NewApiMetadata(provider string, parts ...string) Metadata
- func NewExplicitMetadata(r Range, ref string) Metadata
- func NewMetadata(r Range, ref string) Metadata
- func NewRemoteMetadata(id string) Metadata
- func NewTestMetadata() Metadata
- func NewUnmanagedMetadata() Metadata
- func NewUnresolvableMetadata(r Range, ref string) Metadata
- func (m Metadata) GetMetadata() Metadata
- func (m Metadata) GetRawValue() any
- func (m Metadata) Internal() any
- func (m Metadata) IsDefault() bool
- func (m Metadata) IsExplicit() bool
- func (m Metadata) IsManaged() bool
- func (m Metadata) IsMultiLine() bool
- func (m Metadata) IsResolvable() bool
- func (m Metadata) IsUnmanaged() bool
- func (m Metadata) MarshalJSON() ([]byte, error)
- func (m Metadata) Parent() *Metadata
- func (m Metadata) Range() Range
- func (m Metadata) Reference() string
- func (m Metadata) Root() Metadata
- func (m *Metadata) SetParentPtr(p *Metadata)
- func (m *Metadata) SetRange(r Range)
- func (m *Metadata) SetReference(ref string)
- func (m Metadata) String() string
- func (m *Metadata) ToRego() any
- func (m *Metadata) UnmarshalJSON(data []byte) error
- func (m Metadata) WithInternal(internal any) Metadata
- func (m Metadata) WithParent(p Metadata) Metadata
- type RFC3339Time
- type Range
- func NewRange(filename string, startLine, endLine int, sourcePrefix string, srcFS fs.FS) Range
- func NewRangeWithFSKey(filename string, startLine, endLine int, sourcePrefix, fsKey string, ...) Range
- func NewRangeWithLogicalSource(filename string, startLine, endLine int, sourcePrefix string, srcFS fs.FS) Range
- func (r Range) Covers(other Range) bool
- func (r Range) GetEndLine() int
- func (r Range) GetFS() fs.FS
- func (r Range) GetFSKey() string
- func (r Range) GetFilename() string
- func (r Range) GetLocalFilename() string
- func (r Range) GetSourcePrefix() string
- func (r Range) GetStartLine() int
- func (r Range) Includes(other Range) bool
- func (r Range) IsMultiLine() bool
- func (r Range) LineCount() int
- func (r Range) MarshalJSON() ([]byte, error)
- func (r Range) String() string
- func (r *Range) UnmarshalJSON(data []byte) error
- func (r Range) Validate() error
- type Severity
- type Source
- type Spec
- type SpecCheck
- type StringValue
- func (s StringValue) Contains(value string) bool
- func (s StringValue) EndsWith(suffix string) bool
- func (s StringValue) EqualTo(value string) bool
- func (s StringValue) IsEmpty() bool
- func (s StringValue) IsNotEmpty() bool
- func (s StringValue) IsOneOf(values ...string) bool
- func (s StringValue) NotEqualTo(value string) bool
- func (s StringValue) StartsWith(prefix string) bool
- type StringValueList
- type TimeValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFSKey ¶
Types ¶
type BaseValue ¶ added in v0.69.0
type BaseValue[T any] struct { // contains filtered or unexported fields }
func (BaseValue[T]) GetMetadata ¶ added in v0.69.0
func (BaseValue[T]) GetRawValue ¶ added in v0.69.0
func (BaseValue[T]) MarshalJSON ¶ added in v0.69.0
func (*BaseValue[T]) UnmarshalJSON ¶ added in v0.69.0
type BoolValue ¶
func BoolDefault ¶
func BoolExplicit ¶
func BoolFromCtyValue ¶ added in v0.68.0
BoolFromCtyValue converts a cty.Value to iacTypes.BoolValue. Returns the BoolValue and true if conversion to bool succeeded.
func BoolUnresolvable ¶
type BytesValue ¶
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 BytesTest ¶ added in v0.69.0
func BytesTest(value []byte) BytesValue
func BytesUnresolvable ¶
func BytesUnresolvable(m Metadata) BytesValue
func (BytesValue) Len ¶
func (v BytesValue) Len() int
func (BytesValue) ToRego ¶
func (v BytesValue) ToRego() any
type ComplianceSpec ¶
type ComplianceSpec struct {
Spec Spec `yaml:"spec"`
}
ComplianceSpec represent the compliance specification
type Control ¶
type Control struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
Checks []SpecCheck `yaml:"checks,omitempty"`
Commands []Command `yaml:"commands,omitempty"`
Severity Severity `yaml:"severity"`
DefaultStatus ControlStatus `yaml:"defaultStatus,omitempty"`
}
Control represent the cps controls data and mapping checks
type ControlStatus ¶
type ControlStatus string
type IntValue ¶
func IntDefault ¶
func IntExplicit ¶
func IntUnresolvable ¶
func (IntValue) GreaterThan ¶
type MapValue ¶
func (MapValue) GetRawValue ¶
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
func NewApiMetadata ¶
func NewExplicitMetadata ¶
func NewMetadata ¶
func NewRemoteMetadata ¶
func NewTestMetadata ¶
func NewTestMetadata() Metadata
func NewUnmanagedMetadata ¶
func NewUnmanagedMetadata() Metadata
func NewUnresolvableMetadata ¶
func (Metadata) GetMetadata ¶
func (Metadata) GetRawValue ¶
func (Metadata) IsExplicit ¶
func (Metadata) IsMultiLine ¶
func (Metadata) IsResolvable ¶
func (Metadata) IsUnmanaged ¶
func (Metadata) MarshalJSON ¶
func (*Metadata) SetParentPtr ¶
func (*Metadata) SetReference ¶
func (*Metadata) UnmarshalJSON ¶
func (Metadata) WithInternal ¶
func (Metadata) WithParent ¶
type RFC3339Time ¶ added in v0.69.0
func (RFC3339Time) MarshalJSON ¶ added in v0.69.0
func (t RFC3339Time) MarshalJSON() ([]byte, error)
func (*RFC3339Time) UnmarshalJSON ¶ added in v0.69.0
func (t *RFC3339Time) UnmarshalJSON(data []byte) error
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
func NewRangeWithFSKey ¶
func (Range) GetEndLine ¶
func (Range) GetFilename ¶
func (Range) GetLocalFilename ¶
func (Range) GetSourcePrefix ¶
func (Range) GetStartLine ¶
func (Range) IsMultiLine ¶
func (Range) MarshalJSON ¶
func (*Range) UnmarshalJSON ¶
type Source ¶
type Source string
const ( SourceDockerfile Source = "dockerfile" SourceKubernetes Source = "kubernetes" // Deprecated: use "kubernetes" instead SourceRbac Source = "rbac" // Deprecated: use "cloud" instead SourceDefsec Source = "defsec" SourceCloud Source = "cloud" SourceYAML Source = "yaml" SourceJSON Source = "json" SourceTOML Source = "toml" SourceTerraformRaw Source = "terraform-raw" )
type Spec ¶
type Spec struct {
ID string `yaml:"id"`
Title string `yaml:"title"`
Description string `yaml:"description"`
Version string `yaml:"version"`
Platform string `yaml:"platform"`
Type string `yaml:"type"`
RelatedResources []string `yaml:"relatedResources,omitempty"`
Controls []Control `yaml:"controls"`
}
type SpecCheck ¶
type SpecCheck struct {
ID string `yaml:"id"`
}
SpecCheck represent the scanner who perform the control check
type StringValue ¶
func String ¶
func String(value string, m Metadata) StringValue
func StringDefault ¶
func StringDefault(value string, m Metadata) StringValue
func StringExplicit ¶
func StringExplicit(value string, m Metadata) StringValue
func StringTest ¶ added in v0.51.0
func StringTest(value string) StringValue
func StringUnresolvable ¶
func StringUnresolvable(m Metadata) StringValue
func (StringValue) Contains ¶
func (s StringValue) Contains(value string) bool
func (StringValue) EndsWith ¶
func (s StringValue) EndsWith(suffix string) bool
func (StringValue) EqualTo ¶
func (s StringValue) EqualTo(value string) bool
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) NotEqualTo ¶
func (s StringValue) NotEqualTo(value string) bool
func (StringValue) StartsWith ¶
func (s StringValue) StartsWith(prefix string) bool
type StringValueList ¶
type StringValueList []StringValue
func (StringValueList) AsStrings ¶
func (l StringValueList) AsStrings() (output []string)
type TimeValue ¶
type TimeValue struct {
BaseValue[RFC3339Time]
}
func TimeUnresolvable ¶
func (TimeValue) GetRawValue ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.