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

ShadowServer parser attempts to download schema even if not configured #2530

Closed
kamil-certat opened this issue Oct 7, 2024 · 5 comments · Fixed by #2531
Closed

ShadowServer parser attempts to download schema even if not configured #2530

kamil-certat opened this issue Oct 7, 2024 · 5 comments · Fixed by #2531
Labels
bug Indicates an unexpected problem or unintended behavior component: bots

Comments

@kamil-certat
Copy link
Contributor

The schema update call is included in the standard IntelMQ's crontab file in deb distribution. However, the parser does not check if there is any ShadowServer bot configured in the runtime. In a controlled environment it causes unnecessary alerts/errors.

The parser should follow the behaviour of other bots and check if there is any configured parser before attempting to download new schema.

@kamil-certat kamil-certat added bug Indicates an unexpected problem or unintended behavior component: bots labels Oct 7, 2024
@sebix
Copy link
Member

sebix commented Oct 12, 2024

@elsif2

@elsif2
Copy link
Collaborator

elsif2 commented Oct 13, 2024

Proposed fix for parser.py:

Before:

            if config.update_schema():
                runtime_conf = utils.get_bots_settings()
                try:
                    ctl = IntelMQController()
                    for bot in runtime_conf:
                        if runtime_conf[bot]["module"] == __name__:
                            ctl.bot_reload(bot)

After:

            runtime_conf = utils.get_bots_settings()
            try:
                ctl = IntelMQController()
                for bot in runtime_conf:
                    if runtime_conf[bot]["module"] == __name__:
                        if config.update_schema():                            
                            ctl.bot_reload(bot)

@kamil-certat
Copy link
Contributor Author

@elsif2 How would it work if there were multiple parser bots? If it doesn't download schema for every bot separately, then I think it looks great :)

@elsif2
Copy link
Collaborator

elsif2 commented Oct 15, 2024

I believe each instance would have the same VAR_STATE_PATH location, so there would only be one copy.

@sebix
Copy link
Member

sebix commented Oct 15, 2024

I believe each instance would have the same VAR_STATE_PATH location, so there would only be one copy.

Spoiler: There's at least one large IntelMQ user which prefers to use a different path for the schema (VAR_STATE_PATH/shadowserver) to keep /var/lib/intelmq/bots organized, which I fully understand. So there might come a feature request to optionally use different schema path or change the default schema path soon.

@elsif2 elsif2 linked a pull request Oct 15, 2024 that will close this issue
sebix added a commit that referenced this issue Nov 4, 2024
…mpts-to-download-schema-even-if-not-configured

Fix to avoid schema download if not configured #2530.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: bots
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants