Skip to content
Snippets Groups Projects
Commit 27f13194 authored by Michal Kostěnec's avatar Michal Kostěnec Committed by root
Browse files

Option 'secret' overwrites client's configuration

parent bfe140ac
Branches
Tags
No related merge requests found
...@@ -39,6 +39,9 @@ D. Configuration ...@@ -39,6 +39,9 @@ D. Configuration
warden_client-kippo.cfg warden_client-kippo.cfg
warden - path to warden-client config, e.g. 'warden/warden_client.cfg' warden - path to warden-client config, e.g. 'warden/warden_client.cfg'
name - sensor's source id used as a source of events, e.g. 'cz.cesnet.server.kippo' name - sensor's source id used as a source of events, e.g. 'cz.cesnet.server.kippo'
secret - secret to authenticate client
- if 'secret' is non empty, is used instead of value in client's configuration
- useful while using more sensors with single client's configuration
anonymised - no | yes | omit anonymised - no | yes | omit
- no (default value) - no (default value)
......
...@@ -22,6 +22,7 @@ DEFAULT_NAME = 'org.example.warden.test' ...@@ -22,6 +22,7 @@ DEFAULT_NAME = 'org.example.warden.test'
DEFAULT_AWIN = 5 DEFAULT_AWIN = 5
DEFAULT_ANONYMISED = 'no' DEFAULT_ANONYMISED = 'no'
DEFAULT_TARGET_NET = '0.0.0.0/0' DEFAULT_TARGET_NET = '0.0.0.0/0'
DEFAULT_SECRET = ''
def gen_event_idea(client_name, detect_time, win_start_time, win_end_time, conn_count, src_ip, dst_ip, aggr_win, anonymised, target_net): def gen_event_idea(client_name, detect_time, win_start_time, win_end_time, conn_count, src_ip, dst_ip, aggr_win, anonymised, target_net):
...@@ -72,6 +73,10 @@ def main(): ...@@ -72,6 +73,10 @@ def main():
awin = aconfig.get('awin', DEFAULT_AWIN) * 60 awin = aconfig.get('awin', DEFAULT_AWIN) * 60
wconfig['name'] = aname wconfig['name'] = aname
asecret = aconfig.get('secret', DEFAULT_SECRET)
if asecret:
wconfig['secret'] = asecret
wclient = Client(**wconfig) wclient = Client(**wconfig)
aanonymised = aconfig.get('anonymised', DEFAULT_ANONYMISED) aanonymised = aconfig.get('anonymised', DEFAULT_ANONYMISED)
......
{ {
"warden": "warden_client.cfg", "warden": "warden_client.cfg",
"name": "cz.cesnet.server.kippo", "name": "cz.cesnet.server.kippo",
"secret": "",
"anonymised": "no", "anonymised": "no",
"target_net": "195.113.0.0/16", "target_net": "195.113.0.0/16",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment