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

Bug: sigma collections errors are not merged #112

Closed
c-dvl opened this issue Apr 3, 2023 · 0 comments
Closed

Bug: sigma collections errors are not merged #112

c-dvl opened this issue Apr 3, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@c-dvl
Copy link

c-dvl commented Apr 3, 2023

Hi,

SigmaCollection.errors is always empty because errors are not merged in the merge function.

Fix:

def merge(cls, collections : Iterable["SigmaCollection"], collect_errors) -> "SigmaCollection":
        """Merge multiple SigmaCollection objects into one and return it."""
        if collect_errors:
            return cls([
                rule
                for collection in collections
                for rule in collection
            ], [
                error
                for collection in collections
                for error in collection.errors
            ] )
        else:
            return cls([
            rule
            for collection in collections
            for rule in collection
        ])

In load_ruleset() function return cls.merge(sigma_collections, collect_errors)

Regards,
Céline

@thomaspatzke thomaspatzke self-assigned this Apr 5, 2023
@thomaspatzke thomaspatzke added the bug Something isn't working label Apr 5, 2023
thomaspatzke added a commit that referenced this issue Apr 5, 2023
Fixes Bug: sigma collections errors are not merged #112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants