FeeiCN / GSIL

GitHub Sensitive Information Leakage(GitHub敏感信息泄露监控)
https://feei.cn/gsil/
GNU General Public License v3.0
2.13k stars 486 forks source link

NameError: name 'rules_dict' is not defined麻烦能给看看这是怎么回事吗? #55

Closed buddyho closed 5 years ago

buddyho commented 5 years ago

/usr/work/tool/app/GSIL/gsil.py zrb Traceback (most recent call last): File "/usr/work/tool/app/GSIL/gsil.py", line 28, in sys.exit(gsil()) File "/home/work/tool/app/GSIL/gsil/init.py", line 105, in gsil start(sys.argv[1]) File "/home/work/tool/app/GSIL/gsil/init.py", line 65, in start rules = get_rules(rule_types) File "/home/work/tool/app/GSIL/gsil/config.py", line 166, in get_rules for types, rule_list in rules_dict.items(): NameError: name 'rules_dict' is not defined

buddyho commented 5 years ago

貌似是不支持多个关键字,一个关键字的情况下无问题,配置两个及以上即在邮件中报该错误。 运行报错如下: 2019-06-20 16:47:20,377 [GSIL] [CRITICAL] please config GSIL/rules.gsil! 2019-06-20 16:47:20,378 [GSIL] [CRITICAL] Traceback (most recent call last): File "/home/work/tool/app/GSIL/gsil/config.py", line 145, in rules_dict = json.load(f) File "/opt/anaconda3/lib/python3.7/json/init.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/opt/anaconda3/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/opt/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/opt/anaconda3/lib/python3.7/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 8 column 13 (char 202)

2019-06-20 16:47:20,423 [GSIL] [INFO] start monitor github information leakage: zrb

FeeiCN commented 5 years ago

rules.gsil配置错误,可以贴上来看看

buddyho commented 5 years ago

{ "zrb": { "kejidai": { "kejidai": { "mode": "normal-match", "ext": "php,java,python,node.js,properties" } } "zhijiandai"{ "zhijiandai":{ "mode": "normal-match", "ext": "php,java,python,node.js,properties" } } "caixiaoxian"{ "caixiaoxian":{ "mode": "normal-match", "ext": "php,java,python,node.js,properties" } }

}

}

FeeiCN commented 5 years ago

image

JSON格式有问题,少了逗号和冒号,可以使用https://jsonformatter.curiousconcept.com/ 验证下。

buddyho commented 5 years ago

问题解决,非常感谢。