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

Collector supports case insensitive configuration but it is not properly handled across the codebase. #7002

Closed
rapphil opened this issue Jan 23, 2023 · 3 comments · Fixed by #7021
Labels
bug Something isn't working

Comments

@rapphil
Copy link
Contributor

rapphil commented Jan 23, 2023

Describe the bug
The collector supports case insensitive configuration, allowing typos in the configuration to change the behavior of the code. This can happen in the code because in several instances we are not relaying on the de-serialized datastructure, but checking the existing of keys in the code.

E.g.:

There was a fix for this issue but this was reverted.

Steps to reproduce

Create a configuration with a typo, replacing a lower case by an uppercase in the logging exporter loglevel -> logLevel.

What did you expect to see?
loglevel to be properly set or an error message that the configuration is invalid.

What did you see instead?
loglevel set incorrectly.

What version did you use?
v0.69.1

Environment
Centos 7

@rapphil rapphil added the bug Something isn't working label Jan 23, 2023
@rapphil rapphil changed the title Collector supports case insensitive configuration Collector supports case insensitive configuration but it is not properly handled across the codebase. Jan 23, 2023
@rapphil
Copy link
Contributor Author

rapphil commented Jan 23, 2023

Carbon receiver already got the fix for the typo https://github.com/open-telemetry/opentelemetry-collector-contrib/blame/main/receiver/carbonreceiver/protocol/regex_parser.go#L78 which means that collector-contrib v0.70 will have this fix. after this point it is safe to change the collector validation logic to be case sensitive.

@gbbr
Copy link
Member

gbbr commented Jan 25, 2023

Thanks. I'll create the pull request, for when we're ready. Hope that's ok.

@bogdandrutu
Copy link
Member

The issue is correct, but there is another bug that makes it correct.

If this comment is true https://github.com/open-telemetry/opentelemetry-collector/blob/main/confmap/confmap.go#L119 then this issue is not an issue, since the checks will be case-insensitive as well, but that comment is not true - Need a fix for this as well.

bogdandrutu pushed a commit that referenced this issue Jan 31, 2023
…ions (#6876)" (#6988)" (#7021)

* Revert "Revert "Fix: Force usage of case-sensitive keys in configurations (#6876)" (#6988)"

This reverts commit 80cabdd.

Closes #7002

* confmap: Remove case-insensitive statement in IsSet
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
3 participants