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

clarify the exact semantics of comments in the rules config #575

Open
calestyo opened this issue Dec 9, 2022 · 1 comment
Open

clarify the exact semantics of comments in the rules config #575

calestyo opened this issue Dec 9, 2022 · 1 comment

Comments

@calestyo
Copy link

calestyo commented Dec 9, 2022

Hey.

As per discussion in: #461 (comment) and especially because of the security sensitive nature of rules.conf, please clarify the exact semantics of comments in it.

I.e., is it just if there's only leading whitespace before the #?

Is generally everything after a # (and including that) ignored (i.e. "end of line comments"), and if so, what if the # appears in some value of a rule, e.g. a USB device name, or is there some kind of detection whether it's part of a value?

Thanks,
Chris.

@Cropi
Copy link
Member

Cropi commented Dec 12, 2022

Everything after the "#" symbol until the end of the line is treated as a comment if and only if the line starts with that particular symbol or has at least one leading whitespace character before the "#". The only exception is when it's part of the rule between quotation marks, e.g. part of the device name. However, not all fields of a rule can contain a "#" symbol, e.g. the device ID must have a format of XXXX:YYYY. I think there is nothing wrong with that.

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

2 participants