Documentation
¶
Overview ¶
Package conf provides configuration handler for dlp
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DlpConf ¶
type DlpConf struct { Global struct { Date string `yaml:"Date"` ApiVersion string `yaml:"ApiVersion"` Mode string `yaml:"Mode"` AllowRPC bool `yaml:"AllowRPC"` EnableRules []int32 `yaml:"EnableRules,flow"` DisableRules []int32 `yaml:"DisableRules,flow"` MaxLogInput int32 `yaml:"MaxLogInput"` MaxRegexRuleID int32 `yaml:"MaxRegexRuleID"` } `yaml:"Global"` MaskRules []MaskRuleItem `yaml:"MaskRules"` Rules []RuleItem `yaml:"Rules"` }
func NewDlpConf ¶
NewDlpConf creates DlpConf object by conf content string
func NewDlpConfByPath ¶
NewDlpConfByPath creates DlpConf object by confPath
type MaskRuleItem ¶
type MaskRuleItem struct { RuleName string `yaml:"RuleName"` MaskType string `yaml:"MaskType"` // one of [CHAR, TAG, REPLACE, EMPTY, ALGO ] Value string `yaml:"Value"` Offset int32 `yaml:"Offset"` Padding int32 `yaml:"Padding"` Length int32 `yaml:"Length"` Reverse bool `yaml:"Reverse"` IgnoreCharSet string `yaml:"IgnoreCharSet"` IgnoreKind []string `yaml:"IgnoreKind"` // one of [NUMERIC, ALPHA_UPPER_CASE, ALPHA_LOWER_CASE, WHITESPACE, PUNCTUATION] }
type RuleItem ¶
type RuleItem struct { RuleID int32 `yaml:"RuleID"` InfoType string `yaml:"InfoType"` Description string `yaml:"Description"` EnName string `yaml:"EnName"` CnName string `yaml:"CnName"` Level string `yaml:"Level"` // L1 (least Sensitive) ~ L4 (Most Sensitive) // (KReg || KDict) && (VReg || VDict) Detect struct { KReg []string `yaml:"KReg"` // Regex List for Key KDict []string `yaml:"KDict,flow"` // Dict for Key VReg []string `yaml:"VReg"` // Regex List for Value VDict []string `yaml:"VDict,flow"` // Dict for Value KRelation string `yaml:"KRelation"` // Relation for Key VRelation string `yaml:"VRelation"` // Relation for Value KAndVRelation string `yaml:"KAndVRelation"` // Relation for Key And Value } `yaml:"Detect"` // result which is hit by blacklist will not returned to caller Filter struct { // BReg || BDict BReg []string `yaml:"BReg"` // Regex List for BlackList BDict []string `yaml:"BDict,flow"` // Dict for BlackList BAlgo []string `yaml:"BAlgo"` // Algorithm List for BlackList, one of [ MASKED ] } `yaml:"Filter"` // result need pass verify process before retured to caller Verify struct { // CReg || CDict CReg []string `yaml:"CReg"` // Regex List for Context Verification CDict []string `yaml:"CDict,flow"` // Dict for Context Verification VAlgo []string `yaml:"VAlgo"` // Algorithm List for Verification, one of [ IDVerif , CardVefif ] } `yaml:"Verify"` Mask string `yaml:"Mask"` // MaskRuleItem.RuleName for Mask ExtInfo map[string]string `yaml:"ExtInfo"` }
Click to show internal directories.
Click to hide internal directories.