Commit Graph

18 Commits

Author SHA1 Message Date
Stefan Miklosovic d75d603281
Merge branch 'cassandra-6.0' into trunk 2026-07-20 20:47:47 +02:00
Stefan Miklosovic 15a6bac06d
Merge branch 'cassandra-5.0' into cassandra-6.0 2026-07-20 20:45:18 +02:00
Stefan Miklosovic bd345213c1
Merge branch 'cassandra-4.1' into cassandra-5.0 2026-07-20 20:43:56 +02:00
Stefan Miklosovic 1c702382de
Merge branch 'cassandra-4.0' into cassandra-4.1 2026-07-20 20:42:36 +02:00
Jeremiah Jordan 26d7b166ba
Verify extension type before initializing reflectively-loaded classes
Cassandra resolves pluggable extensions by class name from configuration, schema, and tooling
inputs. These names were loaded with an initializing Class.forName(name) and type-checked only
afterward, so the named class ran its static initializer before its type was confirmed. After this
change such classes will be loaded without initialization, verified against the expected interface or
base class, and initialized only through normal use after validation.

A shared FBUtilities.classForNameWithoutInitialization helper and typed
instanceOrConstruct/construct overloads apply this to the configurable extension points loaded by
class name: the authentication, authorization, role-management, network and
internode-authenticator backends, the partitioner, audit logger, configuration loader, seed provider,
snitch, abstract types, secondary and custom indexes, compaction strategy, compressor, replication
strategy, SASI analyzers, key and cache providers, query handler, storage and stream hooks, tracing,
the JMX authorization proxy, MBeans, the monotonic clock, nodetool Sjk, triggers, the
sstableloader and stress class options, and diagnostic event classes (loaded without initialization
and checked against DiagnosticEvent, preserving the InvalidClassException contract and the existing
package restriction).

Regression tests confirm that an invalid-type load is rejected without initializing the target
class, and that valid implementations still resolve.

Hadoop client integration and hard-coded JDK and internal class probes are left unchanged.

patch by Jeremiah Jordan; reviewed by Stefan Miklosovic for CASSANDRA-21525
2026-07-20 20:03:45 +02:00
Joel Shepherd 281c1dc92c
Enable IAuthenticator to declare supported and alterable role options
With negotiated authentication (CEP-50), nodes may be configured with multiple authenticators. Prior to this change,
a number of areas in the code assumed that there was a single configured authenticator and contained logic that
switched depending on the authenticator type. This logic won't work when multiple authenticators can be configured.
This change eliminates most calls to DataDescriptor.getAuthenticator(), by enabling individual authenticators to
declare the role attributes they support, requiring callers to specify the type of authenticator they're looking
for, and directly returning whether the node can enforce authn or not rather than inferring it by the presence of
an authenticator.

Testing done: Unit tests for auth and config packages; d-tests for auth-related functionality (e.g. ColumnMasks).

patch by Joel Shepherd; reviewed by Stefan Miklosovic, Andy Tolbert for CASSANDRA-20834
2026-04-12 22:15:49 +02:00
Stefan Miklosovic 2d3d7788f4
Fix failing simulator dtests after CASSANDRA-20368
patch by Stefan Miklosovic; reviewed by David Capwell for CASSANDRA-20450
2025-03-18 19:25:47 +01:00
Tiago Alves c925228a4d
Improve error messages when initializing auth classes
patch by Tiago Alves; reviewed by Stefan Miklosovic, Maxwell Guo for CASSANDRA-20368
2025-03-17 18:37:50 +01:00
Tiago Alves 2dea5c7588
Use ParameterizedClass for all auth-related implementations
Uses ParameterizedClass for IAuthorizer, INetworkAuthorizer, and
IRoleManager implementations enabling those to be configurable from
parameters specified directly in cassandra.yaml.

Opportunistically makes consistent the initialization and setting of
all auth-related implementations and removes code duplication.

