[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-09-05 Thread Maulin Vasavada (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17762263#comment-17762263
 ] 

Maulin Vasavada commented on CASSANDRA-18778:
-

Hi [~andrew.tolbert] [~smiklosovic] sorry I am late looking at this but I read 
the details here. Interestingly when we did CASSANDRA-18124 changes, we did 
talk about this exact issue- What to do with password check for the JKS based 
keystores- as you would be able to notice in that ticket,

!image-2023-09-05-21-13-06-602.png!

 

 

So at that point we decided to go with enforcing the JKS keystores to have the 
password. However, based on what [~andrew.tolbert] mentions here about PKCS12 
keystores generated without a password via OpenSSL makes a valid case in terms 
of `What tools allows`. In the Keytool it clearly gives a warning when we read 
keystores without a password that the authenticity of the data can't be 
verified without the password and that made me think about the password's 
necessity for the JKS keystores. So while from the operational standpoint I 
would still think we should specify password for the keystore, if the tooling 
from OpenSSL allows passwordless keystore creation, we can make this exception.

For the Truststores, however I think we can live without password since it is 
just a collection of `public keys` and authenticity like keystore may be 
considered optional. That was the primary thinking that resulted into the state 
of code that we have prior to this change.


One challenge, if I recollect it right, I ran into was- in the YAML file I 
could not simulate the `null` password because there was a default of `empty 
string` somewhere (most likely EncryptionOptions.java). However, if your 
changes are tested already and merged I guess you have a test case for 
differentiating `null` vs `empty string` (will check your PR).

 

 

All-in-all, I don't mind having to support keystores without passwords and 
don't feel it may be worth requiring passwords for the truststores :)

 

 

 

 

 

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.4, 5.0
>
> Attachments: image-2023-09-05-21-13-06-602.png
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> 

[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-09-05 Thread Tibor Repasi (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17761971#comment-17761971
 ] 

Tibor Repasi commented on CASSANDRA-18778:
--

Hi, thanks for pinging. Sorry for the delayed response, I'm just back from 
holidays.

I've just tested 5.0-alpha1 (take3) on my test cluster set up with 
PEMBasedSslContextFactory which has required CASSANDRA-18124. The patch seems 
not inflicting with the features used there.

LGTM

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.4, 5.0
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-25 Thread Andy Tolbert (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17759060#comment-17759060
 ] 

Andy Tolbert commented on CASSANDRA-18778:
--

{quote}as I am reading that patch ... what about truststores? Should not we 
apply same logic there?
{quote}
This is a good question. It looks like there is no such validation on trust 
store password, and looks like its allowed to be null or empty, and there is an 
existing test for this 
([testEmptyTrustStorePassword|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/security/FileBasedSslContextFactoryTest.java#L167-L179])
 so we should be covered well there.

{quote}
I built it all one more time on more recent branches
{quote}

Awesome, thank you!

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-25 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17758862#comment-17758862
 ] 

Stefan Miklosovic commented on CASSANDRA-18778:
---

+1 from me too.

I built it all one more time on more recent branches:

[4.1 
j11|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3008/workflows/374c4d90-ff16-414f-b1e1-3dd7974bfd22]
[4.1 
j8|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3008/workflows/85477c44-162e-4fab-9d17-f0efd7af5fef]

[5.0 
j17|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3013/workflows/2bd35adf-87ea-4bf8-88d4-1005c80ce999]
[5.0 
j11|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3013/workflows/9d8d83dd-f283-4ec8-a9ff-43f410801ced]

[trunk 
j17|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3012/workflows/699cf0d5-fb26-4c76-8e46-48db627aaec6]
[trunk 
j11|https://app.circleci.com/pipelines/github/instaclustr/cassandra/3012/workflows/1dfba849-060f-4440-90ef-1349e937d2f2]

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-22 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17757656#comment-17757656
 ] 

Stefan Miklosovic commented on CASSANDRA-18778:
---

Ah right ... thank you for the explanation.

pinging [~rtib] to raise awareness about this. Are you around to take a look / 
acknowledge this change?

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-22 Thread Andy Tolbert (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17757655#comment-17757655
 ] 

Andy Tolbert commented on CASSANDRA-18778:
--

{quote}
So, basically, the previous version was throwing exception if it was null OR 
empty.
Now we throw if it is just null.
{quote}

Yep!  That's what I am aiming for, which was the previous behavior I'd observed 
in C* 4.0.  Technically {{null}} could be allowed I suspect, but I figured for 
consistency it should behave the same way (use an empty string for 
{{keystore_password}} when there is no password)

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-22 Thread Andy Tolbert (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17757653#comment-17757653
 ] 

Andy Tolbert commented on CASSANDRA-18778:
--

My understanding of [CASSANDRA-18124] was that it was oriented towards allowing 
{{keystore_password}} to be nullable for the 
{{PEMBasedSslContextFactory}}-based implementation to allow null/empty 
passwords, which it previously didn't.  A side effect of this change was also 
that the default {{FileBasedSslContextFactory}} was changed to additionally 
validate the password to ensure it was non-null/empty[1].   This validation did 
not previously exist, and since {{KeyStore}} does allow empty passwords, this 
could be a regression for someone upgrading from 4.0 to 4.1.2+ where empty 
password PKCS12 keystores were used.  It's probably not a common use case, but 
was something I encountered myself during testing.

[1]: 
https://github.com/apache/cassandra/commit/bd49f6ff265c8bfa64bf140328ae6736dc4a87bd#diff-559a53285872c51f496ae3319425977f741ae2f3a359c2da674403294e17297e

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-22 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17757650#comment-17757650
 ] 

Stefan Miklosovic commented on CASSANDRA-18778:
---

Honestly, I have a hard time to understand this ticket. In (1) we made it 
possible to have nullable password. But here I see

{code}
   if (password == null)
{
throw new IllegalArgumentException("'keystore_password' must be 
specified");
}
{code}

That does not make sense to me. So the previous ticket was wrong?

(1) https://issues.apache.org/jira/browse/CASSANDRA-18778

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-21 Thread Andy Tolbert (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17757055#comment-17757055
 ] 

Andy Tolbert commented on CASSANDRA-18778:
--

Must have missed staging something but pushed a tiny one-liner fix on each of 
my branches to fix the {{@Test}} annotation

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-21 Thread Andy Tolbert (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17757041#comment-17757041
 ] 

Andy Tolbert commented on CASSANDRA-18778:
--

I see some CI tests failing, I must have missed something on my patch...taking 
a look

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-21 Thread Jon Meredith (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17757037#comment-17757037
 ] 

Jon Meredith commented on CASSANDRA-18778:
--

+1 from me, I don't think we considered existing deployments carefully enough 
when the check was upgraded from just null to empty string in CASSANDRA-18124

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-21 Thread Jon Meredith (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17757033#comment-17757033
 ] 

Jon Meredith commented on CASSANDRA-18778:
--

Running through CI

CI Results (pending):
||Branch||Source||Circle CI||Jenkins||
|cassandra-4.1|[branch|https://github.com/jonmeredith/cassandra/tree/commit_remote_branch/CASSANDRA-18778-cassandra-4.1-F8EF5D5E-1505-4998-83C2-77D5EF86AF6D]|[build|https://app.circleci.com/pipelines/github/jonmeredith/cassandra?branch=commit_remote_branch%2FCASSANDRA-18778-cassandra-4.1-F8EF5D5E-1505-4998-83C2-77D5EF86AF6D]|[build|https://ci-cassandra.apache.org/job/Cassandra-devbranch/2566/]|
|cassandra-5.0|[branch|https://github.com/jonmeredith/cassandra/tree/commit_remote_branch/CASSANDRA-18778-cassandra-5.0-F8EF5D5E-1505-4998-83C2-77D5EF86AF6D]|[build|https://app.circleci.com/pipelines/github/jonmeredith/cassandra?branch=commit_remote_branch%2FCASSANDRA-18778-cassandra-5.0-F8EF5D5E-1505-4998-83C2-77D5EF86AF6D]|[build|https://ci-cassandra.apache.org/job/Cassandra-devbranch/2567/]|
|trunk|[branch|https://github.com/jonmeredith/cassandra/tree/commit_remote_branch/CASSANDRA-18778-trunk-F8EF5D5E-1505-4998-83C2-77D5EF86AF6D]|[build|https://app.circleci.com/pipelines/github/jonmeredith/cassandra?branch=commit_remote_branch%2FCASSANDRA-18778-trunk-F8EF5D5E-1505-4998-83C2-77D5EF86AF6D]|[build|unknown]|

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org

[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-21 Thread Andy Tolbert (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17756997#comment-17756997
 ] 

Andy Tolbert commented on CASSANDRA-18778:
--

(y) thanks, would appreciate additional eyes.  I believe it may also be valid 
to pass a {{null}} password to {{KeyStore.load}} or 
{{{}KeyManagerFactory.init{}}}, but Cassandra 4.0 also disallows null 
{{keystore_password}} (but allows empty string) in config validation, so felt 
ok to keep doing the same for consistency:

C* 4.0:
{noformat}
2023-08-11 19:37:43,595 ERROR [main] 
org.apache.cassandra.service.CassandraDaemon - Exception encountered during 
startup: Invalid yaml. Those properties [keystore_password] are not valid
{noformat}

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-21 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17756990#comment-17756990
 ] 

Stefan Miklosovic commented on CASSANDRA-18778:
---

hi[~maulin.vasavada], I want to ask if this is OK with you too.

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-21 Thread Andy Tolbert (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17756981#comment-17756981
 ] 

Andy Tolbert commented on CASSANDRA-18778:
--

Isn't too much to the change needed for this, branches below.  Tentative branch 
pending review and ci test assistance from [~jonmeredith] (thanks!)

||Branch||Source||
|cassandra-4.1|[branch|https://github.com/tolbertam/cassandra/tree/C18778-4.1]|
|cassandra-5.0|[branch|https://github.com/tolbertam/cassandra/tree/C18778-5.0]|
|trunk|[branch|https://github.com/tolbertam/cassandra/tree/C18778-trunk]|

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18778) Empty keystore_password no longer allowed on encryption_options

2023-08-17 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17755698#comment-17755698
 ] 

Stefan Miklosovic commented on CASSANDRA-18778:
---

_which should involve changing FileBasedSslContextFactory.validatePassword to 
only disallow null passwords_

I dont understand, in 18124 we made them nullable?

> Empty keystore_password no longer allowed on encryption_options
> ---
>
> Key: CASSANDRA-18778
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18778
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Config
>Reporter: Andy Tolbert
>Assignee: Andy Tolbert
>Priority: Normal
> Fix For: 4.1.x, 5.0.x
>
>
> After CASSANDRA-18124 (introduced in 4.1.2 and 5.0) it is no longer possible 
> to set an empty {{keystore_password}} under {{client_encryption_options}} or 
> {{server_encryption_options}} using the default implementation 
> {{{}DefaultSslContextFactory{}}}.
> While keytool does not allow generating keystores with empty passwords, it 
> does support reading them. It is not uncommon to use PKCS12 certificates 
> generated by other tools (eg. openssl) that do not enforce passwords.
> The fix for this should be pretty straightforward, which should involve 
> changing 
> [FileBasedSslContextFactory.validatePassword|https://github.com/apache/cassandra/blob/cassandra-4.1.2/src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java#L128-L135]
>  to only disallow null passwords (which would be consistent with previous 
> versions). I will create pull requests against the relevant branches shortly.
> {noformat}
> Exception (org.apache.cassandra.exceptions.ConfigurationException) 
> encountered during startup: Failed to initialize SSL
> org.apache.cassandra.exceptions.ConfigurationException: Failed to initialize 
> SSL
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1155)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:390)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:204)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:188)
>   at 
> org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:804)
>   at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:747)
>   at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:875)
> Caused by: java.io.IOException: Failed to create SSL context using Native 
> transport
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:405)
>   at 
> org.apache.cassandra.config.DatabaseDescriptor.applySslContext(DatabaseDescriptor.java:1150)
>   ... 6 more
> Caused by: java.lang.IllegalArgumentException: 'keystore_password' must be 
> specified
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.validatePassword(FileBasedSslContextFactory.java:133)
>   at 
> org.apache.cassandra.security.FileBasedSslContextFactory.buildKeyManagerFactory(FileBasedSslContextFactory.java:151)
>   at 
> org.apache.cassandra.security.AbstractSslContextFactory.createNettySslContext(AbstractSslContextFactory.java:181)
>   at 
> org.apache.cassandra.security.SSLFactory.createNettySslContext(SSLFactory.java:168)
>   at 
> org.apache.cassandra.security.SSLFactory.validateSslContext(SSLFactory.java:355)
>   ... 7 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org