In this recipe, you will learn how to create an authentication plugin that will allow you to perform fine-grained access control.
Before you start, ensure Marathon is up and running. Before applying any authentication, ensure you enabled SSL to protect secrets from eavesdropping.
Plugins need to be written, so we will use a plugin from the Mesosphere example. It's a good base to start with to write a custom plugin. In this recipe, we will work with Marathon 1.3.5.
First, we need to download the plugin code:
curl -L https://github.com/janisz/marathon-example-plugins/archive/1.3.5.tar.gz | tar -zx cd marathon-example-plugins-1.3.5
The plugin is written in Scala, and to build it we need the Scala Build Tool (SBT):
curl -s https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt > sbt && chmod 0755 sbt
Now we can build it. This might take some time because we need to download all the dependencies and then compile the code...