Microsoft Dev Blogs

How to use self-signed certificates to connect to Azure Managed Instance for Apache Cassandra

thumbnail

Table of Contents

  1. Introduction
  2. Generate Self-Signed Certificates
  3. Connecting to the Cluster with cqlsh
  4. Connecting to the Cluster with Python
  5. Additional Security Measures

Introduction

Azure Managed Instance for Apache Cassandra provides a fully managed service for running Apache Cassandra workloads on Azure. By default, connections to the cluster are secured using SSL certificates signed by a Certificate Authority. This blog post explores how to use self-signed certificates to enhance authentication between the client and the server.

Generate Self-Signed Certificates

  1. Create a configuration file like gen_rootCa_cert.conf from DataStax documentation.
  2. Use OpenSSL to generate the key and certificate in PEM format.

Connecting to the Cluster with cqlsh

  • Configure cqlsh with the path to your client certificate file and key file.
  • Validate the cluster's certificate using openssl.

Connecting to the Cluster with Python

  • Adjust contact points, port, certificates, key file, and queries based on your cluster setup.
  • Use the cluster's node addresses provided by Azure Managed Instance for Apache Cassandra.

Additional Security Measures

  • For an additional layer of protection, verify the server's identity to prevent connections to unauthorized servers.
  • Azure Managed Instance for Apache Cassandra offers high security by default and can be used safely with minimal configuration.