risk_scanner

package
v0.0.0-...-46fbbb1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzeOption

type AnalyzeOption struct {
	//DumpAssessReport bool
	SkipImages []string
}

AnalyzeOption analyze option

type Client

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

Client to post requests

func NewClient

func NewClient(conf *Config) *Client

NewClient new client

func (*Client) IsAnalyzeRunning

func (c *Client) IsAnalyzeRunning() (bool, error)

IsAnalyzeRunning get analyze status

func (*Client) PostAnalyze

func (c *Client) PostAnalyze(a AnalyzeOption) error

PostAnalyze ask server to analyze resources

func (*Client) PostResource

func (c *Client) PostResource(a interface{}) error

func (*Client) SendExitInstruction

func (c *Client) SendExitInstruction() error

SendExitInstruction send exit instruction

type Config

type Config struct {
	Server     string `json:"server"`
	StandAlone bool   `json:"standalone"`
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig read configuration from env

func ReadEnvConfig

func ReadEnvConfig() *Config

ReadEnvConfig read configuration from env

type Controller

type Controller interface {
	// Run inspection.
	Run(ctx context.Context, policy *v1alpha1.InspectionPolicy) error
}

Controller controls the inspection flow.

type RiskController

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

func NewController

func NewController() *RiskController

NewController news a RiskController.

func (*RiskController) CTRL

func (c *RiskController) CTRL() Controller

CTRL returns RiskController interface.

func (*RiskController) Run

func (*RiskController) WithK8sClient

func (c *RiskController) WithK8sClient(cli client.Client) *RiskController

WithK8sClient sets k8s client.

func (*RiskController) WithScheme

func (c *RiskController) WithScheme(scheme *runtime.Scheme) *RiskController

WithScheme sets runtime scheme.

type Server

type Server struct {
	Workloads riskdata.Workloads
	Evaluator riskdata.Evaluator
	IsRunning bool
	Images    map[string]*riskdata.ImageItem
	Last      int64
	// contains filtered or unexported fields
}

Server the server

func NewServer

func NewServer() *Server

NewServer new server instance

func (*Server) Analyze

func (s *Server) Analyze(option AnalyzeOption)

func (*Server) Clear

func (s *Server) Clear()

func (*Server) Run

func (s *Server) Run(address string)

Run turn the server

func (*Server) WithAdapter

func (s *Server) WithAdapter(Adapter providers.Adapter) *Server

WithAdapter sets adapter.

func (*Server) WithContext

func (s *Server) WithContext(ctx context.Context) *Server

func (*Server) WithPolicy

func (s *Server) WithPolicy(policy *v1alpha1.InspectionPolicy) *Server

WithPolicy sets the policy

type Status

type Status struct {
	IsRunning bool  `json:"is_running"`
	Last      int64 `json:"last"`
}

Status risk evaluation status

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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