runner

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: AGPL-3.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	FindingTargetStatusSatisfied    = "satisfied"
	FindingTargetStatusNotSatisfied = "not satisfied"
)

Constants used in plugins for statusses which map to OSCAL due to int requirements of GRPC

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "RUNNER_PLUGIN",
	MagicCookieValue: "AC755DCE-C118-481A-8EFA-18D8675D8122",
}
View Source
var PluginMap = map[string]plugin.Plugin{
	"runner": &RunnerGRPCPlugin{},
}

Functions

func ActivitiesProtoToSdk added in v0.1.0

func ActivitiesProtoToSdk(activities []*proto.Activity) *[]types.Activity

func ActivityProtoToSdk added in v0.1.0

func ActivityProtoToSdk(activity *proto.Activity) *types.Activity

func ComponentReferenceProtoToSdk added in v0.1.0

func ComponentReferenceProtoToSdk(reference *proto.ComponentReference) *types.ComponentReference

func ComponentReferencesProtoToSdk added in v0.1.0

func ComponentReferencesProtoToSdk(activities []*proto.ComponentReference) *[]types.ComponentReference

func ControlReferenceProtoToSdk added in v0.1.0

func ControlReferenceProtoToSdk(control *proto.ControlReference) *types.ControlReference

func ControlReferencesProtoToSdk added in v0.1.0

func ControlReferencesProtoToSdk(controls []*proto.ControlReference) *[]types.ControlReference

func FindingProtoToSdk added in v0.1.0

func FindingProtoToSdk(finding *proto.Finding) *types.Finding

func FindingStatusProtoToSdk added in v0.1.0

func FindingStatusProtoToSdk(status *proto.FindingStatus) *types.FindingStatus

func FindingsProtoToSdk added in v0.1.0

func FindingsProtoToSdk(findings []*proto.Finding) *[]types.Finding

func LinkProtoToSdk added in v0.1.0

func LinkProtoToSdk(link *proto.Link) *types.Link

func LinksProtoToSdk added in v0.1.0

func LinksProtoToSdk(links []*proto.Link) *[]types.Link

func NewApiHelper added in v0.1.0

func NewApiHelper(logger hclog.Logger, client *sdk.Client, agentLabels map[string]string) *apiHelper

func ObservationProtoToSdk added in v0.1.0

func ObservationProtoToSdk(observation *proto.Observation) *types.Observation

func ObservationsProtoToSdk added in v0.1.0

func ObservationsProtoToSdk(observations []*proto.Observation) *[]types.Observation

func OriginActorProtoToSdk added in v0.1.0

func OriginActorProtoToSdk(actor *proto.OriginActor) *types.OriginActor

func OriginActorsProtoToSdk added in v0.1.0

func OriginActorsProtoToSdk(actors []*proto.OriginActor) *[]types.OriginActor

func OriginProtoToSdk added in v0.1.0

func OriginProtoToSdk(origin *proto.Origin) *types.Origin

func OriginsProtoToSdk added in v0.1.0

func OriginsProtoToSdk(origins []*proto.Origin) *[]types.Origin

func PropertiesProtoToSdk added in v0.1.0

func PropertiesProtoToSdk(properties []*proto.Property) *[]types.Property

func PropertyProtoToSdk added in v0.1.0

func PropertyProtoToSdk(property *proto.Property) *types.Property

func RelatedObservationProtoToSdk added in v0.1.0

func RelatedObservationProtoToSdk(observation *proto.RelatedObservation) *types.RelatedObservation

func RelatedObservationsProtoToSdk added in v0.1.0

func RelatedObservationsProtoToSdk(observations []*proto.RelatedObservation) *[]types.RelatedObservation

func RelevantEvidenceProtoToSdk added in v0.1.0

func RelevantEvidenceProtoToSdk(evidence *proto.RelevantEvidence) *types.RelevantEvidence

func RelevantEvidencesProtoToSdk added in v0.1.0

func RelevantEvidencesProtoToSdk(evidences []*proto.RelevantEvidence) *[]types.RelevantEvidence

func RiskProtoToSdk added in v0.1.0

func RiskProtoToSdk(risk *proto.RiskReference) *types.RiskReference

func RisksProtoToSdk added in v0.1.0

func RisksProtoToSdk(risks []*proto.RiskReference) *[]types.RiskReference

func StepProtoToSdk added in v0.1.0

func StepProtoToSdk(step *proto.Step) *types.Step

func StepsProtoToSdk added in v0.1.0

func StepsProtoToSdk(steps []*proto.Step) *[]types.Step

func SubjectReferenceProtoToSdk added in v0.1.0

func SubjectReferenceProtoToSdk(subject *proto.SubjectReference) *types.SubjectReference

func SubjectReferencesProtoToSdk added in v0.1.0

func SubjectReferencesProtoToSdk(subjects []*proto.SubjectReference) *[]types.SubjectReference

func ThreatIDProtoToSdk added in v0.1.0

func ThreatIDProtoToSdk(threatId *proto.ThreatId) *types.ThreatId

func ThreatIDsProtoToSdk added in v0.1.0

func ThreatIDsProtoToSdk(threatIds []*proto.ThreatId) *[]types.ThreatId

Types

type ApiHelper added in v0.0.13

type ApiHelper interface {
	CreateObservations(context.Context, []*proto.Observation) error
	CreateFindings(context.Context, []*proto.Finding) error
}

type GRPCApiHelperClient added in v0.0.13

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

func (*GRPCApiHelperClient) CreateFindings added in v0.1.1

func (m *GRPCApiHelperClient) CreateFindings(ctx context.Context, findings []*proto.Finding) error

func (*GRPCApiHelperClient) CreateObservations added in v0.1.1

func (m *GRPCApiHelperClient) CreateObservations(ctx context.Context, observations []*proto.Observation) error

type GRPCApiHelperServer added in v0.0.13

type GRPCApiHelperServer struct {
	// This is the real implementation
	Impl ApiHelper
}

func (*GRPCApiHelperServer) CreateFindings added in v0.1.1

func (*GRPCApiHelperServer) CreateObservations added in v0.1.1

type GRPCClient

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

GRPCClient is an implementation of KV that talks over RPC.

func (*GRPCClient) Configure

func (m *GRPCClient) Configure(request *proto.ConfigureRequest) (*proto.ConfigureResponse, error)

func (*GRPCClient) Eval

func (m *GRPCClient) Eval(request *proto.EvalRequest, a ApiHelper) (*proto.EvalResponse, error)

type GRPCServer

type GRPCServer struct {
	Impl Runner
	// contains filtered or unexported fields
}

func (*GRPCServer) Configure

func (*GRPCServer) Eval

type Runner

type Runner interface {
	Configure(request *proto.ConfigureRequest) (*proto.ConfigureResponse, error)
	Eval(request *proto.EvalRequest, a ApiHelper) (*proto.EvalResponse, error)
}

type RunnerGRPCPlugin

type RunnerGRPCPlugin struct {
	plugin.Plugin

	// Impl Injection
	Impl Runner
}

func (*RunnerGRPCPlugin) GRPCClient

func (p *RunnerGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*RunnerGRPCPlugin) GRPCServer

func (p *RunnerGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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