Documentation
¶
Index ¶
Constants ¶
View Source
const ( NBVersionCheckName = "NBVersionCheck" OSVersionCheckName = "OSVersionCheck" GeoLocationCheckName = "GeoLocationCheck" PeerNetworkRangeCheckName = "PeerNetworkRangeCheck" CheckActionAllow string = "allow" CheckActionDeny string = "deny" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
func NewChecksFromAPIPostureCheck(source api.PostureCheck) (*Checks, error)
func NewChecksFromAPIPostureCheckUpdate ¶
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 ¶
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"`
}
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
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
type OSVersionCheck ¶
type OSVersionCheck struct {
Android *MinVersionCheck
Darwin *MinVersionCheck
Ios *MinVersionCheck
Linux *MinKernelVersionCheck
Windows *MinKernelVersionCheck
}
func (*OSVersionCheck) Name ¶
func (c *OSVersionCheck) Name() string
type PeerNetworkRangeCheck ¶
func (*PeerNetworkRangeCheck) Check ¶
func (p *PeerNetworkRangeCheck) Check(peer nbpeer.Peer) (bool, error)
func (*PeerNetworkRangeCheck) Name ¶
func (p *PeerNetworkRangeCheck) Name() string
Click to show internal directories.
Click to hide internal directories.