Notes:
 * IInternodeAuthenticator implementations are expected to be set as
   default directly in DatabaseDescriptor instead of done via
   AuthConfig.applyAuth(). This is assumed in tests and client logic.
   For instance ReconnectableSnitchHelperTest fetches this authenticator
   before calling daemonInitialize(). Also, BulkLoader fetches this
   directly when creating an outbound connection.
 * Changing this behavior in BulkLoader causes a cascade of changes.
   First, one would need to add AuthConfig.applyAuth() directly in
   clientInitialize() and then would need to enable all the additional
   classes that this change causes. Long term this might be justified
   as if we're depending on the auth logic to be properly set. However,
   in the context of this change it was decided to postpone further
   changes.
 * Standardize auth-related configurations by using a short-form with
   the class name instead of the full qualified class name containing
   the package name.

 patch by Tiago Alves; reviewed by Mick Semb Wever, Stefan Miklosovic for CASSANDRA-19946
2024-10-09 13:51:51 +02:00
Shailaja Koppu 933137fb14 CIDR filtering authorizer
Patch by Shailaja Koppu, Yifan Cai; Reviewed by Dinesh Joshi, Yifan Cai for CASSANDRA-18592

Co-Authored-By: Yifan Cai <ycai@apache.org>
2023-07-28 20:10:02 -07:00
jkonisa f078c02cb5 Adding Mutual TLS authenticators for client & internode connections
Patch by Jyothsna Konisa & Dinesh Joshi; reviewed by Yifan Cai, Jon Meredith,
Yuki Morishita & Dinesh Joshi for CASSANDRA-18554

Co-Authored-By: Dinesh Joshi <djoshi@apache.org>
2023-07-28 13:54:06 -07:00
Ekaterina Dimitrova a67a2a2441 Handle config parameters upper bound on startup; Fix auto_snapshot_ttl and paxos_purge_grace_period min unit validations
patch by Ekaterina Dimitrova and Andres de la Pena; reviewed by Andres de la Pena and Caleb Rackliffe for CASSANDRA-17571

Co-authored-by: Ekaterina Dimitrova <ekaterina.dimitrova@datastax.com>
Co-authored-by: Andrés de la Peña <a.penya.garcia@gmail.com>
2022-05-20 14:27:20 -04:00
Ekaterina Dimitrova dac738d2eb Transfer config parameters to the new types; Fix corner case for permissions_update_interval, roles_update_interval, credentials_update_interval;Fix typo in Config annotation; Made Converters type safe and fixed a few cases where converters used the wrong type; o should be provided with unit to DataStorageSpec and DurationStorageSpec; Fix null bug in DataStorageSpec and DurationSpec
patch by Ekaterina Dimitrova, David Capwell; reviewed by David Capwell and Caleb Rackliffe for CASSANDRA-17431

Co-authored-by: Ekaterina Dimitrova <ekaterina.dimitrova@datastax.com>
Co-authored-by: David Capwell <dcapwell@apache.org>
2022-04-20 10:20:30 -04:00
Ekaterina Dimitrova 755fd9446b Transfer parameters to the newly introduced configuration framework (3)
patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
2022-02-05 22:28:14 -05:00
Blake Eggleston 54de771e64 Add network authz
Patch by Blake Eggleston; Reviewed by Sam Tunnicliffe for CASSANDRA-13985
2018-04-23 09:55:31 -07:00
Ariel Weisberg 732d1af866 Outbound TCP connections should consult internode authenticator.
Patch by Ariel Weisberg; Reviewed by Marcus Eriksson for CASSANDRA-13324
2017-03-24 15:26:50 -04:00
Robert Stupp f56c0c6685 FOLLOW-UP OF Let DatabaseDescriptor not implicitly startup services
patch by Robert Stupp; reviewed by Jeremiah Jordon for CASSANDRA-9054
2016-08-20 21:18:27 +10:00
Robert Stupp 9797511c56 Let DatabaseDescriptor not implicitly startup services
patch by Robert Stupp; reviewed by Blake Eggleston for CASSANDRA-9054
2016-08-18 11:44:03 +10:00