profile

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceLocal      string = "local"   // local, editable
	SourceSpecial    string = "special" // specials (read-only)
	SourceCommunity  string = "community"
	SourceEnterprise string = "enterprise"
)

Profile Sources

View Source
const (
	DefaultActionNotSet uint8 = 0
	DefaultActionBlock  uint8 = 1
	DefaultActionAsk    uint8 = 2
	DefaultActionPermit uint8 = 3
)

Default Action IDs

Variables

View Source
var (
	CfgOptionDefaultActionKey = "filter/defaultAction"

	CfgOptionBlockScopeInternetKey = "filter/blockInternet"

	CfgOptionBlockScopeLANKey = "filter/blockLAN"

	CfgOptionBlockScopeLocalKey = "filter/blockLocal"

	CfgOptionBlockP2PKey = "filter/blockP2P"

	CfgOptionBlockInboundKey = "filter/blockInbound"

	CfgOptionEndpointsKey = "filter/endpoints"

	CfgOptionServiceEndpointsKey = "filter/serviceEndpoints"

	CfgOptionPreventBypassingKey = "filter/preventBypassing"

	CfgOptionFilterListsKey = "filter/lists"

	CfgOptionFilterSubDomainsKey = "filter/includeSubdomains"

	CfgOptionFilterCNAMEKey = "filter/includeCNAMEs"

	CfgOptionDisableAutoPermitKey = "filter/disableAutoPermit"

	CfgOptionEnforceSPNKey = "filter/enforceSPN"

	CfgOptionRemoveOutOfScopeDNSKey = "filter/removeOutOfScopeDNS"

	CfgOptionRemoveBlockedDNSKey = "filter/removeBlockedDNS"
)

Configuration Keys

Functions

This section is empty.

Types

type LayeredProfile added in v0.4.0

type LayeredProfile struct {
	DisableAutoPermit   config.BoolOption
	BlockScopeLocal     config.BoolOption
	BlockScopeLAN       config.BoolOption
	BlockScopeInternet  config.BoolOption
	BlockP2P            config.BoolOption
	BlockInbound        config.BoolOption
	EnforceSPN          config.BoolOption
	RemoveOutOfScopeDNS config.BoolOption
	RemoveBlockedDNS    config.BoolOption
	FilterSubDomains    config.BoolOption
	FilterCNAMEs        config.BoolOption
	PreventBypassing    config.BoolOption
	// contains filtered or unexported fields
}

LayeredProfile combines multiple Profiles.

func NewLayeredProfile added in v0.4.0

func NewLayeredProfile(localProfile *Profile) *LayeredProfile

NewLayeredProfile returns a new layered profile based on the given local profile.

func (*LayeredProfile) AddEndpoint added in v0.4.0

func (lp *LayeredProfile) AddEndpoint(newEntry string)

AddEndpoint adds an endpoint to the local endpoint list, saves the local profile and reloads the configuration.

func (*LayeredProfile) AddServiceEndpoint added in v0.4.0

func (lp *LayeredProfile) AddServiceEndpoint(newEntry string)

AddServiceEndpoint adds a service endpoint to the local endpoint list, saves the local profile and reloads the configuration.

func (*LayeredProfile) DefaultAction added in v0.4.0

func (lp *LayeredProfile) DefaultAction() uint8

DefaultAction returns the active default action ID.

func (*LayeredProfile) MarkUsed added in v0.4.1

func (lp *LayeredProfile) MarkUsed()

MarkUsed marks the localProfile as used.

func (*LayeredProfile) MatchEndpoint added in v0.4.0

func (lp *LayeredProfile) MatchEndpoint(entity *intel.Entity) (endpoints.EPResult, endpoints.Reason)

MatchEndpoint checks if the given endpoint matches an entry in any of the profiles.

func (*LayeredProfile) MatchFilterLists added in v0.4.0

func (lp *LayeredProfile) MatchFilterLists(entity *intel.Entity) (endpoints.EPResult, endpoints.Reason)

