Package org.apache.cassandra.auth
Class SpiffeCertificateValidator
java.lang.Object
org.apache.cassandra.auth.SpiffeCertificateValidator
- All Implemented Interfaces:
MutualTlsCertificateValidator
This class assumes that the identity of a certificate is SPIFFE which is a URI that is present as part of the SAN
of the client certificate. It has logic to extract identity (Spiffe) out of a certificate & knows how to validate
the client certificates.
Example: internode_authenticator: class_name : org.apache.cassandra.auth.MutualTlsAuthenticator parameters : validator_class_name: org.apache.cassandra.auth.SpiffeCertificateValidator authenticator: class_name : org.apache.cassandra.auth.MutualTlsInternodeAuthenticator parameters : validator_class_name: org.apache.cassandra.auth.SpiffeCertificateValidator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionidentity(Certificate[] clientCertificateChain) This method should provide logic to extract identity out of a certificate to perform mTLS authentication.booleanisValidCertificate(Certificate[] clientCertificateChain) Perform any checks that are to be performed on the certificate before making authorization check to grant the access to the client during mTLS connection.
-
Constructor Details
-
SpiffeCertificateValidator
public SpiffeCertificateValidator()
-
-
Method Details
-
isValidCertificate
Description copied from interface:MutualTlsCertificateValidatorPerform any checks that are to be performed on the certificate before making authorization check to grant the access to the client during mTLS connection. For example - Verifying CA information - Checking CN information - Validating Issuer information - Checking organization information etc- Specified by:
isValidCertificatein interfaceMutualTlsCertificateValidator- Parameters:
clientCertificateChain- client certificate chain- Returns:
- returns if the certificate is valid or not
-
identity
Description copied from interface:MutualTlsCertificateValidatorThis method should provide logic to extract identity out of a certificate to perform mTLS authentication. An example of identity could be the following - an identifier in SAN of the certificate like SPIFFE - CN of the certificate - any other fields in the certificate can be combined and be used as identifier of the certificate- Specified by:
identityin interfaceMutualTlsCertificateValidator- Parameters:
clientCertificateChain- client certificate chain- Returns:
- identifier extracted from certificate
- Throws:
AuthenticationException- when identity cannot be extracted
-