v2

package
v0.0.118 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GKE = "GKE"
	GCP = "GCP"
	EKS = "EKS"
)

Variables

View Source
var PostureReportMockPassedSingleResource = `` /* 6734-byte string literal not displayed */
View Source
var ResourcesListMock = `` /* 69799-byte string literal not displayed */

Functions

func GetResourcesListMock

func GetResourcesListMock() []reporthandling.Resource

Types

type ClusterMetadata added in v0.0.116

type ClusterMetadata struct {
	NumberOfWorkerNodes int    `json:"numberOfWorkerNodes,omitempty"`
	CloudProvider       string `json:"cloudProvider,omitempty"`
	ContextName         string `json:"contextName,omitempty"`
}

type Metadata added in v0.0.116

type Metadata struct {
	ScanMetadata    ScanMetadata    `json:"scanMetadata,omitempty"`
	ClusterMetadata ClusterMetadata `json:"clusterMetadata,omitempty"`
}

type PaginationMarks added in v0.0.94

type PaginationMarks struct {
	ReportNumber int  `json:"chunkNumber"` // serial number of report, used in pagination
	IsLastReport bool `json:"isLastChunk"` //specify this is the last report, used in pagination
}

type PostureReport

type PostureReport struct {
	Attributes           []reportsummary.PostureAttributes `json:"attributes"` //allow flexible properties for posture reports
	CustomerGUID         string                            `json:"customerGUID"`
	ClusterName          string                            `json:"clusterName"`
	ClusterCloudProvider string                            `json:"clusterCloudProvider"`
	ReportID             string                            `json:"reportGUID"`
	JobID                string                            `json:"jobID"`
	PaginationInfo       PaginationMarks                   `json:"paginationInfo"`
	ClusterAPIServerInfo *version.Info                     `json:"clusterAPIServerInfo"`
	ReportGenerationTime time.Time                         `json:"generationTime"`
	SummaryDetails       reportsummary.SummaryDetails      `json:"summaryDetails,omitempty"` // Developing
	Results              []resourcesresults.Result         `json:"results,omitempty"`        // Developing
	Resources            []reporthandling.Resource         `json:"resources,omitempty"`
	Metadata             Metadata                          `json:"metadata,omitempty"`
}

PostureReport posture scanning report structure

func GetPostureReportMockPassedSingleResource

func GetPostureReportMockPassedSingleResource() *PostureReport

func (*PostureReport) AppendResourceResultToSummary added in v0.0.81

func (postureReport *PostureReport) AppendResourceResultToSummary(resourceResult *resourcesresults.Result)

AppendResourceResultToSummary get the result of a single resource. If resource not found will return nil

func (*PostureReport) GetClusterName added in v0.0.90

func (postureReport *PostureReport) GetClusterName() string

func (*PostureReport) GetCustomerGUID added in v0.0.90

func (postureReport *PostureReport) GetCustomerGUID() string

========IPostureReport implementations =======

func (*PostureReport) GetJobID added in v0.0.90

func (postureReport *PostureReport) GetJobID() string

func (*PostureReport) GetReportGUID added in v0.0.90

func (postureReport *PostureReport) GetReportGUID() string

func (*PostureReport) GetResource added in v0.0.77

func (postureReport *PostureReport) GetResource(resourceID string) workloadinterface.IMetadata

GetResource get single resource in IMetadata interface representation

func (*PostureReport) GetStatus added in v0.0.79

func (postureReport *PostureReport) GetStatus() *helpersv1.Status

Status get the overall scanning status

func (*PostureReport) GetTimestamp added in v0.0.90

func (postureReport *PostureReport) GetTimestamp() *time.Time

func (*PostureReport) InitializeSummary added in v0.0.81

func (postureReport *PostureReport) InitializeSummary()

UpdateSummary get the result of a single resource. If resource not found will return nil

func (*PostureReport) ListControls added in v0.0.80

