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 server cipher regarding #1608

Open
kandasamypreetha opened this issue Jul 17, 2024 · 7 comments
Open

TLS server cipher regarding #1608

kandasamypreetha opened this issue Jul 17, 2024 · 7 comments
Labels
is:question Issue is actually a question.

Comments

@kandasamypreetha
Copy link

Hi,
I need to configure the TLS server to ensure it uses specific cipher suites for secure connections. Currently, the server is establishing connections with the default ciphers, but I require the server to prioritize the following cipher suites:

ECDHE_RSA_WITH_AES_128_GCM_SHA256
DHE_RSA_WITH_AES_128_GCM_SHA256

Could you please provide guidance on how to update the server's cipher selection to include these specific ciphers?

Thank you!

@michalvasko
Copy link
Member

All the supported configuration parameters are found in the ietf-netconf-server YANG module. This particular parameter should be supported and found at /ietf-netconf-server:netconf-server/listen/endpoints/endpoint/transport/tls/tls/tls-server-parameters/hello-params/cipher-suites/cipher-suite.

The module is quite big, with all the imports, so you can use tree output format to make some sense of it (you can use yanglint from libyang to print it).

@michalvasko michalvasko added the is:question Issue is actually a question. label Jul 17, 2024
@kandasamypreetha
Copy link
Author

As i am beginner can you please share the example xml for the above to add cipher-suite

@michalvasko
Copy link
Member

Fine, this config adds only the cipher suite configuration (you need the rest of a TLS endpoint configuration for it to be valid and work, more about an example in the README) so it needs to be merged, not imported or replace the previous configuration (you can use sysrepocfg -E <file> to merge a configuration file). Also, this config restricts the allowed cipher-suites only to the 2 you mentioned, if you want to support other ones, you need to add them after those 2 (the higher the cipher-suite, the higher its priority).

<netconf-server xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-server">
    <listen>
        <endpoints>
            <endpoint>
                <name>default-tls</name>
                <tls>
                    <tls-server-parameters>
                        <hello-params>
                            <cipher-suites xmlns:tlscsa="urn:ietf:params:xml:ns:yang:iana-tls-cipher-suite-algs">
                                <cipher-suite>tlscsa:tls-dhe-rsa-with-aes-128-gcm-sha256</cipher-suite>
                                <cipher-suite>tlscsa:tls-ecdhe-rsa-with-aes-128-gcm-sha256</cipher-suite>
                            </cipher-suites>
                        </hello-params>
                    </tls-server-parameters>
                </tls>
            </endpoint>
        </endpoints>
    </listen>
</netconf-server>

@kandasamypreetha
Copy link
Author

kandasamypreetha commented Jul 24, 2024

Hi michal,
Thank you for your guidance on configuring the cipher suites for the TLS endpoint. I have followed your instructions and encountered some challenges. Here's a detailed account of the steps I took and the issues I'm facing.
1.I have installed the iana-tls-cipher-suite-algs YANG module.
2.I enabled the necessary features in the ietf-tls-common module:
tls-1_2,tls-dhe,tls-gcm,tls-sha2
3.Issues Encountered:
---> Despite enabling the required features in ietf-tls-common, I faced the following errors:
root@4423--SW--POY:/home/vvdn/ranjith/NEC_CA/tls_files# sysrepocfg --edit=vi -d running
libyang error: Invalid identityref "tlscsa:tls_dhe_rsa_with_aes_128_gcm_sha256" value - identity not found in module "iana-tls-cipher-suite-algs". (Data location "/ietf-netconf-server:netconf-server/listen/endpoint[name='default-tls']/tls/tls-server-parameters/hello-params/cipher-suites/cipher-suite", line number 74.)
sysrepocfg error: Data parsing failed

---->I tried different variations of the cipher suite identity references (e.g., without the prefix tlscsa: and using uppercase), but none resolved the issue:
root@4423--SW--POY:/home/vvdn/ranjith/NEC_CA/tls_files# sysrepocfg --edit=vi -d running
libyang error: Invalid identityref "tls_dhe_rsa_with_aes_128_gcm_sha256" value - identity not found in module "ietf-netconf-server". (Data location "/ietf-netconf-server:netconf-server/listen/endpoint[name='default-tls']/tls/tls-server-parameters/hello-params/cipher-suites/cipher-suite", line number 74.)
sysrepocfg error: Data parsing failed

root@4423--SW--POY:/home/vvdn/ranjith/NEC_CA/tls_files# sysrepocfg --edit=vi -d running
libyang error: Invalid identityref "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" value - identity not found in module "ietf-netconf-server". (Data location "/ietf-netconf-server:netconf-server/listen/endpoint[name='default-tls']/tls/tls-server-parameters/hello-params/cipher-suites/cipher-suite", line number 68.)
sysrepocfg error: Data parsing failed

4.Could you please provide further guidance on how to correctly reference the cipher suites in the configuration?Is there an additional step or a specific way to enable the cipher suites in the iana-tls-cipher-suite-algs module that I might be missing?

@michalvasko
Copy link
Member

I have provided the data for the latest release netopeer2 v2.2.28, with all its dependencies. Based on what you wrote I am certain you are using some older version. Update it and it will work.

@kandasamypreetha
Copy link
Author

Thank you for your prompt response and for providing the data for the latest release, Netopeer2 v2.2.28. However, due to some dependencies, I need to stick with version 2.1.71.

I am currently using the YANG file iana-tls-cipher-suite-algs@2024-03-16 for Netopeer2 version 2.1.71. Could you please suggest the correct version of the iana-tls-cipher-suite-algs YANG file that would be compatible with Netopeer2 v2.1.71?

@michalvasko
Copy link
Member

No, you cannot be using iana-tls-cipher-suite-algs@2024-03-16 with netopeer2 v2.1.71. This version installs [email protected] and these revisions did not yet require iana-tls-cipher-suite-algs. Manually installing the module will not affect the functionality in any way. So, you either update to the latest release or will not be able to customize the supported cipher-suites, no other option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:question Issue is actually a question.
Projects
None yet
Development

No branches or pull requests

2 participants