Documentation ¶
Index ¶
Constants ¶
const ( STR_REDACTED = "[redacted]" STR_UNKNOWN = "[uknown]" )
Static strings for various usage
Variables ¶
var FilterResultString = map[FilterResult]string{ FILTER_DENY: "DENY", FILTER_ALLOW: "ALLOW", FILTER_PROMPT: "PROMPT", }
FilterResultString converts a filter value ID to its string
var FilterResultValue = map[string]FilterResult{ FilterResultString[FILTER_DENY]: FILTER_DENY, FilterResultString[FILTER_ALLOW]: FILTER_ALLOW, FilterResultString[FILTER_PROMPT]: FILTER_PROMPT, }
FilterResultValue converts a filter value string to its ID
var FilterScopeString = map[FilterScope]string{ APPLY_ONCE: "ONCE", APPLY_SESSION: "SESSION", APPLY_FOREVER: "FOREVER", }
FilterScopeString converts a filter scope ID to its string
var FilterScopeValue = map[string]FilterScope{ FilterScopeString[APPLY_ONCE]: APPLY_ONCE, FilterScopeString[APPLY_SESSION]: APPLY_SESSION, FilterScopeString[APPLY_FOREVER]: APPLY_FOREVER, }
FilterScopeString converts a filter scope string to its ID
var IDToLevel = func() map[string]int32 { m := make(map[string]int32) for k, v := range LevelToID { m[v] = k } return m }()
Log level string conversion
var LevelToID = map[int32]string{ int32(logging.ERROR): "error", int32(logging.WARNING): "warning", int32(logging.NOTICE): "notice", int32(logging.INFO): "info", int32(logging.DEBUG): "debug", }
Log level conversion map
var RuleActionString = map[RuleAction]string{ RULE_ACTION_DENY: "DENY", RULE_ACTION_ALLOW: "ALLOW", }
RuleActionString is used to get a string from an action id
var RuleActionValue = map[string]RuleAction{ RuleActionString[RULE_ACTION_DENY]: RULE_ACTION_DENY, RuleActionString[RULE_ACTION_ALLOW]: RULE_ACTION_ALLOW, }
RuleActionValue is used to get an action id using the action string
var RuleModeString = map[RuleMode]string{ RULE_MODE_SESSION: "SESSION", RULE_MODE_PERMANENT: "PERMANENT", RULE_MODE_SYSTEM: "SYSTEM", }
RuleModeString is used to get a rule mode string from its id
var RuleModeValue = map[string]RuleMode{ RuleModeString[RULE_MODE_SESSION]: RULE_MODE_SESSION, RuleModeString[RULE_MODE_PERMANENT]: RULE_MODE_PERMANENT, RuleModeString[RULE_MODE_SYSTEM]: RULE_MODE_SYSTEM, }
RuleModeValue converts a mode string to its id
Functions ¶
func GetFilterScopeString ¶
func GetFilterScopeString(scope FilterScope) string
GetFilterScopeString is used to safely return a filter scope string
Types ¶
type DesktopEntry ¶
type DesktopEntry struct {
// contains filtered or unexported fields
}
type FilterResult ¶
type FilterResult uint16
FilterResult contains the filtering resulting action
const ( FILTER_DENY FilterResult = iota FILTER_ALLOW FILTER_PROMPT )
type FilterScope ¶
type FilterScope uint16
FilterScope contains a filter's time scope
const ( APPLY_ONCE FilterScope = iota APPLY_SESSION APPLY_FOREVER )
func GetFilterScopeValue ¶
func GetFilterScopeValue(scope string) FilterScope
GetFilterScopeValue is used to safely return a filter scope ID
type Firewall ¶
type Firewall struct {
// contains filtered or unexported fields
}
func (*Firewall) PolicyForPath ¶
type FirewallConfigs ¶
type FirewallConfigs struct { LogLevel string LoggingLevel logging.Level `toml:"-"` LogRedact bool PromptExpanded bool PromptExpert bool DefaultAction string DefaultActionID FilterScope `toml:"-"` }
var FirewallConfig FirewallConfigs
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
func (*Rule) AddrString ¶
type RuleAction ¶
type RuleAction uint16
RuleAction is the action to apply to a rule
const ( RULE_ACTION_DENY RuleAction = iota RULE_ACTION_ALLOW )