Documentation ¶
Index ¶
- Constants
- Variables
- func GetResourcesListMock() []reporthandling.Resource
- type ClusterMetadata
- type ContextMetadata
- type DirectoryContextMetadata
- type FileContextMetadata
- type HelmContextMetadata
- type IBasicPostureReport
- type Metadata
- type PostureReport
- func (postureReport *PostureReport) AppendResourceResultToSummary(resourceResult *resourcesresults.Result)
- func (postureReport *PostureReport) GetClusterName() string
- func (postureReport *PostureReport) GetContextMetadata() *ContextMetadata
- func (postureReport *PostureReport) GetCustomerGUID() string
- func (postureReport *PostureReport) GetJobID() string
- func (postureReport *PostureReport) GetReportGUID() string
- func (postureReport *PostureReport) GetRepositoryHash() string
- func (postureReport *PostureReport) GetResource(resourceID string) workloadinterface.IMetadata
- func (postureReport *PostureReport) GetScannigTarget() ScanningTarget
- func (postureReport *PostureReport) GetStatus() *helpersv1.Status
- func (postureReport *PostureReport) GetTimestamp() *time.Time
- func (postureReport *PostureReport) InitializeSummary()
- func (postureReport *PostureReport) ListControls() []reportsummary.IControlSummary
- func (postureReport *PostureReport) ListControlsIDs() *helpersv1.AllLists
- func (postureReport *PostureReport) ListControlsNames() *helpersv1.AllLists
- func (postureReport *PostureReport) ListFrameworks() []reportsummary.IFrameworkSummary
- func (postureReport *PostureReport) ListFrameworksNames() *helpersv1.AllLists
- func (postureReport *PostureReport) ListResourcesIDs(f *helpersv1.Filters) *helpersv1.AllLists
- func (file *PostureReport) NKeys() int
- func (postureReport *PostureReport) ResourceResult(resourceID string) *resourcesresults.Result
- func (postureReport *PostureReport) ResourceStatus(resourceID string, f *helpersv1.Filters) apis.IStatus
- func (pr *PostureReport) ToBytes() ([]byte, error)
- func (pr *PostureReport) ToString() string
- func (r *PostureReport) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)
- type RepoContextMetadata
- type ScanMetadata
- type ScanningTarget
Constants ¶
const ( GKE = "GKE" GCP = "GCP" EKS = "EKS" )
Variables ¶
var PostureReportMockPassedSingleResource = `` /* 6734-byte string literal not displayed */
var ResourcesListMock = `` /* 69799-byte string literal not displayed */
Functions ¶
func GetResourcesListMock ¶
func GetResourcesListMock() []reporthandling.Resource
Types ¶
type ClusterMetadata ¶
type ClusterMetadata struct { NumberOfWorkerNodes int `json:"numberOfWorkerNodes,omitempty"` CloudProvider string `json:"cloudProvider,omitempty"` ContextName string `json:"contextName,omitempty"` MapNamespaceToNumberOfResources map[string]int `json:"namespaceToNumberOfResources,omitempty"` }
func (*ClusterMetadata) NKeys ¶
func (file *ClusterMetadata) NKeys() int
func (*ClusterMetadata) UnmarshalJSONObject ¶
func (m *ClusterMetadata) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)
ScanMetadata unmarshaller
type ContextMetadata ¶
type ContextMetadata struct { ClusterContextMetadata *ClusterMetadata `json:"clusterContextMetadata,omitempty"` RepoContextMetadata *RepoContextMetadata `json:"gitRepoContextMetadata,omitempty"` FileContextMetadata *FileContextMetadata `json:"fileContextMetadata,omitempty"` HelmContextMetadata *HelmContextMetadata `json:"helmContextMetadata,omitempty"` DirectoryContextMetadata *DirectoryContextMetadata `json:"directoryContextMetadata,omitempty"` }
type FileContextMetadata ¶
type HelmContextMetadata ¶
type HelmContextMetadata struct {
ChartName string `json:"chartName,omitempty"`
}
type IBasicPostureReport ¶
type IBasicPostureReport interface { reportsummary.IBasicPostureReport GetScannigTarget() ScanningTarget GetContextMetadata() *ContextMetadata GetRepositoryHash() string }
type Metadata ¶
type Metadata struct { ScanMetadata ScanMetadata `json:"scanMetadata,omitempty"` ContextMetadata ContextMetadata `json:"targetMetadata,omitempty"` ClusterMetadata ClusterMetadata `json:"clusterMetadata,omitempty"` // DEPRECATED }
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"` // Deprecated ReportID string `json:"reportGUID"` JobID string `json:"jobID"` PaginationInfo armoapi.PaginationMarks `json:"paginationInfo"` ClusterAPIServerInfo *version.Info `json:"clusterAPIServerInfo"` ReportGenerationTime time.Time `json:"generationTime"` SummaryDetails reportsummary.SummaryDetails `json:"summaryDetails,omitempty"` Results []resourcesresults.Result `json:"results,omitempty"` Resources []reporthandling.Resource `json:"resources,omitempty"` // Deprecated Metadata Metadata `json:"metadata,omitempty"` }
PostureReport posture scanning report structure
func GetPostureReportMockPassedSingleResource ¶
func GetPostureReportMockPassedSingleResource() *PostureReport
func (*PostureReport) AppendResourceResultToSummary ¶
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 ¶
func (postureReport *PostureReport) GetClusterName() string
func (*PostureReport) GetContextMetadata ¶
func (postureReport *PostureReport) GetContextMetadata() *ContextMetadata
func (*PostureReport) GetCustomerGUID ¶
func (postureReport *PostureReport) GetCustomerGUID() string
========IPostureReport implementations =======
func (*PostureReport) GetJobID ¶
func (postureReport *PostureReport) GetJobID() string
func (*PostureReport) GetReportGUID ¶
func (postureReport *PostureReport) GetReportGUID() string
func (*PostureReport) GetRepositoryHash ¶
func (postureReport *PostureReport) GetRepositoryHash() string
func (*PostureReport) GetResource ¶
func (postureReport *PostureReport) GetResource(resourceID string) workloadinterface.IMetadata
GetResource get single resource in IMetadata interface representation
func (*PostureReport) GetScannigTarget ¶
func (postureReport *PostureReport) GetScannigTarget() ScanningTarget
func (*PostureReport) GetStatus ¶
func (postureReport *PostureReport) GetStatus() *helpersv1.Status
Status get the overall scanning status
func (*PostureReport) GetTimestamp ¶
func (postureReport *PostureReport) GetTimestamp() *time.Time
func (*PostureReport) InitializeSummary ¶
func (postureReport *PostureReport) InitializeSummary()
UpdateSummary get the result of a single resource. If resource not found will return nil
func (*PostureReport) ListControls ¶
func (postureReport *PostureReport) ListControls() []reportsummary.IControlSummary
=========================================== List Controls ==================================== ListControls list all controls policies summary
func (*PostureReport) ListControlsIDs ¶
func (postureReport *PostureReport) ListControlsIDs() *helpersv1.AllLists
ListControlsIDs list all controls names
func (*PostureReport) ListControlsNames ¶
func (postureReport *PostureReport) ListControlsNames() *helpersv1.AllLists
ListControlsNames list all controls names
func (*PostureReport) ListFrameworks ¶
func (postureReport *PostureReport) ListFrameworks() []reportsummary.IFrameworkSummary
ListFrameworksNames list all framework policies summary
func (*PostureReport) ListFrameworksNames ¶
func (postureReport *PostureReport) ListFrameworksNames() *helpersv1.AllLists
ListFrameworksNames list all frameworks names
func (*PostureReport) ListResourcesIDs ¶
func (postureReport *PostureReport) ListResourcesIDs(f *helpersv1.Filters) *helpersv1.AllLists
func (*PostureReport) NKeys ¶
func (file *PostureReport) NKeys() int
func (*PostureReport) ResourceResult ¶
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 ¶
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 ¶
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 RepoContextMetadata ¶
type RepoContextMetadata struct { Provider string `json:"provider,omitempty"` // repo provider name. e.g. github, gitlab Repo string `json:"repo,omitempty"` Owner string `json:"owner,omitempty"` Branch string `json:"branch,omitempty"` DefaultBranch string `json:"defaultBranch,omitempty"` RemoteURL string `json:"remoteURL,omitempty"` LastCommit reporthandling.LastCommit `json:"lastCommit,omitempty"` }
type ScanMetadata ¶
type ScanMetadata struct { Format string `json:"format,omitempty"` // Format results (table, json, junit ...) KubescapeVersion string `json:"kubescapeVersion,omitempty"` // Kubescape version FormatVersion string `json:"formatVersion,omitempty"` // Format version (v1, v2) ScanningTarget ScanningTarget `json:"scanningTarget,omitempty"` // scanning target 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 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 }
func (*ScanMetadata) NKeys ¶
func (file *ScanMetadata) NKeys() int
func (*ScanMetadata) UnmarshalJSONObject ¶
func (m *ScanMetadata) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error)
ScanMetadata unmarshaler
type ScanningTarget ¶
type ScanningTarget uint16
const ( Cluster ScanningTarget = 0 File ScanningTarget = 1 Repo ScanningTarget = 2 GitLocal ScanningTarget = 3 Directory ScanningTarget = 4 )
func (*ScanningTarget) String ¶
func (st *ScanningTarget) String() string