rego

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 23 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionWithDataDirs

func OptionWithDataDirs(dirs ...string) func(s *Scanner)

func OptionWithDebug

func OptionWithDebug(debugWriter io.Writer) func(s *Scanner)

OptionWithDebug - pass the scanner an io.Writer to log debug messages to

func OptionWithPolicyNamespaces

func OptionWithPolicyNamespaces(includeDefaults bool, namespaces ...string) func(s *Scanner)

func OptionWithTrace

func OptionWithTrace(w io.Writer) func(s *Scanner)

OptionWithTrace - specify an io.Writer for rego tracing

Types

type DynamicMetadata

type DynamicMetadata struct {
	Warning   bool
	Filepath  string
	Message   string
	StartLine int
	EndLine   int
}

type Input

type Input struct {
	Path     string       `json:"path"`
	Contents interface{}  `json:"contents"`
	Type     types.Source `json:"type"`
}

type InputOptions

type InputOptions struct {
	Combined  bool
	Selectors []Selector
}

type MetadataRetriever

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

func NewMetadataRetriever

func NewMetadataRetriever(compiler *ast.Compiler) *MetadataRetriever

func (*MetadataRetriever) RetrieveMetadata

func (m *MetadataRetriever) RetrieveMetadata(ctx context.Context, module *ast.Module) (*StaticMetadata, error)

type Option

type Option func(s *Scanner)

type Scanner

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

func NewScanner

func NewScanner(options ...Option) *Scanner

func (*Scanner) LoadPolicies

func (s *Scanner) LoadPolicies(loadEmbedded bool, srcFS fs.FS, paths []string, readers []io.Reader) error

func (*Scanner) ScanInput

func (s *Scanner) ScanInput(ctx context.Context, inputs ...Input) (scan.Results, error)

type Selector

type Selector struct {
	Type string
}

type StaticMetadata

type StaticMetadata struct {
	ID                 string
	AVDID              string
	Type               string
	Title              string
	ShortCode          string
	Description        string
	Severity           string
	RecommendedActions string
	PrimaryURL         string
	References         []string
	InputOptions       InputOptions
	Package            string
}

func (StaticMetadata) ToRule

func (m StaticMetadata) ToRule() scan.Rule

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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