func (postureReport *PostureReport) ListControls() []reportsummary.IControlSummary

=========================================== List Controls ==================================== ListControls list all controls policies summary

func (*PostureReport) ListControlsIDs added in v0.0.80

func (postureReport *PostureReport) ListControlsIDs() *helpersv1.AllLists

ListControlsIDs list all controls names

func (*PostureReport) ListControlsNames added in v0.0.80

func (postureReport *PostureReport) ListControlsNames() *helpersv1.AllLists

ListControlsNames list all controls names

func (*PostureReport) ListFrameworks added in v0.0.80

func (postureReport *PostureReport) ListFrameworks() []reportsummary.IFrameworkSummary

ListFrameworksNames list all framework policies summary

func (*PostureReport) ListFrameworksNames added in v0.0.80

func (postureReport *PostureReport) ListFrameworksNames() *helpersv1.AllLists

ListFrameworksNames list all frameworks names

func (*PostureReport) ListResourcesIDs added in v0.0.80

func (postureReport *PostureReport) ListResourcesIDs(f *helpersv1.Filters) *helpersv1.AllLists

func (*PostureReport) ListResultsWithControlID added in v0.0.81

func (postureReport *PostureReport) ListResultsWithControlID(controlID string) []resourcesresults.Result

func (*PostureReport) ListResultsWithControlName added in v0.0.81

func (postureReport *PostureReport) ListResultsWithControlName(name string) []resourcesresults.Result

func (*PostureReport) ListResultsWithRuleName added in v0.0.81

func (postureReport *PostureReport) ListResultsWithRuleName(ruleName string) []resourcesresults.Result

func (*PostureReport) NKeys added in v0.0.83

func (file *PostureReport) NKeys() int

func (*PostureReport) ResourceResult added in v0.0.77

func (postureReport *PostureReport) ResourceResult(resourceID string) *resourcesresults.Result

ResourceResult get the result of a single resource. If resource not found will return nil

func (*PostureReport) ResourceStatus added in v0.0.77

func (postureReport *PostureReport) ResourceStatus(resourceID string, f *helpersv1.Filters) apis.IStatus

ResourceStatus get single resource status. If resource not found will return an empty string

func (*PostureReport) ToBytes

func (pr *PostureReport) ToBytes() ([]byte, error)

func (*PostureReport) ToString

func (pr *PostureReport) ToString() string

func (*PostureReport) UnmarshalJSONObject added in v0.0.83

func (r *PostureReport) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)
responsible on fast unmarshaling of various COMMON posture report v2 structure for basic validation

UnmarshalJSONObject - File inside a pkg

type ScanMetadata added in v0.0.116

type ScanMetadata struct {
	Format             string   `json:"format,omitempty"`             // Format results (table, json, junit ...)
	ExcludedNamespaces []string `json:"excludedNamespaces,omitempty"` // used for host sensor namespace
	IncludeNamespaces  []string `json:"includeNamespaces,omitempty"`
	FailThreshold      float32  `json:"failThreshold,omitempty"`  // Failure score threshold
	Submit             bool     `json:"submit,omitempty"`         // Submit results to Armo BE
	HostScanner        bool     `json:"hostScanner,omitempty"`    // Deploy ARMO K8s host sensor to collect data from certain controls
	KeepLocal          bool     `json:"keepLocal,omitempty"`      // Do not submit results
	Logger             string   `json:"logger,omitempty"`         // logger level - debug/info/error
	TargetType         string   `json:"targetType,omitempty"`     // framework/control
	TargetNames        []string `json:"targetNames,omitempty"`    // list of frameworks/controls
	UseExceptions      string   `json:"useExceptions,omitempty"`  // Load file with exceptions configuration
	ControlsInputs     string   `json:"controlsInputs,omitempty"` // Load file with inputs for controls
	VerboseMode        bool     `json:"verboseMode,omitempty"`    // Display all of the input resources and not only failed resources
}

Jump to

Keyboard shortcuts

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