You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Dinesh Joshi <dj...@apache.org> on 2023/06/02 15:02:53 UTC
CASSANDRA-18554 - mTLS based client and internode authenticators
Hi dev@,
We're planning to add mTLS client authentication as well as internode authentication in CASSANDRA-18554. While this is all backward compatible, we thought it would be a good idea to notify the dev list. If anybody is interested please take a look at the JIRA.
Thanks,
Dinesh
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
Does anybody have any questions / comments?
Dinesh
> On Jul 17, 2023, at 12:37 PM, Dinesh Joshi <dj...@apache.org> wrote:
>
> Hi folks,
>
> Given the feedback received, we thought it would be best to do a CEP. Here's the link: https://cwiki.apache.org/confluence/display/CASSANDRA/CEP-34
>
> It incorporates the feedback we've received. Please let me know if there are any other comments. We'll wait for a bit and start a VOTE thread for it.
>
> Thanks,
>
> Dinesh
>
>> On Jul 12, 2023, at 12:13 AM, Dinesh Joshi <dj...@apache.org> wrote:
>>
>> I can certainly start a VOTE thread for the CQL syntax addition. There
>> hasn't been any feedback that suggests that there is an unaddressed
>> concern to the changes we are making.
>>
>> That said, I'm not sure if there was explicit decision that has resulted
>> in an update to the project's governance to reflect this requirement? If
>> there is I seem to have missed it. There was a discussion in the past
>> about notifying the dev list to ensure there is visibility to changes
>> but I don't recall whether there was an explicit voting requirement.
>>
>> On 7/11/23 19:17, Yuki Morishita wrote:
>>>> folks - I think we’ve achieved lazy consensus here. Please continue
>>> with feedback on the jira.
>>>
>>> Hi Dinesh,
>>>
>>> As Jeremiah commented on JIRA, shouldn't we have a vote in the ML?
>>>
>>> For the future reference, in my opinion, adding new CQL syntax should
>>> have a CEP as it is not something we can easily change once defined.
>>
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
Hi folks,
Given the feedback received, we thought it would be best to do a CEP. Here's the link: https://cwiki.apache.org/confluence/display/CASSANDRA/CEP-34
It incorporates the feedback we've received. Please let me know if there are any other comments. We'll wait for a bit and start a VOTE thread for it.
Thanks,
Dinesh
> On Jul 12, 2023, at 12:13 AM, Dinesh Joshi <dj...@apache.org> wrote:
>
> I can certainly start a VOTE thread for the CQL syntax addition. There
> hasn't been any feedback that suggests that there is an unaddressed
> concern to the changes we are making.
>
> That said, I'm not sure if there was explicit decision that has resulted
> in an update to the project's governance to reflect this requirement? If
> there is I seem to have missed it. There was a discussion in the past
> about notifying the dev list to ensure there is visibility to changes
> but I don't recall whether there was an explicit voting requirement.
>
> On 7/11/23 19:17, Yuki Morishita wrote:
>>> folks - I think we’ve achieved lazy consensus here. Please continue
>> with feedback on the jira.
>>
>> Hi Dinesh,
>>
>> As Jeremiah commented on JIRA, shouldn't we have a vote in the ML?
>>
>> For the future reference, in my opinion, adding new CQL syntax should
>> have a CEP as it is not something we can easily change once defined.
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
I can certainly start a VOTE thread for the CQL syntax addition. There
hasn't been any feedback that suggests that there is an unaddressed
concern to the changes we are making.
That said, I'm not sure if there was explicit decision that has resulted
in an update to the project's governance to reflect this requirement? If
there is I seem to have missed it. There was a discussion in the past
about notifying the dev list to ensure there is visibility to changes
but I don't recall whether there was an explicit voting requirement.
On 7/11/23 19:17, Yuki Morishita wrote:
>> folks - I think we’ve achieved lazy consensus here. Please continue
> with feedback on the jira.
>
> Hi Dinesh,
>
> As Jeremiah commented on JIRA, shouldn't we have a vote in the ML?
>
> For the future reference, in my opinion, adding new CQL syntax should
> have a CEP as it is not something we can easily change once defined.
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Yuki Morishita <mo...@gmail.com>.
> folks - I think we’ve achieved lazy consensus here. Please continue with
feedback on the jira.
Hi Dinesh,
As Jeremiah commented on JIRA, shouldn't we have a vote in the ML?
For the future reference, in my opinion, adding new CQL syntax should have
a CEP as it is not something we can easily change once defined.
On Wed, Jul 12, 2023 at 7:19 AM Derek Chen-Becker <de...@chen-becker.org>
wrote:
> EC - eventual consensus?
>
> On Tue, Jul 11, 2023 at 4:03 PM Dinesh Joshi <dj...@apache.org> wrote:
>
>> folks - I think we’ve achieved lazy consensus here. Please continue with
>> feedback on the jira.
>>
>> Thanks,
>>
>> Dinesh
>>
>>
>> On Jul 7, 2023, at 12:23 PM, Jyothsna Konisa <jy...@gmail.com>
>> wrote:
>>
>>
>> Hi Yuki, Jeremiah & Christopher,
>>
>> Thank you very much for the feedback.
>>
>> Regarding removing superuser check for adding/removing identities, I have
>> relaxed that check and added permissions check instead. With this change
>> only users with appropriate permissions to add/drop identities can perform
>> that action.
>>
>> About extending `Create Role` cqlsh statement, we have a couple of
>> reasons for not doing that. We designed the mTLS authenticator in such a
>> way that a single role can be associated with multiple identities, EX:
>> there can be several identities which are read_only users. Also, having a
>> separate cqlsh statement for identities makes it more pluggable and
>> independent. If we still think that extending the create role statement
>> would be a convenient feature, we can add it as required in the followup
>> patches.
>>
>> Christopher, I will be acting upon your feedback regarding having
>> identity in the cassandra.yaml optionally configurable.
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>> On Thu, Jul 6, 2023 at 5:30 PM Dinesh Joshi <dj...@apache.org> wrote:
>>
>>> > On Jun 30, 2023, at 1:09 PM, Jeremiah Jordan <je...@datastax.com>
>>> wrote:
>>> >
>>> > I don’t think users necessarily need to be able to update their own
>>> identities. I just don’t want to have to use the super user role. The
>>> super user role has all power over all things in the data base. I don’t
>>> want to have to give that much power to the person who manages identities,
>>> I just want to give them the power to manage identities.
>>>
>>> Makes sense. I think Jyothsna already pushed an update to the PR to
>>> relax the restriction. Please feel free to take a look at it.
>>>
>>> Dinesh
>>>
>>>
>>>
>>>
>
> --
> +---------------------------------------------------------------+
> | Derek Chen-Becker |
> | GPG Key available at https://keybase.io/dchenbecker and |
> | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
> | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
> +---------------------------------------------------------------+
>
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Derek Chen-Becker <de...@chen-becker.org>.
EC - eventual consensus?
On Tue, Jul 11, 2023 at 4:03 PM Dinesh Joshi <dj...@apache.org> wrote:
> folks - I think we’ve achieved lazy consensus here. Please continue with
> feedback on the jira.
>
> Thanks,
>
> Dinesh
>
>
> On Jul 7, 2023, at 12:23 PM, Jyothsna Konisa <jy...@gmail.com>
> wrote:
>
>
> Hi Yuki, Jeremiah & Christopher,
>
> Thank you very much for the feedback.
>
> Regarding removing superuser check for adding/removing identities, I have
> relaxed that check and added permissions check instead. With this change
> only users with appropriate permissions to add/drop identities can perform
> that action.
>
> About extending `Create Role` cqlsh statement, we have a couple of reasons
> for not doing that. We designed the mTLS authenticator in such a way that a
> single role can be associated with multiple identities, EX: there can be
> several identities which are read_only users. Also, having a separate cqlsh
> statement for identities makes it more pluggable and independent. If we
> still think that extending the create role statement would be a convenient
> feature, we can add it as required in the followup patches.
>
> Christopher, I will be acting upon your feedback regarding having identity
> in the cassandra.yaml optionally configurable.
>
> Thanks,
> Jyothsna Konisa.
>
> On Thu, Jul 6, 2023 at 5:30 PM Dinesh Joshi <dj...@apache.org> wrote:
>
>> > On Jun 30, 2023, at 1:09 PM, Jeremiah Jordan <je...@datastax.com>
>> wrote:
>> >
>> > I don’t think users necessarily need to be able to update their own
>> identities. I just don’t want to have to use the super user role. The
>> super user role has all power over all things in the data base. I don’t
>> want to have to give that much power to the person who manages identities,
>> I just want to give them the power to manage identities.
>>
>> Makes sense. I think Jyothsna already pushed an update to the PR to relax
>> the restriction. Please feel free to take a look at it.
>>
>> Dinesh
>>
>>
>>
>>
--
+---------------------------------------------------------------+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
+---------------------------------------------------------------+
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
folks - I think we’ve achieved lazy consensus here. Please continue with
feedback on the jira.
Thanks,
Dinesh
>
> On Jul 7, 2023, at 12:23 PM, Jyothsna Konisa <jy...@gmail.com> wrote:
>
>
>
>
> Hi Yuki, Jeremiah & Christopher,
>
> Thank you very much for the feedback.
>
> Regarding removing superuser check for adding/removing identities, I have
> relaxed that check and added permissions check instead. With this change
> only users with appropriate permissions to add/drop identities can perform
> that action.
>
> About extending `Create Role` cqlsh statement, we have a couple of reasons
> for not doing that. We designed the mTLS authenticator in such a way that a
> single role can be associated with multiple identities, EX: there can be
> several identities which are read_only users. Also, having a separate cqlsh
> statement for identities makes it more pluggable and independent. If we
> still think that extending the create role statement would be a convenient
> feature, we can add it as required in the followup patches.
>
> Christopher, I will be acting upon your feedback regarding having identity
> in the cassandra.yaml optionally configurable.
>
> Thanks,
> Jyothsna Konisa.
>
>
>
>
>
> On Thu, Jul 6, 2023 at 5:30 PM Dinesh Joshi
> <[djoshi@apache.org](mailto:djoshi@apache.org)> wrote:
>
>
>> > On Jun 30, 2023, at 1:09 PM, Jeremiah Jordan
<[jeremiah@datastax.com](mailto:jeremiah@datastax.com)> wrote:
> >
> > I don’t think users necessarily need to be able to update their own
> identities. I just don’t want to have to use the super user role. The
> super user role has all power over all things in the data base. I don’t
> want to have to give that much power to the person who manages identities, I
> just want to give them the power to manage identities.
>
> Makes sense. I think Jyothsna already pushed an update to the PR to relax
> the restriction. Please feel free to take a look at it.
>
> Dinesh
>
>
>
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Jyothsna Konisa <jy...@gmail.com>.
Hi Yuki, Jeremiah & Christopher,
Thank you very much for the feedback.
Regarding removing superuser check for adding/removing identities, I have
relaxed that check and added permissions check instead. With this change
only users with appropriate permissions to add/drop identities can perform
that action.
About extending `Create Role` cqlsh statement, we have a couple of reasons
for not doing that. We designed the mTLS authenticator in such a way that a
single role can be associated with multiple identities, EX: there can be
several identities which are read_only users. Also, having a separate cqlsh
statement for identities makes it more pluggable and independent. If we
still think that extending the create role statement would be a convenient
feature, we can add it as required in the followup patches.
Christopher, I will be acting upon your feedback regarding having identity
in the cassandra.yaml optionally configurable.
Thanks,
Jyothsna Konisa.
On Thu, Jul 6, 2023 at 5:30 PM Dinesh Joshi <dj...@apache.org> wrote:
> > On Jun 30, 2023, at 1:09 PM, Jeremiah Jordan <je...@datastax.com>
> wrote:
> >
> > I don’t think users necessarily need to be able to update their own
> identities. I just don’t want to have to use the super user role. The
> super user role has all power over all things in the data base. I don’t
> want to have to give that much power to the person who manages identities,
> I just want to give them the power to manage identities.
>
> Makes sense. I think Jyothsna already pushed an update to the PR to relax
> the restriction. Please feel free to take a look at it.
>
> Dinesh
>
>
>
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
> On Jun 30, 2023, at 1:09 PM, Jeremiah Jordan <je...@datastax.com> wrote:
>
> I don’t think users necessarily need to be able to update their own identities. I just don’t want to have to use the super user role. The super user role has all power over all things in the data base. I don’t want to have to give that much power to the person who manages identities, I just want to give them the power to manage identities.
Makes sense. I think Jyothsna already pushed an update to the PR to relax the restriction. Please feel free to take a look at it.
Dinesh
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
> It is surprising to me that we load the identity from the keystore vs explicitly setting an expected value in cassandra.yaml. I get that an error is thrown if the identity doesn't match those of other nodes in the cluster, but does it make sense to prevent startup should the value in the keystore deviate from a (currently nonexistent) value in cassandra.yaml?
We can make it optionally configurable. The concern about adding identities in a yaml is that it generally requires a bounce for Cassandra to pick up new values.
> It feels like there is a parallel to how we set the cluster name in cassandra.yaml even though the value is also present within our local sstables and leads to startup errors should they differ.
I can see the parallels here. Thanks for the feedback.
Dinesh
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Christopher Bradford <br...@gmail.com>.
Looping back to the discussion around keystore usage and shared vs
individual identity. I understand the approach of having a single identity
shared by all nodes in the cluster. Including the entire response here, but
want to focus on the first line.
*The reason we use the keystore is that the node extracts its own identity
> and expects other nodes in the cluster to share the same identity.* This
> default behavior makes it easy to avoid configuring individual identities
> of nodes in the cluster. It's critical to recognize that if we had a
> separate identity for each node in the cluster, then we would need to
> update all nodes in the cluster when a new node is added or removed. This
> way all nodes in the cluster can have a shared identity while
> simultaneously preventing unnecessary operational pain of adding and
> removing identities each time a node is added or removed from the cluster.
(emphasis mine)
It is surprising to me that we load the identity from the keystore vs
explicitly setting an expected value in cassandra.yaml. I get that an error
is thrown if the identity doesn't match those of other nodes in the
cluster, but does it make sense to prevent startup should the value in the
keystore deviate from a (currently nonexistent) value in cassandra.yaml?
It feels like there is a parallel to how we set the cluster name in
cassandra.yaml even though the value is also present within our local
sstables and leads to startup errors should they differ.
Christopher Bradford
On Fri, Jun 30, 2023 at 4:09 PM Jeremiah Jordan <je...@datastax.com>
wrote:
> I don’t think users necessarily need to be able to update their own
> identities. I just don’t want to have to use the super user role. The
> super user role has all power over all things in the data base. I don’t
> want to have to give that much power to the person who manages identities,
> I just want to give them the power to manage identities.
>
> Jeremiah Jordan
> e. jeremiah@datastax.com
> w. www.datastax.com
>
>
>
> On Jun 30, 2023 at 1:35:41 PM, Dinesh Joshi <dj...@apache.org> wrote:
>
>> Yuki, Jeremiah both are fair points. The mental model we're using for
>> mTLS authentication is slightly different.
>>
>> In your model you're treating the TLS identity itself to be similar to
>> the password. The password is the 'shared secret' that currently needs
>> to be rotated by the user that owns the account therefore necessitating
>> the permission to update their password. But that is not the case with
>> TLS certificates and mTLS identities.
>>
>> The model we're going for is different. The identity is provisioned for
>> an account by a super user. This is more locked down and the user can
>> still rotate their own certificates but not change the identity
>> associated with their account without a super user.
>>
>> Once provisioned, a user does not need rotate the identity itself. They
>> only need to obtain fresh certificates as their certificates near
>> expiry. This requires no updates on the database unlike passwords.
>>
>> We could extend this functionality in the future to allow users to
>> change their own identity. Nothing here prevents that.
>>
>> thanks,
>>
>> Dinesh
>>
>>
>>
>> On 6/29/23 08:16, Jeremiah Jordan wrote:
>>
>> I like the idea of extending CREATE ROLE rather than adding a brand new
>>
>> ADD IDENTITY syntax. Not sure how that can line up with one to many
>>
>> relationships for an identity, but maybe that can just be done through
>>
>> role hierarchy?
>>
>>
>> In either case, I don’t think IDENTITY related operations should be tied
>>
>> to the super user flag. They should be tied to either existing role
>>
>> permissions, or a brand new permissions about IDENTITY. We should not
>>
>> require that end users give the account allowed to make IDENTITY changes
>>
>> super user permission to do what ever they want across the whole database.
>>
>>
>> On Jun 28, 2023 at 11:48:02 PM, Yuki Morishita <mor.yuki@gmail.com
>>
>> <ma...@gmail.com>> wrote:
>>
>> > Thinking more about "CREATE ROLE" permission, if we can extend CREATE
>>
>> > ROLE/ALTER ROLE statements, it may look streamlined:
>>
>> >
>>
>> > I don't have the good example, but something like:
>>
>> > ```
>>
>> > CREATE ROLE dev WITH LOGIN = true AND IDENTITIES = {'spiffe://xxx'};
>>
>> > ALTER ROLE dev ADD IDENTITY 'xxx';
>>
>> > LIST ROLES;
>>
>> > ```
>>
>> >
>>
>> > This requires a role to identities table as well as the current
>>
>> > identity to role table though.
>>
>> >
>>
>> > On Thu, Jun 29, 2023 at 12:34 PM Yuki Morishita <mor.yuki@gmail.com
>>
>> > <ma...@gmail.com>> wrote:
>>
>> >
>>
>> > Hi Jyothsna,
>>
>> >
>>
>> > I think for the *initial* commit, the description looks fine to me.
>>
>> > I'd like to see/contribute to the future improvement though:
>>
>> >
>>
>> > * ADD IDENTITY requires SUPERUSER, this means that the brand new
>>
>> > cluster needs to start with
>>
>> > PasswordAuthenticator/CassandraAuthorizer first, and then change
>>
>> > to mTLS one.
>>
>> > * For this, I'd really like to see Cassandra use password
>>
>> > authn and authz by default.
>>
>> > * Cassandra allows the user with "CREATE ROLE" permission to
>>
>> > create roles without superuser privilege. Maybe it is natural to
>>
>> > allow them to add identities also?
>>
>> >
>>
>> >
>>
>> > On Thu, Jun 29, 2023 at 7:35 AM Jyothsna Konisa
>>
>> > <jyothsna1503@gmail.com <ma...@gmail.com>> wrote:
>>
>> >
>>
>> > Hi Yuki,
>>
>> >
>>
>> > I have added cassandra docs for CQL syntax that we are adding
>>
>> > and how to get started with using mTLS authenticators along
>>
>> > with the migration plan. Please review it and let me know if
>>
>> > it looks good.
>>
>> >
>>
>> > Thanks,
>>
>> > Jyothsna Konisa.
>>
>> >
>>
>> > On Wed, Jun 21, 2023 at 10:46 AM Jyothsna Konisa
>>
>> > <jyothsna1503@gmail.com <ma...@gmail.com>> wrote:
>>
>> >
>>
>> > Hi Yuki!
>>
>> >
>>
>> > Thanks for the questions.
>>
>> >
>>
>> > Here are the steps for the initial setup.
>>
>> >
>>
>> > 1. Since only super users can add/remove identities from
>>
>> > the `identity_to_roles` table, operators should use that
>>
>> > role to add authorized identities to the table. Note that
>>
>> > the authenticator is not an mTLS authenticator yet.
>>
>> > EX: ADD IDENTITY
>>
>> > 'spiffe://testdomain.com/testIdentifier/testValue
>>
>> > <
>> https://urldefense.com/v3/__http://testdomain.com/testIdentifier/testValue__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLwxgTEHUA$>'
>> TO ROLE 'read_only_user'
>>
>> >
>>
>> > 2. Change authenticator configuration in cassandra.yaml to
>>
>> > use mTLS authenticator
>>
>> > EX: authenticator:
>>
>> > class_name
>> :org.apache.cassandra.auth.MutualTlsAuthenticator
>>
>> > parameters :
>>
>> > validator_class_name:
>>
>> > org.apache.cassandra.auth.SpiffeCertificateValidator
>>
>> > 3. Restart the cluster so that newly configured mTLS
>>
>> > authenticator is used
>>
>> >
>>
>> > What will be the op's first step to set up the roles and
>>
>> > identities?
>>
>> > -> Yes, the op should set up roles & identities first.
>>
>> >
>>
>> > Is default cassandra / cassandra superuser login still
>>
>> > required to set up other roles and identities?
>>
>> > -> When transitioning from a password based to mTLS based
>>
>> > authenticators, yes superuser login is required to add
>>
>> > identities, as only super users can add them. However when
>>
>> > a cluster is using mTLS based authenticator, the super
>>
>> > user will be associated with some certificate identity and
>>
>> > hence we don't need password based cassandra super user
>> login.
>>
>> >
>>
>> > If initial cassandra super user login is required, does
>>
>> > that mean super users and "cassandra '' superuser bypass
>>
>> > mTLS check?
>>
>> > -> No, while adding identities to the roles table in step1
>>
>> > the authenticator will not be an mTLS authenticator. Once
>>
>> > the identities are added and the authenticator is
>>
>> > configured, even super users have to go through an mTLS
>>
>> > check during connection.
>>
>> >
>>
>> >
>>
>> > Regarding migration
>>
>> >
>>
>> > I *think* you need to first use
>>
>> > MutualTlsWithPasswordFallbackAuthenticator so the current
>>
>> > roles can login with their password,
>>
>> > and eventually the admin sets up identity and then can
>>
>> > switch to mTLS auth.
>>
>> > Is this the expected way for migration?
>>
>> > -> Yes you can do that or else we can add identities with
>>
>> > password based login and then change the authenticator to
>>
>> > be mTLS authenticator.
>>
>> >
>>
>> > I think a thorough documentation for this new feature
>>
>> > including new CQL syntax, setting up and migration would
>>
>> > be greatly appreciated.
>>
>> > -> I have added documentation for the authenticators,
>>
>> > cqlsh commands in the Javadocs in the source code. Maybe I
>>
>> > will add the setup process & migration process in the
>>
>> > Javadocs, does this sound good?
>>
>> >
>>
>> > Thanks,
>>
>> > Jyothsna Konisa.
>>
>> >
>>
>> > On Tue, Jun 20, 2023 at 11:33 PM Yuki Morishita
>>
>> > <mor.yuki@gmail.com <ma...@gmail.com>> wrote:
>>
>> >
>>
>> > Hi Jyothsna,
>>
>> >
>>
>> > Thanks, sorry I have additional questions regarding
>>
>> > set up and migration:
>>
>> >
>>
>> > * Initial set up
>>
>> >
>>
>> > Say, you are building the brand new cassandra cluster
>>
>> > with
>>
>> >
>>
>> > authenticator:
>>
>> > class_name
>>
>> > :org.apache.cassandra.auth.MutualTlsAuthenticator
>>
>> > parameters :
>>
>> > validator_class_name:
>>
>> > org.apache.cassandra.auth.SpiffeCertificateValidator
>>
>> >
>>
>> > What will be the op's first step to set up the roles
>>
>> > and identities?
>>
>> > Is default cassandra / cassandra super user login
>>
>> > still required to set up other roles and identities?
>>
>> > If initial cassandra super user login is required,
>>
>> > does that mean super users and "cassandra" superuser
>>
>> > bypass mTLS check?
>>
>> >
>>
>> > * Migration
>>
>> >
>>
>> > If you are currently using PasswordAuthenticator and
>>
>> > would like to migrate to mTLS authentication:
>>
>> >
>>
>> > I *think* you need to first use
>>
>> > MutualTlsWithPasswordFallbackAuthenticator so the
>>
>> > current roles can login with their password,
>>
>> > and eventually the admin sets up identity and then can
>>
>> > switch to mTLS auth.
>>
>> > Is this the expected way for migration?
>>
>> >
>>
>> > I think a thorough documentation for this new feature
>>
>> > including new CQL syntax, setting up and migration
>>
>> > would be greatly appreciated.
>>
>> >
>>
>> >
>>
>> > On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa
>>
>> > <jyothsna1503@gmail.com
>>
>> > <ma...@gmail.com>> wrote:
>>
>> >
>>
>> > Hi Yuki,
>>
>> >
>>
>> > Sorry I missed answering your other question in
>>
>> > the above reply. Regarding checking what
>>
>> > identities are associated with a given role, one
>>
>> > can make a query to list identities for a given
>>
>> > role to the table. Also note that, addition or
>>
>> > removal of identities from the table can only be
>>
>> > performed by the super user only. Not even
>>
>> > read-write users can perform modifications to the
>>
>> > table.
>>
>> >
>>
>> > Also, If others have no concerns regarding this
>>
>> > patch, can we move forward with the merge? or do
>>
>> > we need voting on this one?
>>
>> >
>>
>> > Thanks,
>>
>> > Jyothsna Konisa.
>>
>> >
>>
>> >
>>
>> > On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa
>>
>> > <jyothsna1503@gmail.com
>>
>> > <ma...@gmail.com>> wrote:
>>
>> >
>>
>> > Hi Yuki,
>>
>> > You are right regarding adding a custom
>>
>> > validator. If one wants to implement a CN
>>
>> > based validator, they can do that and
>>
>> > configure that validator in Cassandra.yaml in
>>
>> > "authenticator.parameters.validator_class_name".
>>
>> >
>>
>> > Regarding a role having multiple identities,
>>
>> > yes a role can have multiple identities
>>
>> > associated with it. For example, there can be
>>
>> > several read_only users for a given cluster,
>>
>> > so the role `readonly_user` can be associated
>>
>> > with multiple identities.
>>
>> >
>>
>> > Regarding the uniqueness of identity, each
>>
>> > identity should be associated with only one
>>
>> > role. For example, a single identity can not
>>
>> > be both admin user and a read only user.
>>
>> >
>>
>> > We have ensured this by carefully designing
>>
>> > the schema of the new table for storing
>>
>> > identity information by making identity as the
>>
>> > primary key which guarantees that each
>>
>> > identity is unique and the same role can have
>>
>> > multiple identities.
>>
>> >
>>
>> > Thanks,
>>
>> > Jyothsna Konisa.
>>
>> >
>>
>> > On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita
>>
>> > <mor.yuki@gmail.com
>>
>> > <ma...@gmail.com>> wrote:
>>
>> >
>>
>> > HI,
>>
>> >
>>
>> > I was discussing with users the other day
>>
>> > regarding a similar feature.
>>
>> > They were thinking of implementing the
>>
>> > custom Authenticator similar to what MySQL
>>
>> > offers:
>>
>> >
>>
>> > CREATE USER 'jeffrey'@'localhost'
>>
>> > REQUIRE SUBJECT
>>
>> > '/C=SE/ST=Stockholm/L=Stockholm/
>>
>> > O=MySQL demo client certificate/
>>
>> >
>>
>> > CN=client/emailAddress=client@example.com
>>
>> > <ma...@example.com>';
>>
>> >
>>
>> > (
>> https://urldefense.com/v3/__https://dev.mysql.com/doc/refman/8.0/en/create-user.html*create-user-tls__;Iw!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD2-XpOdC$
>> <
>> https://urldefense.com/v3/__https://dev.mysql.com/doc/refman/8.0/en/create-user.html*create-user-tls__;Iw!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLyaE8NW0A$
>> >)
>>
>> >
>>
>> > I think they can implement a custom
>>
>> > Validator that validates the identity (for
>>
>> > their case, CN) associated with a role
>>
>> > using the certificate's subject, so that's
>>
>> > great!
>>
>> >
>>
>> > Regarding new CQL syntax,
>>
>> >
>>
>> > > ADD IDENTITY 'testIdentity' TO ROLE
>>
>> > 'testRole';
>>
>> > > DROP IDENTITY 'testIdentity';
>>
>> >
>>
>> > This means a role can have multiple
>>
>> > identities, and each identities must be
>>
>> > unique?
>>
>> > How can users check what identities are
>>
>> > associated with certain roles?
>>
>> >
>>
>> >
>>
>> > On Sun, Jun 18, 2023 at 12:15 AM Dinesh
>>
>> > Joshi <djoshi@apache.org
>>
>> > <ma...@apache.org>> wrote:
>>
>> >
>>
>> > Folks, any feedback here?
>>
>> >
>>
>> > On 6/15/23 12:46, Jyothsna Konisa wrote:
>>
>> > > Hi Everyone!
>>
>> > >
>>
>> > > We are adding the following CQL
>>
>> > queries in this patch for adding and
>>
>> > dropping identities in the new
>>
>> > `system_auth.identity_to_role` table.
>>
>> > >
>>
>> > > ADD IDENTITY 'testIdentity' TO ROLE
>>
>> > 'testRole';
>>
>> > > DROP IDENTITY 'testIdentity';
>>
>> > >
>>
>> > > Please let us know if anyone has any
>>
>> > concerns!
>>
>> > >
>>
>> > > Thanks,
>>
>> > > Jyothsna Konisa.
>>
>> > >
>>
>> > >
>>
>> > > On Sat, Jun 3, 2023 at 7:18 AM Derek
>>
>> > Chen-Becker <derek@chen-becker.org
>>
>> > <ma...@chen-becker.org>
>>
>> > > <mailto:derek@chen-becker.org
>>
>> > <ma...@chen-becker.org>>> wrote:
>>
>> > >
>>
>> > > Sounds great, thanks for the
>>
>> > clarification!
>>
>> > >
>>
>> > > Cheers,
>>
>> > >
>>
>> > > Derek
>>
>> > >
>>
>> > > On Sat, Jun 3, 2023 at 12:48 AM
>>
>> > Dinesh Joshi <djoshi@apache.org
>>
>> > <ma...@apache.org>
>>
>> > > <mailto:djoshi@apache.org
>>
>> > <ma...@apache.org>>> wrote:
>>
>> > >
>>
>> > >> On Jun 2, 2023, at 9:06 PM,
>>
>> > Derek Chen-Becker
>>
>> > >> <derek@chen-becker.org
>>
>> > <ma...@chen-becker.org>
>>
>> > <mailto:derek@chen-becker.org
>>
>> > <ma...@chen-becker.org>>> wrote:
>>
>> > >>
>>
>> > >> This certainly looks like a
>>
>> > nice addition to the operator's
>>
>> > >> tools for securing cluster
>>
>> > access. Out of curiosity, is there
>>
>> > >> anything in this work that
>>
>> > would *preclude* a different
>>
>> > >> authentication scheme for
>>
>> > internode at some point in the
>>
>> > >> future? Has there ever been
>>
>> > discussion of pluggability similar
>>
>> > >> to the client protocol?
>>
>> > >
>>
>> > > This is a pluggable
>>
>> > implementation so it's not mandatory
>>
>> > to use
>>
>> > > it and doesn't preclude one
>>
>> > from using a different mechanism in
>>
>> > > the future. We haven't
>>
>> > explicitly discussed pluggability i.e.
>>
>> > > part of protocol negotiation
>>
>> > in the past for internode
>>
>> > > connections. However, this
>>
>> > work also does not preclude us from
>>
>> > > implementing such changes.
>>
>> > If we do add negotiation this could
>>
>> > > be one of the authentication
>>
>> > mechanisms. So it would be
>>
>> > > complimentary.
>>
>> > >
>>
>> > >
>>
>> > >> Also, am I correct in
>>
>> > understanding that this would allow for
>>
>> > >> multiple certificates for
>>
>> > the same identity (e.g. distinct
>>
>> > >> cert per node)? I certainly
>>
>> > understand the decision to keep
>>
>> > >> things simple and have all
>>
>> > nodes share identity from the
>>
>> > >> perspective of operational
>>
>> > simplicity, but I also don't want
>>
>> > >> to get in a situation where
>>
>> > a single compromised node would
>>
>> > >> require an invalidation and
>>
>> > redeployment on all nodes in the
>>
>> > >> cluster.
>>
>> > >
>>
>> > > I don't recommend all nodes
>>
>> > share the same certificate. Each
>>
>> > > node in the cluster should
>>
>> > obtain a unique certificate with the
>>
>> > > same SPIFFE. In the event a
>>
>> > node is compromised, the operator
>>
>> > > can revoke that node's
>>
>> > certificate without having to redeploy
>> to
>>
>> > > all nodes in the cluster.
>>
>> > >
>>
>> > > thanks,
>>
>> > >
>>
>> > > Dinesh
>>
>> > >
>>
>> > >
>>
>> > >
>>
>> > > --
>>
>> > >
>>
>> >
>> +---------------------------------------------------------------+
>>
>> > > | Derek Chen-Becker
>>
>> > |
>>
>> > > | GPG Key available at
>>
>> >
>> https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD0yQ6GLo$
>>
>> > <
>> https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzc9mLgPA$
>> >
>>
>> > > <
>> https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD0yQ6GLo$
>>
>> > <
>> https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzc9mLgPA$>>and
>> |
>>
>> > > |
>>
>> >
>> https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD8al-xmr$
>> <
>> https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzUrXA0Zg$
>> >
>>
>> > >
>>
>> > <
>> https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD8al-xmr$
>> <
>> https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzUrXA0Zg$>>
>> |
>>
>> > > | Fngrprnt: EB8A 6480 F0A3 C8EB
>>
>> > C1E7 7F42 AFC5 AFEE 96E4 6ACC |
>>
>> > >
>>
>> >
>> +---------------------------------------------------------------+
>>
>> > >
>>
>> >
>>
>>
>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Jeremiah Jordan <je...@datastax.com>.
I don’t think users necessarily need to be able to update their own
identities. I just don’t want to have to use the super user role. The
super user role has all power over all things in the data base. I don’t
want to have to give that much power to the person who manages identities,
I just want to give them the power to manage identities.
Jeremiah Jordan
e. jeremiah@datastax.com
w. www.datastax.com
On Jun 30, 2023 at 1:35:41 PM, Dinesh Joshi <dj...@apache.org> wrote:
> Yuki, Jeremiah both are fair points. The mental model we're using for
> mTLS authentication is slightly different.
>
> In your model you're treating the TLS identity itself to be similar to
> the password. The password is the 'shared secret' that currently needs
> to be rotated by the user that owns the account therefore necessitating
> the permission to update their password. But that is not the case with
> TLS certificates and mTLS identities.
>
> The model we're going for is different. The identity is provisioned for
> an account by a super user. This is more locked down and the user can
> still rotate their own certificates but not change the identity
> associated with their account without a super user.
>
> Once provisioned, a user does not need rotate the identity itself. They
> only need to obtain fresh certificates as their certificates near
> expiry. This requires no updates on the database unlike passwords.
>
> We could extend this functionality in the future to allow users to
> change their own identity. Nothing here prevents that.
>
> thanks,
>
> Dinesh
>
>
>
> On 6/29/23 08:16, Jeremiah Jordan wrote:
>
> I like the idea of extending CREATE ROLE rather than adding a brand new
>
> ADD IDENTITY syntax. Not sure how that can line up with one to many
>
> relationships for an identity, but maybe that can just be done through
>
> role hierarchy?
>
>
> In either case, I don’t think IDENTITY related operations should be tied
>
> to the super user flag. They should be tied to either existing role
>
> permissions, or a brand new permissions about IDENTITY. We should not
>
> require that end users give the account allowed to make IDENTITY changes
>
> super user permission to do what ever they want across the whole database.
>
>
> On Jun 28, 2023 at 11:48:02 PM, Yuki Morishita <mor.yuki@gmail.com
>
> <ma...@gmail.com>> wrote:
>
> > Thinking more about "CREATE ROLE" permission, if we can extend CREATE
>
> > ROLE/ALTER ROLE statements, it may look streamlined:
>
> >
>
> > I don't have the good example, but something like:
>
> > ```
>
> > CREATE ROLE dev WITH LOGIN = true AND IDENTITIES = {'spiffe://xxx'};
>
> > ALTER ROLE dev ADD IDENTITY 'xxx';
>
> > LIST ROLES;
>
> > ```
>
> >
>
> > This requires a role to identities table as well as the current
>
> > identity to role table though.
>
> >
>
> > On Thu, Jun 29, 2023 at 12:34 PM Yuki Morishita <mor.yuki@gmail.com
>
> > <ma...@gmail.com>> wrote:
>
> >
>
> > Hi Jyothsna,
>
> >
>
> > I think for the *initial* commit, the description looks fine to me.
>
> > I'd like to see/contribute to the future improvement though:
>
> >
>
> > * ADD IDENTITY requires SUPERUSER, this means that the brand new
>
> > cluster needs to start with
>
> > PasswordAuthenticator/CassandraAuthorizer first, and then change
>
> > to mTLS one.
>
> > * For this, I'd really like to see Cassandra use password
>
> > authn and authz by default.
>
> > * Cassandra allows the user with "CREATE ROLE" permission to
>
> > create roles without superuser privilege. Maybe it is natural to
>
> > allow them to add identities also?
>
> >
>
> >
>
> > On Thu, Jun 29, 2023 at 7:35 AM Jyothsna Konisa
>
> > <jyothsna1503@gmail.com <ma...@gmail.com>> wrote:
>
> >
>
> > Hi Yuki,
>
> >
>
> > I have added cassandra docs for CQL syntax that we are adding
>
> > and how to get started with using mTLS authenticators along
>
> > with the migration plan. Please review it and let me know if
>
> > it looks good.
>
> >
>
> > Thanks,
>
> > Jyothsna Konisa.
>
> >
>
> > On Wed, Jun 21, 2023 at 10:46 AM Jyothsna Konisa
>
> > <jyothsna1503@gmail.com <ma...@gmail.com>> wrote:
>
> >
>
> > Hi Yuki!
>
> >
>
> > Thanks for the questions.
>
> >
>
> > Here are the steps for the initial setup.
>
> >
>
> > 1. Since only super users can add/remove identities from
>
> > the `identity_to_roles` table, operators should use that
>
> > role to add authorized identities to the table. Note that
>
> > the authenticator is not an mTLS authenticator yet.
>
> > EX: ADD IDENTITY
>
> > 'spiffe://testdomain.com/testIdentifier/testValue
>
> > <
> https://urldefense.com/v3/__http://testdomain.com/testIdentifier/testValue__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLwxgTEHUA$>'
> TO ROLE 'read_only_user'
>
> >
>
> > 2. Change authenticator configuration in cassandra.yaml to
>
> > use mTLS authenticator
>
> > EX: authenticator:
>
> > class_name
> :org.apache.cassandra.auth.MutualTlsAuthenticator
>
> > parameters :
>
> > validator_class_name:
>
> > org.apache.cassandra.auth.SpiffeCertificateValidator
>
> > 3. Restart the cluster so that newly configured mTLS
>
> > authenticator is used
>
> >
>
> > What will be the op's first step to set up the roles and
>
> > identities?
>
> > -> Yes, the op should set up roles & identities first.
>
> >
>
> > Is default cassandra / cassandra superuser login still
>
> > required to set up other roles and identities?
>
> > -> When transitioning from a password based to mTLS based
>
> > authenticators, yes superuser login is required to add
>
> > identities, as only super users can add them. However when
>
> > a cluster is using mTLS based authenticator, the super
>
> > user will be associated with some certificate identity and
>
> > hence we don't need password based cassandra super user
> login.
>
> >
>
> > If initial cassandra super user login is required, does
>
> > that mean super users and "cassandra '' superuser bypass
>
> > mTLS check?
>
> > -> No, while adding identities to the roles table in step1
>
> > the authenticator will not be an mTLS authenticator. Once
>
> > the identities are added and the authenticator is
>
> > configured, even super users have to go through an mTLS
>
> > check during connection.
>
> >
>
> >
>
> > Regarding migration
>
> >
>
> > I *think* you need to first use
>
> > MutualTlsWithPasswordFallbackAuthenticator so the current
>
> > roles can login with their password,
>
> > and eventually the admin sets up identity and then can
>
> > switch to mTLS auth.
>
> > Is this the expected way for migration?
>
> > -> Yes you can do that or else we can add identities with
>
> > password based login and then change the authenticator to
>
> > be mTLS authenticator.
>
> >
>
> > I think a thorough documentation for this new feature
>
> > including new CQL syntax, setting up and migration would
>
> > be greatly appreciated.
>
> > -> I have added documentation for the authenticators,
>
> > cqlsh commands in the Javadocs in the source code. Maybe I
>
> > will add the setup process & migration process in the
>
> > Javadocs, does this sound good?
>
> >
>
> > Thanks,
>
> > Jyothsna Konisa.
>
> >
>
> > On Tue, Jun 20, 2023 at 11:33 PM Yuki Morishita
>
> > <mor.yuki@gmail.com <ma...@gmail.com>> wrote:
>
> >
>
> > Hi Jyothsna,
>
> >
>
> > Thanks, sorry I have additional questions regarding
>
> > set up and migration:
>
> >
>
> > * Initial set up
>
> >
>
> > Say, you are building the brand new cassandra cluster
>
> > with
>
> >
>
> > authenticator:
>
> > class_name
>
> > :org.apache.cassandra.auth.MutualTlsAuthenticator
>
> > parameters :
>
> > validator_class_name:
>
> > org.apache.cassandra.auth.SpiffeCertificateValidator
>
> >
>
> > What will be the op's first step to set up the roles
>
> > and identities?
>
> > Is default cassandra / cassandra super user login
>
> > still required to set up other roles and identities?
>
> > If initial cassandra super user login is required,
>
> > does that mean super users and "cassandra" superuser
>
> > bypass mTLS check?
>
> >
>
> > * Migration
>
> >
>
> > If you are currently using PasswordAuthenticator and
>
> > would like to migrate to mTLS authentication:
>
> >
>
> > I *think* you need to first use
>
> > MutualTlsWithPasswordFallbackAuthenticator so the
>
> > current roles can login with their password,
>
> > and eventually the admin sets up identity and then can
>
> > switch to mTLS auth.
>
> > Is this the expected way for migration?
>
> >
>
> > I think a thorough documentation for this new feature
>
> > including new CQL syntax, setting up and migration
>
> > would be greatly appreciated.
>
> >
>
> >
>
> > On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa
>
> > <jyothsna1503@gmail.com
>
> > <ma...@gmail.com>> wrote:
>
> >
>
> > Hi Yuki,
>
> >
>
> > Sorry I missed answering your other question in
>
> > the above reply. Regarding checking what
>
> > identities are associated with a given role, one
>
> > can make a query to list identities for a given
>
> > role to the table. Also note that, addition or
>
> > removal of identities from the table can only be
>
> > performed by the super user only. Not even
>
> > read-write users can perform modifications to the
>
> > table.
>
> >
>
> > Also, If others have no concerns regarding this
>
> > patch, can we move forward with the merge? or do
>
> > we need voting on this one?
>
> >
>
> > Thanks,
>
> > Jyothsna Konisa.
>
> >
>
> >
>
> > On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa
>
> > <jyothsna1503@gmail.com
>
> > <ma...@gmail.com>> wrote:
>
> >
>
> > Hi Yuki,
>
> > You are right regarding adding a custom
>
> > validator. If one wants to implement a CN
>
> > based validator, they can do that and
>
> > configure that validator in Cassandra.yaml in
>
> > "authenticator.parameters.validator_class_name".
>
> >
>
> > Regarding a role having multiple identities,
>
> > yes a role can have multiple identities
>
> > associated with it. For example, there can be
>
> > several read_only users for a given cluster,
>
> > so the role `readonly_user` can be associated
>
> > with multiple identities.
>
> >
>
> > Regarding the uniqueness of identity, each
>
> > identity should be associated with only one
>
> > role. For example, a single identity can not
>
> > be both admin user and a read only user.
>
> >
>
> > We have ensured this by carefully designing
>
> > the schema of the new table for storing
>
> > identity information by making identity as the
>
> > primary key which guarantees that each
>
> > identity is unique and the same role can have
>
> > multiple identities.
>
> >
>
> > Thanks,
>
> > Jyothsna Konisa.
>
> >
>
> > On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita
>
> > <mor.yuki@gmail.com
>
> > <ma...@gmail.com>> wrote:
>
> >
>
> > HI,
>
> >
>
> > I was discussing with users the other day
>
> > regarding a similar feature.
>
> > They were thinking of implementing the
>
> > custom Authenticator similar to what MySQL
>
> > offers:
>
> >
>
> > CREATE USER 'jeffrey'@'localhost'
>
> > REQUIRE SUBJECT
>
> > '/C=SE/ST=Stockholm/L=Stockholm/
>
> > O=MySQL demo client certificate/
>
> >
>
> > CN=client/emailAddress=client@example.com
>
> > <ma...@example.com>';
>
> >
>
> > (
> https://urldefense.com/v3/__https://dev.mysql.com/doc/refman/8.0/en/create-user.html*create-user-tls__;Iw!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD2-XpOdC$
> <
> https://urldefense.com/v3/__https://dev.mysql.com/doc/refman/8.0/en/create-user.html*create-user-tls__;Iw!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLyaE8NW0A$
> >)
>
> >
>
> > I think they can implement a custom
>
> > Validator that validates the identity (for
>
> > their case, CN) associated with a role
>
> > using the certificate's subject, so that's
>
> > great!
>
> >
>
> > Regarding new CQL syntax,
>
> >
>
> > > ADD IDENTITY 'testIdentity' TO ROLE
>
> > 'testRole';
>
> > > DROP IDENTITY 'testIdentity';
>
> >
>
> > This means a role can have multiple
>
> > identities, and each identities must be
>
> > unique?
>
> > How can users check what identities are
>
> > associated with certain roles?
>
> >
>
> >
>
> > On Sun, Jun 18, 2023 at 12:15 AM Dinesh
>
> > Joshi <djoshi@apache.org
>
> > <ma...@apache.org>> wrote:
>
> >
>
> > Folks, any feedback here?
>
> >
>
> > On 6/15/23 12:46, Jyothsna Konisa wrote:
>
> > > Hi Everyone!
>
> > >
>
> > > We are adding the following CQL
>
> > queries in this patch for adding and
>
> > dropping identities in the new
>
> > `system_auth.identity_to_role` table.
>
> > >
>
> > > ADD IDENTITY 'testIdentity' TO ROLE
>
> > 'testRole';
>
> > > DROP IDENTITY 'testIdentity';
>
> > >
>
> > > Please let us know if anyone has any
>
> > concerns!
>
> > >
>
> > > Thanks,
>
> > > Jyothsna Konisa.
>
> > >
>
> > >
>
> > > On Sat, Jun 3, 2023 at 7:18 AM Derek
>
> > Chen-Becker <derek@chen-becker.org
>
> > <ma...@chen-becker.org>
>
> > > <mailto:derek@chen-becker.org
>
> > <ma...@chen-becker.org>>> wrote:
>
> > >
>
> > > Sounds great, thanks for the
>
> > clarification!
>
> > >
>
> > > Cheers,
>
> > >
>
> > > Derek
>
> > >
>
> > > On Sat, Jun 3, 2023 at 12:48 AM
>
> > Dinesh Joshi <djoshi@apache.org
>
> > <ma...@apache.org>
>
> > > <mailto:djoshi@apache.org
>
> > <ma...@apache.org>>> wrote:
>
> > >
>
> > >> On Jun 2, 2023, at 9:06 PM,
>
> > Derek Chen-Becker
>
> > >> <derek@chen-becker.org
>
> > <ma...@chen-becker.org>
>
> > <mailto:derek@chen-becker.org
>
> > <ma...@chen-becker.org>>> wrote:
>
> > >>
>
> > >> This certainly looks like a
>
> > nice addition to the operator's
>
> > >> tools for securing cluster
>
> > access. Out of curiosity, is there
>
> > >> anything in this work that
>
> > would *preclude* a different
>
> > >> authentication scheme for
>
> > internode at some point in the
>
> > >> future? Has there ever been
>
> > discussion of pluggability similar
>
> > >> to the client protocol?
>
> > >
>
> > > This is a pluggable
>
> > implementation so it's not mandatory
>
> > to use
>
> > > it and doesn't preclude one
>
> > from using a different mechanism in
>
> > > the future. We haven't
>
> > explicitly discussed pluggability i.e.
>
> > > part of protocol negotiation
>
> > in the past for internode
>
> > > connections. However, this
>
> > work also does not preclude us from
>
> > > implementing such changes.
>
> > If we do add negotiation this could
>
> > > be one of the authentication
>
> > mechanisms. So it would be
>
> > > complimentary.
>
> > >
>
> > >
>
> > >> Also, am I correct in
>
> > understanding that this would allow for
>
> > >> multiple certificates for
>
> > the same identity (e.g. distinct
>
> > >> cert per node)? I certainly
>
> > understand the decision to keep
>
> > >> things simple and have all
>
> > nodes share identity from the
>
> > >> perspective of operational
>
> > simplicity, but I also don't want
>
> > >> to get in a situation where
>
> > a single compromised node would
>
> > >> require an invalidation and
>
> > redeployment on all nodes in the
>
> > >> cluster.
>
> > >
>
> > > I don't recommend all nodes
>
> > share the same certificate. Each
>
> > > node in the cluster should
>
> > obtain a unique certificate with the
>
> > > same SPIFFE. In the event a
>
> > node is compromised, the operator
>
> > > can revoke that node's
>
> > certificate without having to redeploy to
>
> > > all nodes in the cluster.
>
> > >
>
> > > thanks,
>
> > >
>
> > > Dinesh
>
> > >
>
> > >
>
> > >
>
> > > --
>
> > >
>
> >
> +---------------------------------------------------------------+
>
> > > | Derek Chen-Becker
>
> > |
>
> > > | GPG Key available at
>
> >
> https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD0yQ6GLo$
>
> > <
> https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzc9mLgPA$
> >
>
> > > <
> https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD0yQ6GLo$
>
> > <
> https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzc9mLgPA$>>and
> |
>
> > > |
>
> >
> https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD8al-xmr$
> <
> https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzUrXA0Zg$
> >
>
> > >
>
> > <
> https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!cDEDWVGjPSrF-8uo85vvzwyJNKT_LUJeFgNpMs_-8JzHZV7TVTU8XrYNZ2cFrT7RSQ8EyDjMD8al-xmr$
> <
> https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzUrXA0Zg$>>
> |
>
> > > | Fngrprnt: EB8A 6480 F0A3 C8EB
>
> > C1E7 7F42 AFC5 AFEE 96E4 6ACC |
>
> > >
>
> >
> +---------------------------------------------------------------+
>
> > >
>
> >
>
>
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
Yuki, Jeremiah both are fair points. The mental model we're using for
mTLS authentication is slightly different.
In your model you're treating the TLS identity itself to be similar to
the password. The password is the 'shared secret' that currently needs
to be rotated by the user that owns the account therefore necessitating
the permission to update their password. But that is not the case with
TLS certificates and mTLS identities.
The model we're going for is different. The identity is provisioned for
an account by a super user. This is more locked down and the user can
still rotate their own certificates but not change the identity
associated with their account without a super user.
Once provisioned, a user does not need rotate the identity itself. They
only need to obtain fresh certificates as their certificates near
expiry. This requires no updates on the database unlike passwords.
We could extend this functionality in the future to allow users to
change their own identity. Nothing here prevents that.
thanks,
Dinesh
On 6/29/23 08:16, Jeremiah Jordan wrote:
> I like the idea of extending CREATE ROLE rather than adding a brand new
> ADD IDENTITY syntax. Not sure how that can line up with one to many
> relationships for an identity, but maybe that can just be done through
> role hierarchy?
>
> In either case, I don’t think IDENTITY related operations should be tied
> to the super user flag. They should be tied to either existing role
> permissions, or a brand new permissions about IDENTITY. We should not
> require that end users give the account allowed to make IDENTITY changes
> super user permission to do what ever they want across the whole database.
>
> On Jun 28, 2023 at 11:48:02 PM, Yuki Morishita <mor.yuki@gmail.com
> <ma...@gmail.com>> wrote:
>> Thinking more about "CREATE ROLE" permission, if we can extend CREATE
>> ROLE/ALTER ROLE statements, it may look streamlined:
>>
>> I don't have the good example, but something like:
>> ```
>> CREATE ROLE dev WITH LOGIN = true AND IDENTITIES = {'spiffe://xxx'};
>> ALTER ROLE dev ADD IDENTITY 'xxx';
>> LIST ROLES;
>> ```
>>
>> This requires a role to identities table as well as the current
>> identity to role table though.
>>
>> On Thu, Jun 29, 2023 at 12:34 PM Yuki Morishita <mor.yuki@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>> Hi Jyothsna,
>>
>> I think for the *initial* commit, the description looks fine to me.
>> I'd like to see/contribute to the future improvement though:
>>
>> * ADD IDENTITY requires SUPERUSER, this means that the brand new
>> cluster needs to start with
>> PasswordAuthenticator/CassandraAuthorizer first, and then change
>> to mTLS one.
>> * For this, I'd really like to see Cassandra use password
>> authn and authz by default.
>> * Cassandra allows the user with "CREATE ROLE" permission to
>> create roles without superuser privilege. Maybe it is natural to
>> allow them to add identities also?
>>
>>
>> On Thu, Jun 29, 2023 at 7:35 AM Jyothsna Konisa
>> <jyothsna1503@gmail.com <ma...@gmail.com>> wrote:
>>
>> Hi Yuki,
>>
>> I have added cassandra docs for CQL syntax that we are adding
>> and how to get started with using mTLS authenticators along
>> with the migration plan. Please review it and let me know if
>> it looks good.
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>> On Wed, Jun 21, 2023 at 10:46 AM Jyothsna Konisa
>> <jyothsna1503@gmail.com <ma...@gmail.com>> wrote:
>>
>> Hi Yuki!
>>
>> Thanks for the questions.
>>
>> Here are the steps for the initial setup.
>>
>> 1. Since only super users can add/remove identities from
>> the `identity_to_roles` table, operators should use that
>> role to add authorized identities to the table. Note that
>> the authenticator is not an mTLS authenticator yet.
>> EX: ADD IDENTITY
>> 'spiffe://testdomain.com/testIdentifier/testValue
>> <https://urldefense.com/v3/__http://testdomain.com/testIdentifier/testValue__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLwxgTEHUA$>' TO ROLE 'read_only_user'
>>
>> 2. Change authenticator configuration in cassandra.yaml to
>> use mTLS authenticator
>> EX: authenticator:
>> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
>> parameters :
>> validator_class_name:
>> org.apache.cassandra.auth.SpiffeCertificateValidator
>> 3. Restart the cluster so that newly configured mTLS
>> authenticator is used
>>
>> What will be the op's first step to set up the roles and
>> identities?
>> -> Yes, the op should set up roles & identities first.
>>
>> Is default cassandra / cassandra superuser login still
>> required to set up other roles and identities?
>> -> When transitioning from a password based to mTLS based
>> authenticators, yes superuser login is required to add
>> identities, as only super users can add them. However when
>> a cluster is using mTLS based authenticator, the super
>> user will be associated with some certificate identity and
>> hence we don't need password based cassandra super user login.
>>
>> If initial cassandra super user login is required, does
>> that mean super users and "cassandra '' superuser bypass
>> mTLS check?
>> -> No, while adding identities to the roles table in step1
>> the authenticator will not be an mTLS authenticator. Once
>> the identities are added and the authenticator is
>> configured, even super users have to go through an mTLS
>> check during connection.
>>
>>
>> Regarding migration
>>
>> I *think* you need to first use
>> MutualTlsWithPasswordFallbackAuthenticator so the current
>> roles can login with their password,
>> and eventually the admin sets up identity and then can
>> switch to mTLS auth.
>> Is this the expected way for migration?
>> -> Yes you can do that or else we can add identities with
>> password based login and then change the authenticator to
>> be mTLS authenticator.
>>
>> I think a thorough documentation for this new feature
>> including new CQL syntax, setting up and migration would
>> be greatly appreciated.
>> -> I have added documentation for the authenticators,
>> cqlsh commands in the Javadocs in the source code. Maybe I
>> will add the setup process & migration process in the
>> Javadocs, does this sound good?
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>> On Tue, Jun 20, 2023 at 11:33 PM Yuki Morishita
>> <mor.yuki@gmail.com <ma...@gmail.com>> wrote:
>>
>> Hi Jyothsna,
>>
>> Thanks, sorry I have additional questions regarding
>> set up and migration:
>>
>> * Initial set up
>>
>> Say, you are building the brand new cassandra cluster
>> with
>>
>> authenticator:
>> class_name
>> :org.apache.cassandra.auth.MutualTlsAuthenticator
>> parameters :
>> validator_class_name:
>> org.apache.cassandra.auth.SpiffeCertificateValidator
>>
>> What will be the op's first step to set up the roles
>> and identities?
>> Is default cassandra / cassandra super user login
>> still required to set up other roles and identities?
>> If initial cassandra super user login is required,
>> does that mean super users and "cassandra" superuser
>> bypass mTLS check?
>>
>> * Migration
>>
>> If you are currently using PasswordAuthenticator and
>> would like to migrate to mTLS authentication:
>>
>> I *think* you need to first use
>> MutualTlsWithPasswordFallbackAuthenticator so the
>> current roles can login with their password,
>> and eventually the admin sets up identity and then can
>> switch to mTLS auth.
>> Is this the expected way for migration?
>>
>> I think a thorough documentation for this new feature
>> including new CQL syntax, setting up and migration
>> would be greatly appreciated.
>>
>>
>> On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa
>> <jyothsna1503@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>> Hi Yuki,
>>
>> Sorry I missed answering your other question in
>> the above reply. Regarding checking what
>> identities are associated with a given role, one
>> can make a query to list identities for a given
>> role to the table. Also note that, addition or
>> removal of identities from the table can only be
>> performed by the super user only. Not even
>> read-write users can perform modifications to the
>> table.
>>
>> Also, If others have no concerns regarding this
>> patch, can we move forward with the merge? or do
>> we need voting on this one?
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>>
>> On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa
>> <jyothsna1503@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>> Hi Yuki,
>> You are right regarding adding a custom
>> validator. If one wants to implement a CN
>> based validator, they can do that and
>> configure that validator in Cassandra.yaml in
>> "authenticator.parameters.validator_class_name".
>>
>> Regarding a role having multiple identities,
>> yes a role can have multiple identities
>> associated with it. For example, there can be
>> several read_only users for a given cluster,
>> so the role `readonly_user` can be associated
>> with multiple identities.
>>
>> Regarding the uniqueness of identity, each
>> identity should be associated with only one
>> role. For example, a single identity can not
>> be both admin user and a read only user.
>>
>> We have ensured this by carefully designing
>> the schema of the new table for storing
>> identity information by making identity as the
>> primary key which guarantees that each
>> identity is unique and the same role can have
>> multiple identities.
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>> On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita
>> <mor.yuki@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>> HI,
>>
>> I was discussing with users the other day
>> regarding a similar feature.
>> They were thinking of implementing the
>> custom Authenticator similar to what MySQL
>> offers:
>>
>> CREATE USER 'jeffrey'@'localhost'
>> REQUIRE SUBJECT
>> '/C=SE/ST=Stockholm/L=Stockholm/
>> O=MySQL demo client certificate/
>>
>> CN=client/emailAddress=client@example.com
>> <ma...@example.com>';
>>
>> (https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls <https://urldefense.com/v3/__https://dev.mysql.com/doc/refman/8.0/en/create-user.html*create-user-tls__;Iw!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLyaE8NW0A$>)
>>
>> I think they can implement a custom
>> Validator that validates the identity (for
>> their case, CN) associated with a role
>> using the certificate's subject, so that's
>> great!
>>
>> Regarding new CQL syntax,
>>
>> > ADD IDENTITY 'testIdentity' TO ROLE
>> 'testRole';
>> > DROP IDENTITY 'testIdentity';
>>
>> This means a role can have multiple
>> identities, and each identities must be
>> unique?
>> How can users check what identities are
>> associated with certain roles?
>>
>>
>> On Sun, Jun 18, 2023 at 12:15 AM Dinesh
>> Joshi <djoshi@apache.org
>> <ma...@apache.org>> wrote:
>>
>> Folks, any feedback here?
>>
>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>> > Hi Everyone!
>> >
>> > We are adding the following CQL
>> queries in this patch for adding and
>> dropping identities in the new
>> `system_auth.identity_to_role` table.
>> >
>> > ADD IDENTITY 'testIdentity' TO ROLE
>> 'testRole';
>> > DROP IDENTITY 'testIdentity';
>> >
>> > Please let us know if anyone has any
>> concerns!
>> >
>> > Thanks,
>> > Jyothsna Konisa.
>> >
>> >
>> > On Sat, Jun 3, 2023 at 7:18 AM Derek
>> Chen-Becker <derek@chen-becker.org
>> <ma...@chen-becker.org>
>> > <mailto:derek@chen-becker.org
>> <ma...@chen-becker.org>>> wrote:
>> >
>> > Sounds great, thanks for the
>> clarification!
>> >
>> > Cheers,
>> >
>> > Derek
>> >
>> > On Sat, Jun 3, 2023 at 12:48 AM
>> Dinesh Joshi <djoshi@apache.org
>> <ma...@apache.org>
>> > <mailto:djoshi@apache.org
>> <ma...@apache.org>>> wrote:
>> >
>> >> On Jun 2, 2023, at 9:06 PM,
>> Derek Chen-Becker
>> >> <derek@chen-becker.org
>> <ma...@chen-becker.org>
>> <mailto:derek@chen-becker.org
>> <ma...@chen-becker.org>>> wrote:
>> >>
>> >> This certainly looks like a
>> nice addition to the operator's
>> >> tools for securing cluster
>> access. Out of curiosity, is there
>> >> anything in this work that
>> would *preclude* a different
>> >> authentication scheme for
>> internode at some point in the
>> >> future? Has there ever been
>> discussion of pluggability similar
>> >> to the client protocol?
>> >
>> > This is a pluggable
>> implementation so it's not mandatory
>> to use
>> > it and doesn't preclude one
>> from using a different mechanism in
>> > the future. We haven't
>> explicitly discussed pluggability i.e.
>> > part of protocol negotiation
>> in the past for internode
>> > connections. However, this
>> work also does not preclude us from
>> > implementing such changes.
>> If we do add negotiation this could
>> > be one of the authentication
>> mechanisms. So it would be
>> > complimentary.
>> >
>> >
>> >> Also, am I correct in
>> understanding that this would allow for
>> >> multiple certificates for
>> the same identity (e.g. distinct
>> >> cert per node)? I certainly
>> understand the decision to keep
>> >> things simple and have all
>> nodes share identity from the
>> >> perspective of operational
>> simplicity, but I also don't want
>> >> to get in a situation where
>> a single compromised node would
>> >> require an invalidation and
>> redeployment on all nodes in the
>> >> cluster.
>> >
>> > I don't recommend all nodes
>> share the same certificate. Each
>> > node in the cluster should
>> obtain a unique certificate with the
>> > same SPIFFE. In the event a
>> node is compromised, the operator
>> > can revoke that node's
>> certificate without having to redeploy to
>> > all nodes in the cluster.
>> >
>> > thanks,
>> >
>> > Dinesh
>> >
>> >
>> >
>> > --
>> >
>> +---------------------------------------------------------------+
>> > | Derek Chen-Becker
>> |
>> > | GPG Key available at
>> https://keybase.io/dchenbecker
>> <https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzc9mLgPA$>
>> > <https://keybase.io/dchenbecker
>> <https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzc9mLgPA$>>and |
>> > |
>> https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org <https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzUrXA0Zg$>
>> >
>> <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org <https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzUrXA0Zg$>> |
>> > | Fngrprnt: EB8A 6480 F0A3 C8EB
>> C1E7 7F42 AFC5 AFEE 96E4 6ACC |
>> >
>> +---------------------------------------------------------------+
>> >
>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Jeremiah Jordan <je...@gmail.com>.
I like the idea of extending CREATE ROLE rather than adding a brand new ADD
IDENTITY syntax. Not sure how that can line up with one to many
relationships for an identity, but maybe that can just be done through role
hierarchy?
In either case, I don’t think IDENTITY related operations should be tied to
the super user flag. They should be tied to either existing role
permissions, or a brand new permissions about IDENTITY. We should not
require that end users give the account allowed to make IDENTITY changes
super user permission to do what ever they want across the whole database.
On Jun 28, 2023 at 11:48:02 PM, Yuki Morishita <mo...@gmail.com> wrote:
> Thinking more about "CREATE ROLE" permission, if we can extend CREATE
> ROLE/ALTER ROLE statements, it may look streamlined:
>
> I don't have the good example, but something like:
> ```
> CREATE ROLE dev WITH LOGIN = true AND IDENTITIES = {'spiffe://xxx'};
> ALTER ROLE dev ADD IDENTITY 'xxx';
> LIST ROLES;
> ```
>
> This requires a role to identities table as well as the current identity
> to role table though.
>
> On Thu, Jun 29, 2023 at 12:34 PM Yuki Morishita <mo...@gmail.com>
> wrote:
>
>> Hi Jyothsna,
>>
>> I think for the *initial* commit, the description looks fine to me.
>> I'd like to see/contribute to the future improvement though:
>>
>> * ADD IDENTITY requires SUPERUSER, this means that the brand new cluster
>> needs to start with PasswordAuthenticator/CassandraAuthorizer first, and
>> then change to mTLS one.
>> * For this, I'd really like to see Cassandra use password authn and
>> authz by default.
>> * Cassandra allows the user with "CREATE ROLE" permission to create
>> roles without superuser privilege. Maybe it is natural to allow them to add
>> identities also?
>>
>>
>> On Thu, Jun 29, 2023 at 7:35 AM Jyothsna Konisa <jy...@gmail.com>
>> wrote:
>>
>>> Hi Yuki,
>>>
>>> I have added cassandra docs for CQL syntax that we are adding and how to
>>> get started with using mTLS authenticators along with the migration plan.
>>> Please review it and let me know if it looks good.
>>>
>>> Thanks,
>>> Jyothsna Konisa.
>>>
>>> On Wed, Jun 21, 2023 at 10:46 AM Jyothsna Konisa <jy...@gmail.com>
>>> wrote:
>>>
>>>> Hi Yuki!
>>>>
>>>> Thanks for the questions.
>>>>
>>>> Here are the steps for the initial setup.
>>>>
>>>> 1. Since only super users can add/remove identities from the
>>>> `identity_to_roles` table, operators should use that role to add authorized
>>>> identities to the table. Note that the authenticator is not an mTLS
>>>> authenticator yet.
>>>> EX: ADD IDENTITY 'spiffe://testdomain.com/testIdentifier/testValue
>>>> <https://urldefense.com/v3/__http://testdomain.com/testIdentifier/testValue__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLwxgTEHUA$>'
>>>> TO ROLE 'read_only_user'
>>>>
>>>> 2. Change authenticator configuration in cassandra.yaml to use mTLS
>>>> authenticator
>>>> EX: authenticator:
>>>> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
>>>> parameters :
>>>> validator_class_name:
>>>> org.apache.cassandra.auth.SpiffeCertificateValidator
>>>> 3. Restart the cluster so that newly configured mTLS authenticator is
>>>> used
>>>>
>>>> What will be the op's first step to set up the roles and identities?
>>>> -> Yes, the op should set up roles & identities first.
>>>>
>>>> Is default cassandra / cassandra superuser login still required to set
>>>> up other roles and identities?
>>>> -> When transitioning from a password based to mTLS based
>>>> authenticators, yes superuser login is required to add identities, as only
>>>> super users can add them. However when a cluster is using mTLS based
>>>> authenticator, the super user will be associated with some certificate
>>>> identity and hence we don't need password based cassandra super user login.
>>>>
>>>> If initial cassandra super user login is required, does that mean super
>>>> users and "cassandra '' superuser bypass mTLS check?
>>>> -> No, while adding identities to the roles table in step1 the
>>>> authenticator will not be an mTLS authenticator. Once the identities are
>>>> added and the authenticator is configured, even super users have to go
>>>> through an mTLS check during connection.
>>>>
>>>>
>>>> Regarding migration
>>>>
>>>> I *think* you need to first use
>>>> MutualTlsWithPasswordFallbackAuthenticator so the current roles can login
>>>> with their password,
>>>> and eventually the admin sets up identity and then can switch to mTLS
>>>> auth.
>>>> Is this the expected way for migration?
>>>> -> Yes you can do that or else we can add identities with password
>>>> based login and then change the authenticator to be mTLS authenticator.
>>>>
>>>> I think a thorough documentation for this new feature including new CQL
>>>> syntax, setting up and migration would be greatly appreciated.
>>>> -> I have added documentation for the authenticators, cqlsh commands in
>>>> the Javadocs in the source code. Maybe I will add the setup process &
>>>> migration process in the Javadocs, does this sound good?
>>>>
>>>> Thanks,
>>>> Jyothsna Konisa.
>>>>
>>>> On Tue, Jun 20, 2023 at 11:33 PM Yuki Morishita <mo...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Jyothsna,
>>>>>
>>>>> Thanks, sorry I have additional questions regarding set up and
>>>>> migration:
>>>>>
>>>>> * Initial set up
>>>>>
>>>>> Say, you are building the brand new cassandra cluster with
>>>>>
>>>>> authenticator:
>>>>> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
>>>>> parameters :
>>>>> validator_class_name:
>>>>> org.apache.cassandra.auth.SpiffeCertificateValidator
>>>>>
>>>>> What will be the op's first step to set up the roles and identities?
>>>>> Is default cassandra / cassandra super user login still required to
>>>>> set up other roles and identities?
>>>>> If initial cassandra super user login is required, does that mean
>>>>> super users and "cassandra" superuser bypass mTLS check?
>>>>>
>>>>> * Migration
>>>>>
>>>>> If you are currently using PasswordAuthenticator and would like to
>>>>> migrate to mTLS authentication:
>>>>>
>>>>> I *think* you need to first use
>>>>> MutualTlsWithPasswordFallbackAuthenticator so the current roles can login
>>>>> with their password,
>>>>> and eventually the admin sets up identity and then can switch to mTLS
>>>>> auth.
>>>>> Is this the expected way for migration?
>>>>>
>>>>> I think a thorough documentation for this new feature including new
>>>>> CQL syntax, setting up and migration would be greatly appreciated.
>>>>>
>>>>>
>>>>> On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa <
>>>>> jyothsna1503@gmail.com> wrote:
>>>>>
>>>>>> Hi Yuki,
>>>>>>
>>>>>> Sorry I missed answering your other question in the above reply.
>>>>>> Regarding checking what identities are associated with a given role, one
>>>>>> can make a query to list identities for a given role to the table. Also
>>>>>> note that, addition or removal of identities from the table can only be
>>>>>> performed by the super user only. Not even read-write users can perform
>>>>>> modifications to the table.
>>>>>>
>>>>>> Also, If others have no concerns regarding this patch, can we move
>>>>>> forward with the merge? or do we need voting on this one?
>>>>>>
>>>>>> Thanks,
>>>>>> Jyothsna Konisa.
>>>>>>
>>>>>>
>>>>>> On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa <
>>>>>> jyothsna1503@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Yuki,
>>>>>>> You are right regarding adding a custom validator. If one wants to
>>>>>>> implement a CN based validator, they can do that and configure that
>>>>>>> validator in Cassandra.yaml in "authenticator.parameters.
>>>>>>> validator_class_name".
>>>>>>>
>>>>>>> Regarding a role having multiple identities, yes a role can have
>>>>>>> multiple identities associated with it. For example, there can be several
>>>>>>> read_only users for a given cluster, so the role `readonly_user` can be
>>>>>>> associated with multiple identities.
>>>>>>>
>>>>>>> Regarding the uniqueness of identity, each identity should be
>>>>>>> associated with only one role. For example, a single identity can not be
>>>>>>> both admin user and a read only user.
>>>>>>>
>>>>>>> We have ensured this by carefully designing the schema of the new
>>>>>>> table for storing identity information by making identity as the primary
>>>>>>> key which guarantees that each identity is unique and the same role can
>>>>>>> have multiple identities.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Jyothsna Konisa.
>>>>>>>
>>>>>>> On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita <mo...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> HI,
>>>>>>>>
>>>>>>>> I was discussing with users the other day regarding a similar
>>>>>>>> feature.
>>>>>>>> They were thinking of implementing the custom
>>>>>>>> Authenticator similar to what MySQL offers:
>>>>>>>>
>>>>>>>> CREATE USER 'jeffrey'@'localhost'
>>>>>>>> REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
>>>>>>>> O=MySQL demo client certificate/
>>>>>>>> CN=client/emailAddress=client@example.com';
>>>>>>>>
>>>>>>>> (
>>>>>>>> https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls
>>>>>>>> <https://urldefense.com/v3/__https://dev.mysql.com/doc/refman/8.0/en/create-user.html*create-user-tls__;Iw!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLyaE8NW0A$>
>>>>>>>> )
>>>>>>>>
>>>>>>>> I think they can implement a custom Validator that validates the
>>>>>>>> identity (for their case, CN) associated with a role using the
>>>>>>>> certificate's subject, so that's great!
>>>>>>>>
>>>>>>>> Regarding new CQL syntax,
>>>>>>>>
>>>>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>>>>> > DROP IDENTITY 'testIdentity';
>>>>>>>>
>>>>>>>> This means a role can have multiple identities, and each identities
>>>>>>>> must be unique?
>>>>>>>> How can users check what identities are associated with certain
>>>>>>>> roles?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Folks, any feedback here?
>>>>>>>>>
>>>>>>>>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>>>>>>>>> > Hi Everyone!
>>>>>>>>> >
>>>>>>>>> > We are adding the following CQL queries in this patch for adding
>>>>>>>>> and dropping identities in the new `system_auth.identity_to_role` table.
>>>>>>>>> >
>>>>>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>>>>>> > DROP IDENTITY 'testIdentity';
>>>>>>>>> >
>>>>>>>>> > Please let us know if anyone has any concerns!
>>>>>>>>> >
>>>>>>>>> > Thanks,
>>>>>>>>> > Jyothsna Konisa.
>>>>>>>>> >
>>>>>>>>> >
>>>>>>>>> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <
>>>>>>>>> derek@chen-becker.org
>>>>>>>>> > <ma...@chen-becker.org>> wrote:
>>>>>>>>> >
>>>>>>>>> > Sounds great, thanks for the clarification!
>>>>>>>>> >
>>>>>>>>> > Cheers,
>>>>>>>>> >
>>>>>>>>> > Derek
>>>>>>>>> >
>>>>>>>>> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <
>>>>>>>>> djoshi@apache.org
>>>>>>>>> > <ma...@apache.org>> wrote:
>>>>>>>>> >
>>>>>>>>> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>>>>>>>>> >> <derek@chen-becker.org <ma...@chen-becker.org>>
>>>>>>>>> wrote:
>>>>>>>>> >>
>>>>>>>>> >> This certainly looks like a nice addition to the
>>>>>>>>> operator's
>>>>>>>>> >> tools for securing cluster access. Out of curiosity, is
>>>>>>>>> there
>>>>>>>>> >> anything in this work that would *preclude* a different
>>>>>>>>> >> authentication scheme for internode at some point in the
>>>>>>>>> >> future? Has there ever been discussion of pluggability
>>>>>>>>> similar
>>>>>>>>> >> to the client protocol?
>>>>>>>>> >
>>>>>>>>> > This is a pluggable implementation so it's not mandatory
>>>>>>>>> to use
>>>>>>>>> > it and doesn't preclude one from using a different
>>>>>>>>> mechanism in
>>>>>>>>> > the future. We haven't explicitly discussed pluggability
>>>>>>>>> i.e.
>>>>>>>>> > part of protocol negotiation in the past for internode
>>>>>>>>> > connections. However, this work also does not preclude
>>>>>>>>> us from
>>>>>>>>> > implementing such changes. If we do add negotiation this
>>>>>>>>> could
>>>>>>>>> > be one of the authentication mechanisms. So it would be
>>>>>>>>> > complimentary.
>>>>>>>>> >
>>>>>>>>> >
>>>>>>>>> >> Also, am I correct in understanding that this would
>>>>>>>>> allow for
>>>>>>>>> >> multiple certificates for the same identity (e.g.
>>>>>>>>> distinct
>>>>>>>>> >> cert per node)? I certainly understand the decision to
>>>>>>>>> keep
>>>>>>>>> >> things simple and have all nodes share identity from the
>>>>>>>>> >> perspective of operational simplicity, but I also don't
>>>>>>>>> want
>>>>>>>>> >> to get in a situation where a single compromised node
>>>>>>>>> would
>>>>>>>>> >> require an invalidation and redeployment on all nodes
>>>>>>>>> in the
>>>>>>>>> >> cluster.
>>>>>>>>> >
>>>>>>>>> > I don't recommend all nodes share the same certificate.
>>>>>>>>> Each
>>>>>>>>> > node in the cluster should obtain a unique certificate
>>>>>>>>> with the
>>>>>>>>> > same SPIFFE. In the event a node is compromised, the
>>>>>>>>> operator
>>>>>>>>> > can revoke that node's certificate without having to
>>>>>>>>> redeploy to
>>>>>>>>> > all nodes in the cluster.
>>>>>>>>> >
>>>>>>>>> > thanks,
>>>>>>>>> >
>>>>>>>>> > Dinesh
>>>>>>>>> >
>>>>>>>>> >
>>>>>>>>> >
>>>>>>>>> > --
>>>>>>>>> >
>>>>>>>>> +---------------------------------------------------------------+
>>>>>>>>> > | Derek Chen-Becker
>>>>>>>>> |
>>>>>>>>> > | GPG Key available at https://keybase.io/dchenbecker
>>>>>>>>> <https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzc9mLgPA$>
>>>>>>>>> > <https://keybase.io/dchenbecker
>>>>>>>>> <https://urldefense.com/v3/__https://keybase.io/dchenbecker__;!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzc9mLgPA$>>and
>>>>>>>>> |
>>>>>>>>> > |
>>>>>>>>> https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>>>>>>>>> <https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzUrXA0Zg$>
>>>>>>>>> > <
>>>>>>>>> https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>>>>>>>>> <https://urldefense.com/v3/__https://pgp.mit.edu/pks/lookup?search=derek*40chen-becker.org__;JQ!!PbtH5S7Ebw!bc-bxD5J_z84ErqBnLngRGkogZQQF2d5tQcORTek4SaE5S_LVkzIYlLIFY73R48icK6fAwtUBLzUrXA0Zg$>>
>>>>>>>>> |
>>>>>>>>> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4
>>>>>>>>> 6ACC |
>>>>>>>>> >
>>>>>>>>> +---------------------------------------------------------------+
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Yuki Morishita <mo...@gmail.com>.
Thinking more about "CREATE ROLE" permission, if we can extend CREATE
ROLE/ALTER ROLE statements, it may look streamlined:
I don't have the good example, but something like:
```
CREATE ROLE dev WITH LOGIN = true AND IDENTITIES = {'spiffe://xxx'};
ALTER ROLE dev ADD IDENTITY 'xxx';
LIST ROLES;
```
This requires a role to identities table as well as the current identity to
role table though.
On Thu, Jun 29, 2023 at 12:34 PM Yuki Morishita <mo...@gmail.com> wrote:
> Hi Jyothsna,
>
> I think for the *initial* commit, the description looks fine to me.
> I'd like to see/contribute to the future improvement though:
>
> * ADD IDENTITY requires SUPERUSER, this means that the brand new cluster
> needs to start with PasswordAuthenticator/CassandraAuthorizer first, and
> then change to mTLS one.
> * For this, I'd really like to see Cassandra use password authn and
> authz by default.
> * Cassandra allows the user with "CREATE ROLE" permission to create
> roles without superuser privilege. Maybe it is natural to allow them to add
> identities also?
>
>
> On Thu, Jun 29, 2023 at 7:35 AM Jyothsna Konisa <jy...@gmail.com>
> wrote:
>
>> Hi Yuki,
>>
>> I have added cassandra docs for CQL syntax that we are adding and how to
>> get started with using mTLS authenticators along with the migration plan.
>> Please review it and let me know if it looks good.
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>> On Wed, Jun 21, 2023 at 10:46 AM Jyothsna Konisa <jy...@gmail.com>
>> wrote:
>>
>>> Hi Yuki!
>>>
>>> Thanks for the questions.
>>>
>>> Here are the steps for the initial setup.
>>>
>>> 1. Since only super users can add/remove identities from the
>>> `identity_to_roles` table, operators should use that role to add authorized
>>> identities to the table. Note that the authenticator is not an mTLS
>>> authenticator yet.
>>> EX: ADD IDENTITY 'spiffe://testdomain.com/testIdentifier/testValue' TO
>>> ROLE 'read_only_user'
>>>
>>> 2. Change authenticator configuration in cassandra.yaml to use mTLS
>>> authenticator
>>> EX: authenticator:
>>> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
>>> parameters :
>>> validator_class_name:
>>> org.apache.cassandra.auth.SpiffeCertificateValidator
>>> 3. Restart the cluster so that newly configured mTLS authenticator is
>>> used
>>>
>>> What will be the op's first step to set up the roles and identities?
>>> -> Yes, the op should set up roles & identities first.
>>>
>>> Is default cassandra / cassandra superuser login still required to set
>>> up other roles and identities?
>>> -> When transitioning from a password based to mTLS based
>>> authenticators, yes superuser login is required to add identities, as only
>>> super users can add them. However when a cluster is using mTLS based
>>> authenticator, the super user will be associated with some certificate
>>> identity and hence we don't need password based cassandra super user login.
>>>
>>> If initial cassandra super user login is required, does that mean super
>>> users and "cassandra '' superuser bypass mTLS check?
>>> -> No, while adding identities to the roles table in step1 the
>>> authenticator will not be an mTLS authenticator. Once the identities are
>>> added and the authenticator is configured, even super users have to go
>>> through an mTLS check during connection.
>>>
>>>
>>> Regarding migration
>>>
>>> I *think* you need to first use
>>> MutualTlsWithPasswordFallbackAuthenticator so the current roles can login
>>> with their password,
>>> and eventually the admin sets up identity and then can switch to mTLS
>>> auth.
>>> Is this the expected way for migration?
>>> -> Yes you can do that or else we can add identities with password based
>>> login and then change the authenticator to be mTLS authenticator.
>>>
>>> I think a thorough documentation for this new feature including new CQL
>>> syntax, setting up and migration would be greatly appreciated.
>>> -> I have added documentation for the authenticators, cqlsh commands in
>>> the Javadocs in the source code. Maybe I will add the setup process &
>>> migration process in the Javadocs, does this sound good?
>>>
>>> Thanks,
>>> Jyothsna Konisa.
>>>
>>> On Tue, Jun 20, 2023 at 11:33 PM Yuki Morishita <mo...@gmail.com>
>>> wrote:
>>>
>>>> Hi Jyothsna,
>>>>
>>>> Thanks, sorry I have additional questions regarding set up and
>>>> migration:
>>>>
>>>> * Initial set up
>>>>
>>>> Say, you are building the brand new cassandra cluster with
>>>>
>>>> authenticator:
>>>> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
>>>> parameters :
>>>> validator_class_name:
>>>> org.apache.cassandra.auth.SpiffeCertificateValidator
>>>>
>>>> What will be the op's first step to set up the roles and identities?
>>>> Is default cassandra / cassandra super user login still required to set
>>>> up other roles and identities?
>>>> If initial cassandra super user login is required, does that mean super
>>>> users and "cassandra" superuser bypass mTLS check?
>>>>
>>>> * Migration
>>>>
>>>> If you are currently using PasswordAuthenticator and would like to
>>>> migrate to mTLS authentication:
>>>>
>>>> I *think* you need to first use
>>>> MutualTlsWithPasswordFallbackAuthenticator so the current roles can login
>>>> with their password,
>>>> and eventually the admin sets up identity and then can switch to mTLS
>>>> auth.
>>>> Is this the expected way for migration?
>>>>
>>>> I think a thorough documentation for this new feature including new CQL
>>>> syntax, setting up and migration would be greatly appreciated.
>>>>
>>>>
>>>> On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa <jy...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Yuki,
>>>>>
>>>>> Sorry I missed answering your other question in the above reply.
>>>>> Regarding checking what identities are associated with a given role, one
>>>>> can make a query to list identities for a given role to the table. Also
>>>>> note that, addition or removal of identities from the table can only be
>>>>> performed by the super user only. Not even read-write users can perform
>>>>> modifications to the table.
>>>>>
>>>>> Also, If others have no concerns regarding this patch, can we move
>>>>> forward with the merge? or do we need voting on this one?
>>>>>
>>>>> Thanks,
>>>>> Jyothsna Konisa.
>>>>>
>>>>>
>>>>> On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa <
>>>>> jyothsna1503@gmail.com> wrote:
>>>>>
>>>>>> Hi Yuki,
>>>>>> You are right regarding adding a custom validator. If one wants to
>>>>>> implement a CN based validator, they can do that and configure that
>>>>>> validator in Cassandra.yaml in "authenticator.parameters.
>>>>>> validator_class_name".
>>>>>>
>>>>>> Regarding a role having multiple identities, yes a role can have
>>>>>> multiple identities associated with it. For example, there can be several
>>>>>> read_only users for a given cluster, so the role `readonly_user` can be
>>>>>> associated with multiple identities.
>>>>>>
>>>>>> Regarding the uniqueness of identity, each identity should be
>>>>>> associated with only one role. For example, a single identity can not be
>>>>>> both admin user and a read only user.
>>>>>>
>>>>>> We have ensured this by carefully designing the schema of the new
>>>>>> table for storing identity information by making identity as the primary
>>>>>> key which guarantees that each identity is unique and the same role can
>>>>>> have multiple identities.
>>>>>>
>>>>>> Thanks,
>>>>>> Jyothsna Konisa.
>>>>>>
>>>>>> On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita <mo...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> HI,
>>>>>>>
>>>>>>> I was discussing with users the other day regarding a similar
>>>>>>> feature.
>>>>>>> They were thinking of implementing the custom
>>>>>>> Authenticator similar to what MySQL offers:
>>>>>>>
>>>>>>> CREATE USER 'jeffrey'@'localhost'
>>>>>>> REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
>>>>>>> O=MySQL demo client certificate/
>>>>>>> CN=client/emailAddress=client@example.com';
>>>>>>>
>>>>>>> (
>>>>>>> https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls
>>>>>>> )
>>>>>>>
>>>>>>> I think they can implement a custom Validator that validates the
>>>>>>> identity (for their case, CN) associated with a role using the
>>>>>>> certificate's subject, so that's great!
>>>>>>>
>>>>>>> Regarding new CQL syntax,
>>>>>>>
>>>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>>>> > DROP IDENTITY 'testIdentity';
>>>>>>>
>>>>>>> This means a role can have multiple identities, and each identities
>>>>>>> must be unique?
>>>>>>> How can users check what identities are associated with certain
>>>>>>> roles?
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Folks, any feedback here?
>>>>>>>>
>>>>>>>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>>>>>>>> > Hi Everyone!
>>>>>>>> >
>>>>>>>> > We are adding the following CQL queries in this patch for adding
>>>>>>>> and dropping identities in the new `system_auth.identity_to_role` table.
>>>>>>>> >
>>>>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>>>>> > DROP IDENTITY 'testIdentity';
>>>>>>>> >
>>>>>>>> > Please let us know if anyone has any concerns!
>>>>>>>> >
>>>>>>>> > Thanks,
>>>>>>>> > Jyothsna Konisa.
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <
>>>>>>>> derek@chen-becker.org
>>>>>>>> > <ma...@chen-becker.org>> wrote:
>>>>>>>> >
>>>>>>>> > Sounds great, thanks for the clarification!
>>>>>>>> >
>>>>>>>> > Cheers,
>>>>>>>> >
>>>>>>>> > Derek
>>>>>>>> >
>>>>>>>> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <
>>>>>>>> djoshi@apache.org
>>>>>>>> > <ma...@apache.org>> wrote:
>>>>>>>> >
>>>>>>>> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>>>>>>>> >> <derek@chen-becker.org <ma...@chen-becker.org>>
>>>>>>>> wrote:
>>>>>>>> >>
>>>>>>>> >> This certainly looks like a nice addition to the
>>>>>>>> operator's
>>>>>>>> >> tools for securing cluster access. Out of curiosity, is
>>>>>>>> there
>>>>>>>> >> anything in this work that would *preclude* a different
>>>>>>>> >> authentication scheme for internode at some point in the
>>>>>>>> >> future? Has there ever been discussion of pluggability
>>>>>>>> similar
>>>>>>>> >> to the client protocol?
>>>>>>>> >
>>>>>>>> > This is a pluggable implementation so it's not mandatory
>>>>>>>> to use
>>>>>>>> > it and doesn't preclude one from using a different
>>>>>>>> mechanism in
>>>>>>>> > the future. We haven't explicitly discussed pluggability
>>>>>>>> i.e.
>>>>>>>> > part of protocol negotiation in the past for internode
>>>>>>>> > connections. However, this work also does not preclude us
>>>>>>>> from
>>>>>>>> > implementing such changes. If we do add negotiation this
>>>>>>>> could
>>>>>>>> > be one of the authentication mechanisms. So it would be
>>>>>>>> > complimentary.
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >> Also, am I correct in understanding that this would
>>>>>>>> allow for
>>>>>>>> >> multiple certificates for the same identity (e.g.
>>>>>>>> distinct
>>>>>>>> >> cert per node)? I certainly understand the decision to
>>>>>>>> keep
>>>>>>>> >> things simple and have all nodes share identity from the
>>>>>>>> >> perspective of operational simplicity, but I also don't
>>>>>>>> want
>>>>>>>> >> to get in a situation where a single compromised node
>>>>>>>> would
>>>>>>>> >> require an invalidation and redeployment on all nodes in
>>>>>>>> the
>>>>>>>> >> cluster.
>>>>>>>> >
>>>>>>>> > I don't recommend all nodes share the same certificate.
>>>>>>>> Each
>>>>>>>> > node in the cluster should obtain a unique certificate
>>>>>>>> with the
>>>>>>>> > same SPIFFE. In the event a node is compromised, the
>>>>>>>> operator
>>>>>>>> > can revoke that node's certificate without having to
>>>>>>>> redeploy to
>>>>>>>> > all nodes in the cluster.
>>>>>>>> >
>>>>>>>> > thanks,
>>>>>>>> >
>>>>>>>> > Dinesh
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > --
>>>>>>>> >
>>>>>>>> +---------------------------------------------------------------+
>>>>>>>> > | Derek Chen-Becker
>>>>>>>> |
>>>>>>>> > | GPG Key available at https://keybase.io/dchenbecker
>>>>>>>> > <https://keybase.io/dchenbecker>and |
>>>>>>>> > |
>>>>>>>> https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>>>>>>>> > <
>>>>>>>> https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org> |
>>>>>>>> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4
>>>>>>>> 6ACC |
>>>>>>>> >
>>>>>>>> +---------------------------------------------------------------+
>>>>>>>> >
>>>>>>>>
>>>>>>>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Yuki Morishita <mo...@gmail.com>.
Hi Jyothsna,
I think for the *initial* commit, the description looks fine to me.
I'd like to see/contribute to the future improvement though:
* ADD IDENTITY requires SUPERUSER, this means that the brand new cluster
needs to start with PasswordAuthenticator/CassandraAuthorizer first, and
then change to mTLS one.
* For this, I'd really like to see Cassandra use password authn and
authz by default.
* Cassandra allows the user with "CREATE ROLE" permission to create
roles without superuser privilege. Maybe it is natural to allow them to add
identities also?
On Thu, Jun 29, 2023 at 7:35 AM Jyothsna Konisa <jy...@gmail.com>
wrote:
> Hi Yuki,
>
> I have added cassandra docs for CQL syntax that we are adding and how to
> get started with using mTLS authenticators along with the migration plan.
> Please review it and let me know if it looks good.
>
> Thanks,
> Jyothsna Konisa.
>
> On Wed, Jun 21, 2023 at 10:46 AM Jyothsna Konisa <jy...@gmail.com>
> wrote:
>
>> Hi Yuki!
>>
>> Thanks for the questions.
>>
>> Here are the steps for the initial setup.
>>
>> 1. Since only super users can add/remove identities from the
>> `identity_to_roles` table, operators should use that role to add authorized
>> identities to the table. Note that the authenticator is not an mTLS
>> authenticator yet.
>> EX: ADD IDENTITY 'spiffe://testdomain.com/testIdentifier/testValue' TO
>> ROLE 'read_only_user'
>>
>> 2. Change authenticator configuration in cassandra.yaml to use mTLS
>> authenticator
>> EX: authenticator:
>> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
>> parameters :
>> validator_class_name:
>> org.apache.cassandra.auth.SpiffeCertificateValidator
>> 3. Restart the cluster so that newly configured mTLS authenticator is used
>>
>> What will be the op's first step to set up the roles and identities?
>> -> Yes, the op should set up roles & identities first.
>>
>> Is default cassandra / cassandra superuser login still required to set up
>> other roles and identities?
>> -> When transitioning from a password based to mTLS based authenticators,
>> yes superuser login is required to add identities, as only super users can
>> add them. However when a cluster is using mTLS based authenticator, the
>> super user will be associated with some certificate identity and hence we
>> don't need password based cassandra super user login.
>>
>> If initial cassandra super user login is required, does that mean super
>> users and "cassandra '' superuser bypass mTLS check?
>> -> No, while adding identities to the roles table in step1 the
>> authenticator will not be an mTLS authenticator. Once the identities are
>> added and the authenticator is configured, even super users have to go
>> through an mTLS check during connection.
>>
>>
>> Regarding migration
>>
>> I *think* you need to first use
>> MutualTlsWithPasswordFallbackAuthenticator so the current roles can login
>> with their password,
>> and eventually the admin sets up identity and then can switch to mTLS
>> auth.
>> Is this the expected way for migration?
>> -> Yes you can do that or else we can add identities with password based
>> login and then change the authenticator to be mTLS authenticator.
>>
>> I think a thorough documentation for this new feature including new CQL
>> syntax, setting up and migration would be greatly appreciated.
>> -> I have added documentation for the authenticators, cqlsh commands in
>> the Javadocs in the source code. Maybe I will add the setup process &
>> migration process in the Javadocs, does this sound good?
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>> On Tue, Jun 20, 2023 at 11:33 PM Yuki Morishita <mo...@gmail.com>
>> wrote:
>>
>>> Hi Jyothsna,
>>>
>>> Thanks, sorry I have additional questions regarding set up and migration:
>>>
>>> * Initial set up
>>>
>>> Say, you are building the brand new cassandra cluster with
>>>
>>> authenticator:
>>> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
>>> parameters :
>>> validator_class_name:
>>> org.apache.cassandra.auth.SpiffeCertificateValidator
>>>
>>> What will be the op's first step to set up the roles and identities?
>>> Is default cassandra / cassandra super user login still required to set
>>> up other roles and identities?
>>> If initial cassandra super user login is required, does that mean super
>>> users and "cassandra" superuser bypass mTLS check?
>>>
>>> * Migration
>>>
>>> If you are currently using PasswordAuthenticator and would like to
>>> migrate to mTLS authentication:
>>>
>>> I *think* you need to first use
>>> MutualTlsWithPasswordFallbackAuthenticator so the current roles can login
>>> with their password,
>>> and eventually the admin sets up identity and then can switch to mTLS
>>> auth.
>>> Is this the expected way for migration?
>>>
>>> I think a thorough documentation for this new feature including new CQL
>>> syntax, setting up and migration would be greatly appreciated.
>>>
>>>
>>> On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa <jy...@gmail.com>
>>> wrote:
>>>
>>>> Hi Yuki,
>>>>
>>>> Sorry I missed answering your other question in the above reply.
>>>> Regarding checking what identities are associated with a given role, one
>>>> can make a query to list identities for a given role to the table. Also
>>>> note that, addition or removal of identities from the table can only be
>>>> performed by the super user only. Not even read-write users can perform
>>>> modifications to the table.
>>>>
>>>> Also, If others have no concerns regarding this patch, can we move
>>>> forward with the merge? or do we need voting on this one?
>>>>
>>>> Thanks,
>>>> Jyothsna Konisa.
>>>>
>>>>
>>>> On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa <jy...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Yuki,
>>>>> You are right regarding adding a custom validator. If one wants to
>>>>> implement a CN based validator, they can do that and configure that
>>>>> validator in Cassandra.yaml in "authenticator.parameters.
>>>>> validator_class_name".
>>>>>
>>>>> Regarding a role having multiple identities, yes a role can have
>>>>> multiple identities associated with it. For example, there can be several
>>>>> read_only users for a given cluster, so the role `readonly_user` can be
>>>>> associated with multiple identities.
>>>>>
>>>>> Regarding the uniqueness of identity, each identity should be
>>>>> associated with only one role. For example, a single identity can not be
>>>>> both admin user and a read only user.
>>>>>
>>>>> We have ensured this by carefully designing the schema of the new
>>>>> table for storing identity information by making identity as the primary
>>>>> key which guarantees that each identity is unique and the same role can
>>>>> have multiple identities.
>>>>>
>>>>> Thanks,
>>>>> Jyothsna Konisa.
>>>>>
>>>>> On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita <mo...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> HI,
>>>>>>
>>>>>> I was discussing with users the other day regarding a similar feature.
>>>>>> They were thinking of implementing the custom
>>>>>> Authenticator similar to what MySQL offers:
>>>>>>
>>>>>> CREATE USER 'jeffrey'@'localhost'
>>>>>> REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
>>>>>> O=MySQL demo client certificate/
>>>>>> CN=client/emailAddress=client@example.com';
>>>>>>
>>>>>> (
>>>>>> https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls
>>>>>> )
>>>>>>
>>>>>> I think they can implement a custom Validator that validates the
>>>>>> identity (for their case, CN) associated with a role using the
>>>>>> certificate's subject, so that's great!
>>>>>>
>>>>>> Regarding new CQL syntax,
>>>>>>
>>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>>> > DROP IDENTITY 'testIdentity';
>>>>>>
>>>>>> This means a role can have multiple identities, and each identities
>>>>>> must be unique?
>>>>>> How can users check what identities are associated with certain roles?
>>>>>>
>>>>>>
>>>>>> On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org>
>>>>>> wrote:
>>>>>>
>>>>>>> Folks, any feedback here?
>>>>>>>
>>>>>>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>>>>>>> > Hi Everyone!
>>>>>>> >
>>>>>>> > We are adding the following CQL queries in this patch for adding
>>>>>>> and dropping identities in the new `system_auth.identity_to_role` table.
>>>>>>> >
>>>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>>>> > DROP IDENTITY 'testIdentity';
>>>>>>> >
>>>>>>> > Please let us know if anyone has any concerns!
>>>>>>> >
>>>>>>> > Thanks,
>>>>>>> > Jyothsna Konisa.
>>>>>>> >
>>>>>>> >
>>>>>>> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <
>>>>>>> derek@chen-becker.org
>>>>>>> > <ma...@chen-becker.org>> wrote:
>>>>>>> >
>>>>>>> > Sounds great, thanks for the clarification!
>>>>>>> >
>>>>>>> > Cheers,
>>>>>>> >
>>>>>>> > Derek
>>>>>>> >
>>>>>>> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <
>>>>>>> djoshi@apache.org
>>>>>>> > <ma...@apache.org>> wrote:
>>>>>>> >
>>>>>>> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>>>>>>> >> <derek@chen-becker.org <ma...@chen-becker.org>>
>>>>>>> wrote:
>>>>>>> >>
>>>>>>> >> This certainly looks like a nice addition to the
>>>>>>> operator's
>>>>>>> >> tools for securing cluster access. Out of curiosity, is
>>>>>>> there
>>>>>>> >> anything in this work that would *preclude* a different
>>>>>>> >> authentication scheme for internode at some point in the
>>>>>>> >> future? Has there ever been discussion of pluggability
>>>>>>> similar
>>>>>>> >> to the client protocol?
>>>>>>> >
>>>>>>> > This is a pluggable implementation so it's not mandatory
>>>>>>> to use
>>>>>>> > it and doesn't preclude one from using a different
>>>>>>> mechanism in
>>>>>>> > the future. We haven't explicitly discussed pluggability
>>>>>>> i.e.
>>>>>>> > part of protocol negotiation in the past for internode
>>>>>>> > connections. However, this work also does not preclude us
>>>>>>> from
>>>>>>> > implementing such changes. If we do add negotiation this
>>>>>>> could
>>>>>>> > be one of the authentication mechanisms. So it would be
>>>>>>> > complimentary.
>>>>>>> >
>>>>>>> >
>>>>>>> >> Also, am I correct in understanding that this would allow
>>>>>>> for
>>>>>>> >> multiple certificates for the same identity (e.g. distinct
>>>>>>> >> cert per node)? I certainly understand the decision to
>>>>>>> keep
>>>>>>> >> things simple and have all nodes share identity from the
>>>>>>> >> perspective of operational simplicity, but I also don't
>>>>>>> want
>>>>>>> >> to get in a situation where a single compromised node
>>>>>>> would
>>>>>>> >> require an invalidation and redeployment on all nodes in
>>>>>>> the
>>>>>>> >> cluster.
>>>>>>> >
>>>>>>> > I don't recommend all nodes share the same certificate.
>>>>>>> Each
>>>>>>> > node in the cluster should obtain a unique certificate
>>>>>>> with the
>>>>>>> > same SPIFFE. In the event a node is compromised, the
>>>>>>> operator
>>>>>>> > can revoke that node's certificate without having to
>>>>>>> redeploy to
>>>>>>> > all nodes in the cluster.
>>>>>>> >
>>>>>>> > thanks,
>>>>>>> >
>>>>>>> > Dinesh
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>> > --
>>>>>>> >
>>>>>>> +---------------------------------------------------------------+
>>>>>>> > | Derek Chen-Becker
>>>>>>> |
>>>>>>> > | GPG Key available at https://keybase.io/dchenbecker
>>>>>>> > <https://keybase.io/dchenbecker>and |
>>>>>>> > |
>>>>>>> https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>>>>>>> > <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org>
>>>>>>> |
>>>>>>> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4
>>>>>>> 6ACC |
>>>>>>> >
>>>>>>> +---------------------------------------------------------------+
>>>>>>> >
>>>>>>>
>>>>>>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Jyothsna Konisa <jy...@gmail.com>.
Hi Yuki,
I have added cassandra docs for CQL syntax that we are adding and how to
get started with using mTLS authenticators along with the migration plan.
Please review it and let me know if it looks good.
Thanks,
Jyothsna Konisa.
On Wed, Jun 21, 2023 at 10:46 AM Jyothsna Konisa <jy...@gmail.com>
wrote:
> Hi Yuki!
>
> Thanks for the questions.
>
> Here are the steps for the initial setup.
>
> 1. Since only super users can add/remove identities from the
> `identity_to_roles` table, operators should use that role to add authorized
> identities to the table. Note that the authenticator is not an mTLS
> authenticator yet.
> EX: ADD IDENTITY 'spiffe://testdomain.com/testIdentifier/testValue' TO
> ROLE 'read_only_user'
>
> 2. Change authenticator configuration in cassandra.yaml to use mTLS
> authenticator
> EX: authenticator:
> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
> parameters :
> validator_class_name:
> org.apache.cassandra.auth.SpiffeCertificateValidator
> 3. Restart the cluster so that newly configured mTLS authenticator is used
>
> What will be the op's first step to set up the roles and identities?
> -> Yes, the op should set up roles & identities first.
>
> Is default cassandra / cassandra superuser login still required to set up
> other roles and identities?
> -> When transitioning from a password based to mTLS based authenticators,
> yes superuser login is required to add identities, as only super users can
> add them. However when a cluster is using mTLS based authenticator, the
> super user will be associated with some certificate identity and hence we
> don't need password based cassandra super user login.
>
> If initial cassandra super user login is required, does that mean super
> users and "cassandra '' superuser bypass mTLS check?
> -> No, while adding identities to the roles table in step1 the
> authenticator will not be an mTLS authenticator. Once the identities are
> added and the authenticator is configured, even super users have to go
> through an mTLS check during connection.
>
>
> Regarding migration
>
> I *think* you need to first use MutualTlsWithPasswordFallbackAuthenticator
> so the current roles can login with their password,
> and eventually the admin sets up identity and then can switch to mTLS auth.
> Is this the expected way for migration?
> -> Yes you can do that or else we can add identities with password based
> login and then change the authenticator to be mTLS authenticator.
>
> I think a thorough documentation for this new feature including new CQL
> syntax, setting up and migration would be greatly appreciated.
> -> I have added documentation for the authenticators, cqlsh commands in
> the Javadocs in the source code. Maybe I will add the setup process &
> migration process in the Javadocs, does this sound good?
>
> Thanks,
> Jyothsna Konisa.
>
> On Tue, Jun 20, 2023 at 11:33 PM Yuki Morishita <mo...@gmail.com>
> wrote:
>
>> Hi Jyothsna,
>>
>> Thanks, sorry I have additional questions regarding set up and migration:
>>
>> * Initial set up
>>
>> Say, you are building the brand new cassandra cluster with
>>
>> authenticator:
>> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
>> parameters :
>> validator_class_name:
>> org.apache.cassandra.auth.SpiffeCertificateValidator
>>
>> What will be the op's first step to set up the roles and identities?
>> Is default cassandra / cassandra super user login still required to set
>> up other roles and identities?
>> If initial cassandra super user login is required, does that mean super
>> users and "cassandra" superuser bypass mTLS check?
>>
>> * Migration
>>
>> If you are currently using PasswordAuthenticator and would like to
>> migrate to mTLS authentication:
>>
>> I *think* you need to first use
>> MutualTlsWithPasswordFallbackAuthenticator so the current roles can login
>> with their password,
>> and eventually the admin sets up identity and then can switch to mTLS
>> auth.
>> Is this the expected way for migration?
>>
>> I think a thorough documentation for this new feature including new CQL
>> syntax, setting up and migration would be greatly appreciated.
>>
>>
>> On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa <jy...@gmail.com>
>> wrote:
>>
>>> Hi Yuki,
>>>
>>> Sorry I missed answering your other question in the above reply.
>>> Regarding checking what identities are associated with a given role, one
>>> can make a query to list identities for a given role to the table. Also
>>> note that, addition or removal of identities from the table can only be
>>> performed by the super user only. Not even read-write users can perform
>>> modifications to the table.
>>>
>>> Also, If others have no concerns regarding this patch, can we move
>>> forward with the merge? or do we need voting on this one?
>>>
>>> Thanks,
>>> Jyothsna Konisa.
>>>
>>>
>>> On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa <jy...@gmail.com>
>>> wrote:
>>>
>>>> Hi Yuki,
>>>> You are right regarding adding a custom validator. If one wants to
>>>> implement a CN based validator, they can do that and configure that
>>>> validator in Cassandra.yaml in "authenticator.parameters.
>>>> validator_class_name".
>>>>
>>>> Regarding a role having multiple identities, yes a role can have
>>>> multiple identities associated with it. For example, there can be several
>>>> read_only users for a given cluster, so the role `readonly_user` can be
>>>> associated with multiple identities.
>>>>
>>>> Regarding the uniqueness of identity, each identity should be
>>>> associated with only one role. For example, a single identity can not be
>>>> both admin user and a read only user.
>>>>
>>>> We have ensured this by carefully designing the schema of the new table
>>>> for storing identity information by making identity as the primary key
>>>> which guarantees that each identity is unique and the same role can have
>>>> multiple identities.
>>>>
>>>> Thanks,
>>>> Jyothsna Konisa.
>>>>
>>>> On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita <mo...@gmail.com>
>>>> wrote:
>>>>
>>>>> HI,
>>>>>
>>>>> I was discussing with users the other day regarding a similar feature.
>>>>> They were thinking of implementing the custom Authenticator similar to
>>>>> what MySQL offers:
>>>>>
>>>>> CREATE USER 'jeffrey'@'localhost'
>>>>> REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
>>>>> O=MySQL demo client certificate/
>>>>> CN=client/emailAddress=client@example.com';
>>>>>
>>>>> (
>>>>> https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls
>>>>> )
>>>>>
>>>>> I think they can implement a custom Validator that validates the
>>>>> identity (for their case, CN) associated with a role using the
>>>>> certificate's subject, so that's great!
>>>>>
>>>>> Regarding new CQL syntax,
>>>>>
>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>> > DROP IDENTITY 'testIdentity';
>>>>>
>>>>> This means a role can have multiple identities, and each identities
>>>>> must be unique?
>>>>> How can users check what identities are associated with certain roles?
>>>>>
>>>>>
>>>>> On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org>
>>>>> wrote:
>>>>>
>>>>>> Folks, any feedback here?
>>>>>>
>>>>>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>>>>>> > Hi Everyone!
>>>>>> >
>>>>>> > We are adding the following CQL queries in this patch for adding
>>>>>> and dropping identities in the new `system_auth.identity_to_role` table.
>>>>>> >
>>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>>> > DROP IDENTITY 'testIdentity';
>>>>>> >
>>>>>> > Please let us know if anyone has any concerns!
>>>>>> >
>>>>>> > Thanks,
>>>>>> > Jyothsna Konisa.
>>>>>> >
>>>>>> >
>>>>>> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <
>>>>>> derek@chen-becker.org
>>>>>> > <ma...@chen-becker.org>> wrote:
>>>>>> >
>>>>>> > Sounds great, thanks for the clarification!
>>>>>> >
>>>>>> > Cheers,
>>>>>> >
>>>>>> > Derek
>>>>>> >
>>>>>> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <djoshi@apache.org
>>>>>> > <ma...@apache.org>> wrote:
>>>>>> >
>>>>>> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>>>>>> >> <derek@chen-becker.org <ma...@chen-becker.org>>
>>>>>> wrote:
>>>>>> >>
>>>>>> >> This certainly looks like a nice addition to the operator's
>>>>>> >> tools for securing cluster access. Out of curiosity, is
>>>>>> there
>>>>>> >> anything in this work that would *preclude* a different
>>>>>> >> authentication scheme for internode at some point in the
>>>>>> >> future? Has there ever been discussion of pluggability
>>>>>> similar
>>>>>> >> to the client protocol?
>>>>>> >
>>>>>> > This is a pluggable implementation so it's not mandatory to
>>>>>> use
>>>>>> > it and doesn't preclude one from using a different
>>>>>> mechanism in
>>>>>> > the future. We haven't explicitly discussed pluggability
>>>>>> i.e.
>>>>>> > part of protocol negotiation in the past for internode
>>>>>> > connections. However, this work also does not preclude us
>>>>>> from
>>>>>> > implementing such changes. If we do add negotiation this
>>>>>> could
>>>>>> > be one of the authentication mechanisms. So it would be
>>>>>> > complimentary.
>>>>>> >
>>>>>> >
>>>>>> >> Also, am I correct in understanding that this would allow
>>>>>> for
>>>>>> >> multiple certificates for the same identity (e.g. distinct
>>>>>> >> cert per node)? I certainly understand the decision to keep
>>>>>> >> things simple and have all nodes share identity from the
>>>>>> >> perspective of operational simplicity, but I also don't
>>>>>> want
>>>>>> >> to get in a situation where a single compromised node would
>>>>>> >> require an invalidation and redeployment on all nodes in
>>>>>> the
>>>>>> >> cluster.
>>>>>> >
>>>>>> > I don't recommend all nodes share the same certificate. Each
>>>>>> > node in the cluster should obtain a unique certificate with
>>>>>> the
>>>>>> > same SPIFFE. In the event a node is compromised, the
>>>>>> operator
>>>>>> > can revoke that node's certificate without having to
>>>>>> redeploy to
>>>>>> > all nodes in the cluster.
>>>>>> >
>>>>>> > thanks,
>>>>>> >
>>>>>> > Dinesh
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > --
>>>>>> >
>>>>>> +---------------------------------------------------------------+
>>>>>> > | Derek Chen-Becker
>>>>>> |
>>>>>> > | GPG Key available at https://keybase.io/dchenbecker
>>>>>> > <https://keybase.io/dchenbecker>and |
>>>>>> > | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>>>>>> > <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org>
>>>>>> |
>>>>>> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC
>>>>>> |
>>>>>> >
>>>>>> +---------------------------------------------------------------+
>>>>>> >
>>>>>>
>>>>>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Jyothsna Konisa <jy...@gmail.com>.
Hi Yuki!
Thanks for the questions.
Here are the steps for the initial setup.
1. Since only super users can add/remove identities from the
`identity_to_roles` table, operators should use that role to add authorized
identities to the table. Note that the authenticator is not an mTLS
authenticator yet.
EX: ADD IDENTITY 'spiffe://testdomain.com/testIdentifier/testValue' TO ROLE
'read_only_user'
2. Change authenticator configuration in cassandra.yaml to use mTLS
authenticator
EX: authenticator:
class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
parameters :
validator_class_name:
org.apache.cassandra.auth.SpiffeCertificateValidator
3. Restart the cluster so that newly configured mTLS authenticator is used
What will be the op's first step to set up the roles and identities?
-> Yes, the op should set up roles & identities first.
Is default cassandra / cassandra superuser login still required to set up
other roles and identities?
-> When transitioning from a password based to mTLS based authenticators,
yes superuser login is required to add identities, as only super users can
add them. However when a cluster is using mTLS based authenticator, the
super user will be associated with some certificate identity and hence we
don't need password based cassandra super user login.
If initial cassandra super user login is required, does that mean super
users and "cassandra '' superuser bypass mTLS check?
-> No, while adding identities to the roles table in step1 the
authenticator will not be an mTLS authenticator. Once the identities are
added and the authenticator is configured, even super users have to go
through an mTLS check during connection.
Regarding migration
I *think* you need to first use MutualTlsWithPasswordFallbackAuthenticator
so the current roles can login with their password,
and eventually the admin sets up identity and then can switch to mTLS auth.
Is this the expected way for migration?
-> Yes you can do that or else we can add identities with password based
login and then change the authenticator to be mTLS authenticator.
I think a thorough documentation for this new feature including new CQL
syntax, setting up and migration would be greatly appreciated.
-> I have added documentation for the authenticators, cqlsh commands in the
Javadocs in the source code. Maybe I will add the setup process & migration
process in the Javadocs, does this sound good?
Thanks,
Jyothsna Konisa.
On Tue, Jun 20, 2023 at 11:33 PM Yuki Morishita <mo...@gmail.com> wrote:
> Hi Jyothsna,
>
> Thanks, sorry I have additional questions regarding set up and migration:
>
> * Initial set up
>
> Say, you are building the brand new cassandra cluster with
>
> authenticator:
> class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
> parameters :
> validator_class_name:
> org.apache.cassandra.auth.SpiffeCertificateValidator
>
> What will be the op's first step to set up the roles and identities?
> Is default cassandra / cassandra super user login still required to set up
> other roles and identities?
> If initial cassandra super user login is required, does that mean super
> users and "cassandra" superuser bypass mTLS check?
>
> * Migration
>
> If you are currently using PasswordAuthenticator and would like to migrate
> to mTLS authentication:
>
> I *think* you need to first use MutualTlsWithPasswordFallbackAuthenticator
> so the current roles can login with their password,
> and eventually the admin sets up identity and then can switch to mTLS auth.
> Is this the expected way for migration?
>
> I think a thorough documentation for this new feature including new CQL
> syntax, setting up and migration would be greatly appreciated.
>
>
> On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa <jy...@gmail.com>
> wrote:
>
>> Hi Yuki,
>>
>> Sorry I missed answering your other question in the above reply.
>> Regarding checking what identities are associated with a given role, one
>> can make a query to list identities for a given role to the table. Also
>> note that, addition or removal of identities from the table can only be
>> performed by the super user only. Not even read-write users can perform
>> modifications to the table.
>>
>> Also, If others have no concerns regarding this patch, can we move
>> forward with the merge? or do we need voting on this one?
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>>
>> On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa <jy...@gmail.com>
>> wrote:
>>
>>> Hi Yuki,
>>> You are right regarding adding a custom validator. If one wants to
>>> implement a CN based validator, they can do that and configure that
>>> validator in Cassandra.yaml in "authenticator.parameters.
>>> validator_class_name".
>>>
>>> Regarding a role having multiple identities, yes a role can have
>>> multiple identities associated with it. For example, there can be several
>>> read_only users for a given cluster, so the role `readonly_user` can be
>>> associated with multiple identities.
>>>
>>> Regarding the uniqueness of identity, each identity should be associated
>>> with only one role. For example, a single identity can not be both admin
>>> user and a read only user.
>>>
>>> We have ensured this by carefully designing the schema of the new table
>>> for storing identity information by making identity as the primary key
>>> which guarantees that each identity is unique and the same role can have
>>> multiple identities.
>>>
>>> Thanks,
>>> Jyothsna Konisa.
>>>
>>> On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita <mo...@gmail.com>
>>> wrote:
>>>
>>>> HI,
>>>>
>>>> I was discussing with users the other day regarding a similar feature.
>>>> They were thinking of implementing the custom Authenticator similar to
>>>> what MySQL offers:
>>>>
>>>> CREATE USER 'jeffrey'@'localhost'
>>>> REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
>>>> O=MySQL demo client certificate/
>>>> CN=client/emailAddress=client@example.com';
>>>>
>>>> (
>>>> https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls
>>>> )
>>>>
>>>> I think they can implement a custom Validator that validates the
>>>> identity (for their case, CN) associated with a role using the
>>>> certificate's subject, so that's great!
>>>>
>>>> Regarding new CQL syntax,
>>>>
>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>> > DROP IDENTITY 'testIdentity';
>>>>
>>>> This means a role can have multiple identities, and each identities
>>>> must be unique?
>>>> How can users check what identities are associated with certain roles?
>>>>
>>>>
>>>> On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org>
>>>> wrote:
>>>>
>>>>> Folks, any feedback here?
>>>>>
>>>>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>>>>> > Hi Everyone!
>>>>> >
>>>>> > We are adding the following CQL queries in this patch for adding and
>>>>> dropping identities in the new `system_auth.identity_to_role` table.
>>>>> >
>>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>>> > DROP IDENTITY 'testIdentity';
>>>>> >
>>>>> > Please let us know if anyone has any concerns!
>>>>> >
>>>>> > Thanks,
>>>>> > Jyothsna Konisa.
>>>>> >
>>>>> >
>>>>> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <
>>>>> derek@chen-becker.org
>>>>> > <ma...@chen-becker.org>> wrote:
>>>>> >
>>>>> > Sounds great, thanks for the clarification!
>>>>> >
>>>>> > Cheers,
>>>>> >
>>>>> > Derek
>>>>> >
>>>>> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <djoshi@apache.org
>>>>> > <ma...@apache.org>> wrote:
>>>>> >
>>>>> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>>>>> >> <derek@chen-becker.org <ma...@chen-becker.org>>
>>>>> wrote:
>>>>> >>
>>>>> >> This certainly looks like a nice addition to the operator's
>>>>> >> tools for securing cluster access. Out of curiosity, is
>>>>> there
>>>>> >> anything in this work that would *preclude* a different
>>>>> >> authentication scheme for internode at some point in the
>>>>> >> future? Has there ever been discussion of pluggability
>>>>> similar
>>>>> >> to the client protocol?
>>>>> >
>>>>> > This is a pluggable implementation so it's not mandatory to
>>>>> use
>>>>> > it and doesn't preclude one from using a different mechanism
>>>>> in
>>>>> > the future. We haven't explicitly discussed pluggability i.e.
>>>>> > part of protocol negotiation in the past for internode
>>>>> > connections. However, this work also does not preclude us
>>>>> from
>>>>> > implementing such changes. If we do add negotiation this
>>>>> could
>>>>> > be one of the authentication mechanisms. So it would be
>>>>> > complimentary.
>>>>> >
>>>>> >
>>>>> >> Also, am I correct in understanding that this would allow
>>>>> for
>>>>> >> multiple certificates for the same identity (e.g. distinct
>>>>> >> cert per node)? I certainly understand the decision to keep
>>>>> >> things simple and have all nodes share identity from the
>>>>> >> perspective of operational simplicity, but I also don't want
>>>>> >> to get in a situation where a single compromised node would
>>>>> >> require an invalidation and redeployment on all nodes in the
>>>>> >> cluster.
>>>>> >
>>>>> > I don't recommend all nodes share the same certificate. Each
>>>>> > node in the cluster should obtain a unique certificate with
>>>>> the
>>>>> > same SPIFFE. In the event a node is compromised, the operator
>>>>> > can revoke that node's certificate without having to
>>>>> redeploy to
>>>>> > all nodes in the cluster.
>>>>> >
>>>>> > thanks,
>>>>> >
>>>>> > Dinesh
>>>>> >
>>>>> >
>>>>> >
>>>>> > --
>>>>> > +---------------------------------------------------------------+
>>>>> > | Derek Chen-Becker |
>>>>> > | GPG Key available at https://keybase.io/dchenbecker
>>>>> > <https://keybase.io/dchenbecker>and |
>>>>> > | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>>>>> > <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org>
>>>>> |
>>>>> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
>>>>> > +---------------------------------------------------------------+
>>>>> >
>>>>>
>>>>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Yuki Morishita <mo...@gmail.com>.
Hi Jyothsna,
Thanks, sorry I have additional questions regarding set up and migration:
* Initial set up
Say, you are building the brand new cassandra cluster with
authenticator:
class_name :org.apache.cassandra.auth.MutualTlsAuthenticator
parameters :
validator_class_name:
org.apache.cassandra.auth.SpiffeCertificateValidator
What will be the op's first step to set up the roles and identities?
Is default cassandra / cassandra super user login still required to set up
other roles and identities?
If initial cassandra super user login is required, does that mean super
users and "cassandra" superuser bypass mTLS check?
* Migration
If you are currently using PasswordAuthenticator and would like to migrate
to mTLS authentication:
I *think* you need to first use MutualTlsWithPasswordFallbackAuthenticator
so the current roles can login with their password,
and eventually the admin sets up identity and then can switch to mTLS auth.
Is this the expected way for migration?
I think a thorough documentation for this new feature including new CQL
syntax, setting up and migration would be greatly appreciated.
On Wed, Jun 21, 2023 at 4:13 AM Jyothsna Konisa <jy...@gmail.com>
wrote:
> Hi Yuki,
>
> Sorry I missed answering your other question in the above reply. Regarding
> checking what identities are associated with a given role, one can make a
> query to list identities for a given role to the table. Also note that,
> addition or removal of identities from the table can only be performed by
> the super user only. Not even read-write users can perform modifications to
> the table.
>
> Also, If others have no concerns regarding this patch, can we move forward
> with the merge? or do we need voting on this one?
>
> Thanks,
> Jyothsna Konisa.
>
>
> On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa <jy...@gmail.com>
> wrote:
>
>> Hi Yuki,
>> You are right regarding adding a custom validator. If one wants to
>> implement a CN based validator, they can do that and configure that
>> validator in Cassandra.yaml in "authenticator.parameters.
>> validator_class_name".
>>
>> Regarding a role having multiple identities, yes a role can have multiple
>> identities associated with it. For example, there can be several read_only
>> users for a given cluster, so the role `readonly_user` can be associated
>> with multiple identities.
>>
>> Regarding the uniqueness of identity, each identity should be associated
>> with only one role. For example, a single identity can not be both admin
>> user and a read only user.
>>
>> We have ensured this by carefully designing the schema of the new table
>> for storing identity information by making identity as the primary key
>> which guarantees that each identity is unique and the same role can have
>> multiple identities.
>>
>> Thanks,
>> Jyothsna Konisa.
>>
>> On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita <mo...@gmail.com>
>> wrote:
>>
>>> HI,
>>>
>>> I was discussing with users the other day regarding a similar feature.
>>> They were thinking of implementing the custom Authenticator similar to
>>> what MySQL offers:
>>>
>>> CREATE USER 'jeffrey'@'localhost'
>>> REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
>>> O=MySQL demo client certificate/
>>> CN=client/emailAddress=client@example.com';
>>>
>>> (
>>> https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls
>>> )
>>>
>>> I think they can implement a custom Validator that validates the
>>> identity (for their case, CN) associated with a role using the
>>> certificate's subject, so that's great!
>>>
>>> Regarding new CQL syntax,
>>>
>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>> > DROP IDENTITY 'testIdentity';
>>>
>>> This means a role can have multiple identities, and each identities must
>>> be unique?
>>> How can users check what identities are associated with certain roles?
>>>
>>>
>>> On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org> wrote:
>>>
>>>> Folks, any feedback here?
>>>>
>>>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>>>> > Hi Everyone!
>>>> >
>>>> > We are adding the following CQL queries in this patch for adding and
>>>> dropping identities in the new `system_auth.identity_to_role` table.
>>>> >
>>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>>> > DROP IDENTITY 'testIdentity';
>>>> >
>>>> > Please let us know if anyone has any concerns!
>>>> >
>>>> > Thanks,
>>>> > Jyothsna Konisa.
>>>> >
>>>> >
>>>> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <
>>>> derek@chen-becker.org
>>>> > <ma...@chen-becker.org>> wrote:
>>>> >
>>>> > Sounds great, thanks for the clarification!
>>>> >
>>>> > Cheers,
>>>> >
>>>> > Derek
>>>> >
>>>> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <djoshi@apache.org
>>>> > <ma...@apache.org>> wrote:
>>>> >
>>>> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>>>> >> <derek@chen-becker.org <ma...@chen-becker.org>>
>>>> wrote:
>>>> >>
>>>> >> This certainly looks like a nice addition to the operator's
>>>> >> tools for securing cluster access. Out of curiosity, is there
>>>> >> anything in this work that would *preclude* a different
>>>> >> authentication scheme for internode at some point in the
>>>> >> future? Has there ever been discussion of pluggability
>>>> similar
>>>> >> to the client protocol?
>>>> >
>>>> > This is a pluggable implementation so it's not mandatory to
>>>> use
>>>> > it and doesn't preclude one from using a different mechanism
>>>> in
>>>> > the future. We haven't explicitly discussed pluggability i.e.
>>>> > part of protocol negotiation in the past for internode
>>>> > connections. However, this work also does not preclude us from
>>>> > implementing such changes. If we do add negotiation this could
>>>> > be one of the authentication mechanisms. So it would be
>>>> > complimentary.
>>>> >
>>>> >
>>>> >> Also, am I correct in understanding that this would allow for
>>>> >> multiple certificates for the same identity (e.g. distinct
>>>> >> cert per node)? I certainly understand the decision to keep
>>>> >> things simple and have all nodes share identity from the
>>>> >> perspective of operational simplicity, but I also don't want
>>>> >> to get in a situation where a single compromised node would
>>>> >> require an invalidation and redeployment on all nodes in the
>>>> >> cluster.
>>>> >
>>>> > I don't recommend all nodes share the same certificate. Each
>>>> > node in the cluster should obtain a unique certificate with
>>>> the
>>>> > same SPIFFE. In the event a node is compromised, the operator
>>>> > can revoke that node's certificate without having to redeploy
>>>> to
>>>> > all nodes in the cluster.
>>>> >
>>>> > thanks,
>>>> >
>>>> > Dinesh
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > +---------------------------------------------------------------+
>>>> > | Derek Chen-Becker |
>>>> > | GPG Key available at https://keybase.io/dchenbecker
>>>> > <https://keybase.io/dchenbecker>and |
>>>> > | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>>>> > <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org> |
>>>> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
>>>> > +---------------------------------------------------------------+
>>>> >
>>>>
>>>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Jyothsna Konisa <jy...@gmail.com>.
Hi Yuki,
Sorry I missed answering your other question in the above reply. Regarding
checking what identities are associated with a given role, one can make a
query to list identities for a given role to the table. Also note that,
addition or removal of identities from the table can only be performed by
the super user only. Not even read-write users can perform modifications to
the table.
Also, If others have no concerns regarding this patch, can we move forward
with the merge? or do we need voting on this one?
Thanks,
Jyothsna Konisa.
On Mon, Jun 19, 2023 at 4:00 PM Jyothsna Konisa <jy...@gmail.com>
wrote:
> Hi Yuki,
> You are right regarding adding a custom validator. If one wants to
> implement a CN based validator, they can do that and configure that
> validator in Cassandra.yaml in "authenticator.parameters.
> validator_class_name".
>
> Regarding a role having multiple identities, yes a role can have multiple
> identities associated with it. For example, there can be several read_only
> users for a given cluster, so the role `readonly_user` can be associated
> with multiple identities.
>
> Regarding the uniqueness of identity, each identity should be associated
> with only one role. For example, a single identity can not be both admin
> user and a read only user.
>
> We have ensured this by carefully designing the schema of the new table
> for storing identity information by making identity as the primary key
> which guarantees that each identity is unique and the same role can have
> multiple identities.
>
> Thanks,
> Jyothsna Konisa.
>
> On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita <mo...@gmail.com> wrote:
>
>> HI,
>>
>> I was discussing with users the other day regarding a similar feature.
>> They were thinking of implementing the custom Authenticator similar to
>> what MySQL offers:
>>
>> CREATE USER 'jeffrey'@'localhost'
>> REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
>> O=MySQL demo client certificate/
>> CN=client/emailAddress=client@example.com';
>>
>> (https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls
>> )
>>
>> I think they can implement a custom Validator that validates the identity
>> (for their case, CN) associated with a role using the certificate's
>> subject, so that's great!
>>
>> Regarding new CQL syntax,
>>
>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>> > DROP IDENTITY 'testIdentity';
>>
>> This means a role can have multiple identities, and each identities must
>> be unique?
>> How can users check what identities are associated with certain roles?
>>
>>
>> On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org> wrote:
>>
>>> Folks, any feedback here?
>>>
>>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>>> > Hi Everyone!
>>> >
>>> > We are adding the following CQL queries in this patch for adding and
>>> dropping identities in the new `system_auth.identity_to_role` table.
>>> >
>>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>>> > DROP IDENTITY 'testIdentity';
>>> >
>>> > Please let us know if anyone has any concerns!
>>> >
>>> > Thanks,
>>> > Jyothsna Konisa.
>>> >
>>> >
>>> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <
>>> derek@chen-becker.org
>>> > <ma...@chen-becker.org>> wrote:
>>> >
>>> > Sounds great, thanks for the clarification!
>>> >
>>> > Cheers,
>>> >
>>> > Derek
>>> >
>>> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <djoshi@apache.org
>>> > <ma...@apache.org>> wrote:
>>> >
>>> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>>> >> <derek@chen-becker.org <ma...@chen-becker.org>> wrote:
>>> >>
>>> >> This certainly looks like a nice addition to the operator's
>>> >> tools for securing cluster access. Out of curiosity, is there
>>> >> anything in this work that would *preclude* a different
>>> >> authentication scheme for internode at some point in the
>>> >> future? Has there ever been discussion of pluggability similar
>>> >> to the client protocol?
>>> >
>>> > This is a pluggable implementation so it's not mandatory to use
>>> > it and doesn't preclude one from using a different mechanism in
>>> > the future. We haven't explicitly discussed pluggability i.e.
>>> > part of protocol negotiation in the past for internode
>>> > connections. However, this work also does not preclude us from
>>> > implementing such changes. If we do add negotiation this could
>>> > be one of the authentication mechanisms. So it would be
>>> > complimentary.
>>> >
>>> >
>>> >> Also, am I correct in understanding that this would allow for
>>> >> multiple certificates for the same identity (e.g. distinct
>>> >> cert per node)? I certainly understand the decision to keep
>>> >> things simple and have all nodes share identity from the
>>> >> perspective of operational simplicity, but I also don't want
>>> >> to get in a situation where a single compromised node would
>>> >> require an invalidation and redeployment on all nodes in the
>>> >> cluster.
>>> >
>>> > I don't recommend all nodes share the same certificate. Each
>>> > node in the cluster should obtain a unique certificate with the
>>> > same SPIFFE. In the event a node is compromised, the operator
>>> > can revoke that node's certificate without having to redeploy
>>> to
>>> > all nodes in the cluster.
>>> >
>>> > thanks,
>>> >
>>> > Dinesh
>>> >
>>> >
>>> >
>>> > --
>>> > +---------------------------------------------------------------+
>>> > | Derek Chen-Becker |
>>> > | GPG Key available at https://keybase.io/dchenbecker
>>> > <https://keybase.io/dchenbecker>and |
>>> > | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>>> > <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org> |
>>> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
>>> > +---------------------------------------------------------------+
>>> >
>>>
>>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Jyothsna Konisa <jy...@gmail.com>.
Hi Yuki,
You are right regarding adding a custom validator. If one wants to
implement a CN based validator, they can do that and configure that
validator in Cassandra.yaml in "authenticator.parameters.
validator_class_name".
Regarding a role having multiple identities, yes a role can have multiple
identities associated with it. For example, there can be several read_only
users for a given cluster, so the role `readonly_user` can be associated
with multiple identities.
Regarding the uniqueness of identity, each identity should be associated
with only one role. For example, a single identity can not be both admin
user and a read only user.
We have ensured this by carefully designing the schema of the new table for
storing identity information by making identity as the primary key which
guarantees that each identity is unique and the same role can have multiple
identities.
Thanks,
Jyothsna Konisa.
On Sun, Jun 18, 2023 at 5:42 PM Yuki Morishita <mo...@gmail.com> wrote:
> HI,
>
> I was discussing with users the other day regarding a similar feature.
> They were thinking of implementing the custom Authenticator similar to
> what MySQL offers:
>
> CREATE USER 'jeffrey'@'localhost'
> REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
> O=MySQL demo client certificate/
> CN=client/emailAddress=client@example.com';
>
> (https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls)
>
> I think they can implement a custom Validator that validates the identity
> (for their case, CN) associated with a role using the certificate's
> subject, so that's great!
>
> Regarding new CQL syntax,
>
> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
> > DROP IDENTITY 'testIdentity';
>
> This means a role can have multiple identities, and each identities must
> be unique?
> How can users check what identities are associated with certain roles?
>
>
> On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org> wrote:
>
>> Folks, any feedback here?
>>
>> On 6/15/23 12:46, Jyothsna Konisa wrote:
>> > Hi Everyone!
>> >
>> > We are adding the following CQL queries in this patch for adding and
>> dropping identities in the new `system_auth.identity_to_role` table.
>> >
>> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
>> > DROP IDENTITY 'testIdentity';
>> >
>> > Please let us know if anyone has any concerns!
>> >
>> > Thanks,
>> > Jyothsna Konisa.
>> >
>> >
>> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <derek@chen-becker.org
>> > <ma...@chen-becker.org>> wrote:
>> >
>> > Sounds great, thanks for the clarification!
>> >
>> > Cheers,
>> >
>> > Derek
>> >
>> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <djoshi@apache.org
>> > <ma...@apache.org>> wrote:
>> >
>> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>> >> <derek@chen-becker.org <ma...@chen-becker.org>> wrote:
>> >>
>> >> This certainly looks like a nice addition to the operator's
>> >> tools for securing cluster access. Out of curiosity, is there
>> >> anything in this work that would *preclude* a different
>> >> authentication scheme for internode at some point in the
>> >> future? Has there ever been discussion of pluggability similar
>> >> to the client protocol?
>> >
>> > This is a pluggable implementation so it's not mandatory to use
>> > it and doesn't preclude one from using a different mechanism in
>> > the future. We haven't explicitly discussed pluggability i.e.
>> > part of protocol negotiation in the past for internode
>> > connections. However, this work also does not preclude us from
>> > implementing such changes. If we do add negotiation this could
>> > be one of the authentication mechanisms. So it would be
>> > complimentary.
>> >
>> >
>> >> Also, am I correct in understanding that this would allow for
>> >> multiple certificates for the same identity (e.g. distinct
>> >> cert per node)? I certainly understand the decision to keep
>> >> things simple and have all nodes share identity from the
>> >> perspective of operational simplicity, but I also don't want
>> >> to get in a situation where a single compromised node would
>> >> require an invalidation and redeployment on all nodes in the
>> >> cluster.
>> >
>> > I don't recommend all nodes share the same certificate. Each
>> > node in the cluster should obtain a unique certificate with the
>> > same SPIFFE. In the event a node is compromised, the operator
>> > can revoke that node's certificate without having to redeploy to
>> > all nodes in the cluster.
>> >
>> > thanks,
>> >
>> > Dinesh
>> >
>> >
>> >
>> > --
>> > +---------------------------------------------------------------+
>> > | Derek Chen-Becker |
>> > | GPG Key available at https://keybase.io/dchenbecker
>> > <https://keybase.io/dchenbecker>and |
>> > | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
>> > <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org> |
>> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
>> > +---------------------------------------------------------------+
>> >
>>
>>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Yuki Morishita <mo...@gmail.com>.
HI,
I was discussing with users the other day regarding a similar feature.
They were thinking of implementing the custom Authenticator similar to what
MySQL offers:
CREATE USER 'jeffrey'@'localhost'
REQUIRE SUBJECT '/C=SE/ST=Stockholm/L=Stockholm/
O=MySQL demo client certificate/
CN=client/emailAddress=client@example.com';
(https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls)
I think they can implement a custom Validator that validates the identity
(for their case, CN) associated with a role using the certificate's
subject, so that's great!
Regarding new CQL syntax,
> ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
> DROP IDENTITY 'testIdentity';
This means a role can have multiple identities, and each identities must be
unique?
How can users check what identities are associated with certain roles?
On Sun, Jun 18, 2023 at 12:15 AM Dinesh Joshi <dj...@apache.org> wrote:
> Folks, any feedback here?
>
> On 6/15/23 12:46, Jyothsna Konisa wrote:
> > Hi Everyone!
> >
> > We are adding the following CQL queries in this patch for adding and
> dropping identities in the new `system_auth.identity_to_role` table.
> >
> > ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
> > DROP IDENTITY 'testIdentity';
> >
> > Please let us know if anyone has any concerns!
> >
> > Thanks,
> > Jyothsna Konisa.
> >
> >
> > On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <derek@chen-becker.org
> > <ma...@chen-becker.org>> wrote:
> >
> > Sounds great, thanks for the clarification!
> >
> > Cheers,
> >
> > Derek
> >
> > On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <djoshi@apache.org
> > <ma...@apache.org>> wrote:
> >
> >> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
> >> <derek@chen-becker.org <ma...@chen-becker.org>> wrote:
> >>
> >> This certainly looks like a nice addition to the operator's
> >> tools for securing cluster access. Out of curiosity, is there
> >> anything in this work that would *preclude* a different
> >> authentication scheme for internode at some point in the
> >> future? Has there ever been discussion of pluggability similar
> >> to the client protocol?
> >
> > This is a pluggable implementation so it's not mandatory to use
> > it and doesn't preclude one from using a different mechanism in
> > the future. We haven't explicitly discussed pluggability i.e.
> > part of protocol negotiation in the past for internode
> > connections. However, this work also does not preclude us from
> > implementing such changes. If we do add negotiation this could
> > be one of the authentication mechanisms. So it would be
> > complimentary.
> >
> >
> >> Also, am I correct in understanding that this would allow for
> >> multiple certificates for the same identity (e.g. distinct
> >> cert per node)? I certainly understand the decision to keep
> >> things simple and have all nodes share identity from the
> >> perspective of operational simplicity, but I also don't want
> >> to get in a situation where a single compromised node would
> >> require an invalidation and redeployment on all nodes in the
> >> cluster.
> >
> > I don't recommend all nodes share the same certificate. Each
> > node in the cluster should obtain a unique certificate with the
> > same SPIFFE. In the event a node is compromised, the operator
> > can revoke that node's certificate without having to redeploy to
> > all nodes in the cluster.
> >
> > thanks,
> >
> > Dinesh
> >
> >
> >
> > --
> > +---------------------------------------------------------------+
> > | Derek Chen-Becker |
> > | GPG Key available at https://keybase.io/dchenbecker
> > <https://keybase.io/dchenbecker>and |
> > | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
> > <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org> |
> > | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
> > +---------------------------------------------------------------+
> >
>
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
Folks, any feedback here?
On 6/15/23 12:46, Jyothsna Konisa wrote:
> Hi Everyone!
>
> We are adding the following CQL queries in this patch for adding and dropping identities in the new `system_auth.identity_to_role` table.
>
> ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
> DROP IDENTITY 'testIdentity';
>
> Please let us know if anyone has any concerns!
>
> Thanks,
> Jyothsna Konisa.
>
>
> On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <derek@chen-becker.org
> <ma...@chen-becker.org>> wrote:
>
> Sounds great, thanks for the clarification!
>
> Cheers,
>
> Derek
>
> On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <djoshi@apache.org
> <ma...@apache.org>> wrote:
>
>> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker
>> <derek@chen-becker.org <ma...@chen-becker.org>> wrote:
>>
>> This certainly looks like a nice addition to the operator's
>> tools for securing cluster access. Out of curiosity, is there
>> anything in this work that would *preclude* a different
>> authentication scheme for internode at some point in the
>> future? Has there ever been discussion of pluggability similar
>> to the client protocol?
>
> This is a pluggable implementation so it's not mandatory to use
> it and doesn't preclude one from using a different mechanism in
> the future. We haven't explicitly discussed pluggability i.e.
> part of protocol negotiation in the past for internode
> connections. However, this work also does not preclude us from
> implementing such changes. If we do add negotiation this could
> be one of the authentication mechanisms. So it would be
> complimentary.
>
>
>> Also, am I correct in understanding that this would allow for
>> multiple certificates for the same identity (e.g. distinct
>> cert per node)? I certainly understand the decision to keep
>> things simple and have all nodes share identity from the
>> perspective of operational simplicity, but I also don't want
>> to get in a situation where a single compromised node would
>> require an invalidation and redeployment on all nodes in the
>> cluster.
>
> I don't recommend all nodes share the same certificate. Each
> node in the cluster should obtain a unique certificate with the
> same SPIFFE. In the event a node is compromised, the operator
> can revoke that node's certificate without having to redeploy to
> all nodes in the cluster.
>
> thanks,
>
> Dinesh
>
>
>
> --
> +---------------------------------------------------------------+
> | Derek Chen-Becker |
> | GPG Key available at https://keybase.io/dchenbecker
> <https://keybase.io/dchenbecker>and |
> | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org
> <https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org> |
> | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
> +---------------------------------------------------------------+
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Jyothsna Konisa <jy...@gmail.com>.
Hi Everyone!
We are adding the following CQL queries in this patch for adding and
dropping identities in the new `system_auth.identity_to_role` table.
ADD IDENTITY 'testIdentity' TO ROLE 'testRole';
DROP IDENTITY 'testIdentity';
Please let us know if anyone has any concerns!
Thanks,
Jyothsna Konisa.
On Sat, Jun 3, 2023 at 7:18 AM Derek Chen-Becker <de...@chen-becker.org>
wrote:
> Sounds great, thanks for the clarification!
>
> Cheers,
>
> Derek
>
> On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <dj...@apache.org> wrote:
>
>> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker <de...@chen-becker.org>
>> wrote:
>>
>> This certainly looks like a nice addition to the operator's tools for
>> securing cluster access. Out of curiosity, is there anything in this work
>> that would *preclude* a different authentication scheme for internode at
>> some point in the future? Has there ever been discussion of pluggability
>> similar to the client protocol?
>>
>>
>> This is a pluggable implementation so it's not mandatory to use it and
>> doesn't preclude one from using a different mechanism in the future. We
>> haven't explicitly discussed pluggability i.e. part of protocol negotiation
>> in the past for internode connections. However, this work also does not
>> preclude us from implementing such changes. If we do add negotiation this
>> could be one of the authentication mechanisms. So it would be complimentary.
>>
>>
>> Also, am I correct in understanding that this would allow for multiple
>> certificates for the same identity (e.g. distinct cert per node)? I
>> certainly understand the decision to keep things simple and have all nodes
>> share identity from the perspective of operational simplicity, but I also
>> don't want to get in a situation where a single compromised node would
>> require an invalidation and redeployment on all nodes in the cluster.
>>
>>
>> I don't recommend all nodes share the same certificate. Each node in the
>> cluster should obtain a unique certificate with the same SPIFFE. In the
>> event a node is compromised, the operator can revoke that node's
>> certificate without having to redeploy to all nodes in the cluster.
>>
>> thanks,
>>
>> Dinesh
>>
>
>
> --
> +---------------------------------------------------------------+
> | Derek Chen-Becker |
> | GPG Key available at https://keybase.io/dchenbecker and |
> | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
> | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
> +---------------------------------------------------------------+
>
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Derek Chen-Becker <de...@chen-becker.org>.
Sounds great, thanks for the clarification!
Cheers,
Derek
On Sat, Jun 3, 2023 at 12:48 AM Dinesh Joshi <dj...@apache.org> wrote:
> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker <de...@chen-becker.org>
> wrote:
>
> This certainly looks like a nice addition to the operator's tools for
> securing cluster access. Out of curiosity, is there anything in this work
> that would *preclude* a different authentication scheme for internode at
> some point in the future? Has there ever been discussion of pluggability
> similar to the client protocol?
>
>
> This is a pluggable implementation so it's not mandatory to use it and
> doesn't preclude one from using a different mechanism in the future. We
> haven't explicitly discussed pluggability i.e. part of protocol negotiation
> in the past for internode connections. However, this work also does not
> preclude us from implementing such changes. If we do add negotiation this
> could be one of the authentication mechanisms. So it would be complimentary.
>
>
> Also, am I correct in understanding that this would allow for multiple
> certificates for the same identity (e.g. distinct cert per node)? I
> certainly understand the decision to keep things simple and have all nodes
> share identity from the perspective of operational simplicity, but I also
> don't want to get in a situation where a single compromised node would
> require an invalidation and redeployment on all nodes in the cluster.
>
>
> I don't recommend all nodes share the same certificate. Each node in the
> cluster should obtain a unique certificate with the same SPIFFE. In the
> event a node is compromised, the operator can revoke that node's
> certificate without having to redeploy to all nodes in the cluster.
>
> thanks,
>
> Dinesh
>
--
+---------------------------------------------------------------+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
+---------------------------------------------------------------+
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
> On Jun 2, 2023, at 9:06 PM, Derek Chen-Becker <de...@chen-becker.org> wrote:
>
> This certainly looks like a nice addition to the operator's tools for securing cluster access. Out of curiosity, is there anything in this work that would *preclude* a different authentication scheme for internode at some point in the future? Has there ever been discussion of pluggability similar to the client protocol?
This is a pluggable implementation so it's not mandatory to use it and doesn't preclude one from using a different mechanism in the future. We haven't explicitly discussed pluggability i.e. part of protocol negotiation in the past for internode connections. However, this work also does not preclude us from implementing such changes. If we do add negotiation this could be one of the authentication mechanisms. So it would be complimentary.
> Also, am I correct in understanding that this would allow for multiple certificates for the same identity (e.g. distinct cert per node)? I certainly understand the decision to keep things simple and have all nodes share identity from the perspective of operational simplicity, but I also don't want to get in a situation where a single compromised node would require an invalidation and redeployment on all nodes in the cluster.
I don't recommend all nodes share the same certificate. Each node in the cluster should obtain a unique certificate with the same SPIFFE. In the event a node is compromised, the operator can revoke that node's certificate without having to redeploy to all nodes in the cluster.
thanks,
Dinesh
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Derek Chen-Becker <de...@chen-becker.org>.
Hi Dinesh,
This certainly looks like a nice addition to the operator's tools for
securing cluster access. Out of curiosity, is there anything in this work
that would *preclude* a different authentication scheme for internode at
some point in the future? Has there ever been discussion of pluggability
similar to the client protocol? Also, am I correct in understanding that
this would allow for multiple certificates for the same identity (e.g.
distinct cert per node)? I certainly understand the decision to keep things
simple and have all nodes share identity from the perspective of
operational simplicity, but I also don't want to get in a situation where a
single compromised node would require an invalidation and redeployment on
all nodes in the cluster.
Cheers,
Derek
On Fri, Jun 2, 2023 at 12:57 PM Dinesh Joshi <dj...@apache.org> wrote:
>
> 1. Is there an expectation that this would be used alongside internode
> and client TLS? Would the certificates be the same, different, or is that
> an implementation detail for the specific deployment to determine?
>
>
> I am not sure what you mean by this would be used alongside internode and
> client TLS? The mutual TLS authentication allows the server to authenticate
> the client's identity using a client TLS certificate. The authenticators
> we're adding enable this functionality. There isn't an expectation that the
> same certificates be used. In fact, clients should not use the same
> certificates as the internode.
>
>
> 1. For some reason I'm having trouble understanding the internode
> authentication portion of this ticket (authenticating a client with a
> certificate makes sense vs just authenticating the connection). Why is this
> needed on top of the connection-level TLS we have now?
>
>
> Current connection-level TLS only secures the TLS connection. It doesn't
> authenticate the peer. This adds the ability to authenticate the peer in
> addition to securing the TLS connection.
>
>
> 1. When an operator or DBA is looking to add a new identity is that
> just handled as part of the new CQL statement or is there some certificate
> management required on the nodes? I assume it's just the CA that needs to
> be placed on the nodes to establish trust in the certificate itself then
> authz happening within C* after determining the certificate can be trusted,
> but want to be certain.
>
>
> Each deployment is different so certificate management isn't scope of the
> database itself. However, the operator can rotate the certificates using an
> external agent and Cassandra will pick them up through SSL hot reloading.
> We don't just rely on a CA trusting the client certificate, we extract the
> identity from the certificate (for example: SPIFFE) and ensure that it is
> allowed to access the cluster. This means someone can't just obtain a
> certificate signed by a CA that Cassandra cluster trusts and connect to it.
>
>
> 1. As a minor nit, should we include static certificates in the test
> data? I see they expire in 2033 which is a fair way off, but I wonder if it
> would make sense to generate the certificates as part of the test setup.
>
> Thanks for the feedback!
>
--
+---------------------------------------------------------------+
| Derek Chen-Becker |
| GPG Key available at https://keybase.io/dchenbecker and |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC |
+---------------------------------------------------------------+
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
> On Jun 2, 2023, at 1:56 PM, Christopher Bradford <br...@gmail.com> wrote:
>
> I am not sure what you mean by this would be used alongside internode and client TLS? The mutual TLS authentication allows the server to authenticate the client's identity using a client TLS certificate. The authenticators we're adding enable this functionality. There isn't an expectation that the same certificates be used. In fact, clients should not use the same certificates as the internode.
>
> My apologies if questions (1 and 2) were a bit convoluted. I'm going to walk through both client and internode below as I perceive the PR.
>
> Client TLS connections have the client certificate checked against the trust store (if client_encryption_options.require_client_auth is set to true). It looks like the authenticator in the PR checks the identity in the subject alternative name part of the certificate against identity / roles relationships specified via CQL. This all makes sense to me, but to be clear my question was whether the certificate used by the client is the same as the certificate used to secure the connection. My initial reading here is that yes the certificates are the same, there's only ever one certificate, we're just looking in two locations for trust. We would first be checking the certificate's trust before the request is ever processed (is the CA or this certificate in the trust store). Then the SAN of the certificate is utilized to determine who the request is being performed by which is then matched up with a role and request processing continues as usual.
Correct.
> Internode communication is where I started to get confused. It wasn't clear where we were authorizing identities as trusted. We still have the server_encryption_options.require_client_auth (similar to client_encryption_options.require_client_auth) boolean to force checking the trust of the provided certificate against our trust store. I was looking for a way to specify either an allowed list of identities or a pattern to match on. Rereading the PR showed me that we are extracting the valid identities from the outbound keystore (reference link). This doesn't seem correct as the associated documentation in cassandra.yaml indicates this is where the public and private key information is stored for a node's outbound (client) connections to other nodes. Should this instead be the server_encryption_options.truststore alongside trusted CA certificates? In either case it seems as though we would need to load the public certificate for all servers in the cluster (including the specified SPIFFE SAN). Is that correct? This means there's no way (yet) to match against a specific pattern of identities, instead they must all be explicitly allowed.
The reason we use the keystore is that the node extracts its own identity and expects other nodes in the cluster to share the same identity. This default behavior makes it easy to avoid configuring individual identities of nodes in the cluster. It's critical to recognize that if we had a separate identity for each node in the cluster, then we would need to update all nodes in the cluster when a new node is added or removed. This way all nodes in the cluster can have a shared identity while simultaneously preventing unnecessary operational pain of adding and removing identities each time a node is added or removed from the cluster.
> Back to my original question, it appears as though we are using a single certificate for internode where we first check the trust chain of the certificate then check the subject against a valid list in some store. This is the same behavior for client certificates. The genesis of my question was whether there would be separate certificates for the SPIFFE work on top of the certificates used for the base TLS communication. There are not (which is good IMO) instead a SAN is expected to be included in the certificate which is then used for checking identity. (Note internode and client certificates may still be separate and in most cases should be).
Correct.
> Given I've sorted out questions 1 and 2 in my mental model, question 3 is a little different. I think the question is more how do I manage certificates and trust given these changes? I think this can be answered with:
>
> For clients we provide a CA certificate in the client trust store and identities via the new CQL syntax for mapping roles to SPIFFE identities. Easy.
>
> Internode communication is handled by adding a CA certificate to the server trust store and outbound node client certificates to a store (which is not clear at the moment per above) which include a SPIFFE identity as part of their SAN.
I hope my explanation above clarifies this confusion.
>
> Please let me know if this is accurate.
>
> To recap open questions from above:
> •
> Should we be using server_encryption_options.outbound_keystore or server_encryption_options.truststore for maintaining the list of trusted identities? The current PR uses the former, I propose the latter is more appropriate.
I hope my explanation above clarifies this confusion.
> • Does each trusted certificate (containing an SPIFFE identity SAN) need to be loaded into the location specified in question 1 above?
no.
> • Is there any way to match on a pattern of an identity?
not necessary.
>
> For example my SPIFFE identity may be spiffe://example.com/payments/cassandra/1, in this example cassandra/1 is the identifier for the node and I want to trust anything that matches spiffe://example.com/payments/cassandra/*. My initial reading here is that it is not possible at this time. We could use a
All nodes in a cluster should have the same SPIFFE as they belong to the same cluster. This simplifying assumption helps reduce the operational pain. So ideally one would embed spiffe://example.com/payments/billingcluster.
> • From a documentation perspective, how would you describe a reference implementation? I think the project could benefit from a reference configuration including mTLS for clients and nodes with separate certificates for all components / nodes alongside a sample SPIFFE identity. (This question may be a bit outside of scope for the particular ticket / feature, but it's something to noodle on)
Yes, we can add more documentation with an example to help illustrate the use.
Thanks,
Dinesh
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Christopher Bradford <br...@gmail.com>.
> I am not sure what you mean by this would be used alongside internode and
> client TLS? The mutual TLS authentication allows the server to authenticate
> the client's identity using a client TLS certificate. The authenticators
> we're adding enable this functionality. There isn't an expectation that the
> same certificates be used. In fact, clients should not use the same
> certificates as the internode.
My apologies if questions (1 and 2) were a bit convoluted. I'm going to
walk through both client and internode below as I perceive the PR.
Client TLS connections have the client certificate checked against the
trust store (if client_encryption_options.require_client_auth is set to
true). It looks like the authenticator in the PR checks the identity in the
subject alternative name part of the certificate against identity / roles
relationships specified via CQL. This all makes sense to me, but to be
clear my question was whether the certificate used by the client is the
same as the certificate used to secure the connection. My initial reading
here is that *yes* the certificates are the same, there's only ever one
certificate, we're just looking in two locations for trust. We would first
be checking the certificate's trust before the request is ever processed
(is the CA or this certificate in the trust store). Then the SAN of the
certificate is utilized to determine *who* the request is being performed
by which is then matched up with a role and request processing continues as
usual.
Internode communication is where I started to get confused. It wasn't clear
where we were authorizing identities as trusted. We still have the
server_encryption_options.require_client_auth (similar to
client_encryption_options.require_client_auth) boolean to force checking
the trust of the provided certificate against our trust store. I was
looking for a way to specify either an allowed list of identities or a
pattern to match on. Rereading the PR showed me that we are extracting the
valid identities from the *outbound key*store (reference link
<https://github.com/apache/cassandra/pull/2372/files#diff-735a80fa49063fd54dfb776e8bacd825f90e74afdddd8cec72e87f8802d77a3aR77>).
This doesn't seem correct as the associated documentation
<https://github.com/apache/cassandra/blob/trunk/conf/cassandra.yaml#L1389-L1394>
in cassandra.yaml indicates this is where the public and private key
information is stored for a node's outbound (client) connections to other
nodes. Should this instead be the server_encryption_options.truststore
alongside trusted CA certificates? In either case it seems as though we
would need to load the public certificate for all servers in the cluster
(including the specified SPIFFE SAN). Is that correct? This means there's
no way (yet) to match against a specific pattern of identities, instead
they must all be explicitly allowed.
Back to my original question, it appears as though we are using a single
certificate for internode where we first check the trust chain of the
certificate then check the subject against a valid list in *some store*.
This is the same behavior for client certificates. The genesis of my
question was whether there would be *separate* certificates for the SPIFFE
work on top of the certificates used for the base TLS communication. *There
are not (which is good IMO) instead a SAN is expected to be included in the
certificate which is then used for checking identity.* (Note internode and
client certificates may still be separate and in most cases should be).
Given I've sorted out questions 1 and 2 in my mental model, question 3 is a
little different. I think the question is more *how do I manage
certificates and trust given these changes?* I think this can be answered
with:
For clients we provide a CA certificate in the client trust store and
identities via the new CQL syntax for mapping roles to SPIFFE identities.
Easy.
Internode communication is handled by adding a CA certificate to the server
trust store and outbound node client certificates to a store (which is not
clear at the moment per above) which include a SPIFFE identity as part of
their SAN.
Please let me know if this is accurate.
To recap open questions from above:
1. Should we be using server_encryption_options.outbound_keystore or
server_encryption_options.truststore for maintaining the list of trusted
identities? The current PR uses the former, I propose the latter is more
appropriate.
2. Does each trusted certificate (containing an SPIFFE identity SAN)
need to be loaded into the location specified in question 1 above?
3. Is there any way to match on a pattern of an identity?
For example my SPIFFE identity may be
*spiffe://example.com/payments/cassandra/1
<http://example.com/payments/cassandra/1>*, in this example *cassandra/1*
is the identifier for the node and I want to trust anything that
matches *spiffe://example.com/payments/cassandra/*
<http://example.com/payments/cassandra/*>.* My initial reading here is
that it is not possible at this time. We could use a common workload
identifier across all nodes in the cluster (ie
*spiffe://example.com/payments/cassandra
<http://example.com/payments/cassandra>*) then we would only need a
single certificate in the trust store with the associated identity. This
leads to my next question...
4. From a documentation perspective, how would you describe a reference
implementation? I think the project could benefit from a reference
configuration including mTLS for clients and nodes with separate
certificates for all components / nodes alongside a sample SPIFFE identity.
(This question may be a bit outside of scope for the particular ticket /
feature, but it's something to noodle on)
Again thank you for the contribution and patience as I work through the
code and mental model mapping this on top of my existing C* / TLS knowledge.
Cheers,
~Chris
Christopher Bradford
On Fri, Jun 2, 2023 at 2:57 PM Dinesh Joshi <dj...@apache.org> wrote:
>
> 1. Is there an expectation that this would be used alongside internode
> and client TLS? Would the certificates be the same, different, or is that
> an implementation detail for the specific deployment to determine?
>
>
> I am not sure what you mean by this would be used alongside internode and
> client TLS? The mutual TLS authentication allows the server to authenticate
> the client's identity using a client TLS certificate. The authenticators
> we're adding enable this functionality. There isn't an expectation that the
> same certificates be used. In fact, clients should not use the same
> certificates as the internode.
>
>
> 1. For some reason I'm having trouble understanding the internode
> authentication portion of this ticket (authenticating a client with a
> certificate makes sense vs just authenticating the connection). Why is this
> needed on top of the connection-level TLS we have now?
>
>
> Current connection-level TLS only secures the TLS connection. It doesn't
> authenticate the peer. This adds the ability to authenticate the peer in
> addition to securing the TLS connection.
>
>
> 1. When an operator or DBA is looking to add a new identity is that
> just handled as part of the new CQL statement or is there some certificate
> management required on the nodes? I assume it's just the CA that needs to
> be placed on the nodes to establish trust in the certificate itself then
> authz happening within C* after determining the certificate can be trusted,
> but want to be certain.
>
>
> Each deployment is different so certificate management isn't scope of the
> database itself. However, the operator can rotate the certificates using an
> external agent and Cassandra will pick them up through SSL hot reloading.
> We don't just rely on a CA trusting the client certificate, we extract the
> identity from the certificate (for example: SPIFFE) and ensure that it is
> allowed to access the cluster. This means someone can't just obtain a
> certificate signed by a CA that Cassandra cluster trusts and connect to it.
>
>
> 1. As a minor nit, should we include static certificates in the test
> data? I see they expire in 2033 which is a fair way off, but I wonder if it
> would make sense to generate the certificates as part of the test setup.
>
> Thanks for the feedback!
>
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Dinesh Joshi <dj...@apache.org>.
> Is there an expectation that this would be used alongside internode and client TLS? Would the certificates be the same, different, or is that an implementation detail for the specific deployment to determine?
I am not sure what you mean by this would be used alongside internode and client TLS? The mutual TLS authentication allows the server to authenticate the client's identity using a client TLS certificate. The authenticators we're adding enable this functionality. There isn't an expectation that the same certificates be used. In fact, clients should not use the same certificates as the internode.
> For some reason I'm having trouble understanding the internode authentication portion of this ticket (authenticating a client with a certificate makes sense vs just authenticating the connection). Why is this needed on top of the connection-level TLS we have now?
Current connection-level TLS only secures the TLS connection. It doesn't authenticate the peer. This adds the ability to authenticate the peer in addition to securing the TLS connection.
> When an operator or DBA is looking to add a new identity is that just handled as part of the new CQL statement or is there some certificate management required on the nodes? I assume it's just the CA that needs to be placed on the nodes to establish trust in the certificate itself then authz happening within C* after determining the certificate can be trusted, but want to be certain.
Each deployment is different so certificate management isn't scope of the database itself. However, the operator can rotate the certificates using an external agent and Cassandra will pick them up through SSL hot reloading. We don't just rely on a CA trusting the client certificate, we extract the identity from the certificate (for example: SPIFFE) and ensure that it is allowed to access the cluster. This means someone can't just obtain a certificate signed by a CA that Cassandra cluster trusts and connect to it.
> As a minor nit, should we include static certificates in the test data? I see they expire in 2033 which is a fair way off, but I wonder if it would make sense to generate the certificates as part of the test setup.
Thanks for the feedback!
Re: CASSANDRA-18554 - mTLS based client and internode authenticators
Posted by Christopher Bradford <br...@gmail.com>.
Hi Dinesh,
This is awesome. I'm certain myself and the folks on the K8ssandra project
will be following along with this ticket. I had a few questions after
looking at the JIRA and attached PR:
1. Is there an expectation that this would be used alongside internode
and client TLS? Would the certificates be the same, different, or is that
an implementation detail for the specific deployment to determine?
2. For some reason I'm having trouble understanding the internode
authentication portion of this ticket (authenticating a client with a
certificate makes sense vs just authenticating the connection). Why is this
needed on top of the connection-level TLS we have now?
3. When an operator or DBA is looking to add a new identity is that just
handled as part of the new CQL statement or is there some certificate
management required on the nodes? I assume it's just the CA that needs to
be placed on the nodes to establish trust in the certificate itself then
authz happening within C* after determining the certificate can be trusted,
but want to be certain.
4. As a minor nit, should we include static certificates in the test
data? I see they expire in 2033 which is a fair way off, but I wonder if it
would make sense to generate the certificates as part of the test setup.
Thanks for the contribution (along with the ping on dev@) and I look
forward to seeing this functionality.
Cheers,
~Chris
Christopher Bradford
On Fri, Jun 2, 2023 at 11:03 AM Dinesh Joshi <dj...@apache.org> wrote:
> Hi dev@,
>
> We're planning to add mTLS client authentication as well as internode
> authentication in CASSANDRA-18554. While this is all backward compatible,
> we thought it would be a good idea to notify the dev list. If anybody is
> interested please take a look at the JIRA.
>
> Thanks,
>
> Dinesh