Giter Club home page Giter Club logo

citadel's Introduction

Welcome to Citadel!

Citadel (c5l) is a simple daemon that implements the Kubernetes Key Management Service (KMS) interface by acquiring a key encryption key (KEK) from an arbitrary command. This makes it easy to plug in your own key management solution as a simple unix command that returns the KEK.

How does it work?

When c5l starts, it runs the command you provide it. This command returns the KEK on standard output. If this command fails during startup, c5l will exit. Otherwise, it will use the KEK from the command to encrypt and decrypt input from Kubernetes.

c5l caches the KEK, and thus does not call the command on every incoming request. The time limit of this cache is specified by the timeout argument. If c5l is not able to refresh the cache after trying several times, it will purge the KEK and report errors to Kubernetes. If c5l eventually succeeds in acquiring the KEK, normal operation will resume.

To specify the socket to create, use the endpoint argument. Otherwise, socket activation is assumed.

Arguments

Required

  • --command string: the command to retrieve the key encryption key

Optional

  • --endpoint string: the listen address (ex. unix:///tmp/socket)

  • --timeout duration: maximum time to cache KEK locally (default 1h)

  • --mode string: encryption mode to use, the options are [aescbc] (default "aescbc")

Crypto Details

The KEK is currently used to do AES-CBC encryption. This does not provide ciphertext authentication. Other methods are being considered with the intent of providing cryptographic agility and features such as authentication.

Examples

Here is an example which uses a Clevis decryption policy to allow access to the KEK only when a Tang server is accessible on the network.

First, you need to generate the KEK and encrypt it using the Clevis policy:

$ dd if=/dev/urandom bs=32 count=1 status=none \
  | clevis encrypt tang '{"url":"http://tang.srv"}' \
  > /var/db/citadel/kek.jwe

Next, you run c5l with the clevis decrypt command:

$ citadel --command 'clevis decrypt < /var/db/citadel/kek.jwe'

When run, c5l will be able to acquire the KEK if, and only if, the Tang server is accessible on the network. Attempts to read the file (/var/db/citadel/kek.jwe) directly will reveal only ciphertext.

citadel's People

Contributors

enj avatar npmccallum avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

citadel's Issues

Consider moving to configuration file

#27 made me realize that we are probably going to be adding more parameters to the command line to handle configuration. It might make more sense to just move to a single required parameter that points to the configuration file. TOML seems like a good choice for the format of the file.

need to store crypto mode in return value

Currently, we return the ciphertext from AES-CBC. However, if we add other encryption modes in the future we will not be able to distinguish ciphertexts. We should store the mode with the ciphertext so that we can automatically distinguish which decryption mode to use.

document things

We should have documentation. README.md is a good place to start.

e2e tests

Tests that actually run this with OpenShift

package for fedora

This is so that clevis-kms can depend on it. Also, we need a release to package for Fedora.

Add contributing to README.md

Some basic setup, how to get it running (in whatever state it currently is in) against a kubernetes cluster (ex, oc cluster up?).

Add logging

So it is easier to understand what KMS is doing.

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.