NethServer / dev

NethServer issue tracker
https://github.com/NethServer/dev/issues
63 stars 19 forks source link

Allow Elliptic Curve Criptography (ECC) certificate #5509

Closed stephdl closed 6 years ago

stephdl commented 6 years ago

Steps to reproduce

With centos7.5 and the tls policy 20180330 the usage of ECC certificate are not allowed by our ssl policy, the ciphers are not allowed, we have to add :

ECDHE-ECDSA-AES256-GCM-SHA384
ECDHE-ECDSA-CHACHA20-POLY1305
ECDHE-ECDSA-AES128-GCM-SHA256
ECDHE-ECDSA-AES256-SHA384
ECDHE-ECDSA-AES128-SHA256

this page will explain better what cipher to use for ECC (we do not want sslv3)

Expected behavior

No error, if needed we have to allow ECC certificate by a new tls policy (TLS-20180621)

Actual behavior

not allowed

Components we have to patch these services

See also

the older issue in GH : https://github.com/NethServer/dev/issues/5438 and the discourse forum: https://community.nethserver.org/t/default-tls-policy-doesnt-allow-connections-with-ecc-certificate/9952


thank danb35

DavidePrincipi commented 6 years ago

What about OpenLDAP? Even if it does not implement TLS policy by now, did you check if it works with an ECC?

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

stephdl commented 6 years ago

will check for ECC and Ldap @DavidePrincipi

How I can build again the rpm nethserver-mail with Travis, the build failed :'(

stephdl commented 6 years ago

Testing cases

install from testing

Test there is no regressions and no error in templates (check logs) by changing the tls-policy

you can check what ciphers are allowed by checking the testssl.sh page

Services to tests with testssl.sh and the 20180330 tls policy

testssl.sh should give back the list of cipher, you are looking forKeyExch. ECDH, for example ECDHE-RSA-AES256-GCM-SHA384

The last and ultimate test is to upload a ECC certificate and check that you can use these services.

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

DavidePrincipi commented 6 years ago

I cannot upload an ECC certificate from Server Manager UI :(

image

To generate the certificate i ran these commands on a Fedora 28:

openssl ecparam -genkey -name prime256v1 -out key.pem
openssl req -new -sha256 -key key.pem -out csr.csr
openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem
openssl req -in csr.csr -text -noout | grep -i "Signature.*SHA256" && echo "All is well" || echo "This certificate will stop working in 2017! You must update OpenSSL to generate a widely-compatible certificate"

origin: https://msol.io/blog/tech/create-a-self-signed-ecc-certificate/

DavidePrincipi commented 6 years ago

Shall we add DSA support too?

stephdl commented 6 years ago

dsa is for signature, not for encryption. openssh dropped the support since openssh7.

I suppose we do not need to allow it.

stephdl commented 6 years ago

What about OpenLDAP? Even if it does not implement TLS policy by now, did you check if it works with an ECC?

not much hints, I do not know

DavidePrincipi commented 6 years ago

OpenSSH does not use a x509 certificate, at least with our configuration and generate its own key pair. I guess it has different requirements.

Instead DSA and ECDSA are part of x509 rfc 3279 and subsequents. I don't know how much they are adopted.

Even if (EC)DSA is for signing I guess it is used in TLS only to identify the peers. Let me dig it more...

stephdl commented 6 years ago

I could see that some vhosts needs to get a cipher definition, like mattermost or nextcloud

My concern is that we need to upgrade consistently the list after each change. For example mattermost won't allow the ecc certificate.

What do you think @DavidePrincipi and @gsanchietti. I wonder if the cipher list should not be stored in the tls-policy key and retrievable everywhere by ${'tls-policy'}{'20180330'}

This will bring other problem, how to separate ciphers (not the same for openssh) and the format to write them (postfix want to separate allowed and refused ciphers)

DavidePrincipi commented 6 years ago

About mattermost and nextcloud, I'd say they should rely on the global Apache setting and not defining their own overrides, unless there are specific requirements from their app clients. We must check this!

As you can see from https://github.com/NethServer/nethserver-base/pull/120, this enhancement is actually a new feature: adding ECC certificates support impacts on Server Manager too!

I think it is better to postpone this new feature after 7.5 release.

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

DavidePrincipi commented 6 years ago

Issue postponed after 7.5 final. Implement a new TLS policy:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

stephdl commented 6 years ago

@davidep what did you plan for this Issue do we release without dsa, not much used and not wanted/needed by the community or do we release as is ?

DavidePrincipi commented 6 years ago

Let's release it for ECC certificates only. Splitting the feature eases the QA and documentation processes too... Furthermore the DSA use case has not been requested.

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

DavidePrincipi commented 6 years ago

Test case

see also the previous test case to see how to run the checks.

stephdl commented 6 years ago

I have some issue to use an ecc cert with dovecot and postfix, I need to investigate

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/updates:

nethbot commented 6 years ago

in 7.5.1804/updates:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

DavidePrincipi commented 6 years ago

Some commands for QA

httpd

curl -k -v https://192.168.122.8
curl -k -v https://192.168.122.8 -H 'Host: mynextcloud.domain.com'
curl -k -v https://192.168.122.8 -H 'Host: mattermost.dpnet.nethesis.it'

httpd vhost

openssl s_client -servername vm8.dpnet.nethesis.it -connect 192.168.122.8:443

httpd-admin

 curl -k -v https://192.168.122.8:980

slapd

LDAPTLS_REQCERT=never ldapsearch -ZZ -s base -H ldap://192.168.122.8 -D 'cn=ldapservice,dc=directory,dc=nh' -x -w '6lpPIkkPr_DEXzdu'  -b ''

dovecot

curl --ssl -k -v -u first.user:Nethesis,1234 imap://192.168.122.8

postfix

curl --ssl -k -v -u first.user:Nethesis,1234 smtp://192.168.122.8:587

generate a CSR with server alt names (-subj)

openssl req -new -sha256 -key ecc-qa-key.pem -out ecc-qa-csr.csr -subj '/CN=vmalpha.dpnet.nethesis.it, O=Nethesis, ST=Italy/emailAddress=davide.principi@nethesis.it/subjectAltName=vmalpha.dpnet.nethesis.it,mattermost.dpnet.nethesis.it,mynextcloud.domain.com,vm8.dpnet.nethesis.it, OU=Development, C=IT, L=Pesaro'
stephdl commented 6 years ago

Tk, I need to write them to the wiki, I did a page on this topic....testssl

DavidePrincipi commented 6 years ago

Other commands for QA:

 nmap  --script ssl-enum-ciphers 192.168.122.8 -p 636
 ./testssl.sh 192.168.122.8:636

The nmap command in Fedora 28 has more detailed output than the one in CentOS7.

nethbot commented 6 years ago

in 7.5.1804/testing:

nethbot commented 6 years ago

in 7.5.1804/testing:

DavidePrincipi commented 6 years ago

Test case


See also https://github.com/NethServer/dev/issues/5509#issuecomment-399154273

stephdl commented 6 years ago

Tk, I need to write them to the wiki, I did a page on this topic....testssl

done https://wiki.nethserver.org/doku.php?id=testing_tls_ssl_encryption

stephdl commented 6 years ago

VERIFICATION

Proposed verified

DavidePrincipi commented 6 years ago

Pushed translations to Transifex