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

Loggen: command line parameters for proxy protocol header #3462

Merged
merged 2 commits into from Oct 28, 2020

Conversation

norberttak
Copy link
Contributor

This PR adds three new command-line option to the loggen to allow the users to define the
source IP, destination IP, and port parameters used in the proxy protocol header.

move proxy protocol header generator from socket plugin to
the log line genrator function

Signed-off-by: Norbert Takacs <norbert.takacs@oneidentity.com>
@kira-syslogng
Copy link
Contributor

Build SUCCESS

@szemere szemere self-requested a review October 22, 2020 12:36
@alltilla
Copy link
Collaborator

Thanks for the PR!

What was the reason behind moving the proxy header generation from socket_plugin.c to loggen.c? Was it to make it work with ssl?
If so, than I think we should use generate_proxy_header() in ssl_plugin.c instead. I think it is not an accident that we have generate_proxy_header() in loggen_helpers.c, so any plugin can use it.

@norberttak
Copy link
Contributor Author

Thanks @alltilla for your review comment. Proxy protocol is no more than (from loggen point of view) generate a simple text message at the beginning of the connection. To generate the log lines (or read from a file) we already have a separated part which is the generate_message() function used by every plugin.
Neither socket nor SSL plugin needs to know about proxy protocol. This is a higher-level function.

In the original form of the code if somebody call the SSL plugin with the proxied option, it will silently ignore the option which is not a good solution. To put the same code to all plugin is also not what I really want to do.

@alltilla
Copy link
Collaborator

I see.

Just thinking out loud:
We might have plugins which does not support proxy protocol (*cough* ALTP). With the common solution they will be able to produce proxy protocol messages, which we cannot handle in syslog-ng. But after all, it might not be a problem, maybe we will have that implemented in syslog-ng some time.

Thanks for the explanation, I am convinced. :)

tests/loggen/loggen.c Outdated Show resolved Hide resolved
Signed-off-by: Norbert Takacs <norbert.takacs@oneidentity.com>
@kira-syslogng
Copy link
Contributor

Build SUCCESS

@Kokan Kokan merged commit 9e20e53 into syslog-ng:master Oct 28, 2020
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

Successfully merging this pull request may close these issues.

None yet

4 participants