Documentation ¶
Index ¶
- type ControlCriteria
- type ControlSummaries
- func (controlSummaries *ControlSummaries) GetControl(criteria ControlCriteria, value string) IControlSummary
- func (controlSummaries *ControlSummaries) GetIDs() []string
- func (controlSummaries *ControlSummaries) ListControlsIDs() *helpersv1.AllLists
- func (controlSummaries *ControlSummaries) ListResourcesIDs() *helpersv1.AllLists
- func (controlSummaries *ControlSummaries) NumberOfControls() ICounters
- type ControlSummary
- func (controlSummary *ControlSummary) Append(status apis.IStatus, ids ...string)
- func (controlSummary *ControlSummary) CalculateStatus()
- func (controlSummary *ControlSummary) GetDescription() string
- func (controlSummary *ControlSummary) GetID() string
- func (controlSummary *ControlSummary) GetName() string
- func (controlSummary *ControlSummary) GetRemediation() string
- func (controlSummary *ControlSummary) GetScore() float32
- func (controlSummary *ControlSummary) GetScoreFactor() float32
- func (controlSummary *ControlSummary) GetStatus() apis.IStatus
- func (controlSummary *ControlSummary) ListResourcesIDs() *helpersv1.AllLists
- func (controlSummary *ControlSummary) NumberOfResources() ICounters
- func (controlSummary *ControlSummary) SetStatus(statusInfo *apis.StatusInfo)
- type FrameworkSummary
- func (frameworkSummary *FrameworkSummary) CalculateStatus()
- func (frameworkSummary *FrameworkSummary) GetControls() IControlsSummaries
- func (frameworkSummary *FrameworkSummary) GetName() string
- func (frameworkSummary *FrameworkSummary) GetScore() float32
- func (frameworkSummary *FrameworkSummary) GetStatus() apis.IStatus
- func (frameworkSummary *FrameworkSummary) Increase(status apis.IStatus)
- func (frameworkSummary *FrameworkSummary) ListControls() []IControlSummary
- func (frameworkSummary *FrameworkSummary) ListControlsIDs() *helpersv1.AllLists
- func (frameworkSummary *FrameworkSummary) ListControlsNames() *helpersv1.AllLists
- func (frameworkSummary *FrameworkSummary) ListResourcesIDs() *helpersv1.AllLists
- func (frameworkSummary *FrameworkSummary) NumberOfControls() ICounters
- func (frameworkSummary *FrameworkSummary) NumberOfResources() ICounters
- type IBasicPostureReport
- type IControlSummary
- type IControlsSummaries
- type ICounters
- type IFrameworkSummary
- type IPolicies
- type ListPolicies
- func (all *ListPolicies) All() []IPolicies
- func (all *ListPolicies) Append(status apis.ScanningStatus, policy IPolicies)
- func (all *ListPolicies) Excluded() []IPolicies
- func (all *ListPolicies) Failed() []IPolicies
- func (all *ListPolicies) Other() []IPolicies
- func (all *ListPolicies) Passed() []IPolicies
- func (all *ListPolicies) Skipped() []IPolicies
- func (all *ListPolicies) Update(all2 *ListPolicies)
- type PostureAttributes
- type PostureCounters
- func (pcounter *PostureCounters) All() int
- func (pcounter *PostureCounters) Excluded() int
- func (pcounter *PostureCounters) Failed() int
- func (pcounter *PostureCounters) Ignored() int
- func (pcounter *PostureCounters) Increase(status apis.IStatus)
- func (pcounter *PostureCounters) Passed() int
- func (pcounter *PostureCounters) Skipped() int
- func (pcounter *PostureCounters) Unknown() int
- type ResourceCounters
- func (resourceCounters *ResourceCounters) All() int
- func (resourceCounters *ResourceCounters) Excluded() int
- func (resourceCounters *ResourceCounters) Failed() int
- func (resourceCounters *ResourceCounters) Increase(status apis.IStatus)
- func (resourceCounters *ResourceCounters) Passed() int
- func (resourceCounters *ResourceCounters) Set(allLists *helpersv1.AllLists)
- func (resourceCounters *ResourceCounters) Skipped() int
- type SummaryDetails
- func (summaryDetails *SummaryDetails) AppendResourceResult(resourceResult *resourcesresults.Result)
- func (summaryDetails *SummaryDetails) CalculateStatus()
- func (summaryDetails *SummaryDetails) ControlName(controlID string) string
- func (summaryDetails *SummaryDetails) GetScore() float32
- func (summaryDetails *SummaryDetails) GetStatus() *helpersv1.Status
- func (summaryDetails *SummaryDetails) Increase(status apis.IStatus)
- func (summaryDetails *SummaryDetails) InitResourcesSummary(controlInfoMap map[string]apis.StatusInfo)
- func (summaryDetails *SummaryDetails) ListControls() []IControlSummary
- func (summaryDetails *SummaryDetails) ListControlsIDs() *helpersv1.AllLists
- func (summaryDetails *SummaryDetails) ListControlsNames() *helpersv1.AllLists
- func (summaryDetails *SummaryDetails) ListFrameworks() []IFrameworkSummary
- func (summaryDetails *SummaryDetails) ListFrameworksNames() *helpersv1.AllLists
- func (summaryDetails *SummaryDetails) ListResourcesIDs() *helpersv1.AllLists
- func (summaryDetails *SummaryDetails) NumberOfControls() ICounters
- func (summaryDetails *SummaryDetails) NumberOfResources() ICounters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlCriteria ¶ added in v0.0.89
type ControlCriteria string
const ( EControlCriteriaID ControlCriteria = "ID" EControlCriteriaName ControlCriteria = "name" )
type ControlSummaries ¶ added in v0.0.89
type ControlSummaries map[string]ControlSummary
func (*ControlSummaries) GetControl ¶ added in v0.0.89
func (controlSummaries *ControlSummaries) GetControl(criteria ControlCriteria, value string) IControlSummary
get control either by criteria = "ID" and value <controlID> or criteria = name and <controlName>
func (*ControlSummaries) GetIDs ¶ added in v0.0.89
func (controlSummaries *ControlSummaries) GetIDs() []string
=============== ControlSummaries
func (*ControlSummaries) ListControlsIDs ¶ added in v0.0.89
func (controlSummaries *ControlSummaries) ListControlsIDs() *helpersv1.AllLists
func (*ControlSummaries) ListResourcesIDs ¶ added in v0.0.89
func (controlSummaries *ControlSummaries) ListResourcesIDs() *helpersv1.AllLists
func (*ControlSummaries) NumberOfControls ¶ added in v0.0.89
func (controlSummaries *ControlSummaries) NumberOfControls() ICounters
might be redundant
type ControlSummary ¶
type ControlSummary struct { ControlID string `json:"controlID"` Name string `json:"name"` Status apis.ScanningStatus `json:"status"` StatusInfo apis.StatusInfo `json:"statusInfo,omitempty"` Score float32 `json:"score"` ScoreFactor float32 `json:"scoreFactor"` ResourceIDs helpersv1.AllLists `json:"resourceIDs"` ResourceCounters ResourceCounters `json:",inline"` Description string `json:"-"` Remediation string `json:"-"` }
ControlSummary summary of scanning from a single control perspective
func (*ControlSummary) Append ¶ added in v0.0.81
func (controlSummary *ControlSummary) Append(status apis.IStatus, ids ...string)
Append increases the counter based on the status
func (*ControlSummary) CalculateStatus ¶ added in v0.0.79
func (controlSummary *ControlSummary) CalculateStatus()
CalculateStatus set the control status based on the resource counters
func (*ControlSummary) GetDescription ¶ added in v0.0.92
func (controlSummary *ControlSummary) GetDescription() string
GetDescription get control description
func (*ControlSummary) GetID ¶ added in v0.0.80
func (controlSummary *ControlSummary) GetID() string
GetID return control ID
func (*ControlSummary) GetName ¶ added in v0.0.80
func (controlSummary *ControlSummary) GetName() string
GetName return control name
func (*ControlSummary) GetRemediation ¶ added in v0.0.92
func (controlSummary *ControlSummary) GetRemediation() string
GetRemediation get control remediation
func (*ControlSummary) GetScore ¶
func (controlSummary *ControlSummary) GetScore() float32
GetScore return control score
func (*ControlSummary) GetScoreFactor ¶ added in v0.0.91
func (controlSummary *ControlSummary) GetScoreFactor() float32
GetScoreFactor return control score
func (*ControlSummary) GetStatus ¶ added in v0.0.79
func (controlSummary *ControlSummary) GetStatus() apis.IStatus
GetStatus get the control status. returns an apis.ScanningStatus object
func (*ControlSummary) ListResourcesIDs ¶ added in v0.0.89
func (controlSummary *ControlSummary) ListResourcesIDs() *helpersv1.AllLists
=================================== Counters ============================================
func (*ControlSummary) NumberOfResources ¶ added in v0.0.85
func (controlSummary *ControlSummary) NumberOfResources() ICounters
NumberOf get the number of resources
func (*ControlSummary) SetStatus ¶ added in v0.0.116
func (controlSummary *ControlSummary) SetStatus(statusInfo *apis.StatusInfo)
type FrameworkSummary ¶
type FrameworkSummary struct { Name string `json:"name"` // framework name Status apis.ScanningStatus `json:"status"` Score float32 `json:"score"` // framework score Version string `json:"version"` // framework version Controls ControlSummaries `json:"controls,omitempty"` // mapping of control - map[<control ID>]<control summary> ResourceCounters ResourceCounters `json:",inline"` }
FrameworkSummary summary of scanning from a single framework perspective
func (*FrameworkSummary) CalculateStatus ¶ added in v0.0.79
func (frameworkSummary *FrameworkSummary) CalculateStatus()
SetStatus set the framework status based on the resource counters
func (*FrameworkSummary) GetControls ¶ added in v0.0.118
func (frameworkSummary *FrameworkSummary) GetControls() IControlsSummaries
Controls return the controls
func (*FrameworkSummary) GetName ¶
func (frameworkSummary *FrameworkSummary) GetName() string
GetName return framework name
func (*FrameworkSummary) GetScore ¶
func (frameworkSummary *FrameworkSummary) GetScore() float32
GetScore return framework score
func (*FrameworkSummary) GetStatus ¶ added in v0.0.79
func (frameworkSummary *FrameworkSummary) GetStatus() apis.IStatus
Status get the framework status. returns an apis.ScanningStatus object
func (*FrameworkSummary) Increase ¶ added in v0.0.79
func (frameworkSummary *FrameworkSummary) Increase(status apis.IStatus)
Increase increases the counter based on the status
func (*FrameworkSummary) ListControls ¶ added in v0.0.85
func (frameworkSummary *FrameworkSummary) ListControls() []IControlSummary
ListControls list all controls
func (*FrameworkSummary) ListControlsIDs ¶ added in v0.0.85
func (frameworkSummary *FrameworkSummary) ListControlsIDs() *helpersv1.AllLists
func (*FrameworkSummary) ListControlsNames ¶ added in v0.0.85
func (frameworkSummary *FrameworkSummary) ListControlsNames() *helpersv1.AllLists
ListControlsNames list all framework names
func (*FrameworkSummary) ListResourcesIDs ¶ added in v0.0.89
func (frameworkSummary *FrameworkSummary) ListResourcesIDs() *helpersv1.AllLists
List resources IDs
func (*FrameworkSummary) NumberOfControls ¶ added in v0.0.89
func (frameworkSummary *FrameworkSummary) NumberOfControls() ICounters
func (*FrameworkSummary) NumberOfResources ¶ added in v0.0.85
func (frameworkSummary *FrameworkSummary) NumberOfResources() ICounters
NumberOfExcluded get the number of excluded resources
type IBasicPostureReport ¶ added in v0.0.90
type IControlSummary ¶ added in v0.0.89
type IControlsSummaries ¶ added in v0.0.89
type IControlsSummaries interface { GetControl(criteria ControlCriteria, value string) IControlSummary NumberOfControls() ICounters ListControlsIDs() *helpersv1.AllLists ListResourcesIDs() *helpersv1.AllLists //avoid using this outside of kubescape }
type IFrameworkSummary ¶ added in v0.0.89
type IFrameworkSummary interface { IPolicies ListControls() []IControlSummary NumberOfControls() ICounters }
type ListPolicies ¶ added in v0.0.80
type ListPolicies struct {
// contains filtered or unexported fields
}
func (*ListPolicies) All ¶ added in v0.0.80
func (all *ListPolicies) All() []IPolicies
func (*ListPolicies) Append ¶ added in v0.0.80
func (all *ListPolicies) Append(status apis.ScanningStatus, policy IPolicies)
Append append single string to matching status list
func (*ListPolicies) Excluded ¶ added in v0.0.80
func (all *ListPolicies) Excluded() []IPolicies
func (*ListPolicies) Failed ¶ added in v0.0.80
func (all *ListPolicies) Failed() []IPolicies
func (*ListPolicies) Other ¶ added in v0.0.80
func (all *ListPolicies) Other() []IPolicies
func (*ListPolicies) Passed ¶ added in v0.0.80
func (all *ListPolicies) Passed() []IPolicies
func (*ListPolicies) Skipped ¶ added in v0.0.80
func (all *ListPolicies) Skipped() []IPolicies
func (*ListPolicies) Update ¶ added in v0.0.80
func (all *ListPolicies) Update(all2 *ListPolicies)
Update AllLists objects with
type PostureAttributes ¶ added in v0.0.90
type PostureCounters ¶ added in v0.0.89
type PostureCounters struct { PassedCounter int `json:"passed"` FailedCounter int `json:"failed"` ExcludedCounter int `json:"excluded"` SkippedCounter int `json:"skipped"` IgnoredCounter int `json:"ignored"` UnknownCounter int `json:"unknown"` }
func (*PostureCounters) All ¶ added in v0.0.89
func (pcounter *PostureCounters) All() int
func (*PostureCounters) Excluded ¶ added in v0.0.89
func (pcounter *PostureCounters) Excluded() int
NumberOfExcluded get the number of excluded posture object
func (*PostureCounters) Failed ¶ added in v0.0.89
func (pcounter *PostureCounters) Failed() int
Failed get the number of failed posture object
func (*PostureCounters) Ignored ¶ added in v0.0.89
func (pcounter *PostureCounters) Ignored() int
func (*PostureCounters) Increase ¶ added in v0.0.89
func (pcounter *PostureCounters) Increase(status apis.IStatus)
func (*PostureCounters) Passed ¶ added in v0.0.89
func (pcounter *PostureCounters) Passed() int
NumberOfPassed get the number of passed posture object
func (*PostureCounters) Skipped ¶ added in v0.0.89
func (pcounter *PostureCounters) Skipped() int
NumberOfSkipped get the number of skipped posture object
func (*PostureCounters) Unknown ¶ added in v0.0.89
func (pcounter *PostureCounters) Unknown() int
type ResourceCounters ¶
type ResourceCounters struct { PassedResources int `json:"passedResources"` FailedResources int `json:"failedResources"` ExcludedResources int `json:"excludedResources"` }
func (*ResourceCounters) All ¶ added in v0.0.80
func (resourceCounters *ResourceCounters) All() int
NumberOfAll get the number of all resources
func (*ResourceCounters) Excluded ¶ added in v0.0.80
func (resourceCounters *ResourceCounters) Excluded() int
NumberOfExcluded get the number of excluded resources
func (*ResourceCounters) Failed ¶ added in v0.0.80
func (resourceCounters *ResourceCounters) Failed() int
NumberOfFailed get the number of failed resources
func (*ResourceCounters) Increase ¶ added in v0.0.79
func (resourceCounters *ResourceCounters) Increase(status apis.IStatus)
Increase increases the counter based on the status
func (*ResourceCounters) Passed ¶ added in v0.0.80
func (resourceCounters *ResourceCounters) Passed() int
NumberOfPassed get the number of passed resources
func (*ResourceCounters) Set ¶ added in v0.0.81
func (resourceCounters *ResourceCounters) Set(allLists *helpersv1.AllLists)
NumberOfExcluded get the number of excluded resources
func (*ResourceCounters) Skipped ¶ added in v0.0.80
func (resourceCounters *ResourceCounters) Skipped() int
NumberOfSkipped get the number of skipped resources
type SummaryDetails ¶
type SummaryDetails struct { Score float32 `json:"score"` // overall score Status apis.ScanningStatus `json:"status"` // overall status Frameworks []FrameworkSummary `json:"frameworks"` // list of framework summary Controls ControlSummaries `json:"controls,omitempty"` // mapping of control - map[<control ID>]<control summary> ResourceCounters ResourceCounters `json:",inline"` }
SummaryDetails detailed summary of the scanning. will contain versions, counters, etc.
func MockSummaryDetails ¶ added in v0.0.79
func MockSummaryDetails() *SummaryDetails
func (*SummaryDetails) AppendResourceResult ¶ added in v0.0.81
func (summaryDetails *SummaryDetails) AppendResourceResult(resourceResult *resourcesresults.Result)
updateSummaryWithResource get the result of a single resource. If resource not found will return nil
func (*SummaryDetails) CalculateStatus ¶ added in v0.0.79
func (summaryDetails *SummaryDetails) CalculateStatus()
SetStatus set the framework status based on the resource counters
func (*SummaryDetails) ControlName ¶ added in v0.0.80
func (summaryDetails *SummaryDetails) ControlName(controlID string) string
================================================================================
func (*SummaryDetails) GetScore ¶ added in v0.0.117
func (summaryDetails *SummaryDetails) GetScore() float32
GetScore return score
func (*SummaryDetails) GetStatus ¶ added in v0.0.79
func (summaryDetails *SummaryDetails) GetStatus() *helpersv1.Status
Status get the scan status. returns an apis.ScanningStatus object
func (*SummaryDetails) Increase ¶ added in v0.0.79
func (summaryDetails *SummaryDetails) Increase(status apis.IStatus)
Increase increases the counter based on the status
func (*SummaryDetails) InitResourcesSummary ¶ added in v0.0.81
func (summaryDetails *SummaryDetails) InitResourcesSummary(controlInfoMap map[string]apis.StatusInfo)
InitResourcesSummary must run this AFTER initializing the controls
func (*SummaryDetails) ListControls ¶
func (summaryDetails *SummaryDetails) ListControls() []IControlSummary
ListControls list all controls
func (*SummaryDetails) ListControlsIDs ¶ added in v0.0.80
func (summaryDetails *SummaryDetails) ListControlsIDs() *helpersv1.AllLists
func (*SummaryDetails) ListControlsNames ¶ added in v0.0.80
func (summaryDetails *SummaryDetails) ListControlsNames() *helpersv1.AllLists
ListControlsNames list all framework names
func (*SummaryDetails) ListFrameworks ¶
func (summaryDetails *SummaryDetails) ListFrameworks() []IFrameworkSummary
ListFrameworks list all frameworks
func (*SummaryDetails) ListFrameworksNames ¶ added in v0.0.80
func (summaryDetails *SummaryDetails) ListFrameworksNames() *helpersv1.AllLists
ListFrameworksNames list all framework names
func (*SummaryDetails) ListResourcesIDs ¶ added in v0.0.81
func (summaryDetails *SummaryDetails) ListResourcesIDs() *helpersv1.AllLists
ListResourcesIDs list all resources IDs
func (*SummaryDetails) NumberOfControls ¶ added in v0.0.91
func (summaryDetails *SummaryDetails) NumberOfControls() ICounters
NumberOfControls get number of controls
func (*SummaryDetails) NumberOfResources ¶ added in v0.0.85
func (summaryDetails *SummaryDetails) NumberOfResources() ICounters
NumberOfExcluded get the number of excluded resources