MatchFilterLists matches the entity against the set of filter lists.

func (*LayeredProfile) MatchServiceEndpoint added in v0.4.0

func (lp *LayeredProfile) MatchServiceEndpoint(entity *intel.Entity) (endpoints.EPResult, endpoints.Reason)

MatchServiceEndpoint checks if the given endpoint of an inbound connection matches an entry in any of the profiles.

func (*LayeredProfile) RevisionCnt added in v0.4.4

func (lp *LayeredProfile) RevisionCnt() (revisionCounter uint64)

RevisionCnt returns the current profile revision counter.

func (*LayeredProfile) SecurityLevel added in v0.4.0

func (lp *LayeredProfile) SecurityLevel() uint8

SecurityLevel returns the highest security level of all layered profiles.

func (*LayeredProfile) Update added in v0.4.0

func (lp *LayeredProfile) Update() (revisionCounter uint64)

Update checks for updated profiles and replaces any outdated profiles.

type Profile

type Profile struct {
	record.Base
	sync.Mutex

	// Identity
	ID     string
	Source string

	// App Information
	Name        string
	Description string
	Homepage    string
	// Icon is a path to the icon and is either prefixed "f:" for filepath, "d:" for a database path or "e:" for the encoded data.
	Icon string

	// References - local profiles only
	// LinkedPath is a filesystem path to the executable this profile was created for.
	LinkedPath string
	// LinkedProfiles is a list of other profiles
	LinkedProfiles []string

	// Configuration
	// The mininum security level to apply to connections made with this profile
	SecurityLevel uint8
	Config        map[string]interface{}

	// When this Profile was approximately last used.
	// For performance reasons not every single usage is saved.
	ApproxLastUsed int64
	Created        int64
	// contains filtered or unexported fields
}

Profile is used to predefine a security profile for applications.

func EnsureProfile

func EnsureProfile(r record.Record) (*Profile, error)

EnsureProfile ensures that the given record is a *Profile, and returns it.

func FindOrCreateLocalProfileByPath added in v0.4.0

func FindOrCreateLocalProfileByPath(fullPath string) (profile *Profile, new bool, err error)

FindOrCreateLocalProfileByPath returns an existing or new profile for the given application path.

func GetProfile added in v0.4.0

func GetProfile(source, id string) (*Profile, error)

GetProfile loads a profile from the database.

func GetProfileByScopedID added in v0.4.0

func GetProfileByScopedID(scopedID string) (*Profile, error)

GetProfileByScopedID loads a profile from the database using a scoped ID like "local/id" or "community/id".

func GetSystemProfile added in v0.4.1

func GetSystemProfile() *Profile

GetSystemProfile returns the special profile used for the Kernel.

func GetUnidentifiedProfile added in v0.4.1

func GetUnidentifiedProfile() *Profile

GetUnidentifiedProfile returns the special profile assigned to unidentified processes.

func New

func New() *Profile

New returns a new Profile.

func (*Profile) AddEndpoint added in v0.4.0

func (profile *Profile) AddEndpoint(newEntry string)

AddEndpoint adds an endpoint to the endpoint list, saves the profile and reloads the configuration.

func (*Profile) AddServiceEndpoint added in v0.4.0

func (profile *Profile) AddServiceEndpoint(newEntry string)

AddServiceEndpoint adds a service endpoint to the endpoint list, saves the profile and reloads the configuration.

func (*Profile) MarkUsed

func (profile *Profile) MarkUsed()

MarkUsed marks the profile as used and saves it when it has changed.

func (*Profile) Save

func (profile *Profile) Save() error

Save saves the profile to the database

func (*Profile) ScopedID added in v0.4.0

func (profile *Profile) ScopedID() string

ScopedID returns the scoped ID (Source + ID) of the profile.

func (*Profile) String

func (profile *Profile) String() string

String returns a string representation of the Profile.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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