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

[PARSERS] Escalate an error if two parsers have same name #3092

Open
LaurenceJJones opened this issue Jun 20, 2024 · 5 comments
Open

[PARSERS] Escalate an error if two parsers have same name #3092

LaurenceJJones opened this issue Jun 20, 2024 · 5 comments
Assignees
Milestone

Comments

@LaurenceJJones
Copy link
Contributor

This will be aimed for 2.0 roadmap, make it an error if the user has two parser with the same name key. This will cause side effects as pointed out by #3090 and countless examples.

We should throw an error if two parsers have the same name key as the in map memory will take the latter as the final value.

@LaurenceJJones LaurenceJJones added this to the 2.0.0 milestone Jun 20, 2024
Copy link

@LaurenceJJones: Thanks for opening an issue, it is currently awaiting triage.

In the meantime, you can:

  1. Check Crowdsec Documentation to see if your issue can be self resolved.
  2. You can also join our Discord.
  3. Check Releases to make sure your agent is on the latest version.
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

@LaurenceJJones: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind bug
  • /kind packaging
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@mmetc mmetc self-assigned this Jun 20, 2024
@mmetc
Copy link
Contributor

mmetc commented Dec 23, 2024

What do you mean exactly "two parsers have the same name"?

Installing a local parser to satisfy a collection dependency and override the official parser is a legit and tested use case (at least in branch hubops).

What if we return an error when attempting to install an item, if there is another already installed with same name and different path?

@LaurenceJJones
Copy link
Contributor Author

LaurenceJJones commented Dec 23, 2024

What do you mean exactly "two parsers have the same name"?

Some users might have the following:

/etc/crowdsec/parsers/s02-enrich/01whitelist.yaml
/etc/crowdsec/parsers/s02-enrich/whitelists.yaml -> /etc/crowdsec/hub/....

both have the same name EG: crowdsecurity/whitelists within the yaml, when crowdsec loads these files it loads them alphabetically meaning your local 01whitelist.yaml will be overidden in memory because it has the same name key as the official crowdsec whitelists.yaml.

We should throw this as a error because you shouldnt have two parser with the same name yaml key.

@mmetc
Copy link
Contributor

mmetc commented Jan 10, 2025

How about a warning? We can easily tweak the behavior. This issue was useful to simplify the code.

#3399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants