Git Product home page Git Product logo

csfle's Introduction

Client-Side Field Level Encryption (CSFLE)

This repository provides several demos of the Confluent Cloud feature Client-Side Field Level Encryption.

It covers step-by-step guidelines for different KMS via folders:

Scenario Key Vault KEK shared
Azure Azure Key Vault no
HashiCorp HashiCorp Vault no
AWS AWS Key Management Service no
GCP GCP Key Management Service no
AWS - Shared AWS Key Management Service yes

Prerequisites

  • Confluent Cloud cluster with Advanced Stream Governance package
  • For clients, Confluent Platform 7.4.2 or 7.5.1 are required.

Goal

We will produce personal data to Confluent Cloud in the following form

{
    "id": "0",
    "name": "Anna",
    "birthday": "1993-08-01",
    "timestamp": "2023-10-07T19:54:21.884Z"
}

However, we set up the corresponding configurations to encrypt the birthday field. We then start a consumer with the corresponding configurations to decrypt the field again.

In order to have a realistic scenario, we do not produce and consume via the CLI but develop a producer and consumer application with Kotlin.

csfle's People

Contributors

1123 avatar dgingera avatar ethaden avatar paoven avatar pneff93 avatar schm1tz1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

csfle's Issues

Add Kotlin Example for Key Rotation and Hashicorp Vault

Nice Repository. Could we add an example for DEK rotation? Or extend the existing Kotlin example with Hashicorp to support key rotation?

We tried to add key rotation via the following configuration (notice the property encrypt.dek.expiry.days):

curl --request POST --url "${SR_REST_ENDPOINT}/subjects/${TOPIC}-value/versions" \
  --user "${SR_API_KEY}:${SR_API_SECRET}" \
  --header 'Content-Type: application/vnd.schemaregistry.v1+json' \
  --data '{
        "ruleSet": {
        "domainRules": [
      {
        "name": "encryptPII",
        "kind": "TRANSFORM",
        "type": "ENCRYPT",
        "mode": "WRITEREAD",
        "tags": ["PII"],
        "params": {
           "encrypt.kek.name": "csfle",
           "encrypt.kms.key.id": "http://127.0.0.1:8200/transit/keys/csfle",
           "encrypt.kms.type": "hcvault",
           "encrypt.dek.expiry.days": 1
          },
        "onFailure": "ERROR,NONE"
        }
        ]
      }
   }'

Also we upgraded to version 7.5.0 of the library. This rsults in the following exceptions:

10:37:03.572 [Thread-0] ERROR KafkaProducer - org.apache.kafka.common.errors.SerializationException: Rule failed: encryptPII for {"id": "0", "name": "Anna", "birthday": "1993-08-01", "timestamp": "2024-03-19T10:37:00.457Z"}
10:37:05.715 [Thread-0] ERROR KafkaProducer - org.apache.kafka.common.errors.SerializationException: Rule failed: encryptPII for {"id": "1", "name": "Joe", "birthday": "1996-09-11", "timestamp": "2024-03-19T10:37:05.577Z"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.