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

tls: add version-specific cipher suite options #3907

Merged
merged 9 commits into from Feb 28, 2022

Conversation

MrAnno
Copy link
Collaborator

@MrAnno MrAnno commented Feb 9, 2022

OpenSSL/libcurl use a separate method for setting TLS 1.3 ciphers to be backward
compatible with older versions/configurations.

This PR adds version-specific cipher-suite() options, for example:

cipher-suite(tls12-and-older("list:of:ciphers"), tls13("list:of:ciphers"))

tls12-and-older() can be used for specifying ciphers for TLS v1.2-and-older,
tls13() can be used to specify TLS v1.3 ciphers.

Note:
For backward compatibility cipher-suite("list:of:ciphers") restricts only the TLSv1.2-and-older cipher suite.

Fixes #3906

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@MrAnno MrAnno added this to the syslog-ng-3.36 milestone Feb 9, 2022
@kira-syslogng
Copy link
Contributor

Build SUCCESS

@MrAnno
Copy link
Collaborator Author

MrAnno commented Feb 9, 2022

Should we allow cipher-suite("list:of:old:ciphers", tls13("list:of:new:ciphers")) too (mixing the compat method with the new)?

@bazsi
Copy link
Collaborator

bazsi commented Feb 10, 2022 via email

@MrAnno
Copy link
Collaborator Author

MrAnno commented Feb 10, 2022

jit.si meeting results:

We decided to use longer but accurate names, for example:
tls12-and-older() and tls13()

If our assumption is correct, OpenSSL will not add a third separated method for new TLS versions, so in case of a theoretical TLS 1.4 or 2.0 version, we could just add an alias for tls13(): tls13-and-newer. If we turn out to be wrong, we can still add new versioned options.

@MrAnno
Copy link
Collaborator Author

MrAnno commented Feb 12, 2022

Done.

@bazsi Could you review this, please?

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@MrAnno
Copy link
Collaborator Author

MrAnno commented Feb 12, 2022

@kira-syslogng do stresstest

@kira-syslogng
Copy link
Contributor

Kira-stress-test: Build SUCCESS

news/feature-3907.md Outdated Show resolved Hide resolved
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
This will be used to report unsupported TLS options/methods, such as
setting TLS 1.3 ciphers.

Signed-off-by: László Várady <laszlo.varady@protonmail.com>
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
…_once

msg_warning_once() can be used to warn the user about a matter only once,
but multiple keylog-file() options can be specified within a single config.

Signed-off-by: László Várady <laszlo.varady@protonmail.com>
TLS <=1.2 and 1.3 ciphers should be set separately:
https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_ciphersuites.html

Signed-off-by: László Várady <laszlo.varady@protonmail.com>
OpenSSL uses a separate method for setting TLS 1.3 ciphers to be backward
compatible with older versions/configurations.

This commits adds version-specific cipher-suite() options, for example:
> cipher-suite(tls12-and-older("list:of:ciphers"), tls13("list:of:ciphers"))

tls12-and-older() can be used for specifying ciphers for TLS v1.2-and-older,
tls13() can be used to specify TLS v1.3 ciphers.

Note:
For backward compatibility cipher-suite("list:of:ciphers") restricts only
the TLSv1.2-and-older cipher suite.

Signed-off-by: László Várady <laszlo.varady@protonmail.com>
libcurl uses a separate method for setting TLS 1.3 ciphers to be backward
compatible with older versions/configurations.

This commits adds version-specific cipher-suite() options, for example:
> cipher-suite(tls12-and-older("list:of:ciphers"), tls13("list:of:ciphers"))

tls12-and-older() can be used for specifying ciphers for TLS v1.2-and-older,
tls13() can be used to specify TLS v1.3 ciphers.

Note:
For backward compatibility cipher-suite("list:of:ciphers") restricts only
the TLSv1.2-and-older cipher suite.

Signed-off-by: László Várady <laszlo.varady@protonmail.com>
This commits adds version-specific cipher-suite() options, for example:
> cipher-suite(tls12-and-older("list:of:ciphers"))

tls12-and-older() can be used for specifying ciphers for TLS v1.2-and-older.
tls13() is currently not supported by paho-mqtt-c.

Note:
For backward compatibility cipher-suite("list:of:ciphers") restricts only
the TLSv1.2-and-older cipher suite.

Signed-off-by: László Várady <laszlo.varady@protonmail.com>
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
@kira-syslogng
Copy link
Contributor

Build SUCCESS

@alltilla alltilla self-requested a review February 24, 2022 22:09
@OverOrion OverOrion self-requested a review February 25, 2022 07:23
Copy link
Collaborator

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@alltilla alltilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the other tls() implementations: riemann() and amqp().
They do not have cipher suite setter options, so these changes are not applicable there.

Approve!

modules/http/http.c Show resolved Hide resolved
@alltilla alltilla added the user-visible-feature User visible feature label Feb 25, 2022
@alltilla alltilla merged commit 7ea72e7 into syslog-ng:master Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user-visible-feature User visible feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syslog-ng tries TLS1.3 even with TLS1.2 cipher-suite(s)
5 participants