diff options
| author | EnderByEndera <[email protected]> | 2021-01-04 14:38:25 +0800 |
|---|---|---|
| committer | EnderByEndera <[email protected]> | 2021-01-04 14:38:25 +0800 |
| commit | 8bdad142ee15e746c47de6819265d8b2fcb6644a (patch) | |
| tree | 613c00acf33ca33dc59589fa0e78badd24b0daa7 | |
| parent | 1de0d07766adac2cd0b12f68287672ec157911fb (diff) | |
revised the comments
| -rw-r--r-- | rules/ruletypes.go | 4 | ||||
| -rw-r--r-- | static/rules/commrules.json | 2 | ||||
| -rw-r--r-- | static/rules/pathrules.json | 2 | ||||
| -rw-r--r-- | static/rules/rules.json | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/rules/ruletypes.go b/rules/ruletypes.go index e57da98..bdefecc 100644 --- a/rules/ruletypes.go +++ b/rules/ruletypes.go @@ -1,7 +1,7 @@ /* * @Author: EnderByEndera * @Date: 2020-12-08 10:59:19 - * @LastEditTime: 2020-12-31 14:11:38 + * @LastEditTime: 2021-01-04 11:21:49 * @LastEditors: Please set LastEditors * @Description: Unmarshal and marshal various types of settings and rules * @FilePath: /commdetection/rules/ruletypes.go @@ -75,7 +75,7 @@ func EvaluatePathRule(cs CommScore) CommScore { for range spaths { ratio += <-out } - // when raitio is larger than threshold 0.1 + // when ratio is larger than threshold 0.1 if ratio > 0.1 { // execute evaluation formula cs.Score *= 1.0 - ratio*(1.0-spath.Coefficient) diff --git a/static/rules/commrules.json b/static/rules/commrules.json index 519cba1..959b475 100644 --- a/static/rules/commrules.json +++ b/static/rules/commrules.json @@ -1 +1 @@ -[{"command":"wget","coefficient":0.8},{"command":"apt","coefficient":1}]
\ No newline at end of file +[{"command":"sudo","coefficient":0.1},{"command":"wget","coefficient":0.8},{"command":"apt","coefficient":0.2}]
\ No newline at end of file diff --git a/static/rules/pathrules.json b/static/rules/pathrules.json index ca1c2c3..4f8c9f0 100644 --- a/static/rules/pathrules.json +++ b/static/rules/pathrules.json @@ -1 +1 @@ -[{"Path":"/root","Coefficient":0.7}]
\ No newline at end of file +[{"Path":"/root/go/src/commdetection","Coefficient":0.5}]
\ No newline at end of file diff --git a/static/rules/rules.json b/static/rules/rules.json index 3a3c234..3339112 100644 --- a/static/rules/rules.json +++ b/static/rules/rules.json @@ -1 +1 @@ -[{"name":"RuleA","rulefunc":"EvaluateCommandRule"}]
\ No newline at end of file +[{"name":"pathrule","rulefunc":"EvaluatePathRule"}]
\ No newline at end of file |
