Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

9/16/2019

Reading time:1 min

eevans/cassandra-ca-manager

by John Doe

Easily create Java keystores with aself-signed CA trust chain, for Apache Cassandra (and other Java applications).Step 1.Create a YAML-formatted manifest describing the certificate authority andmachine certificates. # The top-level working directory base_directory: /path/to/base/directory # The Certificate Authority authority: key: size: 2048 cert: subject: organization: WMF country: US unit: Services valid: 365 password: qwerty # Java keystores keystores: - name: restbase1001-a key: size: 2048 cert: subject: organization: WMF country: US unit: Services valid: 365 password: qwerty - name: restbase1001-b key: size: 2048 cert: subject: organization: WMF country: US unit: Services valid: 365 password: qwerty - name: restbase1002-a key: size: 2048 cert: subject: organization: WMF country: US unit: Services valid: 365 password: qwertyStep 2.Run the script with the manifest as its only argument:$ cassandra-ca-manager manifest.yaml$ tree /path/to/base/directory/path/to/base/directory├── restbase1001-a│   ├── restbase1001-a.crt│   └── restbase1001-a.csr│   └── restbase1001-a.kst├── restbase1001-b│   ├── restbase1001-b.crt│   └── restbase1001-b.csr│   └── restbase1001-b.kst├── restbase1002-a│   ├── restbase1002-a.crt│   └── restbase1002-a.csr│   └── restbase1002-a.kst├── rootCa.crt├── rootCa.key├── rootCa.srl└── truststore3 directories, 13 filesNote: cassandra-ca-manager is idempotent, it will not overwrite any existingmaterial in the base directory. To create additional keystores later, simplyadd their definitions to the manifest, and re-run the script.Step 3.Copy the resulting truststore and *.kst files to their respectivemachines, and configure serverand/or client encryption accordingly.

Illustration Image

Easily create Java keystores with a self-signed CA trust chain, for Apache Cassandra (and other Java applications).

Step 1.

Create a YAML-formatted manifest describing the certificate authority and machine certificates.

    # The top-level working directory
    base_directory: /path/to/base/directory
    # The Certificate Authority
    authority:
      key:
        size: 2048
      cert:
        subject:
          organization: WMF
          country: US
          unit: Services
        valid: 365
      password: qwerty
    # Java keystores
    keystores:
      - name: restbase1001-a
        key:
          size: 2048
        cert:
          subject:
            organization: WMF
            country: US
            unit: Services
          valid: 365
        password: qwerty
      - name: restbase1001-b
        key:
          size: 2048
        cert:
          subject:
            organization: WMF
            country: US
            unit: Services
          valid: 365
        password: qwerty
    
      - name: restbase1002-a
        key:
          size: 2048
        cert:
          subject:
            organization: WMF
            country: US
            unit: Services
          valid: 365
        password: qwerty

Step 2.

Run the script with the manifest as its only argument:

$ cassandra-ca-manager manifest.yaml
$ tree /path/to/base/directory
/path/to/base/directory
├── restbase1001-a
│   ├── restbase1001-a.crt
│   └── restbase1001-a.csr
│   └── restbase1001-a.kst
├── restbase1001-b
│   ├── restbase1001-b.crt
│   └── restbase1001-b.csr
│   └── restbase1001-b.kst
├── restbase1002-a
│   ├── restbase1002-a.crt
│   └── restbase1002-a.csr
│   └── restbase1002-a.kst
├── rootCa.crt
├── rootCa.key
├── rootCa.srl
└── truststore
3 directories, 13 files

Note: cassandra-ca-manager is idempotent, it will not overwrite any existing material in the base directory. To create additional keystores later, simply add their definitions to the manifest, and re-run the script.

Step 3.

Copy the resulting truststore and *.kst files to their respective machines, and configure server and/or client encryption accordingly.

Related Articles

cassandra
ssl
security

Setting Up a Cassandra Cluster With SSL - DZone Cloud

Jean-Paul Azar

7/26/2022

cassandra
security

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

cassandra