|
|
@ -6,7 +6,7 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
const (
|
|
|
|
STR_REDACTED = "[redacted]"
|
|
|
|
STR_REDACTED = "[redacted]"
|
|
|
|
STR_UNKNOWN = "[uknown]"
|
|
|
|
STR_UNKNOWN = "[uknown]"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type RuleAction uint16
|
|
|
|
type RuleAction uint16
|
|
|
@ -16,13 +16,13 @@ const (
|
|
|
|
RULE_ACTION_ALLOW
|
|
|
|
RULE_ACTION_ALLOW
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var RuleActionString = map[RuleAction]string {
|
|
|
|
var RuleActionString = map[RuleAction]string{
|
|
|
|
RULE_ACTION_DENY: "DENY",
|
|
|
|
RULE_ACTION_DENY: "DENY",
|
|
|
|
RULE_ACTION_ALLOW: "ALLOW",
|
|
|
|
RULE_ACTION_ALLOW: "ALLOW",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var RuleActionValue = map[string]RuleAction {
|
|
|
|
var RuleActionValue = map[string]RuleAction{
|
|
|
|
"DENY": RULE_ACTION_DENY,
|
|
|
|
"DENY": RULE_ACTION_DENY,
|
|
|
|
"ALLOW": RULE_ACTION_ALLOW,
|
|
|
|
"ALLOW": RULE_ACTION_ALLOW,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -34,39 +34,38 @@ const (
|
|
|
|
RULE_MODE_SYSTEM
|
|
|
|
RULE_MODE_SYSTEM
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var RuleModeString = map[RuleMode]string {
|
|
|
|
var RuleModeString = map[RuleMode]string{
|
|
|
|
RULE_MODE_SESSION: "SESSION",
|
|
|
|
RULE_MODE_SESSION: "SESSION",
|
|
|
|
RULE_MODE_PERMANENT: "PERMANENT",
|
|
|
|
RULE_MODE_PERMANENT: "PERMANENT",
|
|
|
|
RULE_MODE_SYSTEM: "SYSTEM",
|
|
|
|
RULE_MODE_SYSTEM: "SYSTEM",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var RuleModeValue = map[string]RuleMode {
|
|
|
|
var RuleModeValue = map[string]RuleMode{
|
|
|
|
"SESSION": RULE_MODE_SESSION,
|
|
|
|
"SESSION": RULE_MODE_SESSION,
|
|
|
|
"PERMANENT": RULE_MODE_PERMANENT,
|
|
|
|
"PERMANENT": RULE_MODE_PERMANENT,
|
|
|
|
"SYSTEM": RULE_MODE_SYSTEM,
|
|
|
|
"SYSTEM": RULE_MODE_SYSTEM,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type FilterScope uint16
|
|
|
|
type FilterScope uint16
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
const (
|
|
|
|
APPLY_ONCE FilterScope = iota
|
|
|
|
APPLY_ONCE FilterScope = iota
|
|
|
|
APPLY_SESSION
|
|
|
|
APPLY_SESSION
|
|
|
|
APPLY_FOREVER
|
|
|
|
APPLY_FOREVER
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var FilterScopeString = map[FilterScope]string {
|
|
|
|
var FilterScopeString = map[FilterScope]string{
|
|
|
|
APPLY_ONCE: "ONCE",
|
|
|
|
APPLY_ONCE: "ONCE",
|
|
|
|
APPLY_SESSION: "SESSION",
|
|
|
|
APPLY_SESSION: "SESSION",
|
|
|
|
APPLY_FOREVER: "FOREVER",
|
|
|
|
APPLY_FOREVER: "FOREVER",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var FilterScopeValue = map[string]FilterScope {
|
|
|
|
var FilterScopeValue = map[string]FilterScope{
|
|
|
|
"ONCE": APPLY_ONCE,
|
|
|
|
"ONCE": APPLY_ONCE,
|
|
|
|
"SESSION": APPLY_SESSION,
|
|
|
|
"SESSION": APPLY_SESSION,
|
|
|
|
"FOREVER": APPLY_FOREVER,
|
|
|
|
"FOREVER": APPLY_FOREVER,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GetFilterScopeString(scope FilterScope) string {
|
|
|
|
func GetFilterScopeString(scope FilterScope) string {
|
|
|
|
if val, ok := FilterScopeString[scope]; ok {
|
|
|
|
if val, ok := FilterScopeString[scope]; ok {
|
|
|
|
return val
|
|
|
|
return val
|
|
|
@ -91,14 +90,14 @@ const (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var FilterResultString = map[FilterResult]string{
|
|
|
|
var FilterResultString = map[FilterResult]string{
|
|
|
|
FILTER_DENY: "DENY",
|
|
|
|
FILTER_DENY: "DENY",
|
|
|
|
FILTER_ALLOW: "ALLOW",
|
|
|
|
FILTER_ALLOW: "ALLOW",
|
|
|
|
FILTER_PROMPT: "PROMPT",
|
|
|
|
FILTER_PROMPT: "PROMPT",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var FilterResultValue = map[string]FilterResult {
|
|
|
|
var FilterResultValue = map[string]FilterResult{
|
|
|
|
"DENY": FILTER_DENY,
|
|
|
|
"DENY": FILTER_DENY,
|
|
|
|
"ALLOW": FILTER_ALLOW,
|
|
|
|
"ALLOW": FILTER_ALLOW,
|
|
|
|
"PROMPT": FILTER_PROMPT,
|
|
|
|
"PROMPT": FILTER_PROMPT,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|