Giter Club home page Giter Club logo

authobot's Introduction

Authobot

logo

Authobot is a simple authorization plugin for docker to prevent some API usages that we know will expose hosts data and are not required for a legitimate use of docker from a containerized jenkins build agent.

We prevent

  • running container with bind mounts
  • running privileged container
  • more to come

We also provide a whitelist of authorized API URIs, based on docker-pipeline / declarative-pipeline requirements. Any other API call will be rejected.

Samples

➜ #
➜ # let's run a container 
➜ #
➜ docker run --rm -t  ubuntu echo Hello
Hello

➜ #
➜ # let's now run a _privileged_ container (can access hosts' devices)
➜ #
➜ docker run --rm -t --privileged ubuntu echo Hello
docker: Error response from daemon: authorization denied by plugin authobot:latest: use of Privileged contianers is not allowed.
See 'docker run --help'.

➜ #
➜ # hum, let's bind mount host filesystem to hack all it's secrets
➜ #
➜ docker run --rm -t -v /:/host ubuntu echo Hello
docker: Error response from daemon: authorization denied by plugin authobot:latest: use of bind mounts is not allowed.
See 'docker run --help'.

➜ #
➜ # ok, let's just mount a volume to persist our data
➜ #
➜ docker run --rm -t -v some_volume:/host ubuntu echo Hello
Hello

Contribute / hack

we use dep to manage dependencies. run dep ensure to generate a local vendor folder so you can hack and build the plugin.

build with docker build -t authobot .

create rootfs directory, and export container filesystem

rm -rf rootfs
mkdir rootfs
ID=$(docker run -d authobot:latest)
docker export $ID | tar -x -C rootfs
docker kill $ID
docker rm $ID

Then, install and enable plugin on your local docker daemon

docker plugin create authobot $(pwd)
docker plugin enable authobot

change docker daemon configuration to include --authorization-plugin=authobot and restart daemon.

authobot's People

Contributors

ndeloof avatar

Watchers

 avatar  avatar

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.