policies

package
v0.65.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLinter added in v0.55.0

func NewLinter(paths []string) (linter.Linter, error)

func PreparePackageQuery

func PreparePackageQuery(ctx context.Context, modules []Module) (rego.PreparedEvalQuery, error)

func ReportPackages

func ReportPackages(ctx context.Context, logger *slog.Logger, sqlDB *sql.DB, platform string, org string, repo string, owner string, level string, advisoryType string) (table.Writer, error)

Types

type Level added in v0.60.0

type Level string
const (
	LevelError   Level = "ERROR"
	LevelWarning Level = "WARN"
)

func (Level) String added in v0.60.0

func (l Level) String() string

type Module

type Module struct {
	Filepath string
	Contents string
}

type Policies

type Policies struct{}

func (*Policies) AnonymiseData

func (d *Policies) AnonymiseData(ctx context.Context, sqlDB *sql.DB, orgs []string) (err error)

func (*Policies) CreateTables

func (*Policies) CreateTables(ctx context.Context, sqlDB *sql.DB) error

func (*Policies) Name

func (*Policies) Name() string

type PolicyViolation

type PolicyViolation struct {
	domain.Dependency
	DepTypes []string

	Level        Level
	AdvisoryType advisory.AdvisoryType
	Description  string
}

func EvaluatePolicies

func EvaluatePolicies(ctx context.Context, query rego.PreparedEvalQuery, sqlDB *sql.DB) ([]PolicyViolation, int, error)

func (PolicyViolation) DepTypesAsString

func (v PolicyViolation) DepTypesAsString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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