Documentation ¶
Index ¶
Constants ¶
View Source
const ( NBVersionCheckName = "NBVersionCheck" OSVersionCheckName = "OSVersionCheck" GeoLocationCheckName = "GeoLocationCheck" PeerNetworkRangeCheckName = "PeerNetworkRangeCheck" ProcessCheckName = "ProcessCheck" CheckActionAllow string = "allow" CheckActionDeny string = "deny" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check interface { Name() string Check(ctx context.Context, peer nbpeer.Peer) (bool, error) Validate() error }
Check represents an interface for performing a check on a peer.
type Checks ¶
type Checks struct { // ID of the posture checks ID string `gorm:"primaryKey"` // Name of the posture checks Name string // Description of the posture checks visible in the UI Description string // AccountID is a reference to the Account that this object belongs AccountID string `json:"-" gorm:"index"` // Checks is a set of objects that perform the actual checks Checks ChecksDefinition `gorm:"serializer:json"` }
func NewChecksFromAPIPostureCheck ¶ added in v0.28.0
func NewChecksFromAPIPostureCheck(source api.PostureCheck) (*Checks, error)
func NewChecksFromAPIPostureCheckUpdate ¶ added in v0.28.0
func NewChecksFromAPIPostureCheckUpdate(source api.PostureCheckUpdate, postureChecksID string) (*Checks, error)
func (*Checks) TableName ¶
TableName returns the name of the table for the Checks model in the database.
func (*Checks) ToAPIResponse ¶ added in v0.28.0
func (pc *Checks) ToAPIResponse() *api.PostureCheck
type ChecksDefinition ¶
type ChecksDefinition struct { NBVersionCheck *NBVersionCheck `json:",omitempty"` OSVersionCheck *OSVersionCheck `json:",omitempty"` GeoLocationCheck *GeoLocationCheck `json:",omitempty"` PeerNetworkRangeCheck *PeerNetworkRangeCheck `json:",omitempty"` ProcessCheck *ProcessCheck `json:",omitempty"` }
ChecksDefinition contains definition of actual check
func (ChecksDefinition) Copy ¶
func (cd ChecksDefinition) Copy() ChecksDefinition
Copy returns a copy of a checks definition.
type GeoLocationCheck ¶
type GeoLocationCheck struct { // Locations list of geolocations, to which the policy applies Locations []Location // Action to take upon policy match Action string }
func (*GeoLocationCheck) Name ¶
func (g *GeoLocationCheck) Name() string
func (*GeoLocationCheck) Validate ¶ added in v0.28.0
func (g *GeoLocationCheck) Validate() error
type MinKernelVersionCheck ¶
type MinKernelVersionCheck struct {
MinKernelVersion string
}
type MinVersionCheck ¶
type MinVersionCheck struct {
MinVersion string
}
type NBVersionCheck ¶
type NBVersionCheck struct {
MinVersion string
}
func (*NBVersionCheck) Name ¶
func (n *NBVersionCheck) Name() string
func (*NBVersionCheck) Validate ¶ added in v0.28.0
func (n *NBVersionCheck) Validate() error
type OSVersionCheck ¶
type OSVersionCheck struct { Android *MinVersionCheck Darwin *MinVersionCheck Ios *MinVersionCheck Linux *MinKernelVersionCheck Windows *MinKernelVersionCheck }
func (*OSVersionCheck) Name ¶
func (c *OSVersionCheck) Name() string
func (*OSVersionCheck) Validate ¶ added in v0.28.0
func (c *OSVersionCheck) Validate() error
type PeerNetworkRangeCheck ¶ added in v0.26.1
func (*PeerNetworkRangeCheck) Name ¶ added in v0.26.1
func (p *PeerNetworkRangeCheck) Name() string
func (*PeerNetworkRangeCheck) Validate ¶ added in v0.28.0
func (p *PeerNetworkRangeCheck) Validate() error
type ProcessCheck ¶ added in v0.28.0
type ProcessCheck struct {
Processes []Process
}
func (*ProcessCheck) Name ¶ added in v0.28.0
func (p *ProcessCheck) Name() string
func (*ProcessCheck) Validate ¶ added in v0.28.0
func (p *ProcessCheck) Validate() error
Click to show internal directories.
Click to hide internal directories.