Skip to content

Commit

Permalink
some configure files
Browse files Browse the repository at this point in the history
  • Loading branch information
潘博文 committed Jul 30, 2019
1 parent 6b58970 commit d091e8c
Show file tree
Hide file tree
Showing 3 changed files with 759 additions and 4 deletions.
6 changes: 6 additions & 0 deletions conf/example.conf
@@ -0,0 +1,6 @@
es_host=http://localhost:9200
winlogbeat_index=winlogbeat-*
neo4j_host=bolt://localhost:7687
neo4j_user=neo4j
neo4j_pwd=
attck_yaml=misc/attck.yaml
28 changes: 24 additions & 4 deletions core/rule.py
Expand Up @@ -53,7 +53,12 @@ def match_process_behavior(behavior, ruleset):
if 'file' in cond.keys():
bresult.append(match_entity(behavior.file, cond['file']))

if op_or(bresult):
is_matched = False
if 'op' in cond.keys() and cond['op'] == 'and':
is_matched = op_and(bresult)
else:
is_matched = op_or(bresult)
if is_matched:
return True
return False

Expand All @@ -69,7 +74,12 @@ def match_network_behavior(behavior, ruleset):
if 'file' in cond.keys():
bresult.append(match_entity(behavior.file, cond['file']))

if op_or(bresult):
is_matched = False
if 'op' in cond.keys() and cond['op'] == 'and':
is_matched = op_and(bresult)
else:
is_matched = op_or(bresult)
if is_matched:
return True
return False

Expand All @@ -83,7 +93,12 @@ def match_file_behavior(behavior, ruleset):
if 'file' in cond.keys():
bresult.append(match_entity(behavior.file, cond['file']))

if op_or(bresult):
is_matched = False
if 'op' in cond.keys() and cond['op'] == 'and':
is_matched = op_and(bresult)
else:
is_matched = op_or(bresult)
if is_matched:
return True
return False

Expand All @@ -100,7 +115,12 @@ def match_registry_behavior(behavior, ruleset):
if 'reg' in cond.keys():
bresult.append(match_entity(behavior.reg, cond['reg']))

if op_or(bresult):
is_matched = False
if 'op' in cond.keys() and cond['op'] == 'and':
is_matched = op_and(bresult)
else:
is_matched = op_or(bresult)
if is_matched:
return True
return False

Expand Down

0 comments on commit d091e8c

Please sign in to comment.