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

Option 'secret' overwrites client's configuration (hp-dio)

parent 27f13194
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,9 @@ D. Configuration ...@@ -39,6 +39,9 @@ D. Configuration
warden_client-dio.cfg warden_client-dio.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.dionaea' name - sensor's source id used as a source of events, e.g. 'cz.cesnet.server.dionaea'
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)
......
...@@ -31,6 +31,7 @@ DEFAULT_CONTENT_TYPE = 'application/octet-stream' ...@@ -31,6 +31,7 @@ DEFAULT_CONTENT_TYPE = 'application/octet-stream'
DEFAULT_CONTENT_ENCODING = 'base64' DEFAULT_CONTENT_ENCODING = 'base64'
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_attach_idea(logger, report_binaries, binaries_path, filename, hashtype, hashdigest, vtpermalink, avref): def gen_attach_idea(logger, report_binaries, binaries_path, filename, hashtype, hashdigest, vtpermalink, avref):
...@@ -143,9 +144,13 @@ def main(): ...@@ -143,9 +144,13 @@ def main():
wconfig = read_cfg(aconfig.get('warden', DEFAULT_WCONFIG)) wconfig = read_cfg(aconfig.get('warden', DEFAULT_WCONFIG))
aname = aconfig.get('name', DEFAULT_NAME) aname = aconfig.get('name', DEFAULT_NAME)
wconfig['name'] = aname
asecret = aconfig.get('secret', DEFAULT_SECRET)
if asecret:
wconfig['secret'] = asecret
wclient = Client(**wconfig) wclient = Client(**wconfig)
wconfig['name'] = aname
awin = aconfig.get('awin', DEFAULT_AWIN) * 60 awin = aconfig.get('awin', DEFAULT_AWIN) * 60
abinpath = aconfig.get('binaries_path', DEFAULT_BINPATH) abinpath = aconfig.get('binaries_path', DEFAULT_BINPATH)
......
{ {
"warden": "warden_client.cfg", "warden": "warden_client.cfg",
"name": "cz.cesnet.server.dionaea", "name": "cz.cesnet.server.dionaea",
"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.
Finish editing this message first!
Please register or to comment