my-docker-authz-plugin

command module
v0.0.0-...-a9b67cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2020 License: MIT Imports: 11 Imported by: 0

README

docker-authz-plugin

Docker Authz Plugin template

This is a template project to for creating an access authorization plugin for the Docker Engine.

Note this plugin does exactly nothing. It's just an empty template.

Why?

Plugins were introduced in the Docker Engine in 1.10, as a v1 implementation (legacy plugins), and further extended in 1.13, as a v2 implementation (managed plugins).

Because I needed to create a very basicy authz plugin from scratch but I had found many different (and complex) ways to do that so I decided to create a very simple and reusable template.

Goals
Non-goals
  • To implement a legacy plugin
  • To implement other type of plugins
  • To implement any specific logic

Usage

First, prepare your project:

  • Click on the green "Use this template" button above
  • Rename any occurence of leogr/docker-authz-plugin as you need
  • Edit plugin.go implemeting your plugin logic

Then create and install your plugin:

  • make create builds the plugin and add it to your local Docker
  • make install tells Docker to enable and install the plugin

With the plugin installed and enabled, the Docker daemon needs to be configured to make use of the plugin. This can be done by editing the daemon's configuration file (eg. /etc/docker/daemon.json):

{
    "authorization-plugins": ["leogr/docker-authz-plugin"]
}

Please, use your plugin name if you had renamed it.

Finally, you need to restart the daemon.

If you're using systemctl just run:

$ systemctl restart docker.service

Otherwise, a rude alternative is:

$ sudo kill -HUP $(pidof dockerd)

Enjoy!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
ast
Package ast declares Rego syntax tree types and also includes a parser and compiler for preparing policies for execution in the policy engine.
Package ast declares Rego syntax tree types and also includes a parser and compiler for preparing policies for execution in the policy engine.
location
Package location defines locations in Rego source code.
Package location defines locations in Rego source code.
Package loader contains utilities for loading files into OPA.
Package loader contains utilities for loading files into OPA.
Package rego exposes high level APIs for evaluating Rego policies.
Package rego exposes high level APIs for evaluating Rego policies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL