Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

es-index-export.py does not handle missing fields in DN #1

Open
wbnod opened this issue Oct 27, 2021 · 0 comments
Open

es-index-export.py does not handle missing fields in DN #1

wbnod opened this issue Oct 27, 2021 · 0 comments

Comments

@wbnod
Copy link
Owner

wbnod commented Oct 27, 2021

Script for exporting Elastic index, atomic-threat-coverage/scripts/es-index-export.py breaks when executing Makefile because some data/atc/data_needed/DN_### files are missing required keys, e.g. 'provider:'.

error line 258 in __init__:
if dn['provider'] not in dn_providers:
KeyError: 'provider'

Best case solution is if upstream DN_files are correctly formed with all needed keys present. Since we cannot guarantee that, es-export-index.py needs to provide some level of resilience rather than failing altogether.

Workaround is to wrap block in try/except for error handling:

try:
    for dn in alert_dns:
        ...
except:
    pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant