Giter VIP home page Giter VIP logo

vault-plugin-secrets-kafka's Introduction

[WIP] vault-plugin-kafka-secret

CircleCI

A Vault plugin for generating credentials for Apache Kafka clients.

Generates a dynamic username and ACL that can be used to create a uniq SSL certificate for a Kafka client.

Use this in combination with the vault pki backend.

Pre-Install

๐Ÿ”Œ Installation

  • Download the plugin to Vault's plugin directory.
  • Register the plugin with Vault
    • vault write sys/plugins/catalog/vault-plugin-secrets-kafka \
        sha_256="$SHASUM" \
        command="vault-plugin-secrets-kafka"
  • Enable the plugin mount
    • vault secrets enable -path=kafka -plugin-name=vault-plugin-secrets-kafka plugin

๐Ÿ›  Configure

  • Configure the plugin

    • vault write kafka/config/access address="localhost:9092" ca_certificate="$CA" client_certificate="$CERT" client_key="$PRIVATE_KEY"
    • The client must be capable of writing creating and deleting ACLs.
  • Write a policy

    • {
        "acl": {
          "host": "*",
          "operation": "Read",
          "permission_type": "Allow"
        },
        "resource": {
          "type": "Topic",
          "name": "*",
          "pattern_type_filter": "any"
        }
      }
  • Write the role

    • vault write kafka/roles/read-all-topics policy=$(cat bin/policy.json)
  • Read the credentials, pick the username

    • vault read kafka/creds/read-all-topics
  • Generate a SSL certificate for this client

    •   NAME=$(vault read -field=user kafka/creds/read-all-topics)
        DATA=$(vault write -format=json pki/issue/kafka-clients common_name="$NAME" ttl=$TTL | jq -r .data)
        printf "%s" "$DATA" | jq -r .private_key > private.key
        printf "%s" "$DATA" | jq -r .certificate > client.cert
        printf "%s" "$DATA" | jq -r .issuing_ca  > ca.cert

vault-plugin-secrets-kafka's People

Contributors

mongey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vault-plugin-secrets-kafka's Issues

Update

Hello,
is there any updates on this project ? thanks in advance

Issue building the plugin (undefined kafka.StringlyTypedACL)

Hi,

I have the following error when building the plugin via the bin/dev script :

--> Building
# github.com/Mongey/vault-plugin-secrets-kafka/plugin
../src/github.com/Mongey/vault-plugin-secrets-kafka/plugin/path_list_roles.go:147:12: undefined: kafka.StringlyTypedACL

I already go get github.com/Mongey/terraform-provider-kafka/kafka as the structure comes from terraform-provider-kafka/kafka/kafka_acls.go

Is there another import I should be making ? Or another action rather than executing the dev script ?

Any hint would be useful.
Thx in advance.

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.