HUB
Sign inSign up

biska/pykmip

By biska

•Updated over 2 years ago

Docker container for the PyKMIP Service. Official Package: https://github.com/OpenKMIP/PyKMIP

Image
Security
Developer tools
1

3.2K

biska/pykmip repository overview

⁠PyKMIP

References:

PyKMIP Docs⁠

OpenKMIP Github⁠

I did not create this project, all credit goes to the creators referenced above.

This free open source application has allowed me to get more familiar with VMWare's vCenter Key Management Service, enabling Encryption on VM's and Storage. So I thought I'd make a container for easier deployment.

⁠Setup

Create two new directories on the system you're going to be running this container, to allow persistent data storage, and easier access to important files used in the container. The two directories within the container to map to are:

/app/pykmip-data 
/app/pykmip-config

The config directory contains two files, policy.json and server.conf. These are pre-setup in this container for testing. Refere to the docs for further information if you wish to alter the config of the server.

The data directory will contain pykmip.database - It is generated upon first server run, and will contain key data. You'll also need to generate and provide a certificate and key file to put in this directory (steps below to create a self-signed cert)

This server runs on port 5696 by default, so you'll need this open.

⁠Installation

  • Create the following compose.yml file, replacing the two directory paths to your own paths.
version: "3.8"                                                         
services:                                                              
  PyKMIP:                                                              
    image: biska/pykmip:v1.0.0                                         
    container_name: pykmip                                             
    volumes:                                                           
      - /home/user/docker_data/pykmip/pykmip-data:/app/pykmip-data    
      - /home/user/docker_data/pykmip/pykmip-config:/app/pykmip-config
    ports:                                                             
      - 5696:5696                                                      
    restart: unless-stopped                                            
  • Run the following to create a self signed cert, and place it + the key into the pykmip-data directory:
$ openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /home/user/docker_data/pykmip/pykmip-data/selfsigned.key -out /home/user/docker_data/pykmip/pykmip-data/selfsigned.crt
  • Run the following from the same directory to pull and spin up the docker container:
$ sudo docker compose pull
$ sudo docker compose up -d

The container should now be running. If you're wanting to add this to VMWare's vCenter as a KMS server, see below:

  • Navigate into your vCenter's 'Configure' tab, and select 'Key Providers'.
  • Select Add > Add Standard Key Provider.
  • Enter PyKMIP for the name and KMS, and enter the IP and Port of your server, then select Add Key Provider.
  • Once added, select the Provider from the below, then select 'Establish Trust' > 'Make KMS trust vCenter'.
  • Select 'KMS Certificate and Private Key' > Enter both the Cert, and Key data from your certificates used here.
  • Done :)
Tag summary
Recent tags
Content type
Image
Digest
sha256:b8790203e…
Size
196.8 MB
Last updated
over 2 years ago
docker pull biska/pykmip:v1.0.0